diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml new file mode 100644 index 0000000..57d4f55 --- /dev/null +++ b/.github/workflows/sorbet.yml @@ -0,0 +1,22 @@ +name: Sorbet + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + sorbet: + name: Sorbet + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 + with: + bundler-cache: true + ruby-version: "3.4" + - name: Type check + run: bundle exec srb tc diff --git a/.rubocop.yml b/.rubocop.yml index 92f1761..36a6c15 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + inherit_mode: merge: - Exclude @@ -13,15 +15,9 @@ plugins: - rubocop-rspec - rubocop-performance - rubocop-rake + - rubocop-sorbet AllCops: TargetRubyVersion: 3.3 Exclude: - 'vendor/**/*' - -# singed does not use Sorbet: there is no sorbet/ config, no sorbet runtime dependency, and no -# typecheck step. The Sorbet cops would only add `# typed:` sigils that nothing reads, and -# `# typed: strict` would claim a level of typing this gem does not have. rubocop-gusto's own -# .rubocop.yml disables the department for the same reason. -Sorbet: - Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..6eeac2b --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,16 @@ +# This configuration was generated by +# `rubocop --auto-gen-config --no-exclude-limit --no-auto-gen-timestamp` +# using RuboCop version 1.88.2. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SuggestedStrictness. +Sorbet/StrictSigil: + Exclude: + - 'sorbet/tapioca/require.rb' + - 'spec/spec_helper.rb' + - 'spec/support/sidekiq.rb' diff --git a/AGENTS.md b/AGENTS.md index 23cb7c0..64dbbf1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,6 +18,12 @@ bundle exec rspec spec/path/to/spec.rb # Lint bundle exec rubocop bundle exec rubocop -a # auto-correct + +# Type check (Sorbet) +bundle exec srb tc + +# Regenerate gem RBIs after Gemfile.lock changes +bin/tapioca gems ``` ## Architecture @@ -25,3 +31,10 @@ bundle exec rubocop -a # auto-correct - `lib/singed.rb` — main entry point; provides `Singed.flamegraph` block helper - `lib/singed/` — core classes: flamegraph output handling, stackprof/rbspy integrations, speedscope launcher - `spec/` — RSpec tests + +## Types + +- Files under `lib/` are `# typed: strict`. Write their signatures as [RBS comments](https://sorbet.org/docs/rbs-support) (`#: (String) -> bool`), not `sig` blocks. +- `sorbet-runtime` isn't a dependency of the gem, so nothing under `lib/` may reference `T` at runtime. Use the RBS assertion comments (`#: Type`, `#: as !nil`, `#: as Type`, `#: as untyped`, `#: self as Type`) instead of `T.let`, `T.must`, `T.cast`, `T.unsafe` and `T.bind`. +- Apps that use Tapioca still run these signatures: Tapioca rewrites RBS comments into runtime-checked `sig`s while it loads the app. A signature must therefore only name constants that are loaded whenever its file is (not `ActiveSupport` in `lib/singed.rb`), and must accept every value an app can pass while booting, such as `flamegraph [:show, :index]` in a controller. Otherwise the app's `tapioca gem` or `tapioca dsl` run errors. The specs here don't load `sorbet-runtime`, so they can't catch this. +- Types the generated gem RBIs are missing go in `sorbet/rbi/shims/`. diff --git a/Gemfile b/Gemfile index 5fc3c87..1ed9480 100644 --- a/Gemfile +++ b/Gemfile @@ -6,8 +6,15 @@ source "https://rubygems.org" gemspec gem "activejob" +gem "railties" gem "rake", "~> 13.4" gem "rspec" gem "rubocop-gusto", require: false +gem "rubocop-performance", require: false +gem "rubocop-rake", require: false +gem "rubocop-rspec", require: false +gem "rubocop-sorbet", require: false gem "rubyzip" gem "sidekiq" +gem "sorbet", require: false +gem "tapioca", require: false diff --git a/Gemfile.lock b/Gemfile.lock index e755e9d..605cce1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,10 +7,26 @@ PATH GEM remote: https://rubygems.org/ specs: - activejob (8.1.3.1) - activesupport (= 8.1.3.1) + actionpack (8.1.4) + actionview (= 8.1.4) + activesupport (= 8.1.4) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (8.1.4) + activesupport (= 8.1.4) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.1.4) + activesupport (= 8.1.4) globalid (>= 0.3.6) - activesupport (8.1.3.1) + activesupport (8.1.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) @@ -25,32 +41,80 @@ GEM uri (>= 0.13.1) ast (2.4.3) base64 (0.3.0) + benchmark (0.5.0) bigdecimal (4.1.2) + builder (3.3.0) code_teams (1.3.1) sorbet-runtime concurrent-ruby (1.3.8) connection_pool (3.0.2) + crass (1.0.7) diff-lcs (1.6.2) drb (2.2.3) + erb (6.0.7) erubi (1.13.1) globalid (1.4.0) activesupport (>= 6.1) i18n (1.15.2) concurrent-ruby (~> 1.0) + io-console (0.9.4) + irb (1.18.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) json (2.21.2) language_server-protocol (3.17.0.6) lint_roller (1.1.0) logger (1.7.0) + loofah (2.25.2) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) minitest (6.0.6) drb (~> 2.0) prism (~> 1.5) + netrc (0.11.0) + nokogiri (1.19.4-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.4-arm64-darwin) + racc (~> 1.4) + nokogiri (1.19.4-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.19.4-x86_64-linux-gnu) + racc (~> 1.4) parallel (2.1.0) parser (3.3.12.0) ast (~> 2.4.1) racc + pp (0.6.4) + prettyprint + prettyprint (0.2.0) prism (1.9.0) racc (1.8.1) rack (3.2.7) + rack-session (2.1.2) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.3.1) + rack (>= 3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.7.1) + loofah (~> 2.25, >= 2.25.2) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.1.4) + actionpack (= 8.1.4) + activesupport (= 8.1.4) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.4.2) rbi (0.4.3) @@ -60,9 +124,17 @@ GEM logger prism (>= 1.6.0) tsort + rdoc (8.1.0) + erb + prism (>= 1.6.0) + rbs (>= 4.0.0) + tsort redis-client (0.30.1) connection_pool regexp_parser (2.12.0) + reline (0.7.0) + io-console (~> 0.5) + require-hooks (0.5.1) rexml (3.4.4) rspec (3.13.2) rspec-core (~> 3.13.0) @@ -118,6 +190,10 @@ GEM rubocop (>= 1.75.2) spoom (~> 1.8) ruby-progressbar (1.13.0) + rubydex (0.4.1-aarch64-linux) + rubydex (0.4.1-arm64-darwin) + rubydex (0.4.1-x86_64-darwin) + rubydex (0.4.1-x86_64-linux) rubyzip (3.5.0) securerandom (0.4.1) sidekiq (8.1.7) @@ -146,6 +222,18 @@ GEM sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) stackprof (0.2.28) + tapioca (0.20.0) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (>= 0.4.1) + require-hooks (>= 0.2.2) + rubydex (>= 0.1.0.beta10) + sorbet-static-and-runtime (>= 0.6.12698) + spoom (>= 1.7.16) + thor (>= 1.2.0) + tsort thor (1.5.0) tsort (0.2.0) tzinfo (2.0.6) @@ -154,6 +242,8 @@ GEM unicode-emoji (~> 4.1) unicode-emoji (4.2.0) uri (1.1.1) + useragent (0.16.11) + zeitwerk (2.8.3) PLATFORMS aarch64-linux @@ -163,12 +253,19 @@ PLATFORMS DEPENDENCIES activejob + railties rake (~> 13.4) rspec rubocop-gusto + rubocop-performance + rubocop-rake + rubocop-rspec + rubocop-sorbet rubyzip sidekiq singed! + sorbet + tapioca BUNDLED WITH - 4.0.15 + 4.0.15 diff --git a/README.md b/README.md index a70903e..029e2f7 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,16 @@ end This won't catch the entire request though, just once it's been routed to controller and a response has been served (ie no middleware). +If Sorbet checks the controller (`# typed: true` or stricter), also include `Singed::ControllerExt` in it. The Railtie already includes it into `ActionController::Base` at runtime, but Sorbet can't see that, so it would check `flamegraph :show` against the block form of `flamegraph` instead: + +```ruby +class EmployeesController < ApplicationController + include Singed::ControllerExt + + flamegraph :show +end +``` + ### Rack/Rails requests To capture the whole request, there is a middleware which checks for the `X-Singed` header to be 'true'. With curl, you can do this like: diff --git a/bin/tapioca b/bin/tapioca new file mode 100755 index 0000000..82de9af --- /dev/null +++ b/bin/tapioca @@ -0,0 +1,16 @@ +#!/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__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("tapioca", "tapioca") diff --git a/lib/singed.rb b/lib/singed.rb index a3dabc7..e3fa6a5 100644 --- a/lib/singed.rb +++ b/lib/singed.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "json" @@ -10,44 +11,56 @@ module Singed extend self # rubocop:disable Style/ModuleFunction # Where should flamegraphs be saved? + #: (String | Pathname | nil) -> void def output_directory=(directory) - @output_directory = directory && Pathname.new(directory) + @output_directory = directory && Pathname.new(directory) #: Pathname? end + #: () -> Pathname? def self.output_directory @output_directory end + #: (bool?) -> void def enabled=(enabled) - @enabled = enabled + @enabled = enabled #: bool? end + #: () -> bool? def enabled? return @enabled if defined?(@enabled) @enabled = true end + # Not ActiveSupport::BacktraceCleaner: apps' Tapioca evaluates these sigs even when ActiveSupport isn't loaded. + #: (untyped) -> void def backtrace_cleaner=(backtrace_cleaner) - @backtrace_cleaner = backtrace_cleaner + @backtrace_cleaner = backtrace_cleaner #: untyped end + #: () -> untyped def backtrace_cleaner @backtrace_cleaner end + #: (String) -> bool def silence_line?(line) - return backtrace_cleaner.silence_line?(line) if backtrace_cleaner + cleaner = backtrace_cleaner + return cleaner.silence_line?(line) if cleaner false end + #: (String) -> String def filter_line(line) - return backtrace_cleaner.filter_line(line) if backtrace_cleaner + cleaner = backtrace_cleaner + return cleaner.filter_line(line) if cleaner line end + #: (?String?, ?ignore_gc: bool, ?interval: Integer) -> Flamegraph? def start(label = nil, ignore_gc: false, interval: 1000) return unless enabled? return if profiling? @@ -56,16 +69,19 @@ def start(label = nil, ignore_gc: false, interval: 1000) @current_flamegraph.tap(&:start) end + #: () -> Flamegraph? def stop return nil unless profiling? - flamegraph = @current_flamegraph - @current_flamegraph = nil + # profiling? is only true while @current_flamegraph is set. + flamegraph = @current_flamegraph #: as !nil + @current_flamegraph = nil #: Flamegraph? flamegraph.stop flamegraph.save flamegraph end + #: () -> bool def profiling? @current_flamegraph&.started? || false end diff --git a/lib/singed/backtrace_cleaner_ext.rb b/lib/singed/backtrace_cleaner_ext.rb index 52ae9a3..6481193 100644 --- a/lib/singed/backtrace_cleaner_ext.rb +++ b/lib/singed/backtrace_cleaner_ext.rb @@ -1,7 +1,9 @@ +# typed: strict # frozen_string_literal: true module ActiveSupport class BacktraceCleaner + #: (String) -> String def filter_line(line) filtered_line = line @filters.each do |f| @@ -11,6 +13,7 @@ def filter_line(line) filtered_line end + #: (String) -> bool def silence_line?(line) @silencers.any? { |s| s.call(line) } end diff --git a/lib/singed/cli.rb b/lib/singed/cli.rb index 17c3232..e501618 100644 --- a/lib/singed/cli.rb +++ b/lib/singed/cli.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "shellwords" @@ -8,28 +9,37 @@ module Singed class CLI - attr_accessor :argv, :filename, :opts + #: Array[String] + attr_accessor :argv + #: Pathname? + attr_accessor :filename + + #: OptionParser + attr_accessor :opts + + #: (Array[String]) -> void def initialize(argv) @argv = argv - @opts = OptionParser.new + @opts = OptionParser.new #: OptionParser parse_argv! end + #: () -> void def parse_argv! opts.banner = "Usage: singed [options] " opts.on("-h", "--help", "Show this message") do - @show_help = true + @show_help = true #: bool? end opts.on("-o", "--output-directory DIRECTORY", "Directory to write flamegraph to") do |directory| - @output_directory = directory + @output_directory = directory #: String? end opts.on("-r", "--rate RATE", Integer, "Sample rate for rbspy") do |rate| - @rate = rate + @rate = rate #: Integer? end opts.order(@argv) do |arg| @@ -39,7 +49,7 @@ def parse_argv! if @argv.empty? @show_help = true - @error_message = "missing command to profile" + @error_message = "missing command to profile" #: (String | OptionParser::InvalidOption)? return end @@ -53,6 +63,7 @@ def parse_argv! end end + #: () -> void def run require "singed" @@ -70,7 +81,10 @@ def run Singed.output_directory = @output_directory if @output_directory Singed.output_directory ||= Dir.tmpdir - FileUtils.mkdir_p Singed.output_directory + # The ||= above has just set output_directory if it was unset. + FileUtils.mkdir_p( + Singed.output_directory #: as !nil + ) @filename = Singed::Flamegraph.generate_filename(label: "cli") options = { @@ -107,7 +121,8 @@ def run rbspy.call end - unless filename.exist? + # @filename rather than the nilable filename reader: Sorbet knows it holds a Pathname by now. + unless @filename.exist? puts "#{filename} doesn't exist. Maybe rbspy had a failure capturing it? Check the scrollback." exit 1 end @@ -118,32 +133,38 @@ def run end # clean the report, similar to how Singed::Report does - json = JSON.parse(filename.read) + json = JSON.parse(@filename.read) json["shared"]["frames"].each do |frame| frame["file"] = Singed.filter_line(frame["file"]) end - filename.write(JSON.dump(json)) + @filename.write(JSON.dump(json)) flamegraph = Singed::Flamegraph.new(filename:) flamegraph.open end + #: () -> bool def password_needed? !system("sudo --non-interactive true >/dev/null 2>&1") end + #: () -> bool? def prompt_password system("sudo true") end + #: () -> bool def adjust_ownership! sudo ["chown", ENV["USER"], filename], reason: "Adjusting ownership of #{filename}, but need root." end + #: () -> bool? def show_help? @show_help end + # Never nil or false: exception: true makes Kernel#system raise instead. + #: (Array[String | Integer | Pathname | nil], reason: String, ?env: Hash[String, String]) -> bool def sudo(system_args, reason:, env: {}) loop do break unless password_needed? @@ -160,9 +181,12 @@ def sudo(system_args, reason:, env: {}) puts "$ #{Shellwords.join(sudo_args)}" + # Sorbet can't check a splat of an array of unknown length: https://srb.help/7019 + #: self as untyped system(env, *sudo_args, exception: true) end + #: () -> String? def self.chdir_rails_root original_cwd = Dir.pwd diff --git a/lib/singed/controller_ext.rb b/lib/singed/controller_ext.rb index 2e51b0f..b5a7c9e 100644 --- a/lib/singed/controller_ext.rb +++ b/lib/singed/controller_ext.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "active_support/concern" @@ -6,8 +7,11 @@ module Singed module ControllerExt extend ActiveSupport::Concern + # Concern extends the including controller class with this module; controllers define around_action. + # @requires_ancestor: AbstractController::Callbacks::ClassMethods module ClassMethods # Define an around_action to generate flamegraph for a controller action. + #: (Symbol | String | Array[Symbol | String], ?ignore_gc: bool, ?interval: Integer) -> void def flamegraph(target_action, ignore_gc: false, interval: 1000) around_action(only: target_action) do |controller, action| controller.flamegraph(ignore_gc:, interval:, &action) diff --git a/lib/singed/flamegraph.rb b/lib/singed/flamegraph.rb index 3f79bfa..de370c4 100644 --- a/lib/singed/flamegraph.rb +++ b/lib/singed/flamegraph.rb @@ -1,9 +1,16 @@ +# typed: strict # frozen_string_literal: true module Singed class Flamegraph - attr_accessor :profile, :filename + # The StackProf.results hash; its values vary by key. + #: Hash[Symbol, untyped]? + attr_accessor :profile + #: Pathname + attr_accessor :filename + + #: (?label: String?, ?ignore_gc: bool, ?interval: Integer, ?filename: Pathname?) -> void def initialize(label: nil, ignore_gc: false, interval: 1000, filename: nil) # it's been created elsewhere, ie rbspy if filename @@ -15,22 +22,25 @@ def initialize(label: nil, ignore_gc: false, interval: 1000, filename: nil) raise ArgumentError, "label not supported when given an existing file" end - @filename = filename + @filename = filename #: Pathname else - @ignore_gc = ignore_gc - @interval = interval - @time = Time.now + # Nilable because they stay unset when wrapping an existing file, and #start still reads them. + @ignore_gc = ignore_gc #: bool? + @interval = interval #: Integer? + @time = Time.now #: Time @filename = self.class.generate_filename(label:, time: @time) end end - def record + #: [Result] () { () -> Result } -> Result + def record(&_block) start yield ensure stop end + #: () -> bool def start return false unless Singed.enabled? return false if filename.exist? # file existing means its been captured already @@ -40,18 +50,21 @@ def start @started = true end + #: () -> Hash[Symbol, untyped]? def stop return nil unless started? - @started = false + @started = false #: bool? StackProf.stop @profile = StackProf.results end + #: () -> bool def started? !!@started end + #: () -> void def save if filename.exist? raise ArgumentError, "File #{filename} already exists" @@ -63,19 +76,24 @@ def save filename.open("w") { |f| report.print_json(f) } end + #: () -> bool? def open Singed::Speedscope.open(@filename) end + #: () -> String def open_command Singed::Speedscope.open_command(@filename) end + #: (?label: String?, ?time: Time) -> Pathname def self.generate_filename(label: nil, time: Time.now) formatted_time = time.strftime("%Y%m%d%H%M%S-%6N") basename_parts = ["speedscope", label, formatted_time].compact - file = Singed.output_directory.join("#{basename_parts.join('-')}.json") + # Callers must set output_directory first (the Railtie and CLI do); unset, this raises NoMethodError. + file = Singed.output_directory #: as !nil + .join("#{basename_parts.join('-')}.json") # convert to relative directory if it's an absolute path and within the current pwd = Pathname.pwd file = file.relative_path_from(pwd) if file.absolute? && file.to_s.start_with?(pwd.to_s) diff --git a/lib/singed/kernel_ext.rb b/lib/singed/kernel_ext.rb index e1cb741..7bca402 100644 --- a/lib/singed/kernel_ext.rb +++ b/lib/singed/kernel_ext.rb @@ -1,6 +1,14 @@ +# typed: strict # frozen_string_literal: true module Kernel + #: [Result] ( + #| ?String?, + #| ?open: bool, + #| ?ignore_gc: bool, + #| ?interval: Integer, + #| ?io: IO | StringIO + #| ) { () -> Result } -> Result def flamegraph(label = nil, open: true, ignore_gc: false, interval: 1000, io: $stdout, &block) fg = Singed::Flamegraph.new(label:, ignore_gc:, interval:) result = fg.record(&block) diff --git a/lib/singed/rack_middleware.rb b/lib/singed/rack_middleware.rb index d497e62..69ef849 100644 --- a/lib/singed/rack_middleware.rb +++ b/lib/singed/rack_middleware.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Rack Middleware @@ -6,10 +7,14 @@ module Singed class RackMiddleware + # Rack apps are duck-typed: any object that responds to call(env). + #: (untyped) -> void def initialize(app) @app = app end + # Returns the wrapped app's Rack response unchanged, so it is as untyped as the app. + #: (Hash[String, untyped]) -> untyped def call(env) if capture_flamegraph?(env) flamegraph { @app.call(env) } @@ -18,16 +23,19 @@ def call(env) end end + #: (Hash[String, untyped]) -> bool def capture_flamegraph?(env) self.class.always_capture? || env["HTTP_X_SINGED"] == "true" end TRUTHY_STRINGS = ["true", "1", "yes"].freeze + # bool?, not bool: Sorbet can't tell that defined?(@always_capture) means it holds a bool. + #: () -> bool? def self.always_capture? return @always_capture if defined?(@always_capture) - @always_capture = TRUTHY_STRINGS.include?(ENV.fetch("SINGED_MIDDLEWARE_ALWAYS_CAPTURE", "false")) + @always_capture = TRUTHY_STRINGS.include?(ENV.fetch("SINGED_MIDDLEWARE_ALWAYS_CAPTURE", "false")) #: bool? end end end diff --git a/lib/singed/railtie.rb b/lib/singed/railtie.rb index 45a5ea6..12e626f 100644 --- a/lib/singed/railtie.rb +++ b/lib/singed/railtie.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "singed/backtrace_cleaner_ext" @@ -6,6 +7,8 @@ module Singed class Railtie < Rails::Railtie initializer "singed.configure_rails_initialization" do |app| + # Rails instance_execs initializer blocks on the railtie instance. + #: self as Singed::Railtie self.class.init! app.middleware.use Singed::RackMiddleware @@ -15,6 +18,7 @@ class Railtie < Rails::Railtie end end + #: () -> void def self.init! Singed.output_directory ||= Rails.root.join("tmp/speedscope") Singed.backtrace_cleaner = Rails.backtrace_cleaner diff --git a/lib/singed/report.rb b/lib/singed/report.rb index 53b90dd..3771154 100644 --- a/lib/singed/report.rb +++ b/lib/singed/report.rb @@ -1,7 +1,9 @@ +# typed: strict # frozen_string_literal: true module Singed class Report < StackProf::Report + #: () -> void def filter! # copy and paste from StackProf::Report#print_graphviz that does filtering # mark_stack = [] @@ -33,7 +35,9 @@ def filter! frame[:file] = Singed.filter_line(frame[:file]) end - @data[:frames] = list + # frames(true) above has already raised NoMethodError if @data were nil. + data = @data #: as !nil + data[:frames] = list end end end diff --git a/lib/singed/rspec.rb b/lib/singed/rspec.rb index 4978bde..acb508c 100644 --- a/lib/singed/rspec.rb +++ b/lib/singed/rspec.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "singed" diff --git a/lib/singed/sidekiq.rb b/lib/singed/sidekiq.rb index e65f15f..0ecd897 100644 --- a/lib/singed/sidekiq.rb +++ b/lib/singed/sidekiq.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Singed @@ -7,6 +8,7 @@ class ServerMiddleware TRUTHY_STRINGS = %w(true 1 yes).freeze + #: [Result] (::Sidekiq::Job, Hash[String, untyped], String) { () -> Result } -> Result def call(job_instance, job_payload, _queue, &block) return block.call unless capture_flamegraph?(job_instance, job_payload) @@ -15,27 +17,35 @@ def call(job_instance, job_payload, _queue, &block) private + # A job class's capture_flamegraph? hook may return any value; only its truthiness counts. + #: (::Sidekiq::Job, Hash[String, untyped]) -> top def capture_flamegraph?(job_instance, job_payload) return TRUTHY_STRINGS.include?(job_payload["x-singed"].to_s) if job_payload.key?("x-singed") - job_class = job_class(job_instance, job_payload) + # The optional capture_flamegraph? hook is duck-typed, which Sorbet can't express. + job_class = job_class(job_instance, job_payload) #: as untyped return false unless job_class return job_class.capture_flamegraph?(job_payload) if job_class.respond_to?(:capture_flamegraph?) TRUTHY_STRINGS.include?(ENV.fetch("SINGED_MIDDLEWARE_ALWAYS_CAPTURE", "false")) end + #: (::Sidekiq::Job, Hash[String, untyped]) -> String def flamegraph_label(job_instance, job_payload) [job_class(job_instance, job_payload), job_payload["jid"]].compact.join("--") end + #: (::Sidekiq::Job, Hash[String, untyped]) -> Class[top]? def job_class(job_instance, job_payload) job_class = job_payload.fetch("wrapped", job_instance) # ActiveJob return job_class if job_class.is_a?(Class) return job_class.class if job_class.is_a?(::Sidekiq::Job) + # Sidekiq payloads carry the job class as a string, so it can only be resolved at runtime. + # rubocop:disable Sorbet/ConstantsFromStrings return job_class.constantize if job_class.respond_to?(:constantize) Object.const_get(job_class.to_s) + # rubocop:enable Sorbet/ConstantsFromStrings rescue NameError nil end diff --git a/lib/singed/speedscope.rb b/lib/singed/speedscope.rb index d168d9b..0ac4dd3 100644 --- a/lib/singed/speedscope.rb +++ b/lib/singed/speedscope.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "rbconfig" @@ -10,10 +11,12 @@ module Speedscope VERSION = "1.24.0" class << self + #: () -> String def bundled_index_html File.join(File.expand_path("../..", __dir__), "vendor", "speedscope", "index.html") end + #: (String | Pathname) -> String def open_command(profile_path) if File.exist?(bundled_index_html) "#{os_open_command} file://#{bundled_index_html}#localProfilePath=#{profile_path}" @@ -22,6 +25,7 @@ def open_command(profile_path) end end + #: (String | Pathname) -> bool? def open(profile_path) profile_path = profile_path.to_s @@ -34,12 +38,14 @@ def open(profile_path) private + #: (String) -> bool? def open_with_npx(profile_path) system("npx", "speedscope", profile_path) end # Based on speedscope CLI code (MIT license) # See https://github.com/jlfwong/speedscope/blob/3613918de0dd55a263d0d04f85b0c8c2039c7bee/bin/cli.mjs + #: (String) -> bool? def open_with_bundled_speedscope(profile_path) source_buffer = File.binread(profile_path) filename = File.basename(profile_path) @@ -64,6 +70,7 @@ def open_with_bundled_speedscope(profile_path) system os_open_command, url_to_open end + #: () -> String def os_open_command case host_os = RbConfig::CONFIG["host_os"] when /mswin|mingw|cygwin/ diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 0000000..89bad9c --- /dev/null +++ b/sorbet/config @@ -0,0 +1,7 @@ +--dir=. +--enable-experimental-rbs-comments +--enable-experimental-requires-ancestor +--enable-experimental-rspec +--ignore=tmp/ +--ignore=vendor/ +--parser=prism diff --git a/sorbet/rbi/annotations/.gitattributes b/sorbet/rbi/annotations/.gitattributes new file mode 100644 index 0000000..d2eacd2 --- /dev/null +++ b/sorbet/rbi/annotations/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-vendored=true diff --git a/sorbet/rbi/annotations/actionpack.rbi b/sorbet/rbi/annotations/actionpack.rbi new file mode 100644 index 0000000..4af55bf --- /dev/null +++ b/sorbet/rbi/annotations/actionpack.rbi @@ -0,0 +1,452 @@ +# typed: true + +# 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 + +# @version >= 5.2.0 +module ActionController::ContentSecurityPolicy::ClassMethods + # @shim: required to declare T.attached_class + extend T::Generic + + has_attached_class! :out + + sig { params(enabled: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(policy: ActionDispatch::ContentSecurityPolicy).void)).void } + def content_security_policy(enabled = true, **options, &block); end +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, block: T.nilable(T.proc.params(key: T.any(String, Symbol)).returns(T.untyped))).returns(T.untyped) } + def fetch(key, *args, &block); end + + sig { returns(String) } + def inspect; end + + sig { params(other_hash: T.untyped, block: T.untyped).returns(ActionController::Parameters) } + def merge!(other_hash, &block); 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)).returns(T.untyped) } + sig { params(key: T::Array[T.any(String, Symbol)]).returns(T::Array[T.untyped]) } + def require(key); end + + # required is an alias of require + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } + sig { params(key: T::Array[T.any(String, Symbol)]).returns(T::Array[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 { 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 { params(block: T.nilable(T.proc.params(value: T.untyped).returns(T.untyped))).returns(ActionController::Parameters) } + def transform_values!(&block); end + + sig { params(block: T.nilable(T.proc.params(value: T.untyped).returns(T.untyped))).returns(ActionController::Parameters) } + def transform_values(&block); end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def values_at(*keys); 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 +end + +# @version >= 6.1.0 +module ActionController::PermissionsPolicy::ClassMethods + # @shim: required to declare T.attached_class + extend T::Generic + + has_attached_class! :out + + sig { params(options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(policy: ActionDispatch::PermissionsPolicy).void)).void } + def permissions_policy(**options, &block); 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..9c939f0 --- /dev/null +++ b/sorbet/rbi/annotations/actionview.rbi @@ -0,0 +1,75 @@ +# typed: true + +# 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/activejob.rbi b/sorbet/rbi/annotations/activejob.rbi new file mode 100644 index 0000000..8887fbb --- /dev/null +++ b/sorbet/rbi/annotations/activejob.rbi @@ -0,0 +1,50 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveJob::Base + sig { params(blk: T.proc.bind(T.attached_class).params(job: T.attached_class, exception: Exception).void).void } + def self.after_discard(&blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.after_enqueue(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.after_perform(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class, block: T.untyped).void)).void } + def self.around_enqueue(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class, block: T.untyped).void)).void } + def self.around_perform(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.before_enqueue(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.before_perform(*filters, &blk); end + + sig { type_parameters(:ExceptionType).params(exceptions: T::Class[T.type_parameter(:ExceptionType)], block: T.nilable(T.proc.params(job: T.attached_class, error: T.type_parameter(:ExceptionType)).void)).void } + sig { params(exceptions: T.any(Module, String), block: T.nilable(T.proc.params(job: T.attached_class, error: T.untyped).void)).void } + def self.discard_on(*exceptions, &block); end + + sig { params(klasses: T.any(Module, String), with: T.nilable(Symbol), block: T.nilable(T.proc.params(exception: T.untyped).void)).void } + def self.rescue_from(*klasses, with: nil, &block); end + + sig { params(exceptions: T.any(Module, String), wait: T.any(ActiveSupport::Duration, Integer, Symbol, T.proc.params(executions: Integer).returns(Integer)), attempts: T.any(Integer, Symbol), queue: T.nilable(T.any(String, Symbol)), priority: T.untyped, jitter: Numeric, block: T.nilable(T.proc.params(job: T.attached_class, error: T.untyped).void)).void } + def self.retry_on(*exceptions, wait: 3.seconds, attempts: 5, queue: nil, priority: nil, jitter: ActiveJob::Exceptions::JITTER_DEFAULT, &block); end + + sig { params(part_name: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.bind(T.attached_class).returns(T.untyped))).void } + def self.queue_as(part_name = nil, &block); end + + sig { params(priority: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).returns(T.untyped))).void } + def self.queue_with_priority(priority = nil, &block); end +end + +# @version >= 8.1.0.beta1 +module ActiveJob::Continuable + sig { params(step_name: Symbol, start: T.untyped, isolated: T::Boolean, block: T.nilable(T.proc.params(step: ActiveJob::Continuation::Step).void)).void } + def step(step_name, start: nil, isolated: false, &block); end +end diff --git a/sorbet/rbi/annotations/activesupport.rbi b/sorbet/rbi/annotations/activesupport.rbi new file mode 100644 index 0000000..c081921 --- /dev/null +++ b/sorbet/rbi/annotations/activesupport.rbi @@ -0,0 +1,574 @@ +# typed: true + +# 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 + +module ActiveSupport::Concern + sig { params(base: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def included(base = nil, &block); end + + # @version >= 6.1.0 + sig { params(base: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def prepended(base = nil, &block); end + + # @version >= 4.2.0 + sig { params(class_methods_module_definition: T.nilable(T.proc.bind(T.untyped).void)).void } + def class_methods(&class_methods_module_definition); 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 local?; end +end + +class ActiveSupport::HashWithIndifferentAccess < Hash + K = type_member { {fixed: T.any(String, Symbol)} } + V = type_member { {fixed: T.untyped} } + Elem = type_member { {fixed: T.untyped} } + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def with_indifferent_access; end + + sig { type_parameters(:V2, :ConflictRes).params(other_hash: T::Hash[T.untyped, T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: String, + old_val: T.untyped, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(ActiveSupport::HashWithIndifferentAccess) } + def deep_merge(other_hash, &block); end + + sig { type_parameters(:V2, :ConflictRes).params(other_hash: T::Hash[T.untyped, T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: String, + old_val: T.untyped, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(ActiveSupport::HashWithIndifferentAccess) } + def deep_merge!(other_hash, &block); end + + # @version >= 7.2 + sig { params(other: T.untyped).returns(T::Boolean) } + def deep_merge?(other); 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 + + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class Object + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(FalseClass) } + def html_safe?; end + + sig { returns(T.nilable(T.self_type)) } + def presence; end + + sig { params(another_object: T.untyped).returns(T.nilable(T.self_type)) } + def presence_in(another_object); end + + sig { returns(T::Boolean) } + def present?; end +end + +class Hash + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end + + sig { returns(T::Boolean) } + def extractable_options?; end + + # @version >= 6.1.0 + sig { returns(T.self_type) } + def compact_blank; end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def with_indifferent_access; end + + sig { type_parameters(:K2, :V2, :ConflictRes).params(other_hash: T::Hash[T.type_parameter(:K2), T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: T.any(K, T.type_parameter(:K2)), + old_val: V, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(T::Hash[T.any(K, T.type_parameter(:K2)), T.any(V, T.type_parameter(:V2), T.type_parameter(:ConflictRes))]) } + def deep_merge(other_hash, &block); end + + sig { type_parameters(:K2, :V2, :ConflictRes).params(other_hash: T::Hash[T.type_parameter(:K2), T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: T.any(K, T.type_parameter(:K2)), + old_val: V, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(T::Hash[T.any(K, T.type_parameter(:K2)), T.any(V, T.type_parameter(:V2), T.type_parameter(:ConflictRes))]) } + def deep_merge!(other_hash, &block); end + + # @version >= 7.2 + sig { params(other: T.untyped).returns(T::Boolean) } + def deep_merge?(other); end +end + +class Array + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end + + 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(block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T.any(T::Array[Elem], T::Enumerator[Elem])) } + def extract!(&block); end + + sig { returns(ActiveSupport::ArrayInquirer) } + def inquiry; end + + sig { params(object: T.untyped).returns(T::Array[T.untyped]) } + def self.wrap(object); end +end + +class Date + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class DateTime + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +module Enumerable + sig { type_parameters(:Block).params(block: T.proc.params(arg0: Elem).returns(T.type_parameter(:Block))).returns(T::Hash[T.type_parameter(:Block), Elem]) } + sig { returns(T::Enumerable[T.untyped]) } + def index_by(&block); end + + sig { type_parameters(:Block).params(block: T.proc.params(arg0: Elem).returns(T.type_parameter(:Block))).returns(T::Hash[Elem, T.type_parameter(:Block)]) } + sig { returns(T::Enumerable[T.untyped]) } + sig { type_parameters(:Default).params(default: T.type_parameter(:Default)).returns(T::Hash[Elem, T.type_parameter(:Default)]) } + def index_with(default = nil, &block); end + + sig { params(block: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T::Boolean) } + sig { returns(T::Boolean) } + def many?(&block); end + + sig { params(object: BasicObject).returns(T::Boolean) } + def exclude?(object); end + + # @version >= 6.1.0 + sig { returns(T::Array[Elem]) } + def compact_blank; end + + # @version >= 7.0.0 + sig { returns(Elem) } + def sole; end +end + +class NilClass + sig { returns(TrueClass) } + def blank?; end + + # @shim: since `present?` is always false, `presence` always returns `nil` + sig { returns(NilClass) } + def presence; end + + # @shim: since `blank?` is always true, `present?` always returns `false` + sig { returns(FalseClass) } + def present?; end +end + +class FalseClass + sig { returns(TrueClass) } + def blank?; end + + # @shim: since `present?` is always false, `presence` always returns `nil` + sig { returns(NilClass) } + def presence; end + + # @shim: since `blank?` is always true, `present?` always returns `false` + sig { returns(FalseClass) } + def present?; end +end + +class TrueClass + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class Numeric + sig { returns(FalseClass) } + def blank?; end + + sig { returns(TrueClass) } + def html_safe?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class Time + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end + + sig { returns(ActiveSupport::TimeZone) } + def self.zone; end + + sig { returns(T.any(ActiveSupport::TimeWithZone, ::Time)) } + def self.current; end +end + +class Symbol + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end + + # alias for `#start_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def starts_with?(*string_or_regexp); end + + # alias for `#end_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def ends_with?(*string_or_regexp); end +end + +class String + sig { returns(TrueClass) } + def acts_like_string?; end + + # This is the subset of `#[]` sigs that have just 1 parameter. + # https://github.com/sorbet/sorbet/blob/40ad87b4dc7be23fa00c1369ac9f927053c68907/rbi/core/string.rbi#L270-L303 + sig { params(position: Integer).returns(T.nilable(String)) } + sig { params(position: T.any(T::Range[Integer], Regexp)).returns(T.nilable(String)) } + sig { params(position: String).returns(T.nilable(String)) } + def at(position); end + + sig { returns(String) } + def as_json; end + + sig { returns(T::Boolean) } + def blank?; end + + sig { params(first_letter: Symbol).returns(String) } + def camelcase(first_letter = :upper); end + + sig { params(first_letter: Symbol).returns(String) } + def camelize(first_letter = :upper); end + + sig { returns(String) } + def classify; end + + sig { returns(T.untyped) } + def constantize; end + + sig { returns(String) } + def dasherize; end + + sig { returns(String) } + def deconstantize; end + + sig { returns(String) } + def demodulize; end + + # alias for `#end_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def ends_with?(*string_or_regexp); end + + sig { returns(String) } + def downcase_first; end + + sig { params(string: String).returns(T::Boolean) } + def exclude?(string); end + + sig { params(limit: Integer).returns(String) } + def first(limit = 1); end + + sig { params(separate_class_name_and_id_with_underscore: T::Boolean).returns(String) } + def foreign_key(separate_class_name_and_id_with_underscore = true); end + + sig { params(position: Integer).returns(String) } + def from(position); end + + sig { returns(ActiveSupport::SafeBuffer) } + def html_safe; end + + sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) } + def humanize(capitalize: true, keep_id_suffix: false); end + + sig { params(zone: T.nilable(T.any(ActiveSupport::TimeZone, String))).returns(T.any(ActiveSupport::TimeWithZone, Time)) } + def in_time_zone(zone = ::Time.zone); end + + sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(String) } + def indent(amount, indent_string = nil, indent_empty_lines = false); end + + sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) } + def indent!(amount, indent_string = nil, indent_empty_lines = false); end + + sig { returns(ActiveSupport::StringInquirer) } + def inquiry; end + + sig { returns(T::Boolean) } + def is_utf8?; end + + sig { params(limit: Integer).returns(String) } + def last(limit = 1); end + + sig { returns(ActiveSupport::Multibyte::Chars) } + def mb_chars; end + + sig { params(separator: String, preserve_case: T::Boolean, locale: T.nilable(Symbol)).returns(String) } + def parameterize(separator: "-", preserve_case: false, locale: nil); end + + sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) } + def pluralize(count = nil, locale = :en); end + + sig { returns(T::Boolean) } + def present?; end + + sig { params(patterns: T.any(String, Regexp)).returns(String) } + def remove(*patterns); end + + sig { params(patterns: T.any(String, Regexp)).returns(String) } + def remove!(*patterns); end + + sig { returns(T.untyped) } + def safe_constantize; end + + sig { params(locale: Symbol).returns(String) } + def singularize(locale = :en); end + + sig { returns(String) } + def squish; end + + sig { returns(String) } + def squish!; end + + # alias for `#start_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def starts_with?(*string_or_regexp); end + + sig { returns(String) } + def strip_heredoc; end + + sig { returns(String) } + def tableize; end + + sig { params(keep_id_suffix: T::Boolean).returns(String) } + def titlecase(keep_id_suffix: false); end + + sig { params(keep_id_suffix: T::Boolean).returns(String) } + def titleize(keep_id_suffix: false); end + + sig { params(position: Integer).returns(String) } + def to(position); end + + sig { returns(::Date) } + def to_date; end + + sig { returns(::DateTime) } + def to_datetime; end + + sig { params(form: T.nilable(Symbol)).returns(T.nilable(Time)) } + def to_time(form = :local); end + + sig { params(truncate_to: Integer, options: T::Hash[Symbol, T.anything]).returns(String) } + def truncate(truncate_to, options = {}); end + + sig { params(truncate_to: Integer, omission: T.nilable(String)).returns(String) } + def truncate_bytes(truncate_to, omission: "…"); end + + sig { params(words_count: Integer, options: T::Hash[Symbol, T.anything]).returns(String) } + def truncate_words(words_count, options = {}); end + + sig { returns(String) } + def underscore; end + + sig { returns(String) } + def upcase_first; end +end + +class ActiveSupport::ErrorReporter + # @version >= 7.1.0.beta1 + sig { type_parameters(:Block, :Fallback).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), fallback: T.nilable(T.proc.returns(T.type_parameter(:Fallback))), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.any(T.type_parameter(:Block), T.type_parameter(:Fallback))) } + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end + + # @version >= 7.1.0.beta1 + sig { type_parameters(:Block).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) } + def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end + + # @version >= 7.1.0.beta1 + sig { params(error: Exception, handled: T::Boolean, severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void } + def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # @version >= 7.2.0.beta1 + sig { params(error: T.any(Exception, String), severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void } + def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end +end + +module ActiveSupport::Testing::Assertions + sig { type_parameters(:Block).params(block: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) } + def assert_nothing_raised(&block); end + + sig { type_parameters(:TResult).params(expression: T.any(Proc, Kernel), message: Kernel, from: T.anything, to: T.anything, block: T.proc.returns(T.type_parameter(:TResult))).returns(T.type_parameter(:TResult)) } + def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end +end + +module ActiveSupport::Testing::ErrorReporterAssertions + # @version >= 7.1.0.rc1 + sig { params(error_class: T.class_of(Exception), block: T.proc.void).returns(ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report) } + def assert_error_reported(error_class = T.unsafe(nil), &block); end + + # @version >= 8.1.0.beta1 + sig { params(error_class: T.class_of(Exception), block: T.proc.void).returns(T::Array[ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report]) } + def capture_error_reports(error_class = T.unsafe(nil), &block); end +end diff --git a/sorbet/rbi/annotations/globalid.rbi b/sorbet/rbi/annotations/globalid.rbi new file mode 100644 index 0000000..916b21d --- /dev/null +++ b/sorbet/rbi/annotations/globalid.rbi @@ -0,0 +1,30 @@ +# typed: true + +# 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/i18n.rbi b/sorbet/rbi/annotations/i18n.rbi new file mode 100644 index 0000000..2de3719 --- /dev/null +++ b/sorbet/rbi/annotations/i18n.rbi @@ -0,0 +1,40 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module I18n::Base + # A list set through `#available_locales=` is symbolized on the way in, but the + # fallback to `backend.available_locales` is returned as the backend built it, + # and a custom backend is free to hand back strings. + sig { returns(T::Array[T.any(String, Symbol)]) } + def available_locales; end + + sig { params(value: T.nilable(T.any(String, Symbol, T::Array[T.any(String, Symbol)]))).returns(T.nilable(T.any(String, Symbol, T::Array[T.any(String, Symbol)]))) } + def available_locales=(value); end + + sig { returns(Symbol) } + def default_locale; end + + sig { params(value: T.nilable(T.any(String, Symbol))).returns(T.nilable(T.any(String, Symbol))) } + def default_locale=(value); end + + sig { returns(String) } + def default_separator; end + + sig { params(value: String).returns(String) } + def default_separator=(value); end + + sig { returns(T::Boolean) } + def enforce_available_locales; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enforce_available_locales=(value); end + + sig { returns(T.any(Symbol, FalseClass)) } + def locale; end + + sig { params(value: T.nilable(T.any(String, Symbol, FalseClass))).returns(T.nilable(T.any(String, Symbol, FalseClass))) } + def locale=(value); end +end diff --git a/sorbet/rbi/annotations/minitest.rbi b/sorbet/rbi/annotations/minitest.rbi new file mode 100644 index 0000000..6404733 --- /dev/null +++ b/sorbet/rbi/annotations/minitest.rbi @@ -0,0 +1,116 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Minitest::Assertions + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def assert(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(MatchData) } + def assert_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_nil(obj, msg = nil); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(stdout: T.nilable(T.any(String, Regexp)), stderr: T.nilable(T.any(String, Regexp)), block: T.proc.void).returns(T::Boolean) } + def assert_output(stdout = nil, stderr = nil, &block); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def assert_path_exists(path, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def assert_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def assert_predicate(o1, op, msg = nil); end + + sig { params(exp: NilClass, block: T.proc.void).returns(StandardError) } + sig { type_parameters(:T).params(exp: T.any(T::Class[T.type_parameter(:T)], Regexp, String), block: T.proc.void).returns(T.type_parameter(:T)) } + def assert_raises(*exp, &block); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def assert_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_same(exp, act, msg = nil); end + + sig { params(block: T.proc.void).returns(T::Boolean) } + def assert_silent(&block); end + + sig { params(sym: Symbol, msg: T.anything, block: T.proc.void).returns(T.anything) } + def assert_throws(sym, msg = nil, &block); end + + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def refute(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_nil(obj, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def refute_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def refute_path_exists(path, msg = nil); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def refute_predicate(o1, op, msg = nil); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def refute_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_same(exp, act, msg = nil); end +end diff --git a/sorbet/rbi/annotations/railties.rbi b/sorbet/rbi/annotations/railties.rbi new file mode 100644 index 0000000..820b3ef --- /dev/null +++ b/sorbet/rbi/annotations/railties.rbi @@ -0,0 +1,104 @@ +# typed: true + +# 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(Rails::Autoloaders) } + def autoloaders; 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::ErrorReporter) } + def error; end + + # @version >= 8.1.0.beta1 + sig { returns(ActiveSupport::EventReporter) } + def event; end + + # @version >= 7.1.0.rc1 + sig { returns(ActiveSupport::BroadcastLogger) } + 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::Autoloaders + Elem = type_member(:out) { { fixed: Zeitwerk::Loader } } + + sig { params(block: T.proc.params(arg0: Elem).returns(T.untyped)).returns(T.untyped) } + def each(&block); end + + sig { returns(Zeitwerk::Loader) } + def main; end + + sig { returns(Zeitwerk::Loader) } + def once; end +end + +class Rails::Engine < ::Rails::Railtie + class << self + # @shim: delegated to the instance using `method_missing` + sig { void } + def load_seed; end + + # @shim: delegated to the instance using `method_missing` + sig { returns(Pathname) } + def root; end + + # @shim: delegated to the instance using `method_missing` + sig { params(block: T.nilable(T.proc.bind(ActionDispatch::Routing::Mapper).void)).returns(ActionDispatch::Routing::RouteSet) } + def routes(&block); end + end + + sig { void } + def load_seed; end + + sig { params(block: T.nilable(T.proc.bind(ActionDispatch::Routing::Mapper).void)).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 + + class << self + sig { params(block: T.proc.bind(Rake::DSL).params(app: Rails::Application).void).void } + def rake_tasks(&block); end + 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..0d2cb4e --- /dev/null +++ b/sorbet/rbi/annotations/rainbow.rbi @@ -0,0 +1,269 @@ +# typed: true + +# 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 { 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 + 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/annotations/sidekiq.rbi b/sorbet/rbi/annotations/sidekiq.rbi new file mode 100644 index 0000000..38dc284 --- /dev/null +++ b/sorbet/rbi/annotations/sidekiq.rbi @@ -0,0 +1,84 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class Sidekiq::CLI + sig { returns(Sidekiq::Launcher) } + def launcher; end + + sig { returns(Sidekiq::CLI) } + def self.instance; end +end + +class Sidekiq::Client + sig { params(item: T.untyped).returns(T.untyped) } + def normalize_item(item); end + + sig { params(item_class: T.untyped).returns(T.untyped) } + def normalized_hash(item_class); end +end + +class Sidekiq::DeadSet < ::Sidekiq::JobSet + Elem = type_member { { fixed: Sidekiq::SortedEntry } } +end + +class Sidekiq::JobSet < ::Sidekiq::SortedSet + Elem = type_member { { fixed: Sidekiq::SortedEntry } } +end + +class Sidekiq::Launcher + sig { returns(T::Boolean) } + def stopping?; end +end + +class Sidekiq::Middleware::Chain + Elem = type_member { { fixed: T.untyped } } +end + +class Sidekiq::ProcessSet + Elem = type_member { { fixed: Sidekiq::Process } } +end + +class Sidekiq::Queue + Elem = type_member { { fixed: Sidekiq::Job } } + + sig { returns(T::Boolean) } + def paused?; end + + sig { returns(Integer) } + def size; end +end + +class Sidekiq::RetrySet < ::Sidekiq::JobSet + Elem = type_member { { fixed: Sidekiq::SortedEntry } } +end + +class Sidekiq::ScheduledSet < ::Sidekiq::JobSet + Elem = type_member { { fixed: Sidekiq::SortedEntry } } +end + +class Sidekiq::SortedSet + Elem = type_member { { fixed: Sidekiq::SortedEntry } } +end + +module Sidekiq::Job + sig { returns(String) } + def jid; end +end + +module Sidekiq::Job::ClassMethods + sig { params(args: T.untyped).returns(String) } + def perform_async(*args); end + + sig { params(interval: T.untyped, args: T.untyped).returns(String) } + def perform_at(interval, *args); end + + sig { params(interval: T.untyped, args: T.untyped).returns(String) } + def perform_in(interval, *args); end +end + +class Sidekiq::WorkSet + Elem = type_member { { fixed: T.untyped } } +end diff --git a/sorbet/rbi/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/actionpack@8.1.4.rbi b/sorbet/rbi/gems/actionpack@8.1.4.rbi new file mode 100644 index 0000000..bed0c72 --- /dev/null +++ b/sorbet/rbi/gems/actionpack@8.1.4.rbi @@ -0,0 +1,20423 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionpack` gem. +# Please instead update this file by running `bin/tapioca gem actionpack`. + + +# :markup: markdown +# +# pkg:gem/actionpack#lib/abstract_controller/deprecator.rb:5 +module AbstractController + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionpack#lib/abstract_controller/deprecator.rb:6 + def deprecator; end + + # pkg:gem/actionpack#lib/abstract_controller.rb:27 + def eager_load!; end + end +end + +# Raised when a non-existing controller action is triggered. +# +# pkg:gem/actionpack#lib/abstract_controller/base.rb:12 +class AbstractController::ActionNotFound < ::StandardError + include ::DidYouMean::Correctable + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:15 + def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:13 + def action; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:13 + def controller; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:24 + def corrections; end +end + +# pkg:gem/actionpack#lib/abstract_controller/asset_paths.rb:6 +module AbstractController::AssetPaths + extend ::ActiveSupport::Concern +end + +# # Abstract Controller Base +# +# AbstractController::Base is a low-level API. Nobody should be using it +# directly, and subclasses (like ActionController::Base) are expected to provide +# their own `render` method, since rendering means different things depending on +# the context. +# +# pkg:gem/actionpack#lib/abstract_controller/base.rb:36 +class AbstractController::Base + extend ::ActiveSupport::DescendantsTracker + + # Delegates to the class's ::action_methods. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def action_methods; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:43 + def action_name; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:43 + def action_name=(_arg0); end + + # Returns true if a method for the action is available and can be dispatched, + # false otherwise. + # + # Notice that `action_methods.include?("foo")` may return false and + # `available_action?("foo")` returns true because this method considers actions + # that are also available through other means, for example, implicit render + # ones. + # + # #### Parameters + # * `action_name` - The name of an action to be tested + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def available_action?(action_name); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:49 + def config; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:49 + def config=(_arg0); end + + # Delegates to the class's ::controller_path. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def controller_path; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:47 + def formats; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:47 + def formats=(_arg0); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def inspect; end + + # Tests if a response body is set. Used to determine if the `process_action` + # callback needs to be terminated in AbstractController::Callbacks. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def performed?; end + + # Calls the action going through the entire Action Dispatch stack. + # + # The actual method that is called is determined by calling #method_for_action. + # If no method can handle the action, then an AbstractController::ActionNotFound + # error is raised. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def process(action, *, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:39 + def response_body; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:39 + def response_body=(_arg0); end + + # Actually call the method associated with the action. Override this method if + # you wish to change how action methods are called, not to add additional + # behavior around it. For example, you would override #send_action if you want + # to inject arguments into the method. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def send_action(*_arg0); end + + private + + # Takes an action name and returns the name of the method that will handle the + # action. + # + # It checks if the action name is valid and returns false otherwise. + # + # See method_for_action for more information. + # + # #### Parameters + # * `action_name` - An action name to find a method name for + # + # + # #### Returns + # * `string` - The name of the method that handles the action + # * false - No valid method name could be found. + # + # Raise `AbstractController::ActionNotFound`. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def _find_action_name(action_name); end + + # If the action name was not found, but a method called "action_missing" was + # found, #method_for_action will return "_handle_action_missing". This method + # calls #action_missing with the current action name. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def _handle_action_missing(*args); end + + # Checks if the action name is valid and returns false otherwise. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def _valid_action_name?(action_name); end + + # Returns true if the name can be considered an action because it has a method + # defined in the controller. + # + # #### Parameters + # * `name` - The name of an action to be tested + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def action_method?(name); end + + # Takes an action name and returns the name of the method that will handle the + # action. In normal cases, this method returns the same name as it receives. By + # default, if #method_for_action receives a name that is not an action, it will + # look for an #action_missing method and return "_handle_action_missing" if one + # is found. + # + # Subclasses may override this method to add additional conditions that should + # be considered an action. For instance, an HTTP controller with a template + # matching the action name is considered to exist. + # + # If you override this method to handle additional cases, you may also provide a + # method (like `_handle_method_missing`) to handle the case. + # + # If none of these conditions are true, and `method_for_action` returns `nil`, + # an `AbstractController::ActionNotFound` exception will be raised. + # + # #### Parameters + # * `action_name` - An action name to find a method name for + # + # + # #### Returns + # * `string` - The name of the method that handles the action + # * `nil` - No method name could be found. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def method_for_action(action_name); end + + # Call the action. Override this in a subclass to modify the behavior around + # processing an action. This, and not #process, is the intended way to override + # action dispatching. + # + # Notice that the first argument is the method to be dispatched which is **not** + # necessarily the same as the action name. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:128 + def process_action(*, **, &); end + + class << self + # pkg:gem/actionpack#lib/abstract_controller/base.rb:53 + def abstract; end + + # Define a controller as abstract. See internal_methods for more details. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:57 + def abstract!; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:54 + def abstract?; end + + # A `Set` of method names that should be considered actions. This includes all + # public instance methods on a controller, less any internal methods (see + # internal_methods), adding back in any methods that are internal, but still + # exist on the class itself. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:93 + def action_methods; end + + # action_methods are cached and there is sometimes a need to refresh them. + # ::clear_action_methods! allows you to do that, so next time you run + # action_methods, they will be recalculated. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:106 + def clear_action_methods!; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:49 + def config; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:49 + def config=(value); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:122 + def configure; end + + # Returns the full controller name, underscored, without the ending Controller. + # + # class MyApp::MyPostsController < AbstractController::Base + # + # end + # + # MyApp::MyPostsController.controller_path # => "my_app/my_posts" + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:118 + def controller_path; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:132 + def eager_load!; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:61 + def inherited(klass); end + + # A list of all internal methods for a controller. This finds the first abstract + # superclass of a controller, and gets a list of all public instance methods on + # that abstract class. Public instance methods of a controller would normally be + # considered action methods, so methods declared on abstract classes are being + # removed. (ActionController::Metal and ActionController::Base are defined as + # abstract) + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:77 + def internal_methods; end + + # Refresh the cached action_methods when a new action_method is added. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:127 + def method_added(name); end + + # Returns true if the given controller is capable of rendering a path. A + # subclass of `AbstractController::Base` may return false. An Email controller + # for example does not support paths, only full URLs. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:191 + def supports_path?; end + + private + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:49 + def __class_attr_config; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:49 + def __class_attr_config=(new_value); end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/caching.rb:6 +module AbstractController::Caching + include ::AbstractController::Caching::ConfigMethods + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + + mixes_in_class_methods GeneratedClassMethods + + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:57 + def view_cache_dependencies; end + + private + + # Convenience accessor. + # + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:63 + def cache(key, options = T.unsafe(nil), &block); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/caching.rb:51 +module AbstractController::Caching::ClassMethods + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:52 + def view_cache_dependency(&dependency); end +end + +# pkg:gem/actionpack#lib/abstract_controller/caching.rb:14 +module AbstractController::Caching::ConfigMethods + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:15 + def cache_store; end + + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:19 + def cache_store=(store); end + + private + + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:24 + def cache_configured?; end +end + +# # Abstract Controller Caching Fragments +# +# Fragment caching is used for caching various blocks within views without +# caching the entire action as a whole. This is useful when certain elements of +# an action change frequently or depend on complicated state while other parts +# rarely change or can be shared amongst multiple parties. The caching is done +# using the `cache` helper available in the Action View. See +# ActionView::Helpers::CacheHelper for more information. +# +# While it's strongly recommended that you use key-based cache expiration (see +# links in CacheHelper for more information), it is also possible to manually +# expire caches. For example: +# +# expire_fragment('name_of_cache') +# +# pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:21 +module AbstractController::Caching::Fragments + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + + # Given a key (as described in `expire_fragment`), returns a key array suitable + # for use in reading, writing, or expiring a cached fragment. All keys begin + # with `:views`, followed by `ENV["RAILS_CACHE_ID"]` or + # `ENV["RAILS_APP_VERSION"]` if set, followed by any controller-wide key prefix + # values, ending with the specified `key` value. + # + # pkg:gem/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). + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:131 + def expire_fragment(key, options = T.unsafe(nil)); end + + # Check if a cached fragment from the location signified by `key` exists (see + # `expire_fragment` for acceptable formats). + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:105 + def fragment_exist?(key, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:144 + def instrument_fragment_cache(name, key, &block); end + + # Reads a cached fragment from the location signified by `key` (see + # `expire_fragment` for acceptable formats). + # + # pkg:gem/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). + # + # pkg:gem/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 + +# pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:38 +module AbstractController::Caching::Fragments::ClassMethods + # Allows you to specify controller-wide key prefixes for cache fragments. Pass + # either a constant `value`, or a block which computes a value each time a cache + # key is generated. + # + # For example, you may want to prefix all fragment cache keys with a global + # version identifier, so you can easily invalidate all caches. + # + # class ApplicationController + # fragment_cache_key "v1" + # end + # + # When it's time to invalidate all fragments, simply change the string constant. + # Or, progressively roll out the cache invalidation using a computed value: + # + # class ApplicationController + # fragment_cache_key do + # @account.id.odd? ? "v1" : "v2" + # end + # end + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:58 + def fragment_cache_key(value = T.unsafe(nil), &key); end +end + +# # Abstract Controller Callbacks +# +# Abstract Controller provides hooks during the life cycle of a controller +# action. Callbacks allow you to trigger logic during this cycle. Available +# callbacks are: +# +# * `after_action` +# * `append_after_action` +# * `append_around_action` +# * `append_before_action` +# * `around_action` +# * `before_action` +# * `prepend_after_action` +# * `prepend_around_action` +# * `prepend_before_action` +# * `skip_after_action` +# * `skip_around_action` +# * `skip_before_action` +# +# pkg:gem/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. + # + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:265 + def process_action(*, **, &); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:41 +class AbstractController::Callbacks::ActionFilter + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:42 + def initialize(filters, conditional_key, actions); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:71 + def after(controller); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:73 + def around(controller); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:72 + def before(controller); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:48 + def match?(controller); end +end + +# pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:76 +module AbstractController::Callbacks::ClassMethods + # Take callback names and an optional callback proc, normalize them, then call + # the block with each callback. This allows us to abstract the normalization + # across several methods that use it. + # + # #### Parameters + # * `callbacks` - An array of callbacks, with an optional options hash as the + # last parameter. + # * `block` - A proc that should be added to the callbacks. + # + # + # #### Block Parameters + # * `name` - The callback to be added. + # * `options` - A hash of options to be used when adding the callback. + # + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:122 + def _insert_callbacks(callbacks, block = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:100 + def _normalize_callback_option(options, from, to); end + + # If `:only` or `:except` are used, convert the options into the `:if` and + # `:unless` options of ActiveSupport::Callbacks. + # + # The basic idea is that `:only => :index` gets converted to `:if => proc {|c| + # c.action_name == "index" }`. + # + # Note that `:only` has priority over `:if` in case they are used together. + # + # only: :index, if: -> { true } # the :if option will be ignored. + # + # Note that `:if` has priority over `:except` in case they are used together. + # + # except: :index, if: -> { true } # the :except option will be ignored. + # + # #### Options + # * `only` - The callback should be run only for this action. + # * `except` - The callback should be run for all actions except this action. + # + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:95 + def _normalize_callback_options(options); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:233 + def after_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:254 + def append_after_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:254 + def append_around_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:254 + def append_before_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:233 + def around_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:233 + def before_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:257 + def internal_methods; end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:239 + def prepend_after_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:239 + def prepend_around_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:239 + def prepend_before_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:247 + def skip_after_action(*names); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:247 + def skip_around_action(*names); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:247 + def skip_before_action(*names); end +end + +# pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:32 +AbstractController::Callbacks::DEFAULT_INTERNAL_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/abstract_controller/collector.rb:8 +module AbstractController::Collector + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def atom(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def bmp(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def css(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def csv(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def gif(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def gzip(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def html(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def ics(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def jpeg(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def js(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def json(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def m4a(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def md(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def mp3(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def mp4(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def mpeg(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def multipart_form(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def ogg(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def otf(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def pdf(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def png(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def rss(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def svg(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def text(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def tiff(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def ttf(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def url_encoded_form(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def vcf(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def vtt(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def webm(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def webp(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def woff(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def woff2(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def xml(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def yaml(*, **, &); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:11 + def zip(*, **, &); end + + private + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:27 + def method_missing(symbol, *, **, &); end + + class << self + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def generate_method_for_mime(mime); end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:10 +class AbstractController::DoubleRenderError < ::AbstractController::Error + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:13 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:11 +AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/abstract_controller/error.rb:6 +class AbstractController::Error < ::StandardError; end + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:9 +module AbstractController::Helpers + extend ::ActiveSupport::Concern + extend ::AbstractController::Helpers::Resolution + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:28 + def _helpers; end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:64 +module AbstractController::Helpers::ClassMethods + include ::AbstractController::Helpers::Resolution + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:76 + def _helpers=(_arg0); end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:218 + def _helpers_for_modification; end + + # Clears up all existing helpers in this class, only keeping the helper with the + # same name as this class. + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:209 + def clear_helpers; end + + # Includes the given modules in the template class. + # + # Modules can be specified in different ways. All of the following calls include + # `FooHelper`: + # + # # Module, recommended. + # helper FooHelper + # + # # String/symbol without the "helper" suffix, camel or snake case. + # helper "Foo" + # helper :Foo + # helper "foo" + # helper :foo + # + # The last two assume that `"foo".camelize` returns "Foo". + # + # When strings or symbols are passed, the method finds the actual module object + # using String#constantize. Therefore, if the module has not been yet loaded, it + # has to be autoloadable, which is normally the case. + # + # Namespaces are supported. The following calls include `Foo::BarHelper`: + # + # # Module, recommended. + # helper Foo::BarHelper + # + # # String/symbol without the "helper" suffix, camel or snake case. + # helper "Foo::Bar" + # helper :"Foo::Bar" + # helper "foo/bar" + # helper :"foo/bar" + # + # The last two assume that `"foo/bar".camelize` returns "Foo::Bar". + # + # The method accepts a block too. If present, the block is evaluated in the + # context of the controller helper module. This simple call makes the `wadus` + # method available in templates of the enclosing controller: + # + # helper do + # def wadus + # "wadus" + # end + # end + # + # Furthermore, all the above styles can be mixed together: + # + # helper FooHelper, "woo", "bar/baz" do + # def wadus + # "wadus" + # end + # end + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:198 + def helper(*args, &block); end + + # Declare a controller method as a helper. For example, the following + # makes the `current_user` and `logged_in?` controller methods available + # to the view: + # + # class ApplicationController < ActionController::Base + # helper_method :current_user, :logged_in? + # + # private + # def current_user + # @current_user ||= User.find_by(id: session[:user]) + # end + # + # def logged_in? + # current_user != nil + # end + # end + # + # In a view: + # + # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%> + # + # #### Parameters + # * `method[, method]` - A name or names of a method on the controller to be + # made available on the view. + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:128 + def helper_method(*methods); end + + # When a class is inherited, wrap its helper module in a new module. This + # ensures that the parent class's module can be changed independently of the + # child class's. + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:68 + def inherited(klass); end + + private + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:237 + def default_helper_module!; end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:226 + def define_helpers_module(klass, helpers = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:32 +module AbstractController::Helpers::Resolution + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:48 + def all_helpers_from_path(path); end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:57 + def helper_modules_from_paths(paths); end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:33 + def modules_for_helpers(modules_or_helper_prefixes); end +end + +# pkg:gem/actionpack#lib/abstract_controller/logger.rb:8 +module AbstractController::Logger + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:18 +module AbstractController::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + + # Normalizes arguments and options, and then delegates to render_to_body and + # sticks the result in `self.response_body`. + # + # Supported options depend on the underlying `render_to_body` implementation. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:26 + def render(*args, &block); end + + # Performs the actual template rendering. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:50 + def render_to_body(options = T.unsafe(nil)); end + + # Similar to #render, but only returns the rendered template as a string, + # instead of setting `self.response_body`. + # + # If a component extends the semantics of `response_body` (as ActionController + # extends it to be anything that responds to the method each), this method needs + # to be overridden in order to still return a string. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:44 + def render_to_string(*args, &block); end + + # Returns `Content-Type` of rendered content. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:54 + def rendered_format; end + + # This method should return a hash with assigns. You can overwrite this + # configuration per controller. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:62 + def view_assigns; end + + private + + # Normalize args by converting `render "foo"` to `render action: "foo"` and + # `render "foo/bar"` to `render file: "foo/bar"`. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:73 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Normalize options. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:88 + def _normalize_options(options); end + + # Normalize args and options. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:114 + def _normalize_render(*args, &block); end + + # Process the rendered format. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:98 + def _process_format(format); end + + # Process extra options. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:93 + def _process_options(options); end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:101 + def _process_variant(options); end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:121 + def _protected_ivars; end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:104 + def _set_html_content_type; end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:110 + def _set_rendered_content_type(format); end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:107 + def _set_vary_header; end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:58 +AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/abstract_controller/translation.rb:8 +module AbstractController::Translation + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:40 + def l(object, **options); end + + # Delegates to `I18n.localize`. + # + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:37 + def localize(object, **options); end + + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:34 + def t(key, **options); end + + # Delegates to `I18n.translate`. + # + # When the given key starts with a period, it will be scoped by the current + # controller and action. So if you call `translate(".foo")` from + # `PeopleController#index`, it will convert the call to + # `I18n.translate("people.index.foo")`. This makes it less repetitive to + # translate many keys within the same controller / action and gives you a simple + # framework for scoping them consistently. + # + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:17 + def translate(key, **options); end +end + +# # URL For +# +# Includes `url_for` into the host class (e.g. an abstract controller or +# mailer). The class has to provide a `RouteSet` by implementing the `_routes` +# methods. Otherwise, an exception will be raised. +# +# Note that this module is completely decoupled from HTTP - the only requirement +# is a valid `_routes` implementation. +# +# pkg:gem/actionpack#lib/abstract_controller/url_for.rb:14 +module AbstractController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # pkg:gem/actionpack#lib/abstract_controller/url_for.rb:18 + def _routes; end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/url_for.rb:23 +module AbstractController::UrlFor::ClassMethods + # pkg:gem/actionpack#lib/abstract_controller/url_for.rb:24 + def _routes; end + + # pkg:gem/actionpack#lib/abstract_controller/url_for.rb:28 + def action_methods; end +end + +# # Action Controller +# +# Action Controller is a module of Action Pack. +# +# Action Controller provides a base controller class that can be subclassed to +# implement filters and actions to handle requests. The result of an action is +# typically content generated from views. +# :markup: markdown +# +# pkg:gem/actionpack#lib/action_controller/deprecator.rb:5 +module ActionController + extend ::ActiveSupport::Autoload + + class << self + # See Renderers.add + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:7 + def add_renderer(key, &block); end + + # pkg:gem/actionpack#lib/action_controller/deprecator.rb:6 + def deprecator; end + + # See Renderers.remove + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:12 + def remove_renderer(key); end + end +end + +# # Action Controller API +# +# API Controller is a lightweight version of ActionController::Base, created for +# applications that don't require all functionalities that a complete Rails +# controller provides, allowing you to create controllers with just the features +# that you need for API only applications. +# +# An API Controller is different from a normal controller in the sense that by +# default it doesn't include a number of features that are usually required by +# browser access only: layouts and templates rendering, flash, assets, and so +# on. This makes the entire controller stack thinner, suitable for API +# applications. It doesn't mean you won't have such features if you need them: +# they're all available for you to include in your application, they're just not +# part of the default API controller stack. +# +# Normally, `ApplicationController` is the only controller that inherits from +# `ActionController::API`. All other controllers in turn inherit from +# `ApplicationController`. +# +# A sample controller could look like this: +# +# class PostsController < ApplicationController +# def index +# posts = Post.all +# render json: posts +# end +# end +# +# Request, response, and parameters objects all work the exact same way as +# ActionController::Base. +# +# ## Renders +# +# The default API Controller stack includes all renderers, which means you can +# use `render :json` and siblings freely in your controllers. Keep in mind that +# templates are not going to be rendered, so you need to ensure your controller +# is calling either `render` or `redirect_to` in all actions, otherwise it will +# return `204 No Content`. +# +# def show +# post = Post.find(params[:id]) +# render json: post +# end +# +# ## Redirects +# +# Redirects are used to move from one action to another. You can use the +# `redirect_to` method in your controllers in the same way as in +# ActionController::Base. For example: +# +# def create +# redirect_to root_url and return if not_authorized? +# # do stuff here +# end +# +# ## Adding New Behavior +# +# In some scenarios you may want to add back some functionality provided by +# ActionController::Base that is not present by default in +# `ActionController::API`, for instance `MimeResponds`. This module gives you +# the `respond_to` method. Adding it is quite simple, you just need to include +# the module in a specific controller or in `ApplicationController` in case you +# want it available in your entire application: +# +# class ApplicationController < ActionController::API +# include ActionController::MimeResponds +# end +# +# class PostsController < ApplicationController +# def index +# posts = Post.all +# +# respond_to do |format| +# format.json { render json: posts } +# format.xml { render xml: posts } +# end +# end +# end +# +# Make sure to check the modules included in ActionController::Base if you want +# to use any other functionality that is not provided by `ActionController::API` +# out of the box. +# +# pkg:gem/actionpack#lib/action_controller/api.rb:93 +class ActionController::API < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::ActionController::Redirecting + include ::ActionController::ApiRendering + include ::ActionController::Rendering + include ::ActionController::Renderers + include ::ActionController::Renderers::All + include ::ActionController::Head + include ::ActionController::ConditionalGet + include ::ActionController::BasicImplicitRender + include ::ActionController::StrongParameters + include ::ActionController::RateLimiting + include ::ActionController::Caching + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionController::DataStreaming + include ::ActionController::DefaultHeaders + include ::ActionController::Logging + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + include ::ActiveSupport::Rescuable + include ::ActionController::Rescue + include ::ActionController::Instrumentation + include ::ActionController::ParamsWrapper + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Redirecting::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::ActionController::RateLimiting::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Rescue::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _renderers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _run_process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _run_process_action_callbacks!(&block); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _view_cache_dependencies=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _view_cache_dependencies?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _wrapper_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_open_redirect; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_open_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_path_relative_redirect; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_path_relative_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_static_extension(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_static_extension=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def enable_fragment_cache_logging(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def enable_fragment_cache_logging=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def etaggers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def fragment_cache_keys=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def fragment_cache_keys?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def logger(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def logger=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def perform_caching(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def perform_caching=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def rescue_handlers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def rescue_handlers?; end + + class << self + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _allowed_redirect_hosts; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _allowed_redirect_hosts=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _process_action_callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _renderers=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _view_cache_dependencies=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _view_cache_dependencies?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _wrapper_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_open_redirect; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_open_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_path_relative_redirect; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def action_on_path_relative_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def allowed_redirect_hosts; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def allowed_redirect_hosts_permissions; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def allowed_redirect_hosts_permissions=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_static_extension(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_static_extension=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def enable_fragment_cache_logging(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def enable_fragment_cache_logging=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def escape_json_responses; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def escape_json_responses=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def escape_json_responses?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def etaggers=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def fragment_cache_keys=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def fragment_cache_keys?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def logger(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def logger=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def perform_caching(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def perform_caching=(arg); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def rescue_handlers=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def rescue_handlers?; end + + # Shortcut helper that returns all the ActionController::API modules except the + # ones passed as arguments: + # + # class MyAPIBaseController < ActionController::Metal + # ActionController::API.without_modules(:UrlFor).each do |left| + # include left + # end + # end + # + # This gives better control over what you want to exclude and makes it easier to + # create an API controller class, instead of listing the modules required + # manually. + # + # pkg:gem/actionpack#lib/action_controller/api.rb:108 + def without_modules(*modules); end + + private + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr___callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__allowed_redirect_hosts; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__allowed_redirect_hosts=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__renderers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__renderers=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__view_cache_dependencies=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr__wrapper_options=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_allowed_redirect_hosts_permissions; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_allowed_redirect_hosts_permissions=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:93 + def __class_attr_config; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:93 + def __class_attr_config=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_default_url_options=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_escape_json_responses; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_escape_json_responses=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_etaggers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_etaggers=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_fragment_cache_keys=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:93 + def __class_attr_middleware_stack; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:93 + def __class_attr_middleware_stack=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_controller/api.rb:116 +ActionController::API::MODULES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:6 +class ActionController::ActionControllerError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:6 +module ActionController::AllowBrowser + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::AllowBrowser::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:63 + def allow_browser(versions:, block:); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:73 +class ActionController::AllowBrowser::BrowserBlocker + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:80 + def initialize(request, versions:); end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:84 + def blocked?; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:78 + def request; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:78 + def versions; end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:105 + def bot?; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:121 + def expanded_versions; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:117 + def minimum_browser_version_for_browser; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:125 + def normalized_browser_name; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:89 + def parsed_user_agent; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:97 + def unsupported_browser?; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:93 + def user_agent_version_reported?; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:109 + def version_below_minimum_required?; end + + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:101 + def version_guarded_browser?; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:74 +ActionController::AllowBrowser::BrowserBlocker::SETS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:9 +module ActionController::AllowBrowser::ClassMethods + # Specify the browser versions that will be allowed to access all actions (or + # some, as limited by `only:` or `except:`). Only browsers matched in the hash + # or named set passed to `versions:` will be blocked if they're below the + # versions specified. This means that all other browsers, as well as agents that + # aren't reporting a user-agent header, will be allowed access. + # + # A browser that's blocked will by default be served the file in + # public/406-unsupported-browser.html with an HTTP status code of "406 Not + # Acceptable". + # + # In addition to specifically named browser versions, you can also pass + # `:modern` as the set to restrict support to browsers natively supporting webp + # images, web push, badges, import maps, CSS nesting, and CSS :has. This + # includes Safari 17.2+, Chrome 120+, Firefox 121+, Opera 106+. + # + # You can use https://caniuse.com to check for browser versions supporting the + # features you use. + # + # You can use `ActiveSupport::Notifications` to subscribe to events of browsers + # being blocked using the `browser_block.action_controller` event name. + # + # Examples: + # + # class ApplicationController < ActionController::Base + # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has + # allow_browser versions: :modern + # end + # + # class ApplicationController < ActionController::Base + # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has + # allow_browser versions: :modern, block: :handle_outdated_browser + # + # private + # def handle_outdated_browser + # render file: Rails.root.join("public/custom-error.html"), status: :not_acceptable + # end + # end + # + # class ApplicationController < ActionController::Base + # # All versions of Chrome and Opera will be allowed, but no versions of "internet explorer" (ie). Safari needs to be 16.4+ and Firefox 121+. + # allow_browser versions: { safari: 16.4, firefox: 121, ie: false } + # end + # + # class MessagesController < ApplicationController + # # In addition to the browsers blocked by ApplicationController, also block Opera below 104 and Chrome below 119 for the show action. + # allow_browser versions: { opera: 104, chrome: 119 }, only: :show + # end + # + # pkg:gem/actionpack#lib/action_controller/metal/allow_browser.rb:57 + def allow_browser(versions:, block: T.unsafe(nil), **options); end +end + +# pkg:gem/actionpack#lib/action_controller/api/api_rendering.rb:6 +module ActionController::ApiRendering + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/api/api_rendering.rb:13 + def render_to_body(options = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:9 +class ActionController::BadRequest < ::ActionController::ActionControllerError + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:10 + def initialize(msg = T.unsafe(nil)); end +end + +# # Action Controller Base +# +# Action Controllers are the core of a web request in Rails. They are made up of +# one or more actions that are executed on request and then either it renders a +# template or redirects to another action. An action is defined as a public +# method on the controller, which will automatically be made accessible to the +# web-server through Rails Routes. +# +# By default, only the ApplicationController in a Rails application inherits +# from `ActionController::Base`. All other controllers inherit from +# ApplicationController. This gives you one class to configure things such as +# request forgery protection and filtering of sensitive request parameters. +# +# A sample controller could look like this: +# +# class PostsController < ApplicationController +# def index +# @posts = Post.all +# end +# +# def create +# @post = Post.create params[:post] +# redirect_to posts_path +# end +# end +# +# Actions, by default, render a template in the `app/views` directory +# corresponding to the name of the controller and action after executing code in +# the action. For example, the `index` action of the PostsController would +# render the template `app/views/posts/index.html.erb` by default after +# populating the `@posts` instance variable. +# +# Unlike index, the create action will not render a template. After performing +# its main purpose (creating a new post), it initiates a redirect instead. This +# redirect works by returning an external `302 Moved` HTTP response that takes +# the user to the index action. +# +# These two methods represent the two basic action archetypes used in Action +# Controllers: Get-and-show and do-and-redirect. Most actions are variations on +# these themes. +# +# ## Requests +# +# For every request, the router determines the value of the `controller` and +# `action` keys. These determine which controller and action are called. The +# remaining request parameters, the session (if one is available), and the full +# request with all the HTTP headers are made available to the action through +# accessor methods. Then the action is performed. +# +# The full request object is available via the request accessor and is primarily +# used to query for HTTP headers: +# +# def server_ip +# location = request.env["REMOTE_ADDR"] +# render plain: "This server hosted at #{location}" +# end +# +# ## Parameters +# +# All request parameters, whether they come from a query string in the URL or +# form data submitted through a POST request are available through the `params` +# method which returns a hash. For example, an action that was performed through +# `/posts?category=All&limit=5` will include `{ "category" => "All", "limit" => +# "5" }` in `params`. +# +# It's also possible to construct multi-dimensional parameter hashes by +# specifying keys using brackets, such as: +# +# +# +# +# A request coming from a form holding these inputs will include `{ "post" => { +# "name" => "david", "address" => "hyacintvej" } }`. If the address input had +# been named `post[address][street]`, the `params` would have included `{ "post" +# => { "address" => { "street" => "hyacintvej" } } }`. There's no limit to the +# depth of the nesting. +# +# ## Sessions +# +# Sessions allow you to store objects in between requests. This is useful for +# objects that are not yet ready to be persisted, such as a Signup object +# constructed in a multi-paged process, or objects that don't change much and +# are needed all the time, such as a User object for a system that requires +# login. The session should not be used, however, as a cache for objects where +# it's likely they could be changed unknowingly. It's usually too much work to +# keep it all synchronized -- something databases already excel at. +# +# You can place objects in the session by using the `session` method, which +# accesses a hash: +# +# session[:person] = Person.authenticate(user_name, password) +# +# You can retrieve it again through the same hash: +# +# "Hello #{session[:person]}" +# +# For removing objects from the session, you can either assign a single key to +# `nil`: +# +# # removes :person from session +# session[:person] = nil +# +# or you can remove the entire session with `reset_session`. +# +# By default, sessions are stored in an encrypted browser cookie (see +# ActionDispatch::Session::CookieStore). Thus the user will not be able to read +# or edit the session data. However, the user can keep a copy of the cookie even +# after it has expired, so you should avoid storing sensitive information in +# cookie-based sessions. +# +# ## Responses +# +# Each action results in a response, which holds the headers and document to be +# sent to the user's browser. The actual response object is generated +# automatically through the use of renders and redirects and requires no user +# intervention. +# +# ## Renders +# +# Action Controller sends content to the user by using one of five rendering +# methods. The most versatile and common is the rendering of a template. +# Also included with \Rails is Action View, which enables rendering of ERB +# templates. It's automatically configured. The controller passes objects to the +# view by assigning instance variables: +# +# def show +# @post = Post.find(params[:id]) +# end +# +# Which are then automatically available to the view: +# +# Title: <%= @post.title %> +# +# You don't have to rely on the automated rendering. For example, actions that +# could result in the rendering of different templates will use the manual +# rendering methods: +# +# def search +# @results = Search.find(params[:query]) +# case @results.count +# when 0 then render action: "no_results" +# when 1 then render action: "show" +# when 2..10 then render action: "show_many" +# end +# end +# +# Read more about writing ERB and Builder templates in ActionView::Base. +# +# ## Redirects +# +# Redirects are used to move from one action to another. For example, after a +# `create` action, which stores a blog entry to the database, we might like to +# show the user the new entry. Because we're following good DRY principles +# (Don't Repeat Yourself), we're going to reuse (and redirect to) a `show` +# action that we'll assume has already been created. The code might look like +# this: +# +# def create +# @entry = Entry.new(params[:entry]) +# if @entry.save +# # The entry was saved correctly, redirect to show +# redirect_to action: 'show', id: @entry.id +# else +# # things didn't go so well, do something else +# end +# end +# +# In this case, after saving our new entry to the database, the user is +# redirected to the `show` method, which is then executed. Note that this is an +# external HTTP-level redirection which will cause the browser to make a second +# request (a GET to the show action), and not some internal re-routing which +# calls both "create" and then "show" within one request. +# +# Learn more about `redirect_to` and what options you have in +# ActionController::Redirecting. +# +# ## Calling multiple redirects or renders +# +# An action may perform only a single render or a single redirect. Attempting to +# do either again will result in a DoubleRenderError: +# +# def do_something +# redirect_to action: "elsewhere" +# render action: "overthere" # raises DoubleRenderError +# end +# +# If you need to redirect on the condition of something, then be sure to add +# "return" to halt execution. +# +# def do_something +# if monkeys.nil? +# redirect_to(action: "elsewhere") +# return +# end +# render action: "overthere" # won't be called if monkeys is nil +# end +# +# pkg:gem/actionpack#lib/action_controller/base.rb:208 +class ActionController::Base < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::AbstractController::Translation + include ::AbstractController::AssetPaths + include ::AbstractController::Helpers + include ::ActionController::Helpers + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::ActionController::Redirecting + include ::ActionView::Rendering + include ::ActionView::Layouts + include ::ActionController::Rendering + include ::ActionController::Renderers + include ::ActionController::Renderers::All + include ::ActionController::Head + include ::ActionController::ConditionalGet + include ::ActionController::EtagWithTemplateDigest + include ::ActionController::EtagWithFlash + include ::ActionController::Caching + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionController::MimeResponds + include ::ActionController::BasicImplicitRender + include ::ActionController::ImplicitRender + include ::ActionController::StrongParameters + include ::ActionController::ParameterEncoding + include ::ActionController::Cookies + include ::ActionController::Flash + include ::ActionController::FormBuilder + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + include ::ActionController::RequestForgeryProtection + include ::ActionController::ContentSecurityPolicy + include ::ActionController::PermissionsPolicy + include ::ActionController::RateLimiting + include ::ActionController::AllowBrowser + include ::ActionController::Streaming + include ::ActionController::DataStreaming + include ::ActionController::HttpAuthentication::Basic::ControllerMethods + include ::ActionController::HttpAuthentication::Digest::ControllerMethods + include ::ActionController::HttpAuthentication::Token::ControllerMethods + include ::ActionController::DefaultHeaders + include ::ActionController::Logging + include ::ActiveSupport::Rescuable + include ::ActionController::Rescue + include ::ActionController::Instrumentation + include ::ActionController::ParamsWrapper + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionController::Helpers::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Redirecting::ClassMethods + extend ::ActionView::Rendering::ClassMethods + extend ::ActionView::Layouts::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionController::ParameterEncoding::ClassMethods + extend ::ActionController::Flash::ClassMethods + extend ::ActionController::FormBuilder::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActionController::RequestForgeryProtection::ClassMethods + extend ::ActionController::ContentSecurityPolicy::ClassMethods + extend ::ActionController::PermissionsPolicy::ClassMethods + extend ::ActionController::RateLimiting::ClassMethods + extend ::ActionController::AllowBrowser::ClassMethods + extend ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Rescue::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helper_methods; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helper_methods=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helper_methods?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout_conditions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout_conditions?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def _renderers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def _run_process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def _run_process_action_callbacks!(&block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def _view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def _view_cache_dependencies=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def _view_cache_dependencies?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def _wrapper_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_open_redirect; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_open_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_path_relative_redirect; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_path_relative_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def allow_forgery_protection(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def allow_forgery_protection=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def asset_host(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def asset_host=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def assets_dir(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def assets_dir=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def csrf_token_storage_strategy(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def csrf_token_storage_strategy=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def default_asset_host_protocol(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def default_asset_host_protocol=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def default_static_extension(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def default_static_extension=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def enable_fragment_cache_logging(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def enable_fragment_cache_logging=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def etag_with_template_digest; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def etag_with_template_digest=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def etag_with_template_digest?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def etaggers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def flash(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_origin_check(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_origin_check=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_strategy(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_strategy=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def fragment_cache_keys=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def fragment_cache_keys?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def helpers_path; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def helpers_path=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def helpers_path?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def include_all_helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def include_all_helpers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def include_all_helpers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def javascripts_dir(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def javascripts_dir=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def log_warning_on_csrf_failure(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def log_warning_on_csrf_failure=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def logger(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def logger=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def per_form_csrf_tokens(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def per_form_csrf_tokens=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def perform_caching(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def perform_caching=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def relative_url_root(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def relative_url_root=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def request_forgery_protection_token(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def request_forgery_protection_token=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def rescue_handlers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def rescue_handlers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def stylesheets_dir(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def stylesheets_dir=(arg); end + + private + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout(lookup_context, formats, keys); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:325 + def _protected_ivars; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def alert; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def notice; end + + class << self + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def __callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def _allowed_redirect_hosts; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def _allowed_redirect_hosts=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:291 + def _default_form_builder; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:291 + def _default_form_builder=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:291 + def _default_form_builder?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def _flash_types; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def _flash_types=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def _flash_types?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helper_methods; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helper_methods=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helper_methods?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def _helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout_conditions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout_conditions=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def _layout_conditions?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def _process_action_callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def _renderers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def _view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def _view_cache_dependencies=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def _view_cache_dependencies?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def _wrapper_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_open_redirect; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_open_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_path_relative_redirect; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def action_on_path_relative_redirect=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def allow_forgery_protection(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def allow_forgery_protection=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def allowed_redirect_hosts; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def allowed_redirect_hosts_permissions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def allowed_redirect_hosts_permissions=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def asset_host(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def asset_host=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def assets_dir(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def assets_dir=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def csrf_token_storage_strategy(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def csrf_token_storage_strategy=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def default_asset_host_protocol(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def default_asset_host_protocol=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def default_static_extension(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def default_static_extension=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def enable_fragment_cache_logging(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def enable_fragment_cache_logging=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def escape_json_responses; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def escape_json_responses=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def escape_json_responses?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def etag_with_template_digest; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def etag_with_template_digest=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def etag_with_template_digest?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def etaggers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_origin_check(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_origin_check=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_strategy(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def forgery_protection_strategy=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def fragment_cache_keys=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def fragment_cache_keys?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def helpers_path; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def helpers_path=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def helpers_path?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def include_all_helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def include_all_helpers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def include_all_helpers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def javascripts_dir(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def javascripts_dir=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def log_warning_on_csrf_failure(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def log_warning_on_csrf_failure=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def logger(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def logger=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def per_form_csrf_tokens(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def per_form_csrf_tokens=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def perform_caching(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def perform_caching=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def relative_url_root(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def relative_url_root=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def request_forgery_protection_token(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def request_forgery_protection_token=(arg); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def rescue_handlers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def rescue_handlers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def stylesheets_dir(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:274 + def stylesheets_dir=(arg); end + + # Shortcut helper that returns all the modules included in + # ActionController::Base except the ones passed as arguments: + # + # class MyBaseController < ActionController::Metal + # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| + # include left + # end + # end + # + # This gives better control over what you want to exclude and makes it easier to + # create a bare controller class, instead of listing the modules required + # manually. + # + # pkg:gem/actionpack#lib/action_controller/base.rb:223 + def without_modules(*modules); end + + private + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def __class_attr___callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def __class_attr__allowed_redirect_hosts; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def __class_attr__allowed_redirect_hosts=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:291 + def __class_attr__default_form_builder; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:291 + def __class_attr__default_form_builder=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def __class_attr__flash_types; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def __class_attr__flash_types=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def __class_attr__helper_methods; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def __class_attr__helper_methods=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def __class_attr__layout; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def __class_attr__layout=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def __class_attr__layout_conditions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:278 + def __class_attr__layout_conditions=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def __class_attr__renderers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def __class_attr__renderers=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def __class_attr__view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def __class_attr__view_cache_dependencies=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def __class_attr__wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:314 + def __class_attr__wrapper_options=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def __class_attr_allowed_redirect_hosts_permissions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:277 + def __class_attr_allowed_redirect_hosts_permissions=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:208 + def __class_attr_config; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:208 + def __class_attr_config=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def __class_attr_default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:276 + def __class_attr_default_url_options=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def __class_attr_escape_json_responses; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:280 + def __class_attr_escape_json_responses=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def __class_attr_etag_with_template_digest; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:282 + def __class_attr_etag_with_template_digest=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def __class_attr_etaggers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:281 + def __class_attr_etaggers=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def __class_attr_fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def __class_attr_fragment_cache_keys=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def __class_attr_helpers_path; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def __class_attr_helpers_path=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def __class_attr_include_all_helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:275 + def __class_attr_include_all_helpers=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:208 + def __class_attr_middleware_stack; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:208 + def __class_attr_middleware_stack=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def __class_attr_rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:308 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_controller/base.rb:275 +module ActionController::Base::HelperMethods + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def alert(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def combined_fragment_cache_key(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:293 + def content_security_policy?(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:293 + def content_security_policy_nonce(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:289 + def cookies(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def form_authenticity_token(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:290 + def notice(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:292 + def protect_against_forgery?(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:284 + def view_cache_dependencies(*, **, &); end +end + +# pkg:gem/actionpack#lib/action_controller/base.rb:231 +ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) + +# Define some internal variables that should not be propagated to the view. +# +# pkg:gem/actionpack#lib/action_controller/base.rb:319 +ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/basic_implicit_render.rb:6 +module ActionController::BasicImplicitRender + # pkg:gem/actionpack#lib/action_controller/metal/basic_implicit_render.rb:13 + def default_render; end + + # pkg:gem/actionpack#lib/action_controller/metal/basic_implicit_render.rb:7 + def send_action(method, *args); end +end + +# # Action Controller Caching +# +# Caching is a cheap way of speeding up slow applications by keeping the result +# of calculations, renderings, and database calls around for subsequent +# requests. +# +# Note: To turn off all caching provided by Action Controller, set +# +# config.action_controller.perform_caching = false +# +# ## Caching stores +# +# All the caching stores from ActiveSupport::Cache are available to be used as +# backends for Action Controller caching. +# +# Configuration examples (FileStore is the default): +# +# config.action_controller.cache_store = :memory_store +# config.action_controller.cache_store = :file_store, '/path/to/cache/directory' +# config.action_controller.cache_store = :mem_cache_store, 'localhost' +# config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211') +# config.action_controller.cache_store = MyOwnStore.new('parameter') +# +# pkg:gem/actionpack#lib/action_controller/caching.rb:28 +module ActionController::Caching + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + mixes_in_class_methods ::AbstractController::Caching::ClassMethods + mixes_in_class_methods ::AbstractController::Caching::ConfigMethods + + private + + # pkg:gem/actionpack#lib/action_controller/caching.rb:44 + def instrument_name; end + + # pkg:gem/actionpack#lib/action_controller/caching.rb:36 + def instrument_payload(key); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:9 +module ActionController::ConditionalGet + include ::ActionController::Head + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + # Sets the `Cache-Control` header, overwriting existing directives. This method + # will also ensure an HTTP `Date` header for client compatibility. + # + # Defaults to issuing the `private` directive, so that intermediate caches must + # not cache the response. + # + # #### Options + # + # `:public` + # directive. + # + # `:must_revalidate` + # + # `:stale_while_revalidate` + # + # `:stale_if_error` + # + # `:immutable` + # + # + # Any additional key-value pairs are concatenated as directives. For a list of + # supported `Cache-Control` directives, see the [article on + # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). + # + # #### Examples + # + # expires_in 10.minutes + # # => Cache-Control: max-age=600, private + # + # expires_in 10.minutes, public: true + # # => Cache-Control: max-age=600, public + # + # expires_in 10.minutes, public: true, must_revalidate: true + # # => Cache-Control: max-age=600, public, must-revalidate + # + # expires_in 1.hour, stale_while_revalidate: 60.seconds + # # => Cache-Control: max-age=3600, private, stale-while-revalidate=60 + # + # expires_in 1.hour, stale_if_error: 5.minutes + # # => Cache-Control: max-age=3600, private, stale-if-error=300 + # + # expires_in 1.hour, public: true, "s-maxage": 3.hours, "no-transform": true + # # => Cache-Control: max-age=3600, public, s-maxage=10800, no-transform=true + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:290 + def expires_in(seconds, options = T.unsafe(nil)); end + + # Sets an HTTP 1.1 `Cache-Control` header of `no-cache`. This means the resource + # will be marked as stale, so clients must always revalidate. + # Intermediate/browser caches may still store the asset. + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:309 + def expires_now; end + + # Sets the `etag`, `last_modified`, or both on the response, and renders a `304 + # Not Modified` response if the request is already fresh. + # + # #### Options + # + # `:etag` + # + # `:weak_etag` + # `If-None-Match` header may receive a `304 Not Modified` response if the + # ETag matches exactly. + # + # they're good for caching HTML pages in browser caches. They can't be used + # for responses that must be byte-identical, like serving `Range` requests + # within a PDF file. + # + # `:strong_etag` + # `If-None-Match` header may receive a `304 Not Modified` response if the + # ETag matches exactly. + # + # byte. This is necessary for serving `Range` requests within a large video + # or PDF file, for example, or for compatibility with some CDNs that don't + # support weak ETags. + # + # `:last_modified` + # that specify an `If-Modified-Since` header may receive a `304 Not + # Modified` response if `last_modified` <= `If-Modified-Since`. + # + # `:public` + # `true` if you want your application to be cacheable by other devices, such + # as proxy caches. + # + # `:cache_control` + # of `Cache-Control` directives, see the [article on + # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). + # + # `:template` + # included in ETags. If the action renders a different template, you can + # include its digest instead. If the action doesn't render a template at + # all, you can pass `template: false` to skip any attempt to check for a + # template digest. + # + # + # #### Examples + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(etag: @article, last_modified: @article.updated_at, public: true) + # end + # + # This will send a `304 Not Modified` response if the request specifies a + # matching ETag and `If-Modified-Since` header. Otherwise, it will render the + # `show` template. + # + # You can also just pass a record: + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(@article) + # end + # + # `etag` will be set to the record, and `last_modified` will be set to the + # record's `updated_at`. + # + # You can also pass an object that responds to `maximum`, such as a collection + # of records: + # + # def index + # @articles = Article.all + # fresh_when(@articles) + # end + # + # In this case, `etag` will be set to the collection, and `last_modified` will + # be set to `maximum(:updated_at)` (the timestamp of the most recently updated + # record). + # + # When passing a record or a collection, you can still specify other options, + # such as `:public` and `:cache_control`: + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(@article, public: true, cache_control: { no_cache: true }) + # end + # + # The above will set `Cache-Control: public, no-cache` in the response. + # + # When rendering a different template than the controller/action's default + # template, you can indicate which digest to include in the ETag: + # + # before_action { fresh_when @article, template: "widgets/show" } + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:137 + def fresh_when(object = T.unsafe(nil), etag: T.unsafe(nil), weak_etag: T.unsafe(nil), strong_etag: T.unsafe(nil), last_modified: T.unsafe(nil), public: T.unsafe(nil), cache_control: T.unsafe(nil), template: T.unsafe(nil)); end + + # Cache or yield the block. The cache is supposed to never expire. + # + # You can use this method when you have an HTTP response that never changes, and + # the browser and proxies should cache it indefinitely. + # + # * `public`: By default, HTTP responses are private, cached only on the + # user's web browser. To allow proxies to cache the response, set `true` to + # indicate that they can serve the cached response to all users. + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:321 + def http_cache_forever(public: T.unsafe(nil)); end + + # Adds the `must-understand` directive to the `Cache-Control` header, which indicates + # that a cache MUST understand the semantics of the response status code that has been + # received, or discard the response. + # + # This is particularly useful when returning responses with new or uncommon + # status codes that might not be properly interpreted by older caches. + # + # #### Example + # + # def show + # @article = Article.find(params[:id]) + # + # if @article.early_access? + # must_understand + # render status: 203 # Non-Authoritative Information + # else + # fresh_when @article + # end + # end + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:355 + def must_understand; end + + # Sets an HTTP 1.1 `Cache-Control` header of `no-store`. This means the resource + # may not be stored in any cache. + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:331 + def no_store; end + + # Sets the `etag` and/or `last_modified` on the response and checks them against + # the request. If the request doesn't match the provided options, it is + # considered stale, and the response should be rendered from scratch. Otherwise, + # it is fresh, and a `304 Not Modified` is sent. + # + # #### Options + # + # See #fresh_when for supported options. + # + # #### Examples + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(etag: @article, last_modified: @article.updated_at) + # @statistics = @article.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # You can also just pass a record: + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(@article) + # @statistics = @article.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # `etag` will be set to the record, and `last_modified` will be set to the + # record's `updated_at`. + # + # You can also pass an object that responds to `maximum`, such as a collection + # of records: + # + # def index + # @articles = Article.all + # + # if stale?(@articles) + # @statistics = @articles.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # In this case, `etag` will be set to the collection, and `last_modified` will + # be set to `maximum(:updated_at)` (the timestamp of the most recently updated + # record). + # + # When passing a record or a collection, you can still specify other options, + # such as `:public` and `:cache_control`: + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(@article, public: true, cache_control: { no_cache: true }) + # @statistics = @articles.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # The above will set `Cache-Control: public, no-cache` in the response. + # + # When rendering a different template than the controller/action's default + # template, you can indicate which digest to include in the ETag: + # + # def show + # super if stale?(@article, template: "widgets/show") + # end + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:236 + def stale?(object = T.unsafe(nil), **freshness_kwargs); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:361 + def combine_etags(validator, options); end + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:18 +module ActionController::ConditionalGet::ClassMethods + # Allows you to consider additional controller-wide information when generating + # an ETag. For example, if you serve pages tailored depending on who's logged in + # at the moment, you may want to add the current user id to be part of the ETag + # to prevent unauthorized displaying of cached pages. + # + # class InvoicesController < ApplicationController + # etag { current_user&.id } + # + # def show + # # Etag will differ even for the same invoice when it's viewed by a different current_user + # @invoice = Invoice.find(params[:id]) + # fresh_when etag: @invoice + # end + # end + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:33 + def etag(&etagger); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:6 +module ActionController::ContentSecurityPolicy + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Helpers + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + mixes_in_class_methods ::ActionController::ContentSecurityPolicy::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:74 + def content_security_policy?; end + + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:78 + def content_security_policy_nonce; end + + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:82 + def current_content_security_policy; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:17 +module ActionController::ContentSecurityPolicy::ClassMethods + # Overrides parts of the globally configured `Content-Security-Policy` header: + # + # class PostsController < ApplicationController + # content_security_policy do |policy| + # policy.base_uri "https://www.example.com" + # end + # end + # + # Options can be passed similar to `before_action`. For example, pass `only: + # :index` to override the header on the index action only: + # + # class PostsController < ApplicationController + # content_security_policy(only: :index) do |policy| + # policy.default_src :self, :https + # end + # end + # + # Pass `false` to remove the `Content-Security-Policy` header: + # + # class PostsController < ApplicationController + # content_security_policy false, only: :index + # end + # + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:40 + def content_security_policy(enabled = T.unsafe(nil), **options, &block); end + + # Overrides the globally configured `Content-Security-Policy-Report-Only` + # header: + # + # class PostsController < ApplicationController + # content_security_policy_report_only only: :index + # end + # + # Pass `false` to remove the `Content-Security-Policy-Report-Only` header: + # + # class PostsController < ApplicationController + # content_security_policy_report_only false, only: :index + # end + # + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:66 + def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/cookies.rb:6 +module ActionController::Cookies + extend ::ActiveSupport::Concern + + private + + # The cookies for the current request. See ActionDispatch::Cookies for more + # information. + # + # pkg:gem/actionpack#lib/action_controller/metal/cookies.rb:16 + def cookies; end +end + +# # Action Controller Data Streaming +# +# Methods for sending arbitrary data and for streaming files to the browser, +# instead of rendering. +# +# pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:13 +module ActionController::DataStreaming + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + private + + # Sends the given binary data to the browser. This method is similar to `render + # plain: data`, but also allows you to specify whether the browser should + # display the response as a file attachment (i.e. in a download dialog) or as + # inline data. You may also set the content type, the file name, and other + # things. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. + # * `:type` - specifies an HTTP content type. Defaults to + # `application/octet-stream`. You can specify either a string or a symbol + # for a registered type with `Mime::Type.register`, for example `:json`. If + # omitted, type will be inferred from the file extension specified in + # `:filename`. If no content type is registered for the extension, the + # default type `application/octet-stream` will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are `"inline"` and `"attachment"` (default). + # * `:status` - specifies the status code to send with the response. Defaults + # to 200. + # + # + # Generic data download: + # + # send_data buffer + # + # Download a dynamically-generated tarball: + # + # send_data generate_tgz('dir'), filename: 'dir.tgz' + # + # Display an image Active Record in the browser: + # + # send_data image.data, type: image.content_type, disposition: 'inline' + # + # See `send_file` for more information on HTTP `Content-*` headers and caching. + # + # pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:122 + def send_data(data, options = T.unsafe(nil)); end + + # Sends the file. This uses a server-appropriate method (such as `X-Sendfile`) + # via the `Rack::Sendfile` middleware. The header to use is set via + # `config.action_dispatch.x_sendfile_header`. Your server can also configure + # this for you by setting the `X-Sendfile-Type` header. + # + # Be careful to sanitize the path parameter if it is coming from a web page. + # `send_file(params[:path])` allows a malicious user to download any file on + # your server. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. Defaults to + # `File.basename(path)`. + # * `:type` - specifies an HTTP content type. You can specify either a string + # or a symbol for a registered type with `Mime::Type.register`, for example + # `:json`. If omitted, the type will be inferred from the file extension + # specified in `:filename`. If no content type is registered for the + # extension, the default type `application/octet-stream` will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are `"inline"` and `"attachment"` (default). + # * `:status` - specifies the status code to send with the response. Defaults + # to 200. + # * `:url_based_filename` - set to `true` if you want the browser to guess the + # filename from the URL, which is necessary for i18n filenames on certain + # browsers (setting `:filename` overrides this option). + # + # + # The default `Content-Type` and `Content-Disposition` headers are set to + # download arbitrary binary files in as many browsers as possible. IE versions + # 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when + # downloading over SSL). + # + # Simple download: + # + # send_file '/path/to.zip' + # + # Show a JPEG in the browser: + # + # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline' + # + # Show a 404 page in the browser: + # + # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404 + # + # You can use other `Content-*` HTTP headers to provide additional information + # to the client. See MDN for a [list of HTTP + # headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). + # + # Also be aware that the document may be cached by proxies and browsers. The + # `Pragma` and `Cache-Control` headers declare how the file may be cached by + # intermediaries. They default to require clients to validate with the server + # before releasing cached responses. See https://www.mnot.net/cache_docs/ for an + # overview of web caching and [RFC + # 9111](https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control) for the + # `Cache-Control` header spec. + # + # pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:77 + def send_file(path, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:127 + def send_file_headers!(options); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:19 +ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:18 +ActionController::DataStreaming::DEFAULT_SEND_FILE_TYPE = T.let(T.unsafe(nil), String) + +# # Action Controller Default Headers +# +# Allows configuring default headers that will be automatically merged into each +# response. +# +# pkg:gem/actionpack#lib/action_controller/metal/default_headers.rb:10 +module ActionController::DefaultHeaders + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods +end + +# pkg:gem/actionpack#lib/action_controller/metal/default_headers.rb:13 +module ActionController::DefaultHeaders::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/default_headers.rb:14 + def make_response!(request); end +end + +# # Action Controller Etag With Flash +# +# When you're using the flash, it's generally used as a conditional on the view. +# This means the content of the view depends on the flash. Which in turn means +# that the ETag for a response should be computed with the content of the flash +# in mind. This does that by including the content of the flash as a component +# in the ETag that's generated for a response. +# +# pkg:gem/actionpack#lib/action_controller/metal/etag_with_flash.rb:13 +module ActionController::EtagWithFlash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# # Action Controller Etag With Template Digest +# +# When our views change, they should bubble up into HTTP cache freshness and +# bust browser caches. So the template digest for the current action is +# automatically included in the ETag. +# +# Enabled by default for apps that use Action View. Disable by setting +# +# config.action_controller.etag_with_template_digest = false +# +# Override the template to digest by passing `:template` to `fresh_when` and +# `stale?` calls. For example: +# +# # We're going to render widgets/show, not posts/show +# fresh_when @post, template: 'widgets/show' +# +# # We're not going to render a template, so omit it from the ETag. +# fresh_when @post, template: false +# +# pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:25 +module ActionController::EtagWithTemplateDigest + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:39 + def determine_template_etag(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:55 + def lookup_and_digest_template(template); end + + # Pick the template digest to include in the ETag. If the `:template` option is + # present, use the named template. If `:template` is `nil` or absent, use the + # default controller/action template. If `:template` is false, omit the template + # digest from the ETag. + # + # pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:49 + def pick_template_for_etag(options); end + + module GeneratedClassMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# Raised from `expect!` when an expected parameter is missing or is of an +# incompatible type. +# +# params = ActionController::Parameters.new(a: {}) +# params.expect!(:a) +# # => ActionController::ExpectedParameterMissing: param is missing or the value is empty or invalid: a +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:49 +class ActionController::ExpectedParameterMissing < ::ActionController::ParameterMissing; end + +# pkg:gem/actionpack#lib/action_controller/metal/flash.rb:6 +module ActionController::Flash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Flash::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/flash.rb:50 + def redirect_to(options = T.unsafe(nil), response_options_and_flash = T.unsafe(nil)); end + + module GeneratedClassMethods + def _flash_types; end + def _flash_types=(value); end + def _flash_types?; end + end + + module GeneratedInstanceMethods; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/flash.rb:16 +module ActionController::Flash::ClassMethods + # Creates new flash types. You can pass as many types as you want to create + # flash types other than the default `alert` and `notice` in your controllers + # and views. For instance: + # + # # in application_controller.rb + # class ApplicationController < ActionController::Base + # add_flash_types :warning + # end + # + # # in your controller + # redirect_to user_path(@user), warning: "Incomplete profile" + # + # # in your view + # <%= warning %> + # + # This method will automatically define a new method for each of the given + # names, and it will be available in your views. + # + # pkg:gem/actionpack#lib/action_controller/metal/flash.rb:34 + def add_flash_types(*types); end +end + +# # Action Controller Form Builder +# +# Override the default form builder for all views rendered by this controller +# and any of its descendants. Accepts a subclass of +# ActionView::Helpers::FormBuilder. +# +# For example, given a form builder: +# +# class AdminFormBuilder < ActionView::Helpers::FormBuilder +# def special_field(name) +# end +# end +# +# The controller specifies a form builder as its default: +# +# class AdminAreaController < ApplicationController +# default_form_builder AdminFormBuilder +# end +# +# Then in the view any form using `form_with` or `form_for` will be an +# instance of the specified form builder: +# +# <%= form_with(model: @instance) do |builder| %> +# <%= builder.special_field(:name) %> +# <% end %> +# +# pkg:gem/actionpack#lib/action_controller/form_builder.rb:31 +module ActionController::FormBuilder + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::FormBuilder::ClassMethods + + # Default form builder for the controller + # + # pkg:gem/actionpack#lib/action_controller/form_builder.rb:51 + def default_form_builder; end + + module GeneratedClassMethods + def _default_form_builder; end + def _default_form_builder=(value); end + def _default_form_builder?; end + end + + module GeneratedInstanceMethods; end +end + +# pkg:gem/actionpack#lib/action_controller/form_builder.rb:38 +module ActionController::FormBuilder::ClassMethods + # Set the form builder to be used as the default for all forms in the views + # rendered by this controller and its subclasses. + # + # #### Parameters + # * `builder` - Default form builder. Accepts a subclass of + # ActionView::Helpers::FormBuilder + # + # pkg:gem/actionpack#lib/action_controller/form_builder.rb:45 + def default_form_builder(builder); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/head.rb:6 +module ActionController::Head + # Returns a response that has no content (merely headers). The options argument + # is interpreted to be a hash of header names and values. This allows you to + # easily return a response that consists only of significant headers: + # + # head :created, location: person_path(@person) + # + # head :created, location: @person + # + # It can also be used to return exceptional conditions: + # + # return head(:method_not_allowed) unless request.post? + # return head(:bad_request) unless valid_request? + # render + # + # See `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list of valid `status` + # symbols. + # + # pkg:gem/actionpack#lib/action_controller/metal/head.rb:23 + def head(status, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/head.rb:58 + def include_content?(status); end +end + +# # Action Controller Helpers +# +# The Rails framework provides a large number of helpers for working with +# assets, dates, forms, numbers and model objects, to name a few. These helpers +# are available to all templates by default. +# +# In addition to using the standard template helpers provided, creating custom +# helpers to extract complicated logic or reusable functionality is strongly +# encouraged. By default, each controller will include all helpers. These +# helpers are only accessible on the controller through `#helpers` +# +# In previous versions of Rails the controller will include a helper which +# matches the name of the controller, e.g., `MyController` will automatically +# include `MyHelper`. You can revert to the old behavior with the following: +# +# # config/application.rb +# class Application < Rails::Application +# config.action_controller.include_all_helpers = false +# end +# +# Additional helpers can be specified using the `helper` class method in +# ActionController::Base or any controller which inherits from it. +# +# The `to_s` method from the Time class can be wrapped in a helper method to +# display a custom message if a Time object is blank: +# +# module FormattedTimeHelper +# def format_time(time, format=:long, blank_message=" ") +# time.blank? ? blank_message : time.to_fs(format) +# end +# end +# +# FormattedTimeHelper can now be included in a controller, using the `helper` +# class method: +# +# class EventsController < ActionController::Base +# helper FormattedTimeHelper +# def index +# @events = Event.all +# end +# end +# +# Then, in any view rendered by `EventsController`, the `format_time` method can +# be called: +# +# <% @events.each do |event| -%> +#

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

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

Hello, World

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

Hello, World

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

Hello, World

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

Hello, <%= @name %>!

" + # # => renders "

Hello, World!

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

Hello, World!

".html_safe + # # => renders "

Hello, World!

" + # + # render html: "

Hello, World!

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

Hello, World

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

Hello, <%= @name %>!

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

Hello, World!

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

Hello, <%= name %>!

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

Hello, World!

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

Hello, World!

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

Hello, World!

" with the default layout + # + # `:status` + # number or as the status name in Symbol form. Defaults to 200. + # + # render "posts/new", status: 422 + # # => renders app/views/posts/new.html.erb with HTTP status code 422 + # + # render "posts/new", status: :unprocessable_entity + # # => renders app/views/posts/new.html.erb with HTTP status code 422 + # + # `:variants` + # + # render "posts/index", variants: [:mobile] + # # => renders app/views/posts/index.html+mobile.erb + # + # -- + # Check for double render errors and set the content_type after rendering. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:171 + def render(*args); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:191 + def render_to_body(options = T.unsafe(nil)); end + + # Similar to #render, but only returns the rendered template as a string, + # instead of setting `self.response_body`. + # -- + # Override render_to_string because body can now be set to a Rack body. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:180 + def render_to_string(*); end + + private + + # Normalize both text and status options. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:233 + def _normalize_options(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:247 + def _normalize_text(options); end + + # Process controller specific options, as status, content-type and location. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:256 + def _process_options(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:202 + def _process_variant(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:208 + def _render_in_priorities(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:216 + def _set_html_content_type; end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:220 + def _set_rendered_content_type(format); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:226 + def _set_vary_header; end + + # Before processing, set the request formats in current controller formats. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:197 + def process_action(*); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:11 +module ActionController::Rendering::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:23 + def inherited(klass); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:13 + def render(*, **, &); end + + # Returns a renderer instance (inherited from ActionController::Renderer) for + # the controller. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:17 + def renderer; end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:19 + def setup_renderer!; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:9 +ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY = T.let(T.unsafe(nil), Array) + +# # Action Controller Request Forgery Protection +# +# Controller actions are protected from Cross-Site Request Forgery (CSRF) +# attacks by including a token in the rendered HTML for your application. This +# token is stored as a random string in the session, to which an attacker does +# not have access. When a request reaches your application, Rails verifies the +# received token with the token in the session. All requests are checked except +# GET requests as these should be idempotent. Keep in mind that all +# session-oriented requests are CSRF protected by default, including JavaScript +# and HTML requests. +# +# Since HTML and JavaScript requests are typically made from the browser, we +# need to ensure to verify request authenticity for the web browser. We can use +# session-oriented authentication for these types of requests, by using the +# `protect_from_forgery` method in our controllers. +# +# GET requests are not protected since they don't have side effects like writing +# to the database and don't leak sensitive information. JavaScript requests are +# an exception: a third-party site can use a +# +# The first two characters (`">`) are required in case the exception happens +# while rendering attributes for a given tag. You can check the real cause for +# the exception in your logger. +# +# ## Web server support +# +# Rack 3+ compatible servers all support streaming. +# +# pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:169 +module ActionController::Streaming + private + + # Call render_body if we are streaming instead of usual `render`. + # + # pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:172 + def _render_template(options); end +end + +# # Strong Parameters +# +# It provides an interface for protecting attributes from end-user assignment. +# This makes Action Controller parameters forbidden to be used in Active Model +# mass assignment until they have been explicitly enumerated. +# +# In addition, parameters can be marked as required and flow through a +# predefined raise/rescue flow to end up as a `400 Bad Request` with no effort. +# +# class PeopleController < ActionController::Base +# # Using "Person.create(params[:person])" would raise an +# # ActiveModel::ForbiddenAttributesError exception because it'd +# # be using mass assignment without an explicit permit step. +# # This is the recommended form: +# def create +# Person.create(person_params) +# end +# +# # This will pass with flying colors as long as there's a person key in the +# # parameters, otherwise it'll raise an ActionController::ParameterMissing +# # exception, which will get caught by ActionController::Base and turned +# # into a 400 Bad Request reply. +# def update +# redirect_to current_account.people.find(params[:id]).tap { |person| +# person.update!(person_params) +# } +# end +# +# private +# # Using a private method to encapsulate the permissible parameters is +# # a good pattern since you'll be able to reuse the same permit +# # list between create and update. Also, you can specialize this method +# # with per-user checking of permissible attributes. +# def person_params +# params.expect(person: [:name, :age]) +# end +# end +# +# In order to use `accepts_nested_attributes_for` with Strong Parameters, you +# will need to specify which nested attributes should be permitted. You might +# want to allow `:id` and `:_destroy`, see ActiveRecord::NestedAttributes for +# more information. +# +# class Person +# has_many :pets +# accepts_nested_attributes_for :pets +# end +# +# class PeopleController < ActionController::Base +# def create +# Person.create(person_params) +# end +# +# ... +# +# private +# +# def person_params +# # It's mandatory to specify the nested attributes that should be permitted. +# # If you use `permit` with just the key that points to the nested attributes hash, +# # it will return an empty hash. +# params.expect(person: [ :name, :age, pets_attributes: [ :id, :name, :category ] ]) +# end +# end +# +# See ActionController::Parameters.expect, +# See ActionController::Parameters.require, and +# ActionController::Parameters.permit for more information. +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1508 +module ActionController::StrongParameters + # Returns a new ActionController::Parameters object that has been instantiated + # with the `request.parameters`. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1511 + def params; end + + # Assigns the given `value` to the `params` hash. If `value` is a Hash, this + # will create an ActionController::Parameters object that has been instantiated + # with the given `value` hash. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1526 + def params=(value); end +end + +# pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:4 +class ActionController::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:91 + def exist_fragment?(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:95 + def expire_fragment(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:43 + def halted_callback(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:25 + def process_action(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:87 + def read_fragment(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:64 + def redirect_to(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:47 + def rescue_from_callback(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:68 + def send_data(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:60 + def send_file(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:7 + def start_processing(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:72 + def unpermitted_parameters(event); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:83 + def write_fragment(event); end + + private + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:110 + def additions_for(payload); end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:100 + def fragment_cache(method_name, event); end + + class << self + private + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:81 + def __class_attr_debug_methods; end + + # pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:81 + def __class_attr_debug_methods=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_controller/structured_event_subscriber.rb:5 +ActionController::StructuredEventSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/template_assertions.rb:6 +module ActionController::TemplateAssertions + # pkg:gem/actionpack#lib/action_controller/template_assertions.rb:7 + def assert_template(options = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# # Action Controller Test Case +# +# Superclass for ActionController functional tests. Functional tests allow you +# to test a single controller action per test method. +# +# ## Use integration style controller tests over functional style controller tests. +# +# Rails discourages the use of functional tests in favor of integration tests +# (use ActionDispatch::IntegrationTest). +# +# New Rails applications no longer generate functional style controller tests +# and they should only be used for backward compatibility. Integration style +# controller tests perform actual requests, whereas functional style controller +# tests merely simulate a request. Besides, integration tests are as fast as +# functional tests and provide lot of helpers such as `as`, `parsed_body` for +# effective testing of controller actions including even API endpoints. +# +# ## Basic example +# +# Functional tests are written as follows: +# 1. First, one uses the `get`, `post`, `patch`, `put`, `delete`, or `head` +# method to simulate an HTTP request. +# 2. Then, one asserts whether the current state is as expected. "State" can be +# anything: the controller's HTTP response, the database contents, etc. +# +# +# For example: +# +# class BooksControllerTest < ActionController::TestCase +# def test_create +# # Simulate a POST response with the given HTTP parameters. +# post(:create, params: { book: { title: "Love Hina" }}) +# +# # Asserts that the controller tried to redirect us to +# # the created book's URI. +# assert_response :found +# +# # Asserts that the controller really put the book in the database. +# assert_not_nil Book.find_by(title: "Love Hina") +# end +# end +# +# You can also send a real document in the simulated HTTP request. +# +# def test_create +# json = {book: { title: "Love Hina" }}.to_json +# post :create, body: json +# end +# +# ## Special instance variables +# +# ActionController::TestCase will also automatically provide the following +# instance variables for use in the tests: +# +# @controller +# +# @request +# You can modify this object before sending the HTTP request. For example, +# you might want to set some session properties before sending a GET +# request. +# +# @response +# last HTTP response. In the above example, `@response` becomes valid after +# calling `post`. If the various assert methods are not sufficient, then you +# may use this object to inspect the HTTP response in detail. +# +# +# ## Controller is automatically inferred +# +# ActionController::TestCase will automatically infer the controller under test +# from the test class name. If the controller cannot be inferred from the test +# class name, you can explicitly set it with `tests`. +# +# class SpecialEdgeCaseWidgetsControllerTest < ActionController::TestCase +# tests WidgetController +# end +# +# ## Testing controller internals +# +# In addition to these specific assertions, you also have easy access to various +# collections that the regular test/unit assertions can be used against. These +# collections are: +# +# * session: Objects being saved in the session. +# * flash: The flash objects currently in the session. +# * cookies: Cookies being sent to the user on this request. +# +# +# These collections can be used just like any other hash: +# +# assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" +# assert flash.empty? # makes sure that there's nothing in the flash +# +# On top of the collections, you have the complete URL that a given action +# redirected to available in `redirect_to_url`. +# +# For redirects within the same controller, you can even call follow_redirect +# and the redirect will be followed, triggering another action call which can +# then be asserted against. +# +# ## Manipulating session and cookie variables +# +# Sometimes you need to set up the session and cookie variables for a test. To +# do this just assign a value to the session or cookie collection: +# +# session[:key] = "value" +# cookies[:key] = "value" +# +# To clear the cookies for a test just clear the cookie collection: +# +# cookies.clear +# +# ## Testing named routes +# +# If you're using named routes, they can be easily tested using the original +# named routes' methods straight in the test case. +# +# assert_redirected_to page_url(title: 'foo') +# +# pkg:gem/actionpack#lib/action_controller/test_case.rb:368 +class ActionController::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TestCase::Behavior + include ::ActionController::TemplateAssertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionController::TestCase::Behavior::ClassMethods + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def _controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def _controller_class=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def _controller_class?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:600 + def _run_setup_callbacks(&block); end + + class << self + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def _controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def _controller_class=(value); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def _controller_class?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:369 + def executor_around_each_request; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:369 + def executor_around_each_request=(_arg0); end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:600 + def __class_attr___callbacks; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:600 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def __class_attr__controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + def __class_attr__controller_class=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:371 +module ActionController::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionController::TemplateAssertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionController::TestCase::Behavior::ClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:592 + def build_response(klass); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:552 + def controller_class_name; end + + # Simulate a DELETE request with the given parameters and set/volley the + # response. See `get` for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:463 + def delete(action, **args); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:556 + def generated_path(generated_extras); end + + # Simulate a GET request with the given parameters. + # + # * `action`: The controller action to call. + # * `params`: The hash with HTTP parameters that you want to pass. This may be + # `nil`. + # * `body`: The request body with a string that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `session`: A hash of parameters to store in the session. This may be + # `nil`. + # * `flash`: A hash of parameters to store in the flash. This may be `nil`. + # + # + # You can also simulate POST, PATCH, PUT, DELETE, and HEAD requests with `post`, + # `patch`, `put`, `delete`, and `head`. Example sending parameters, session, and + # setting a flash message: + # + # get :show, + # params: { id: 7 }, + # session: { user_id: 1 }, + # flash: { notice: 'This is flash message' } + # + # Note that the request method is not verified. The different methods are + # available to make the tests more expressive. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:439 + def get(action, **args); end + + # Simulate a HEAD request with the given parameters and set/volley the response. + # See `get` for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:469 + def head(action, **args); end + + # Simulate a PATCH request with the given parameters and set/volley the + # response. See `get` for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:451 + def patch(action, **args); end + + # Simulate a POST request with the given parameters and set/volley the response. + # See `get` for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:445 + def post(action, **args); end + + # Simulate an HTTP request to `action` by specifying request method, parameters + # and set/volley the response. + # + # * `action`: The controller action to call. + # * `method`: Request method used to send the HTTP request. Possible values + # are `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, `HEAD`. Defaults to `GET`. + # Can be a symbol. + # * `params`: The hash with HTTP parameters that you want to pass. This may be + # `nil`. + # * `body`: The request body with a string that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `session`: A hash of parameters to store in the session. This may be + # `nil`. + # * `flash`: A hash of parameters to store in the flash. This may be `nil`. + # * `format`: Request format. Defaults to `nil`. Can be string or symbol. + # * `as`: Content type. Defaults to `nil`. Must be a symbol that corresponds + # to a mime type. + # + # + # Example calling `create` action and sending two params: + # + # process :create, + # method: 'POST', + # params: { + # user: { name: 'Gaurish Sharma', email: 'user@example.com' } + # }, + # session: { user_id: 1 }, + # flash: { notice: 'This is flash message' } + # + # To simulate `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, and `HEAD` requests + # prefer using #get, #post, #patch, #put, #delete and #head methods respectively + # which will make tests more expressive. + # + # It's not recommended to make more than one request in the same test. Instance + # variables that are set in one request will not persist to the next request, + # but it's not guaranteed that all Rails internal state will be reset. Prefer + # ActionDispatch::IntegrationTest for making multiple requests in the same test. + # + # Note that the request method is not verified. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:512 + def process(action, method: T.unsafe(nil), params: T.unsafe(nil), session: T.unsafe(nil), body: T.unsafe(nil), flash: T.unsafe(nil), format: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end + + # Simulate a PUT request with the given parameters and set/volley the response. + # See `get` for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:457 + def put(action, **args); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:560 + def query_parameter_names(generated_extras); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:377 + def request; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:377 + def response; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:564 + def setup_controller_request_and_response; end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:685 + def check_required_ivars; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:681 + def document_root_element; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:635 + def process_controller_response(action, cookies, xhr); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:671 + def scrub_env!(env); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:605 + def setup_request(controller_class_name, action, parameters, session, flash, xhr); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:627 + def wrap_execution(&block); end + + module GeneratedClassMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end + + module GeneratedInstanceMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:379 +module ActionController::TestCase::Behavior::ClassMethods + # pkg:gem/actionpack#lib/action_controller/test_case.rb:401 + def controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:397 + def controller_class=(new_class); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:409 + def determine_default_controller_class(name); end + + # Sets the controller class name. Useful if the name can't be inferred from test + # class. Normalizes `controller_class` before using. + # + # tests WidgetController + # tests :widget + # tests 'widget' + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:386 + def tests(controller_class); end +end + +# ActionController::TestCase will be deprecated and moved to a gem in the +# future. Please use ActionDispatch::IntegrationTest going forward. +# +# pkg:gem/actionpack#lib/action_controller/test_case.rb:46 +class ActionController::TestRequest < ::ActionDispatch::TestRequest + # pkg:gem/actionpack#lib/action_controller/test_case.rb:69 + def initialize(env, session, controller_class); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:88 + def assign_parameters(routes, controller_path, action, parameters, generated_path, query_string_keys); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:84 + def content_type=(type); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:54 + def controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:80 + def query_string=(string); end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:179 + def params_parsers; end + + class << self + # Create a new test request with default `env` values. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:57 + def create(controller_class); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:50 + def new_session; end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:64 + def default_env; end + end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:47 +ActionController::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:151 +ActionController::TestRequest::ENCODER = T.let(T.unsafe(nil), T.untyped) + +# Methods #destroy and #load! are overridden to avoid calling methods on the +# @store object, which does not exist for the TestSession class. +# +# pkg:gem/actionpack#lib/action_controller/test_case.rb:197 +class ActionController::TestSession < ::Rack::Session::Abstract::PersistedSecure::SecureSessionHash + # pkg:gem/actionpack#lib/action_controller/test_case.rb:200 + def initialize(session = T.unsafe(nil), id = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:220 + def destroy; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:224 + def dig(*keys); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:233 + def enabled?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:208 + def exists?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:229 + def fetch(key, *args, &block); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:237 + def id_was; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:212 + def keys; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:216 + def values; end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:242 + def load!; end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:198 +ActionController::TestSession::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/metal/testing.rb:6 +module ActionController::Testing; end + +# Behavior specific to functional tests +# +# pkg:gem/actionpack#lib/action_controller/metal/testing.rb:8 +module ActionController::Testing::Functional + # pkg:gem/actionpack#lib/action_controller/metal/testing.rb:9 + def clear_instance_variables_between_requests; end + + # pkg:gem/actionpack#lib/action_controller/metal/testing.rb:18 + def recycle!; end +end + +# Raised when a Rate Limit is exceeded by too many requests within a period of +# time. +# +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:109 +class ActionController::TooManyRequests < ::ActionController::ActionControllerError; end + +# Raised when a Parameters instance is not marked as permitted and an operation +# to transform it to hash is called. +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.to_h +# # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:74 +class ActionController::UnfilteredParameters < ::ArgumentError + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:75 + def initialize; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:75 +class ActionController::UnknownFormat < ::ActionController::ActionControllerError; end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:72 +class ActionController::UnknownHttpMethod < ::ActionController::ActionControllerError; end + +# Raised when a supplied parameter is not expected and +# ActionController::Parameters.action_on_unpermitted_parameters is set to +# `:raise`. +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => ActionController::UnpermittedParameters: found unpermitted parameters: :a, :b +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:59 +class ActionController::UnpermittedParameters < ::IndexError + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:62 + def initialize(params); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:60 + def params; end +end + +# # Action Controller UrlFor +# +# Includes `url_for` into the host class. The class has to provide a `RouteSet` +# by implementing the `_routes` method. Otherwise, an exception will be raised. +# +# In addition to AbstractController::UrlFor, this module accesses the HTTP layer +# to define URL options like the `host`. In order to do so, this module requires +# the host class to implement `env` which needs to be Rack-compatible, and +# `request` which returns an ActionDispatch::Request instance. +# +# class RootUrl +# include ActionController::UrlFor +# include Rails.application.routes.url_helpers +# +# delegate :env, :request, to: :controller +# +# def initialize(controller) +# @controller = controller +# @url = root_path # named route from the application. +# end +# end +# +# pkg:gem/actionpack#lib/action_controller/metal/url_for.rb:27 +module ActionController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/metal/url_for.rb:32 + def initialize(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/url_for.rb:37 + def url_options; end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:27 +class ActionController::UrlGenerationError < ::ActionController::ActionControllerError + include ::DidYouMean::Correctable + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:30 + def initialize(message, routes = T.unsafe(nil), route_name = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:41 + def corrections; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:28 + def method_name; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:28 + def route_name; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:28 + def routes; end +end + +# # Action Dispatch +# +# Action Dispatch is a module of Action Pack. +# +# Action Dispatch parses information about the web request, handles routing as +# defined by the user, and does advanced processing related to HTTP such as +# MIME-type negotiation, decoding parameters in POST, PATCH, or PUT bodies, +# handling HTTP caching logic, cookies and sessions. +# :markup: markdown +# +# pkg:gem/actionpack#lib/action_dispatch/deprecator.rb:5 +module ActionDispatch + extend ::ActiveSupport::Autoload + + # pkg:gem/actionpack#lib/action_dispatch.rb:149 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app=(val); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/deprecator.rb:6 + def deprecator; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app=(val); end + + # pkg:gem/actionpack#lib/action_dispatch.rb:146 + def verbose_redirect_logs; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:146 + def verbose_redirect_logs=(_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:9 +class ActionDispatch::ActionableExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:12 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:16 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:10 + def endpoint; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:10 + def endpoint=(val); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:26 + def actionable_request?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:30 + def redirect_to(location); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:10 + def endpoint; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:10 + def endpoint=(val); end + end +end + +# This is a class that abstracts away an asserted response. It purposely does +# not inherit from Response because it doesn't need it. That means it does not +# have headers or a body. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:9 +class ActionDispatch::AssertionResponse + # Accepts a specific response status code as an Integer (404) or String ('404') + # or a response status range as a Symbol pseudo-code (:success, indicating any + # 200-299 status code). + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:22 + def initialize(code_or_name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:10 + def code; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:35 + def code_and_name; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:10 + def name; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:40 + def code_from_name(name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:44 + def name_from_code(code); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:12 +ActionDispatch::AssertionResponse::GENERIC_RESPONSE_CODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:6 +module ActionDispatch::Assertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + extend ::ActiveSupport::Concern + include ::ActionDispatch::Assertions::RoutingAssertions + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions.rb:17 + def html_document; end +end + +# A small suite of assertions that test responses from Rails applications. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:8 +module ActionDispatch::Assertions::ResponseAssertions + # Asserts that the given +text+ is present somewhere in the response body. + # + # assert_in_body fixture(:name).description + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:77 + def assert_in_body(text); end + + # Asserts that the given +text+ is not present anywhere in the response body. + # + # assert_not_in_body fixture(:name).description + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:84 + def assert_not_in_body(text); end + + # Asserts that the response is a redirect to a URL matching the given options. + # + # # Asserts that the redirection was to the "index" action on the WeblogController + # assert_redirected_to controller: "weblog", action: "index" + # + # # Asserts that the redirection was to the named route login_url + # assert_redirected_to login_url + # + # # Asserts that the redirection was to the URL for @customer + # assert_redirected_to @customer + # + # # Asserts that the redirection matches the regular expression + # assert_redirected_to %r(\Ahttp://example.org) + # + # # Asserts that the redirection has the HTTP status code 301 (Moved + # # Permanently). + # assert_redirected_to "/some/path", status: :moved_permanently + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:60 + def assert_redirected_to(url_options = T.unsafe(nil), options = T.unsafe(nil), message = T.unsafe(nil)); end + + # Asserts that the response is one of the following types: + # + # * `:success` - Status code was in the 200-299 range + # * `:redirect` - Status code was in the 300-399 range + # * `:missing` - Status code was 404 + # * `:error` - Status code was in the 500-599 range + # + # + # You can also pass an explicit status number like `assert_response(501)` or its + # symbolic equivalent `assert_response(:not_implemented)`. See + # `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list. + # + # # Asserts that the response was a redirection + # assert_response :redirect + # + # # Asserts that the response code was status code 401 (unauthorized) + # assert_response 401 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:33 + def assert_response(type, message = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:129 + def code_with_name(code_or_name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:118 + def exception_if_present; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:103 + def generate_response_message(expected, actual = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:123 + def location_if_redirected; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:94 + def normalize_argument_to_redirection(fragment); end + + # Proxy to to_param if the object will respond to it. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:90 + def parameterize(value); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:113 + def response_body_if_short; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:9 +ActionDispatch::Assertions::ResponseAssertions::RESPONSE_PREDICATES = T.let(T.unsafe(nil), Hash) + +# Suite of assertions to test routes generated by Rails and the handling of +# requests made to them. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:15 +module ActionDispatch::Assertions::RoutingAssertions + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # Asserts that the provided options can be used to generate the provided path. + # This is the inverse of `assert_recognizes`. The `extras` parameter is used to + # tell the request the names and values of additional request parameters that + # would be in a query string. The `message` parameter allows you to specify a + # custom error message for assertion failures. + # + # The `defaults` parameter is unused. + # + # # Asserts that the default action is generated for a route with no action + # assert_generates "/items", controller: "items", action: "index" + # + # # Tests that the list action is properly routed + # assert_generates "/items/list", controller: "items", action: "list" + # + # # Tests the generation of a route with a parameter + # assert_generates "/items/list/1", { controller: "items", action: "list", id: "1" } + # + # # Asserts that the generated route gives us our custom route + # assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" } + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:216 + def assert_generates(expected_path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end + + # Asserts that the routing of the given `path` was handled correctly and that + # the parsed options (given in the `expected_options` hash) match `path`. + # Basically, it asserts that Rails recognizes the route given by + # `expected_options`. + # + # Pass a hash in the second argument (`path`) to specify the request method. + # This is useful for routes requiring a specific HTTP method. The hash should + # contain a `:path` with the incoming request path and a `:method` containing + # the required HTTP verb. + # + # # Asserts that POSTing to /items will call the create action on ItemsController + # assert_recognizes({controller: 'items', action: 'create'}, {path: 'items', method: :post}) + # + # You can also pass in `extras` with a hash containing URL parameters that would + # normally be in the query string. This can be used to assert that values in the + # query string will end up in the params hash correctly. To test query strings + # you must use the extras argument because appending the query string on the + # path directly will not work. For example: + # + # # Asserts that a path of '/items/list/1?view=print' returns the correct options + # assert_recognizes({controller: 'items', action: 'list', id: '1', view: 'print'}, 'items/list/1', { view: "print" }) + # + # The `message` parameter allows you to pass in an error message that is + # displayed upon failure. + # + # # Check the default route (i.e., the index action) + # assert_recognizes({controller: 'items', action: 'index'}, 'items') + # + # # Test a specific action + # assert_recognizes({controller: 'items', action: 'list'}, 'items/list') + # + # # Test an action with a parameter + # assert_recognizes({controller: 'items', action: 'destroy', id: '1'}, 'items/destroy/1') + # + # # Test a custom route + # assert_recognizes({controller: 'items', action: 'show', id: '1'}, 'view/item1') + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:176 + def assert_recognizes(expected_options, path, extras = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Asserts that path and options match both ways; in other words, it verifies + # that `path` generates `options` and then that `options` generates `path`. This + # essentially combines `assert_recognizes` and `assert_generates` into one step. + # + # The `extras` hash allows you to specify options that would normally be + # provided as a query string to the action. The `message` parameter allows you + # to specify a custom error message to display upon failure. + # + # # Asserts a basic route: a controller with the default action (index) + # assert_routing '/home', controller: 'home', action: 'index' + # + # # Test a route generated with a specific controller, action, and parameter (id) + # assert_routing '/entries/show/23', controller: 'entries', action: 'show', id: 23 + # + # # Asserts a basic route (controller + default action), with an error message if it fails + # assert_routing '/store', { controller: 'store', action: 'index' }, {}, {}, 'Route for store index not generated properly' + # + # # Tests a route, providing a defaults hash + # assert_routing 'controller/action/9', {id: "9", item: "square"}, {controller: "controller", action: "action"}, {}, {item: "square"} + # + # # Tests a route with an HTTP method + # assert_routing({ method: 'put', path: '/product/321' }, { controller: "product", action: "update", id: "321" }) + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:260 + def assert_routing(path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end + + # ROUTES TODO: These assertions should really work in an integration context + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:273 + def method_missing(selector, *, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:115 + def setup; end + + # A helper to make it easier to test different route configurations. This method + # temporarily replaces @routes with a new RouteSet instance. + # + # The new instance is yielded to the passed block. Typically the block will + # create some routes using `set.draw { match ... }`: + # + # with_routing do |set| + # set.draw do + # resources :users + # end + # assert_equal "/users", users_path + # end + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:133 + def with_routing(config = T.unsafe(nil), &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:282 + def create_routes(config = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:348 + def fail_on(exception_class, message); end + + # Recognizes the route for a given path. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:314 + def recognized_request_for(path, extras = T.unsafe(nil), msg); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:306 + def reset_routes(old_routes, old_controller); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:88 +module ActionDispatch::Assertions::RoutingAssertions::ClassMethods + # A helper to make it easier to test different route configurations. This method + # temporarily replaces @routes with a new RouteSet instance before each test. + # + # The new instance is yielded to the passed block. Typically the block will + # create some routes using `set.draw { match ... }`: + # + # with_routing do |set| + # set.draw do + # resources :users + # end + # end + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:101 + def with_routing(&block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:18 +module ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:40 + def with_routing(&block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:58 + def create_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:50 + def initialize_lazy_routes(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:80 + def reset_routes(old_routes, old_routes_call_method, old_integration_session); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:21 +module ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:22 + def with_routing(&block); end +end + +# # Action Dispatch AssumeSSL +# +# When proxying through a load balancer that terminates SSL, the forwarded +# request will appear as though it's HTTP instead of HTTPS to the application. +# This makes redirects and cookie security target HTTP instead of HTTPS. This +# middleware makes the server assume that the proxy already terminated SSL, and +# that the request really is HTTPS. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/assume_ssl.rb:13 +class ActionDispatch::AssumeSSL + # pkg:gem/actionpack#lib/action_dispatch/middleware/assume_ssl.rb:14 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/assume_ssl.rb:18 + def call(env); end +end + +# # Action Dispatch Callbacks +# +# Provides callbacks to be executed before and after dispatching the request. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:9 +class ActionDispatch::Callbacks + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:24 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:12 + def _call_callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:12 + def _run_call_callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:12 + def _run_call_callbacks!(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:28 + def call(env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def __callbacks=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:12 + def _call_callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:12 + def _call_callbacks=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:19 + def after(*args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:15 + def before(*args, &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def __class_attr___callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def __class_attr___callbacks=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:8 +module ActionDispatch::Constants; end + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:23 +ActionDispatch::Constants::CONTENT_ENCODING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:24 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:25 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:27 +ActionDispatch::Constants::FEATURE_POLICY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:26 +ActionDispatch::Constants::LOCATION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:30 +ActionDispatch::Constants::SERVER_TIMING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:31 +ActionDispatch::Constants::STRICT_TRANSPORT_SECURITY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:37 +ActionDispatch::Constants::UNPROCESSABLE_CONTENT = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:22 +ActionDispatch::Constants::VARY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:29 +ActionDispatch::Constants::X_CASCADE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:28 +ActionDispatch::Constants::X_REQUEST_ID = T.let(T.unsafe(nil), String) + +# # Action Dispatch Content Security Policy +# +# Configures the HTTP [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) +# response header to help protect against XSS and +# injection attacks. +# +# Example global policy: +# +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# +# # Specify URI for violation reports +# policy.report_uri "/csp-violation-report-endpoint" +# end +# +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:28 +class ActionDispatch::ContentSecurityPolicy + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:182 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def base_uri(*sources); end + + # Specify whether to prevent the user agent from loading any assets over HTTP + # when the page uses HTTPS: + # + # policy.block_all_mixed_content + # + # Pass `false` to allow it again: + # + # policy.block_all_mixed_content false + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:210 + def block_all_mixed_content(enabled = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:299 + def build(context = T.unsafe(nil), nonce = T.unsafe(nil), nonce_directives = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def child_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def connect_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def default_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:180 + def directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def font_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def form_action(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def frame_ancestors(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def frame_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def img_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def manifest_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def media_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def object_src(*sources); end + + # Restricts the set of plugins that can be embedded: + # + # policy.plugin_types "application/x-shockwave-flash" + # + # Leave empty to allow all plugins: + # + # policy.plugin_types + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:226 + def plugin_types(*types); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def prefetch_src(*sources); end + + # Enable the [report-uri](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri) + # directive. Violation reports will be sent to the + # specified URI: + # + # policy.report_uri "/csp-violation-report-endpoint" + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:240 + def report_uri(uri); end + + # Specify asset types for which [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) is required: + # + # policy.require_sri_for :script, :style + # + # Leave empty to not require Subresource Integrity: + # + # policy.require_sri_for + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:252 + def require_sri_for(*types); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def require_trusted_types_for(*sources); end + + # Specify whether a [sandbox](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox) + # should be enabled for the requested resource: + # + # policy.sandbox + # + # Values can be passed as arguments: + # + # policy.sandbox "allow-scripts", "allow-modals" + # + # Pass `false` to disable the sandbox: + # + # policy.sandbox false + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:273 + def sandbox(*values); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def script_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def script_src_attr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def script_src_elem(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def style_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def style_src_attr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def style_src_elem(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def trusted_types(*sources); end + + # Specify whether user agents should treat any assets over HTTP as HTTPS: + # + # policy.upgrade_insecure_requests + # + # Pass `false` to disable it: + # + # policy.upgrade_insecure_requests false + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:291 + def upgrade_insecure_requests(enabled = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:192 + def worker_src(*sources); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:324 + def apply_mapping(source); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:305 + def apply_mappings(sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:358 + def build_directive(directive, sources, context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:330 + def build_directives(context, nonce, nonce_directives); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:386 + def hash_source?(source); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:187 + def initialize_copy(other); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:382 + def nonce_directive?(directive, nonce_directives); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:364 + def resolve_source(source, context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:346 + def validate(directive, sources); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:176 +ActionDispatch::ContentSecurityPolicy::DEFAULT_NONCE_DIRECTIVES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:149 +ActionDispatch::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:174 +ActionDispatch::ContentSecurityPolicy::HASH_SOURCE_ALGORITHM_PREFIXES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:29 +class ActionDispatch::ContentSecurityPolicy::InvalidDirectiveError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:128 +ActionDispatch::ContentSecurityPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:32 +class ActionDispatch::ContentSecurityPolicy::Middleware + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:33 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:37 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:59 + def header_name(request); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:67 + def policy_present?(headers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:73 +module ActionDispatch::ContentSecurityPolicy::Request + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:80 + def content_security_policy; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:84 + def content_security_policy=(policy); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:112 + def content_security_policy_nonce; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:104 + def content_security_policy_nonce_directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:108 + def content_security_policy_nonce_directives=(generator); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:96 + def content_security_policy_nonce_generator; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:100 + def content_security_policy_nonce_generator=(generator); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:88 + def content_security_policy_report_only; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:92 + def content_security_policy_report_only=(value); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:123 + def generate_content_security_policy_nonce; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:77 +ActionDispatch::ContentSecurityPolicy::Request::NONCE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:78 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_DIRECTIVES = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:76 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_GENERATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:74 +ActionDispatch::ContentSecurityPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:75 +ActionDispatch::ContentSecurityPolicy::Request::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# Read and write data to cookies through ActionController::Cookies#cookies. +# +# When reading cookie data, the data is read from the HTTP request header, +# Cookie. When writing cookie data, the data is sent out in the HTTP response +# header, `Set-Cookie`. +# +# Examples of writing: +# +# # Sets a simple session cookie. +# # This cookie will be deleted when the user's browser is closed. +# cookies[:user_name] = "david" +# +# # Cookie values are String-based. Other data types need to be serialized. +# cookies[:lat_lon] = JSON.generate([47.68, -122.37]) +# +# # Sets a cookie that expires in 1 hour. +# cookies[:login] = { value: "XJ-122", expires: 1.hour } +# +# # Sets a cookie that expires at a specific time. +# cookies[:login] = { value: "XJ-122", expires: Time.utc(2020, 10, 15, 5) } +# +# # Sets a signed cookie, which prevents users from tampering with its value. +# cookies.signed[:user_id] = current_user.id +# # It can be read using the signed method. +# cookies.signed[:user_id] # => 123 +# +# # Sets an encrypted cookie value before sending it to the client which +# # prevent users from reading and tampering with its value. +# cookies.encrypted[:discount] = 45 +# # It can be read using the encrypted method. +# cookies.encrypted[:discount] # => 45 +# +# # Sets a "permanent" cookie (which expires in 20 years from now). +# cookies.permanent[:login] = "XJ-122" +# +# # You can also chain these methods: +# cookies.signed.permanent[:login] = "XJ-122" +# +# Examples of reading: +# +# cookies[:user_name] # => "david" +# cookies.size # => 2 +# JSON.parse(cookies[:lat_lon]) # => [47.68, -122.37] +# cookies.signed[:login] # => "XJ-122" +# cookies.encrypted[:discount] # => 45 +# +# Example for deleting: +# +# cookies.delete :user_name +# +# Please note that if you specify a `:domain` when setting a cookie, you must +# also specify the domain when deleting the cookie: +# +# cookies[:name] = { +# value: 'a yummy cookie', +# expires: 1.year, +# domain: 'domain.com' +# } +# +# cookies.delete(:name, domain: 'domain.com') +# +# The option symbols for setting cookies are: +# +# * `:value` - The cookie's value. +# * `:path` - The path for which this cookie applies. Defaults to the root of +# the application. +# * `:domain` - The domain for which this cookie applies so you can restrict +# to the domain level. If you use a schema like www.example.com and want to +# share session with user.example.com set `:domain` to `:all`. To support +# multiple domains, provide an array, and the first domain matching +# `request.host` will be used. Make sure to specify the `:domain` option +# with `:all` or `Array` again when deleting cookies. For more flexibility +# you can set the domain on a per-request basis by specifying `:domain` with +# a proc. +# +# domain: nil # Does not set cookie domain. (default) +# domain: :all # Allow the cookie for the top most level +# # domain and subdomains. +# domain: %w(.example.com .example.org) # Allow the cookie +# # for concrete domain names. +# domain: proc { Tenant.current.cookie_domain } # Set cookie domain dynamically +# domain: proc { |req| ".sub.#{req.host}" } # Set cookie domain dynamically based on request +# +# * `:tld_length` - When using `:domain => :all`, this option can be used to +# explicitly set the TLD length when using a short (<= 3 character) domain +# that is being interpreted as part of a TLD. For example, to share cookies +# between user1.lvh.me and user2.lvh.me, set `:tld_length` to 2. +# * `:expires` - The time at which this cookie expires, as a Time or +# ActiveSupport::Duration object. +# * `:secure` - Whether this cookie is only transmitted to HTTPS servers. +# Default is `false`. +# * `:httponly` - Whether this cookie is accessible via scripting or only +# HTTP. Defaults to `false`. +# * `:same_site` - The value of the `SameSite` cookie attribute, which +# determines how this cookie should be restricted in cross-site contexts. +# Possible values are `nil`, `:none`, `:lax`, and `:strict`. Defaults to +# `:lax`. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:195 +class ActionDispatch::Cookies + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:702 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:706 + def call(env); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:201 +ActionDispatch::Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:506 +class ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:509 + def initialize(parent_jar); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:513 + def [](name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:525 + def []=(name, options); end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:537 + def request; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:555 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:548 + def cookie_metadata(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:540 + def expiry_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:554 + def parse(name, data, purpose: T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:207 +ActionDispatch::Cookies::COOKIES_DIGEST = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:208 +ActionDispatch::Cookies::COOKIES_ROTATIONS = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:209 +ActionDispatch::Cookies::COOKIES_SAME_SITE_PROTECTION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:206 +ActionDispatch::Cookies::COOKIES_SERIALIZER = T.let(T.unsafe(nil), String) + +# Include in a cookie jar to allow chaining, e.g. `cookies.permanent.signed`. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:219 +module ActionDispatch::Cookies::ChainedCookieJars + # Returns a jar that'll automatically encrypt cookie values before sending them + # to the client and will decrypt them for read. If the cookie was tampered with + # by the user (or a 3rd party), `nil` will be returned. + # + # If `config.action_dispatch.encrypted_cookie_salt` and + # `config.action_dispatch.encrypted_signed_cookie_salt` are both set, legacy + # cookies encrypted with HMAC AES-256-CBC will be transparently upgraded. + # + # This jar requires that you set a suitable secret for the verification on your + # app's `secret_key_base`. + # + # Example: + # + # cookies.encrypted[:discount] = 45 + # # => Set-Cookie: discount=DIQ7fw==--K3n//8vvnSbGq9dA--7Xh91HfLpwzbj1czhBiwOg==; path=/ + # + # cookies.encrypted[:discount] # => 45 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:274 + def encrypted; end + + # Returns a jar that'll automatically set the assigned cookies to have an + # expiration date 20 years from now. Example: + # + # cookies.permanent[:prefers_open_id] = true + # # => Set-Cookie: prefers_open_id=true; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # + # This jar is only meant for writing. You'll read permanent cookies through the + # regular accessor. + # + # This jar allows chaining with the signed jar as well, so you can set + # permanent, signed cookies. Examples: + # + # cookies.permanent.signed[:remember_me] = current_user.id + # # => Set-Cookie: remember_me=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:234 + def permanent; end + + # Returns a jar that'll automatically generate a signed representation of cookie + # value and verify it when reading from the cookie again. This is useful for + # creating cookies with values that the user is not supposed to change. If a + # signed cookie was tampered with by the user (or a 3rd party), `nil` will be + # returned. + # + # This jar requires that you set a suitable secret for the verification on your + # app's `secret_key_base`. + # + # Example: + # + # cookies.signed[:discount] = 45 + # # => Set-Cookie: discount=BAhpMg==--2c1c6906c90a3bc4fd54a51ffb41dffa4bf6b5f7; path=/ + # + # cookies.signed[:discount] # => 45 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:253 + def signed; end + + # Returns the `signed` or `encrypted` jar, preferring `encrypted` if + # `secret_key_base` is set. Used by ActionDispatch::Session::CookieStore to + # avoid the need to introduce new cookie stores. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:281 + def signed_or_encrypted; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:304 + def encrypted_cookie_cipher; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:298 + def prepare_upgrade_legacy_hmac_aes_cbc_cookies?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:308 + def signed_cookie_digest; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:291 + def upgrade_legacy_hmac_aes_cbc_cookies?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:313 +class ActionDispatch::Cookies::CookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:324 + def initialize(request); end + + # Returns the value of the cookie by `name`, or `nil` if no such cookie exists. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:345 + def [](name); end + + # Sets the cookie named `name`. The second argument may be the cookie's value or + # a hash of options as documented above. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:379 + def []=(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:441 + def always_write_cookie; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:441 + def always_write_cookie=(val); end + + # Removes all cookies on the client machine by calling `delete` for each cookie. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:425 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:334 + def commit!; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:332 + def committed?; end + + # Removes the cookie on the client machine by setting the value to an empty + # string and the expiration date in the past. Like `[]=`, you can pass in an + # options hash to delete cookies with extra data such as a `:path`. + # + # Returns the value of the cookie, or `nil` if the cookie does not exist. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:404 + def delete(name, options = T.unsafe(nil)); end + + # Whether the given cookie is to be deleted by this CookieJar. Like `[]=`, you + # can pass in an options hash to test if a deletion applies to a specific + # `:path`, `:domain` etc. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:418 + def deleted?(name, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:340 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:349 + def fetch(name, *args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:356 + def has_key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:353 + def key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:322 + def request; end + + # Returns the cookies as Hash. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:359 + def to_hash(*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:373 + def to_header; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:361 + def update(other_hash); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:366 + def update_cookies_from_jar; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:429 + def write(response); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:444 + def escape(string); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:452 + def handle_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:448 + def write_cookie?(cookie); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:441 + def always_write_cookie; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:441 + def always_write_cookie=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:316 + def build(req, cookies); end + end +end + +# Raised when storing more than 4K of session data. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:216 +class ActionDispatch::Cookies::CookieOverflow < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:203 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_CIPHER = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:199 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:200 +ActionDispatch::Cookies::ENCRYPTED_SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:650 +class ActionDispatch::Cookies::EncryptedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:653 + def initialize(parent_jar); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:695 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:687 + def parse(name, encrypted_message, purpose: T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:197 +ActionDispatch::Cookies::GENERATOR_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:196 +ActionDispatch::Cookies::HTTP_HEADER = T.let(T.unsafe(nil), String) + +# Cookies can typically store 4096 bytes. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:213 +ActionDispatch::Cookies::MAX_COOKIE_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:558 +class ActionDispatch::Cookies::PermanentCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:560 + def commit(name, options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:205 +ActionDispatch::Cookies::SECRET_KEY_BASE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:204 +ActionDispatch::Cookies::SIGNED_COOKIE_DIGEST = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:198 +ActionDispatch::Cookies::SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:565 +module ActionDispatch::Cookies::SerializedCookieJars + protected + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:569 + def digest; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:612 + def check_for_overflow!(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:608 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:594 + def parse(name, dumped, force_reserialize: T.unsafe(nil), **); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:588 + def reserialize?(dumped); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:574 + def serializer; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:566 +ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER = ActiveSupport::MessageEncryptor::NullSerializer + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:621 +class ActionDispatch::Cookies::SignedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:624 + def initialize(parent_jar); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:643 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:637 + def parse(name, signed_message, purpose: T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:202 +ActionDispatch::Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:210 +ActionDispatch::Cookies::USE_COOKIES_WITH_METADATA = T.let(T.unsafe(nil), String) + +# # Action Dispatch DebugExceptions +# +# This middleware is responsible for logging exceptions and showing a debugging +# page in case the request is local. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:15 +class ActionDispatch::DebugExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:23 + def initialize(app, routes_app = T.unsafe(nil), response_format = T.unsafe(nil), interceptors = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:30 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:206 + def api_request?(content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:148 + def compose_exception_message(wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:118 + def create_template(request, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:50 + def invoke_interceptors(request, exception, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:180 + def log_array(logger, lines, request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:138 + def log_error(request, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:210 + def log_rescued_responses?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:192 + def logger(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:134 + def render(status, body, format); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:58 + def render_exception(request, exception, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:94 + def render_for_api_request(content_type, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:80 + def render_for_browser_request(request, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:200 + def routes_inspector(exception); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:196 + def stderr_logger; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:16 + def interceptors; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:18 + def register_interceptor(object = T.unsafe(nil), &block); end + end +end + +# # Action Dispatch DebugLocks +# +# This middleware can be used to diagnose deadlocks in the autoload interlock. +# +# To use it, insert it near the top of the middleware stack, using +# `config/application.rb`: +# +# config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks +# +# After restarting the application and re-triggering the deadlock condition, the +# route `/rails/locks` will show a summary of all threads currently known to the +# interlock, which lock level they are holding or awaiting, and their current +# backtrace. +# +# Generally a deadlock will be caused by the interlock conflicting with some +# other external lock or blocking I/O call. These cannot be automatically +# identified, but should be visible in the displayed backtraces. +# +# NOTE: The formatting and content of this middleware's output is intended for +# human consumption, and should be expected to change between releases. +# +# This middleware exposes operational details of the server, with no access +# control. It should only be enabled when in use, and removed thereafter. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:29 +class ActionDispatch::DebugLocks + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:30 + def initialize(app, path = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:35 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:108 + def blocked_by?(victim, blocker, all_threads); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:49 + def render_details(req); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:11 +class ActionDispatch::DebugView < ::ActionView::Base + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:14 + def initialize(assigns); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:20 + def compiled_method_container; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:44 + def debug_hash(object); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:36 + def debug_headers(headers); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:24 + def debug_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:58 + def editor_url(location, line: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:73 + def params_valid?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:69 + def protect_against_forgery?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:48 + def render(*); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:12 +ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:11 +class ActionDispatch::ExceptionWrapper + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:51 + def initialize(backtrace_cleaner, exception); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:102 + def actions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:114 + def annotated_source_code; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:136 + def application_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:49 + def backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:90 + def corrections; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:49 + def exception; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:49 + def exception_class_name; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:234 + def exception_id; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:230 + def exception_inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:222 + def exception_name; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:130 + def exception_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:78 + def failures; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:94 + def file_name; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:140 + def framework_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:144 + def full_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:74 + def has_cause?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:82 + def has_corrections?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:98 + def line_number; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:226 + def message; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:86 + def original_message; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:200 + def rescue_response?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:12 + def rescue_responses; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:12 + def rescue_responses=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:122 + def rescue_template; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:31 + def rescue_templates; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:31 + def rescue_templates=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:62 + def routing_error?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:185 + def show?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:44 + def silent_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:44 + def silent_exceptions=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:204 + def source_extracts; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:218 + def source_to_show_id; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:126 + def status_code; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:70 + def sub_template_message; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:66 + def template_error?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:210 + def trace_to_show; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:148 + def traces; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:106 + def unwrapped_exception; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:49 + def wrapped_causes; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:40 + def wrapper_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:40 + def wrapper_exceptions=(val); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:258 + def backtrace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:260 + def build_backtrace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:283 + def causes_for(exception); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:293 + def clean_backtrace(*args); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:346 + def extract_file_and_line_number(trace); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:301 + def extract_source(trace); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:330 + def extract_source_fragment_lines(source_lines, line); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:336 + def source_fragment(path, line); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:289 + def wrapped_causes_for(exception, backtrace_cleaner); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:12 + def rescue_responses; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:12 + def rescue_responses=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:31 + def rescue_templates; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:31 + def rescue_templates=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:44 + def silent_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:44 + def silent_exceptions=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:181 + def status_code_for_exception(class_name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:40 + def wrapper_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:40 + def wrapper_exceptions=(val); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:239 +class ActionDispatch::ExceptionWrapper::SourceMapLocation + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:240 + def initialize(location, template); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:245 + def spot(exc); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/executor.rb:8 +class ActionDispatch::Executor + # pkg:gem/actionpack#lib/action_dispatch/middleware/executor.rb:9 + def initialize(app, executor); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/executor.rb:13 + def call(env); end +end + +# # Action Dispatch FileHandler +# +# This endpoint serves static files from disk using `Rack::Files`. +# +# URL paths are matched with static files according to expected conventions: +# `path`, `path`.html, `path`/index.html. +# +# Precompressed versions of these files are checked first. Brotli (.br) and gzip +# (.gz) files are supported. If `path`.br exists, this endpoint returns that +# +# If no matching file is found, this endpoint responds `404 Not Found`. +# +# Pass the `root` directory to search for matching files, an optional `index: +# "index"` to change the default `path`/index.html, and optional additional +# response headers. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:47 +class ActionDispatch::FileHandler + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:55 + def initialize(root, index: T.unsafe(nil), headers: T.unsafe(nil), precompressed: T.unsafe(nil), compressible_content_types: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:69 + def attempt(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:65 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:185 + def clean_path(path_info); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:149 + def compressible?(content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:162 + def each_candidate_filepath(path_info); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:153 + def each_precompressed_filepath(filepath); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:144 + def file_readable?(path); end + + # Match a URI path to a static file to be served. + # + # Used by the `Static` class to negotiate a servable file in the `public/` + # directory (see Static#call). + # + # Checks for `path`, `path`.html, and `path`/index.html files, in that order, + # including .br and .gzip compressed extensions. + # + # If a matching file is found, the path and necessary response headers + # (Content-Type, Content-Encoding) are returned. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:104 + def find_file(path_info, accept_encoding:); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:80 + def serve(request, filepath, content_headers); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:112 + def try_files(filepath, content_type, accept_encoding:); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:122 + def try_precompressed_files(filepath, headers, accept_encoding:); end +end + +# `Accept-Encoding` value -> file extension +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:49 +ActionDispatch::FileHandler::PRECOMPRESSED = T.let(T.unsafe(nil), Hash) + +# # Action Dispatch Flash +# +# The flash provides a way to pass temporary primitive-types (String, Array, +# Hash) between actions. Anything you place in the flash will be exposed to the +# very next action and then cleared out. This is a great way of doing notices +# and alerts, such as a create action that sets `flash[:notice] = "Post +# successfully created"` before redirecting to a display action that can then +# expose the flash to its template. Actually, that exposure is automatically +# done. +# +# class PostsController < ActionController::Base +# def create +# # save post +# flash[:notice] = "Post successfully created" +# redirect_to @post +# end +# +# def show +# # doesn't need to assign the flash notice to the template, that's done automatically +# end +# end +# +# Then in `show.html.erb`: +# +# <% if flash[:notice] %> +#
<%= flash[:notice] %>
+# <% end %> +# +# Since the `notice` and `alert` keys are a common idiom, convenience accessors +# are available: +# +# flash.alert = "You must be logged in" +# flash.notice = "Post successfully created" +# +# This example places a string in the flash. And of course, you can put as many +# as you like at a time too. If you want to pass non-primitive types, you will +# have to handle that in your application. Example: To show messages with links, +# you will have to use sanitize helper. +# +# Just remember: They'll be gone by the time the next action has been performed. +# +# See docs on the FlashHash class for more details about the flash. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:50 +class ActionDispatch::Flash + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:312 + def new(app); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:119 +class ActionDispatch::Flash::FlashHash + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:149 + def initialize(flashes = T.unsafe(nil), discard = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:169 + def [](k); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:163 + def []=(k, v); end + + # Convenience accessor for `flash[:alert]`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:280 + def alert; end + + # Convenience accessor for `flash[:alert]=`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:285 + def alert=(message); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:204 + def clear; end + + # Immediately deletes the single flash entry. Use this method when you want + # remove the message within the current action. See also #discard. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:189 + def delete(key); end + + # Marks the entire flash or a single flash entry to be discarded by the end of + # the current action: + # + # flash.discard # discard the entire flash at the end of the current action + # flash.discard(:warning) # discard only the "warning" entry at the end of the current action + # + # Use this method when you want to display the message in the current action but + # not in the next one. See also #delete. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:264 + def discard(k = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:209 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:200 + def empty?; end + + # Keeps either the entire current flash or a specific flash entry available for + # the next action: + # + # flash.keep # keeps the entire flash + # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:250 + def keep(k = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:183 + def key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:179 + def keys; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:213 + def merge!(h); end + + # Convenience accessor for `flash[:notice]`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:290 + def notice; end + + # Convenience accessor for `flash[:notice]=`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:295 + def notice=(message); end + + # Sets a flash that will not be available to the next action, only to the + # current. + # + # flash.now[:message] = "Hello current action" + # + # This method enables you to use the flash as a central messaging system in your + # app. When you need to pass an object to the next action, you use the standard + # flash assign (`[]=`). When you need to pass an object to the current action, + # you use `now`, and your object will vanish when the current action is done. + # + # Entries set via `now` are accessed the same way as standard entries: + # `flash['my-key']`. + # + # Also, brings two convenience accessors: + # + # flash.now.alert = "Beware now!" + # # Equivalent to flash.now[:alert] = "Beware now!" + # + # flash.now.notice = "Good luck now!" + # # Equivalent to flash.now[:notice] = "Good luck now!" + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:241 + def now; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:215 + def replace(h); end + + # Mark for removal entries that were kept, and delete unkept ones. + # + # This method is called automatically by filters, so you generally don't need to + # care about it. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:274 + def sweep; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:196 + def to_hash; end + + # Builds a hash containing the flashes to keep for the next request. If there + # are none to keep, returns `nil`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:143 + def to_session_value; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:173 + def update(h); end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:300 + def now_is_loaded?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:155 + def initialize_copy(other); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:305 + def stringify_array(array); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:122 + def from_session_value(value); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:90 +class ActionDispatch::Flash::FlashNow + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:93 + def initialize(flash); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:104 + def [](k); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:97 + def []=(k, v); end + + # Convenience accessor for `flash.now[:alert]=`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:109 + def alert=(message); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:91 + def flash; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:91 + def flash=(_arg0); end + + # Convenience accessor for `flash.now[:notice]=`. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:114 + def notice=(message); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:51 +ActionDispatch::Flash::KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:53 +module ActionDispatch::Flash::RequestMethods + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:71 + def commit_flash; end + + # Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash. + # + # See ActionDispatch::Flash for example usage. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:57 + def flash; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:63 + def flash=(flash); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:67 + def flash_hash; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:84 + def reset_session; end +end + +# # Action Dispatch HostAuthorization +# +# This middleware guards from DNS rebinding attacks by explicitly permitting the +# hosts a request can be sent to, and is passed the options set in +# `config.host_authorization`. +# +# Requests can opt-out of Host Authorization with `exclude`: +# +# config.host_authorization = { exclude: ->(request) { request.path =~ /healthcheck/ } } +# +# When a request comes to an unauthorized host, the `response_app` application +# will be executed and rendered. If no `response_app` is given, a default one +# will run. The default response app logs blocked host info with level 'error' +# and responds with `403 Forbidden`. The body of the response contains debug +# info if `config.consider_all_requests_local` is set to true, otherwise the +# body is empty. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:22 +class ActionDispatch::HostAuthorization + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:128 + def initialize(app, hosts, exclude: T.unsafe(nil), response_app: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:136 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:152 + def blocked_hosts(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:164 + def excluded?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:168 + def mark_as_authorized(request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:23 +ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:89 +class ActionDispatch::HostAuthorization::DefaultResponseApp + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:92 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:123 + def available_logger(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:115 + def log_error(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:108 + def response(format, body); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:101 + def response_body(request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:90 +ActionDispatch::HostAuthorization::DefaultResponseApp::RESPONSE_STATUS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:26 +ActionDispatch::HostAuthorization::IPV4_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:27 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:28 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME_WITH_PORT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:24 +ActionDispatch::HostAuthorization::PORT_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:35 +class ActionDispatch::HostAuthorization::Permissions + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:36 + def initialize(hosts); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:44 + def allows?(host); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:40 + def empty?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:84 + def extract_hostname(host); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:61 + def sanitize_hosts(hosts); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:71 + def sanitize_regexp(host); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:75 + def sanitize_string(host); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:25 +ActionDispatch::HostAuthorization::SUBDOMAIN_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:29 +ActionDispatch::HostAuthorization::VALID_IP_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch.rb:95 +module ActionDispatch::Http + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:7 +module ActionDispatch::Http::Cache; end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:8 +module ActionDispatch::Http::Cache::Request + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:71 + def cache_control_directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:36 + def etag_matches?(etag); end + + # Check response freshness (`Last-Modified` and `ETag`) against request + # `If-Modified-Since` and `If-None-Match` conditions. + # If both headers are supplied, based on configuration, either `ETag` is preferred over `Last-Modified` + # or both are considered equally. You can adjust the preference with + # `config.action_dispatch.strict_freshness`. + # Reference: http://tools.ietf.org/html/rfc7232#section-6 + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:49 + def fresh?(response); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:14 + def if_modified_since; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:24 + def if_none_match; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:28 + def if_none_match_etags; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:32 + def not_modified?(modified_at); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:12 + def strict_freshness; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:12 + def strict_freshness=(val); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:12 + def strict_freshness; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:12 + def strict_freshness=(val); end + end +end + +# Represents the HTTP Cache-Control header for requests, +# providing methods to access various cache control directives +# Reference: https://www.rfc-editor.org/rfc/rfc9111.html#name-request-directives +# +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:78 +class ActionDispatch::Http::Cache::Request::CacheControlDirectives + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:79 + def initialize(cache_control_header); end + + # Returns the value of the max-age directive. + # This directive indicates that the client is willing to accept a response + # whose age is no greater than the specified number of seconds. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:122 + def max_age; end + + # Returns the value of the max-stale directive. + # When max-stale is present with a value, returns that integer value. + # When max-stale is present without a value, returns true (unlimited staleness). + # When max-stale is not present, returns nil. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:128 + def max_stale; end + + # Returns true if max-stale directive is present (with or without a value) + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:131 + def max_stale?; end + + # Returns true if max-stale directive is present without a value (unlimited staleness) + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:136 + def max_stale_unlimited?; end + + # Returns the value of the min-fresh directive. + # This directive indicates that the client is willing to accept a response + # whose freshness lifetime is no less than its current age plus the specified time in seconds. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:143 + def min_fresh; end + + # Returns true if the no-cache directive is present. + # This directive indicates that a cache must not use the response + # to satisfy subsequent requests without successful validation on the origin server. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:102 + def no_cache?; end + + # Returns true if the no-store directive is present. + # This directive indicates that a cache must not store any part of the + # request or response. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:109 + def no_store?; end + + # Returns true if the no-transform directive is present. + # This directive indicates that a cache or proxy must not transform the payload. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:115 + def no_transform?; end + + # Returns true if the only-if-cached directive is present. + # This directive indicates that the client only wishes to obtain a + # stored response. If a valid stored response is not available, + # the server should respond with a 504 (Gateway Timeout) status. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:95 + def only_if_cached?; end + + # Returns the value of the stale-if-error directive. + # This directive indicates that the client is willing to accept a stale response + # if the check for a fresh one fails with an error for the specified number of seconds. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:148 + def stale_if_error; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:151 + def parse_directives(header_value); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:9 +ActionDispatch::Http::Cache::Request::HTTP_IF_MODIFIED_SINCE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:10 +ActionDispatch::Http::Cache::Request::HTTP_IF_NONE_MATCH = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:180 +module ActionDispatch::Http::Cache::Response + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:181 + def cache_control; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:197 + def date; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:207 + def date=(utc_time); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:203 + def date?; end + + # This method sets a weak ETag validator on the response so browsers and proxies + # may cache the response, keyed on the ETag. On subsequent requests, the + # `If-None-Match` header is set to the cached ETag. If it matches the current + # ETag, we can return a `304 Not Modified` response with no body, letting the + # browser or proxy know that their cache is current. Big savings in request time + # and network bandwidth. + # + # Weak ETags are considered to be semantically equivalent but not byte-for-byte + # identical. This is perfect for browser caching of HTML pages where we don't + # care about exact equality, just what the user is viewing. + # + # Strong ETags are considered byte-for-byte identical. They allow a browser or + # proxy cache to support `Range` requests, useful for paging through a PDF file + # or scrubbing through a video. Some CDNs only support strong ETags and will + # ignore weak ETags entirely. + # + # Weak ETags are what we almost always need, so they're the default. Check out + # #strong_etag= to provide a strong ETag validator. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:229 + def etag=(weak_validators); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:241 + def etag?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:183 + def last_modified; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:193 + def last_modified=(utc_time); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:189 + def last_modified?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:237 + def strong_etag=(strong_validators); end + + # True if an ETag is set, and it isn't a weak validator (not preceded with + # `W/`). + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:250 + def strong_etag?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:233 + def weak_etag=(weak_validators); end + + # True if an ETag is set, and it's a weak validator (preceded with `W/`). + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:244 + def weak_etag?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:273 + def cache_control_headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:267 + def cache_control_segments; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:263 + def generate_strong_etag(validators); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:259 + def generate_weak_etag(validators); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:304 + def handle_conditional_get!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:313 + def merge_and_normalize_cache_control!(cache_control); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:291 + def prepare_cache_control!; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:255 +ActionDispatch::Http::Cache::Response::DATE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:295 +ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:301 +ActionDispatch::Http::Cache::Response::IMMUTABLE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:256 +ActionDispatch::Http::Cache::Response::LAST_MODIFIED = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:300 +ActionDispatch::Http::Cache::Response::MUST_REVALIDATE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:302 +ActionDispatch::Http::Cache::Response::MUST_UNDERSTAND = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:297 +ActionDispatch::Http::Cache::Response::NO_CACHE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:296 +ActionDispatch::Http::Cache::Response::NO_STORE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:299 +ActionDispatch::Http::Cache::Response::PRIVATE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:298 +ActionDispatch::Http::Cache::Response::PUBLIC = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:257 +ActionDispatch::Http::Cache::Response::SPECIAL_KEYS = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:7 +class ActionDispatch::Http::ContentDisposition + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:14 + def initialize(disposition:, filename:); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:21 + def ascii_filename; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:12 + def disposition; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:12 + def filename; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:31 + def to_s; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:27 + def utf8_filename; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:40 + def percent_escape(string, pattern); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:8 + def format(disposition:, filename:); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:25 +ActionDispatch::Http::ContentDisposition::RFC_5987_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:19 +ActionDispatch::Http::ContentDisposition::TRADITIONAL_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch HTTP Filter Parameters +# +# Allows you to specify sensitive query string and POST parameters to filter +# from the request log. +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# env["action_dispatch.parameter_filter"] = [:foo, "bar"] +# +# For more information about filter behavior, see +# ActiveSupport::ParameterFilter. +# +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:19 +module ActionDispatch::Http::FilterParameters + # :startdoc: + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:26 + def initialize; end + + # Returns a hash of request.env with all sensitive data replaced. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:42 + def filtered_env; end + + # Returns a hash of parameters with all sensitive data replaced. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:35 + def filtered_parameters; end + + # Reconstructs a path with all sensitive GET parameters replaced. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:47 + def filtered_path; end + + # Returns the `ActiveSupport::ParameterFilter` object used to filter in this + # request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:53 + def parameter_filter; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:62 + def env_filter; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:73 + def filtered_query_string; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:69 + def parameter_filter_for(filters); end +end + +# :stopdoc: +# +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:21 +ActionDispatch::Http::FilterParameters::ENV_MATCH = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:23 +ActionDispatch::Http::FilterParameters::NULL_ENV_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:22 +ActionDispatch::Http::FilterParameters::NULL_PARAM_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:7 +module ActionDispatch::Http::FilterRedirect + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:10 + def filtered_location; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:27 + def location_filter_match?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:19 + def location_filters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:37 + def parameter_filtered_location; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:8 +ActionDispatch::Http::FilterRedirect::FILTERED = T.let(T.unsafe(nil), String) + +# # Action Dispatch HTTP Headers +# +# Provides access to the request's HTTP headers from the environment. +# +# env = { "CONTENT_TYPE" => "text/plain", "HTTP_USER_AGENT" => "curl/7.43.0" } +# headers = ActionDispatch::Http::Headers.from_hash(env) +# headers["Content-Type"] # => "text/plain" +# headers["User-Agent"] # => "curl/7.43.0" +# +# Also note that when headers are mapped to CGI-like variables by the Rack +# server, both dashes and underscores are converted to underscores. This +# ambiguity cannot be resolved at this stage anymore. Both underscores and +# dashes have to be interpreted as if they were originally sent as dashes. +# +# # GET / HTTP/1.1 +# # ... +# # User-Agent: curl/7.43.0 +# # X_Custom_Header: token +# +# headers["X_Custom_Header"] # => nil +# headers["X-Custom-Header"] # => "token" +# +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:28 +class ActionDispatch::Http::Headers + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:58 + def initialize(request); end + + # Returns the value for the given key mapped to @env. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:63 + def [](key); end + + # Sets the given value for the key mapped to @env. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:68 + def []=(key, value); end + + # Add a value to a multivalued header like `Vary` or `Accept-Encoding`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:73 + def add(key, value); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:98 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:118 + def env; end + + # Returns the value for the given key mapped to @env. + # + # If the key is not found and an optional code block is not provided, raises a + # `KeyError` exception. + # + # If the code block is provided, then it will be run and its result returned. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:90 + def fetch(key, default = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:80 + def include?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:77 + def key?(key); end + + # Returns a new Http::Headers instance containing the contents of + # `headers_or_env` and the original instance. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:104 + def merge(headers_or_env); end + + # Adds the contents of `headers_or_env` to original instance entries; duplicate + # keys are overwritten with the values from `headers_or_env`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:112 + def merge!(headers_or_env); end + + private + + # Converts an HTTP header name to an environment variable name if it is not + # contained within the headers hash. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:123 + def env_name(key); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:54 + def from_hash(hash); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:29 +ActionDispatch::Http::Headers::CGI_VARIABLES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:82 +ActionDispatch::Http::Headers::DEFAULT = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:50 +ActionDispatch::Http::Headers::HTTP_HEADER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:9 +module ActionDispatch::Http::MimeNegotiation + extend ::ActiveSupport::Concern + + # Returns the accepted MIME type for the request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:42 + def accepts; end + + # The MIME type of the HTTP request, such as [Mime](:xml). + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:24 + def content_mime_type; end + + # Returns the MIME type for the format used in the request. + # + # # GET /posts/5.xml + # request.format # => Mime[:xml] + # + # # GET /posts/5.xhtml + # request.format # => Mime[:html] + # + # # GET /posts/5 + # request.format # => Mime[:html] or Mime[:js], or request.accepts.first + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:68 + def format(_view_path = T.unsafe(nil)); end + + # Sets the format by string extension, which can be used to force custom formats + # that are not controlled by the extension. + # + # class ApplicationController < ActionController::Base + # before_action :adjust_format_for_iphone + # + # private + # def adjust_format_for_iphone + # request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/] + # end + # end + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:174 + def format=(extension); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:72 + def formats; end + + # Sets the formats by string extensions. This differs from #format= by allowing + # you to set multiple, ordered formats, which is useful when you want to have a + # fallback. + # + # In this example, the `:iphone` format will be used if it's available, + # otherwise it'll fall back to the `:html` format. + # + # class ApplicationController < ActionController::Base + # before_action :adjust_format_for_iphone_with_html_fallback + # + # private + # def adjust_format_for_iphone_with_html_fallback + # request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/] + # end + # end + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:194 + def formats=(extensions); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:37 + def has_content_type?; end + + # Returns the first MIME type that matches the provided array of MIME types. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:202 + def negotiate_mime(order); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:214 + def should_apply_vary_header?; end + + # Returns the \variant for the response template as an instance of + # ActiveSupport::ArrayInquirer. + # + # request.variant = :phone + # request.variant.phone? # => true + # request.variant.tablet? # => false + # + # request.variant = [:phone, :tablet] + # request.variant.phone? # => true + # request.variant.desktop? # => false + # request.variant.any?(:phone, :desktop) # => true + # request.variant.any?(:desktop, :watch) # => false + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:159 + def variant; end + + # Sets the \variant for the response template. + # + # When determining which template to render, Action View will incorporate + # all variants from the request. For example, if an + # `ArticlesController#index` action needs to respond to + # `request.variant = [:ios, :turbo_native]`, it will render the + # first template file it can find in the following list: + # + # - `app/views/articles/index.html+ios.erb` + # - `app/views/articles/index.html+turbo_native.erb` + # - `app/views/articles/index.html.erb` + # + # Variants add context to the requests that views render appropriately. + # Variant names are arbitrary, and can communicate anything from the + # request's platform (`:android`, `:ios`, `:linux`, `:macos`, `:windows`) + # to its browser (`:chrome`, `:edge`, `:firefox`, `:safari`), to the type + # of user (`:admin`, `:guest`, `:user`). + # + # Note: Adding many new variant templates with similarities to existing + # template files can make maintaining your view code more difficult. + # + # #### Parameters + # + # * `variant` - a symbol name or an array of symbol names for variants + # used to render the response template + # + # #### Examples + # + # class ApplicationController < ActionController::Base + # before_action :determine_variants + # + # private + # def determine_variants + # variants = [] + # + # # some code to determine the variant(s) to use + # + # variants << :ios if request.user_agent.include?("iOS") + # variants << :turbo_native if request.user_agent.include?("Turbo Native") + # + # request.variant = variants + # end + # end + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:137 + def variant=(variant); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:238 + def format_from_path_extension; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:223 + def params_readable?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:234 + def use_accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:229 + def valid_accept_header; end +end + +# We use normal content negotiation unless you include **/** in your list, in +# which case we assume you're a browser and send HTML. +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:221 +ActionDispatch::Http::MimeNegotiation::BROWSER_LIKE_ACCEPTS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:12 +class ActionDispatch::Http::MimeNegotiation::InvalidType < ::Mime::Type::InvalidMimeType; end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:14 +ActionDispatch::Http::MimeNegotiation::RESCUABLE_MIME_FORMAT_ERRORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:7 +module ActionDispatch::Http::Parameters + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Http::Parameters::ClassMethods + + # Returns both GET and POST parameters in a single hash. + # + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:52 + def parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:65 + def params; end + + # Returns a hash with the parameters used to form the path of the request. + # Returned hash keys are symbols: + # + # { action: "my_action", controller: "my_controller" } + # + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:84 + def path_parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:67 + def path_parameters=(parameters); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:102 + def log_parse_error_once; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:114 + def params_parsers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:89 + def parse_formatted_parameters(parsers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:36 +module ActionDispatch::Http::Parameters::ClassMethods + # Configure the parameter parser for a given MIME type. + # + # It accepts a hash where the key is the symbol of the MIME type and the value + # is a proc. + # + # original_parsers = ActionDispatch::Request.parameter_parsers + # xml_parser = -> (raw_post) { Hash.from_xml(raw_post) || {} } + # new_parsers = original_parsers.merge(xml: xml_parser) + # ActionDispatch::Request.parameter_parsers = new_parsers + # + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:46 + def parameter_parsers=(parsers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:12 +ActionDispatch::Http::Parameters::DEFAULT_PARSERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:10 +ActionDispatch::Http::Parameters::PARAMETERS_KEY = T.let(T.unsafe(nil), String) + +# Raised when raw data from the request cannot be parsed by the parser defined +# for request's content MIME type. +# +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:21 +class ActionDispatch::Http::Parameters::ParseError < ::StandardError + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:22 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:9 +module ActionDispatch::Http::URL + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:277 + def initialize; end + + # Returns the domain part of a host, such as "rubyonrails.org" in + # "www.rubyonrails.org". You can specify a different `tld_length`, such as 2 to + # catch rubyonrails.co.uk in "www.rubyonrails.co.uk". + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:420 + def domain(tld_length = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:112 + def domain_extractor; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:112 + def domain_extractor=(val); end + + # Returns the host for this request, such as "example.com". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host # => "example.com" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:324 + def host; end + + # Returns a host:port string for this request, such as "example.com" or + # "example.com:8080". Port is only included if it is not a default port (80 or + # 443) + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host_with_port # => "example.com:8080" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:340 + def host_with_port; end + + # Returns a number port suffix like 8080 if the port number of this request is + # not the default HTTP port 80 or HTTPS port 443. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.optional_port # => nil + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.optional_port # => 8080 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:390 + def optional_port; end + + # Returns the port number of this request as an integer. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.port # => 80 + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.port # => 8080 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:351 + def port; end + + # Returns a string port suffix, including colon, like ":8080" if the port number + # of this request is not the default HTTP port 80 or HTTPS port 443. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.port_string # => "" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.port_string # => ":8080" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:402 + def port_string; end + + # Returns 'https://' if this is an SSL request and 'http://' otherwise. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.protocol # => "http://" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on' + # req.protocol # => "https://" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:298 + def protocol; end + + # Returns the host and port for this request, such as "example.com:8080". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.raw_host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.raw_host_with_port # => "example.com:80" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.raw_host_with_port # => "example.com:8080" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:312 + def raw_host_with_port; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:110 + def secure_protocol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:110 + def secure_protocol=(val); end + + # Returns the requested port, such as 8080, based on SERVER_PORT. + # + # req = ActionDispatch::Request.new 'SERVER_PORT' => '80' + # req.server_port # => 80 + # + # req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' + # req.server_port # => 8080 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:413 + def server_port; end + + # Returns the standard port number for this request's protocol. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.standard_port # => 80 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:363 + def standard_port; end + + # Returns whether this request is using the standard port. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.standard_port? # => true + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.standard_port? # => false + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:378 + def standard_port?; end + + # Returns all the subdomains as a string, so `"dev.www"` would be returned for + # "dev.www.rubyonrails.org". You can specify a different `tld_length`, such as 2 + # to catch `"www"` instead of `"www.rubyonrails"` in "www.rubyonrails.co.uk". + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:435 + def subdomain(tld_length = T.unsafe(nil)); end + + # Returns all the subdomains as an array, so `["dev", "www"]` would be returned + # for "dev.www.rubyonrails.org". You can specify a different `tld_length`, such + # as 2 to catch `["www"]` instead of `["www", "rubyonrails"]` in + # "www.rubyonrails.co.uk". + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:428 + def subdomains(tld_length = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:111 + def tld_length; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:111 + def tld_length=(val); end + + # Returns the complete URL used for this request. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.url # => "http://example.com" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:287 + def url; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:112 + def domain_extractor; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:112 + def domain_extractor=(val); end + + # Returns the domain part of a host given the domain level. + # + # # Top-level domain example + # extract_domain('www.example.com', 1) # => "example.com" + # # Second-level domain example + # extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:121 + def extract_domain(host, tld_length); end + + # Returns the subdomains of a host as a String given the domain level. + # + # # Top-level domain example + # extract_subdomain('www.example.com', 1) # => "www" + # # Second-level domain example + # extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:145 + def extract_subdomain(host, tld_length); end + + # Returns the subdomains of a host as an Array given the domain level. + # + # # Top-level domain example + # extract_subdomains('www.example.com', 1) # => ["www"] + # # Second-level domain example + # extract_subdomains('dev.www.example.co.uk', 2) # => ["dev", "www"] + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:131 + def extract_subdomains(host, tld_length); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:157 + def full_url_for(options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:169 + def path_for(options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:110 + def secure_protocol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:110 + def secure_protocol=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:111 + def tld_length; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:111 + def tld_length=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:149 + def url_for(options); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:189 + def add_anchor(path, anchor); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:182 + def add_params(path, params); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:203 + def build_host_url(host, port, protocol, options, path); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:195 + def extract_domain_from(host, tld_length); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:199 + def extract_subdomains_from(host, tld_length); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:227 + def named_host?(host); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:244 + def normalize_host(_host, options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:264 + def normalize_port(port, protocol); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:231 + def normalize_protocol(protocol); end + end +end + +# DomainExtractor provides utility methods for extracting domain and subdomain +# information from host strings. This module is used internally by Action Dispatch +# to parse host names and separate the domain from subdomains based on the +# top-level domain (TLD) length. +# +# The module assumes a standard domain structure where domains consist of: +# - Subdomains (optional, can be multiple levels) +# - Domain name +# - Top-level domain (TLD, can be multiple levels like .co.uk) +# +# For example, in "api.staging.example.co.uk": +# - Subdomains: ["api", "staging"] +# - Domain: "example.co.uk" (with tld_length=2) +# - TLD: "co.uk" +# +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:28 +module ActionDispatch::Http::URL::DomainExtractor + extend ::ActionDispatch::Http::URL::DomainExtractor + + # Extracts the domain part from a host string, including the specified + # number of top-level domain components. + # + # The domain includes the main domain name plus the TLD components. + # The +tld_length+ parameter specifies how many components from the right + # should be considered part of the TLD. + # + # ==== Parameters + # + # [+host+] + # The host string to extract the domain from. + # + # [+tld_length+] + # The number of domain components that make up the TLD. For example, + # use 1 for ".com" or 2 for ".co.uk". + # + # ==== Examples + # + # # Standard TLD (tld_length = 1) + # DomainExtractor.domain_from("www.example.com", 1) + # # => "example.com" + # + # # Country-code TLD (tld_length = 2) + # DomainExtractor.domain_from("www.example.co.uk", 2) + # # => "example.co.uk" + # + # # Multiple subdomains + # DomainExtractor.domain_from("api.staging.myapp.herokuapp.com", 1) + # # => "herokuapp.com" + # + # # Single component (returns the host itself) + # DomainExtractor.domain_from("localhost", 1) + # # => "localhost" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:64 + def domain_from(host, tld_length); end + + # Extracts the subdomain components from a host string as an Array. + # + # Returns all the components that come before the domain and TLD parts. + # The +tld_length+ parameter is used to determine where the domain begins + # so that everything before it is considered a subdomain. + # + # ==== Parameters + # + # [+host+] + # The host string to extract subdomains from. + # + # [+tld_length+] + # The number of domain components that make up the TLD. This affects + # where the domain boundary is calculated. + # + # ==== Examples + # + # # Standard TLD (tld_length = 1) + # DomainExtractor.subdomains_from("www.example.com", 1) + # # => ["www"] + # + # # Country-code TLD (tld_length = 2) + # DomainExtractor.subdomains_from("api.staging.example.co.uk", 2) + # # => ["api", "staging"] + # + # # No subdomains + # DomainExtractor.subdomains_from("example.com", 1) + # # => [] + # + # # Single subdomain with complex TLD + # DomainExtractor.subdomains_from("www.mysite.co.uk", 2) + # # => ["www"] + # + # # Multiple levels of subdomains + # DomainExtractor.subdomains_from("dev.api.staging.example.com", 1) + # # => ["dev", "api", "staging"] + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:104 + def subdomains_from(host, tld_length); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:11 +ActionDispatch::Http::URL::HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:10 +ActionDispatch::Http::URL::IP_HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:12 +ActionDispatch::Http::URL::PROTOCOL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch HTTP UploadedFile +# +# Models uploaded files. +# +# The actual file is accessible via the `tempfile` accessor, though some of its +# interface is available directly for convenience. +# +# Uploaded files are temporary files whose lifespan is one request. When the +# object is finalized Ruby unlinks the file, so there is no need to clean them +# with a separate maintenance task. +# +# pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:17 +class ActionDispatch::Http::UploadedFile + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:31 + def initialize(hash); end + + # Shortcut for `tempfile.close`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:73 + def close(unlink_now = T.unsafe(nil)); end + + # A string with the MIME type of the file. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:22 + def content_type; end + + # A string with the MIME type of the file. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:22 + def content_type=(_arg0); end + + # Shortcut for `tempfile.eof?`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:98 + def eof?; end + + # A string with the headers of the multipart request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:29 + def headers; end + + # A string with the headers of the multipart request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:29 + def headers=(_arg0); end + + # Shortcut for `tempfile.open`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:68 + def open; end + + # The basename of the file in the client. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:19 + def original_filename; end + + # The basename of the file in the client. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:19 + def original_filename=(_arg0); end + + # Shortcut for `tempfile.path`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:78 + def path; end + + # Shortcut for `tempfile.read`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:63 + def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end + + # Shortcut for `tempfile.rewind`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:88 + def rewind; end + + # Shortcut for `tempfile.size`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:93 + def size; end + + # A `Tempfile` object with the actual uploaded file. Note that some of its + # interface is available directly. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:26 + def tempfile; end + + # A `Tempfile` object with the actual uploaded file. Note that some of its + # interface is available directly. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:26 + def tempfile=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:102 + def to_io; end + + # Shortcut for `tempfile.to_path`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:83 + def to_path; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:14 +module ActionDispatch::Integration; end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:15 +module ActionDispatch::Integration::RequestHelpers + # Performs a DELETE request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:42 + def delete(path, **args); end + + # Follow a single redirect response. If the last response was not a redirect, an + # exception will be raised. Otherwise, the redirect is performed on the location + # header. If the redirection is a 307 or 308 redirect, the same HTTP verb will + # be used when redirecting, otherwise a GET request will be performed. Any + # arguments are passed to the underlying request. + # + # The HTTP_REFERER header will be set to the previous url. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:65 + def follow_redirect!(headers: T.unsafe(nil), **args); end + + # Performs a GET request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:18 + def get(path, **args); end + + # Performs a HEAD request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:48 + def head(path, **args); end + + # Performs an OPTIONS request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:54 + def options(path, **args); end + + # Performs a PATCH request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:30 + def patch(path, **args); end + + # Performs a POST request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:24 + def post(path, **args); end + + # Performs a PUT request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:36 + def put(path, **args); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:335 +module ActionDispatch::Integration::Runner + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:343 + def initialize(*args, &blk); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:340 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:413 + def assertions; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:417 + def assertions=(assertions); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def assigns(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:348 + def before_setup; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def cookies(*, **, &); end + + # Copy the instance variables from the current session instance into the test + # instance. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:423 + def copy_session_variables!; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:363 + def create_session(app); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:429 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:433 + def default_url_options=(options); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def delete(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def follow_redirect!(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def get(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def head(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:353 + def integration_session; end + + # Open a new session instance. If a block is given, the new session is yielded + # to the block before being returned. + # + # session = open_session do |sess| + # sess.extend(CustomAssertions) + # end + # + # By default, a single session is automatically created for you, but you can use + # this method to open multiple sessions that ought to be tested simultaneously. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:405 + def open_session; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def patch(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def post(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:385 + def put(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def remove!; end + + # Reset the current session. This is useful for testing multiple sessions in a + # single test case. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:359 + def reset!; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:341 + def root_session; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:341 + def root_session=(_arg0); end + + private + + # Delegate unhandled messages to the current session instance. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:443 + def method_missing(method, *, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:438 + def respond_to_missing?(method, _); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:338 +ActionDispatch::Integration::Runner::APP_SESSIONS = T.let(T.unsafe(nil), Hash) + +# An instance of this class represents a set of requests and responses performed +# sequentially by a test process. Because you can instantiate multiple sessions +# and run them side-by-side, you can also mimic (to some limited extent) +# multiple simultaneous users interacting with your system. +# +# Typically, you will instantiate a new session using Runner#open_session, +# rather than instantiating a Session directly. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:91 +class ActionDispatch::Integration::Session + include ::Minitest::Assertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::RequestHelpers + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # Create and initialize a new Session instance. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:133 + def initialize(app); end + + # The Accept header to send. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:110 + def accept; end + + # The Accept header to send. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:110 + def accept=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:97 + def body(*, **, &); end + + # A reference to the controller instance used by the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:119 + def controller; end + + # A map of the cookies returned by the last response, and which will be sent + # with the next request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:114 + def cookies; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:97 + def headers(*, **, &); end + + # The hostname used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:101 + def host; end + + # Set the host name to use in the next request. + # + # session.host! "www.example.com" + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:316 + def host!(_arg0); end + + # The hostname used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:104 + def host=(_arg0); end + + # Specify whether or not the session should mimic a secure HTTPS request. + # + # session.https! + # session.https!(false) + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:180 + def https!(flag = T.unsafe(nil)); end + + # Returns `true` if the session is mimicking a secure HTTPS request. + # + # if session.https? + # # ... + # end + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:189 + def https?; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:98 + def path(*, **, &); end + + # Performs the actual request. + # + # * `method`: The HTTP method (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS) + # as a symbol. + # * `path`: The URI (as a String) on which you want to perform the request. + # * `params`: The HTTP parameters that you want to pass. This may be `nil`, a + # Hash, or a String that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `headers`: Additional headers to pass, as a Hash. The headers will be + # merged into the Rack env hash. + # * `env`: Additional env to pass, as a Hash. The headers will be merged into + # the Rack env hash. + # * `xhr`: Set to `true` if you want to make an Ajax request. Adds request + # headers characteristic of `XMLHttpRequest`, e.g. `HTTP_X_REQUESTED_WITH`. The + # headers will be merged into the Rack env hash. + # * `as`: Used for encoding the request with different content type. Supports + # `:json` by default and will set the appropriate request headers. The + # headers will be merged into the Rack env hash. + # + # + # This method is rarely used directly. Use RequestHelpers#get, + # RequestHelpers#post, or other standard HTTP methods in integration tests. + # `#process` is only required when using a request method that doesn't have a + # method defined in the integration tests. + # + # This method returns the response status, after performing the request. + # Furthermore, if this method was called from an ActionDispatch::IntegrationTest + # object, then that object's `@response` instance variable will point to a + # ActionDispatch::TestResponse object which one can use to inspect the details of the response. + # + # Example: + # + # process :get, '/author', params: { since: 201501011400 } + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:226 + def process(method, path, params: T.unsafe(nil), headers: T.unsafe(nil), env: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:97 + def redirect?(*, **, &); end + + # The remote_addr used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:107 + def remote_addr; end + + # The remote_addr used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:107 + def remote_addr=(_arg0); end + + # A reference to the request instance used by the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:122 + def request; end + + # A running counter of the number of requests processed. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def request_count; end + + # A running counter of the number of requests processed. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def request_count=(_arg0); end + + # Resets the instance. This can be used to reset the state information in an + # existing session instance, so it can be used from a clean-slate condition. + # + # session.reset! + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:156 + def reset!; end + + # A reference to the response instance used by the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:125 + def response; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:97 + def status(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:97 + def status_message(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:140 + def url_options; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:319 + def _mock_session; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:327 + def build_expanded_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:323 + def build_full_uri(path, env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def default_url_options?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def __class_attr_default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:130 + def __class_attr_default_url_options=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:92 +ActionDispatch::Integration::Session::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# An integration test spans multiple controllers and actions, tying them all +# together to ensure they work together as expected. It tests more completely +# than either unit or functional tests do, exercising the entire stack, from the +# dispatcher to the database. +# +# At its simplest, you simply extend `IntegrationTest` and write your tests +# using the Integration::RequestHelpers#get and/or +# Integration::RequestHelpers#post methods: +# +# require "test_helper" +# +# class ExampleTest < ActionDispatch::IntegrationTest +# fixtures :people +# +# def test_login +# # get the login page +# get "/login" +# assert_equal 200, status +# +# # post the login and follow through to the home page +# post "/login", params: { username: people(:jamis).username, +# password: people(:jamis).password } +# follow_redirect! +# assert_equal 200, status +# assert_equal "/home", path +# end +# end +# +# However, you can also have multiple session instances open per test, and even +# extend those instances with assertions and methods to create a very powerful +# testing DSL that is specific for your application. You can even reference any +# named routes you happen to have defined. +# +# require "test_helper" +# +# class AdvancedTest < ActionDispatch::IntegrationTest +# fixtures :people, :rooms +# +# def test_login_and_speak +# jamis, david = login(:jamis), login(:david) +# room = rooms(:office) +# +# jamis.enter(room) +# jamis.speak(room, "anybody home?") +# +# david.enter(room) +# david.speak(room, "hello!") +# end +# +# private +# +# module CustomAssertions +# def enter(room) +# # reference a named route, for maximum internal consistency! +# get(room_url(id: room.id)) +# assert(...) +# ... +# end +# +# def speak(room, message) +# post "/say/#{room.id}", xhr: true, params: { message: message } +# assert(...) +# ... +# end +# end +# +# def login(who) +# open_session do |sess| +# sess.extend(CustomAssertions) +# who = people(who) +# sess.post "/login", params: { username: who.username, +# password: who.password } +# assert(...) +# end +# end +# end +# +# Another longer example would be: +# +# A simple integration test that exercises multiple controllers: +# +# require "test_helper" +# +# class UserFlowsTest < ActionDispatch::IntegrationTest +# test "login and browse site" do +# # login via https +# https! +# get "/login" +# assert_response :success +# +# post "/login", params: { username: users(:david).username, password: users(:david).password } +# follow_redirect! +# assert_equal '/welcome', path +# assert_equal 'Welcome david!', flash[:notice] +# +# https!(false) +# get "/articles/all" +# assert_response :success +# assert_dom 'h1', 'Articles' +# end +# end +# +# As you can see the integration test involves multiple controllers and +# exercises the entire stack from database to dispatcher. In addition you can +# have multiple session instances open simultaneously in a test and extend those +# instances with assertion methods to create a very powerful testing DSL +# (domain-specific language) just for your application. +# +# Here's an example of multiple sessions and custom DSL in an integration test +# +# require "test_helper" +# +# class UserFlowsTest < ActionDispatch::IntegrationTest +# test "login and browse site" do +# # User david logs in +# david = login(:david) +# # User guest logs in +# guest = login(:guest) +# +# # Both are now available in different sessions +# assert_equal 'Welcome david!', david.flash[:notice] +# assert_equal 'Welcome guest!', guest.flash[:notice] +# +# # User david can browse site +# david.browses_site +# # User guest can browse site as well +# guest.browses_site +# +# # Continue with other assertions +# end +# +# private +# +# module CustomDsl +# def browses_site +# get "/products/all" +# assert_response :success +# assert_dom 'h1', 'Products' +# end +# end +# +# def login(user) +# open_session do |sess| +# sess.extend(CustomDsl) +# u = users(user) +# sess.https! +# sess.post "/login", params: { username: u.username, password: u.password } +# assert_equal '/welcome', sess.path +# sess.https!(false) +# end +# end +# end +# +# See the [request helpers documentation](rdoc-ref:ActionDispatch::Integration::RequestHelpers) +# for help on how to use `get`, etc. +# +# ### Changing the request encoding +# +# You can also test your JSON API easily by setting what the request should be +# encoded as: +# +# require "test_helper" +# +# class ApiTest < ActionDispatch::IntegrationTest +# test "creates articles" do +# assert_difference -> { Article.count } do +# post articles_path, params: { article: { title: "Ahoy!" } }, as: :json +# end +# +# assert_response :success +# assert_equal({ "id" => Article.last.id, "title" => "Ahoy!" }, response.parsed_body) +# end +# end +# +# The `as` option passes an "application/json" Accept header (thereby setting +# the request format to JSON unless overridden), sets the content type to +# "application/json" and encodes the parameters as JSON. +# +# Calling TestResponse#parsed_body on the response parses the response body +# based on the last response MIME type. +# +# Out of the box, only `:json` is supported. But for any custom MIME types +# you've registered, you can add your own encoders with: +# +# ActionDispatch::IntegrationTest.register_encoder :wibble, +# param_encoder: -> params { params.to_wibble }, +# response_parser: -> body { body } +# +# Where `param_encoder` defines how the params should be encoded and +# `response_parser` defines how the response body should be parsed through +# TestResponse#parsed_body. +# +# Consult the [Rails Testing Guide](https://guides.rubyonrails.org/testing.html) +# for more. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:650 +class ActionDispatch::IntegrationTest < ::ActiveSupport::TestCase + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::Runner + include ::ActionController::TemplateAssertions + include ::ActionDispatch::TestHelpers::PageDumpHelper + include ::ActionDispatch::IntegrationTest::Behavior + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + include ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + extend ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + extend ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:660 +module ActionDispatch::IntegrationTest::Behavior + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::Runner + include ::ActionController::TemplateAssertions + include ::ActionDispatch::TestHelpers::PageDumpHelper + extend ::ActiveSupport::Concern + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + include ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + + mixes_in_class_methods ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:693 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:697 + def document_root_element; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:675 +module ActionDispatch::IntegrationTest::Behavior::ClassMethods + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:676 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:684 + def app=(app); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:688 + def register_encoder(*args, **options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:653 +module ActionDispatch::IntegrationTest::UrlOptions + extend ::ActiveSupport::Concern + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:655 + def url_options; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/param_error.rb:21 +class ActionDispatch::InvalidParameterError < ::ActionDispatch::ParamError; end + +# :stopdoc: +# +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:6 +module ActionDispatch::Journey; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:9 +class ActionDispatch::Journey::Ast + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:13 + def initialize(tree, formatted); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:38 + def glob?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:10 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:10 + def path_params; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:25 + def requirements=(requirements); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:11 + def root; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:34 + def route=(route); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:10 + def terminals; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:10 + def tree; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:10 + def wildcard_options; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:43 + def stars; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:43 + def symbols; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:45 + def visit_tree(formatted); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:8 +class ActionDispatch::Journey::Format + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:24 + def initialize(parts); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:39 + def evaluate(hash); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:16 + def required_path(symbol); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:20 + def required_segment(symbol); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:9 +ActionDispatch::Journey::Format::ESCAPE_PATH = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 +ActionDispatch::Journey::Format::ESCAPE_SEGMENT = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 +class ActionDispatch::Journey::Format::Parameter < ::Struct + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:13 + def escape(value); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def escaper; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def escaper=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def name=(_); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def [](*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def keyword_init?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def members; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:12 + def new(*_arg0); end + end +end + +# The Formatter class is used for formatting URLs. For example, parameters +# passed to `url_for` in Rails will eventually call Formatter#generate. +# +# pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:12 +class ActionDispatch::Journey::Formatter + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:15 + def initialize(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:115 + def clear; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:119 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:61 + def generate(name, options, path_parameters); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:13 + def routes; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:219 + def build_cache; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:230 + def cache; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:125 + def extract_parameterized_parts(route, options, recall); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:152 + def match_route(name, options); end + + # Returns an array populated with missing keys if any are present. + # + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:191 + def missing_keys(route, parts); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:148 + def named_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:174 + def non_recursive(cache, options); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:211 + def possibles(cache, options, depth = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:34 +class ActionDispatch::Journey::Formatter::MissingRoute + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:37 + def initialize(constraints, missing_keys, unmatched_keys, routes, name); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:35 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:53 + def message; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:35 + def missing_keys; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:35 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:49 + def params; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:45 + def path(method_name); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:35 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:35 + def unmatched_keys; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:20 +class ActionDispatch::Journey::Formatter::RouteWithParams + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:23 + def initialize(route, parameterized_parts, params); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:21 + def params; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:29 + def path(_); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:9 +module ActionDispatch::Journey::GTG; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:10 +class ActionDispatch::Journey::GTG::Builder + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:15 + def initialize(root); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:13 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:13 + def endpoints; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:87 + def firstpos(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:108 + def lastpos(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:66 + def nullable?(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:13 + def root; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:21 + def transition_table; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:130 + def build_followpos; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:143 + def symbol(edge); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:11 +ActionDispatch::Journey::GTG::Builder::DUMMY_END_NODE = T.let(T.unsafe(nil), ActionDispatch::Journey::Nodes::Dummy) + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:8 +class ActionDispatch::Journey::GTG::MatchData + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:11 + def initialize(memos); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:9 + def memos; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:16 +class ActionDispatch::Journey::GTG::Simulator + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:27 + def initialize(transition_table); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:31 + def memos(string); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:25 + def tt; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:23 +ActionDispatch::Journey::GTG::Simulator::INITIAL_STATE = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:17 +ActionDispatch::Journey::GTG::Simulator::STATIC_TOKENS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:10 +class ActionDispatch::Journey::GTG::TransitionTable + include ::ActionDispatch::Journey::NFA::Dot + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:17 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:168 + def []=(from, to, sym); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:33 + def accepting?(state); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:29 + def accepting_states; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:25 + def add_accepting(state); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:37 + def add_memo(idx, memo); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:103 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:45 + def eclosure(t); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:41 + def memo(idx); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:13 + def memos; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:49 + def move(t, full_string, token, start_index, token_matches_default); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:187 + def states; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:120 + def to_svg; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:194 + def transitions; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:130 + def visualizer(paths, title = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:15 +ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/nfa/dot.rb:7 +module ActionDispatch::Journey::NFA; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nfa/dot.rb:8 +module ActionDispatch::Journey::NFA::Dot + # pkg:gem/actionpack#lib/action_dispatch/journey/nfa/dot.rb:9 + def to_dot; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:68 +module ActionDispatch::Journey::Nodes; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:182 +class ActionDispatch::Journey::Nodes::Binary < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:185 + def initialize(left, right); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:190 + def children; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:183 + def right; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:183 + def right=(_arg0); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:193 +class ActionDispatch::Journey::Nodes::Cat < ::ActionDispatch::Journey::Nodes::Binary + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:194 + def cat?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:195 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:134 +class ActionDispatch::Journey::Nodes::Dot < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:135 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:122 +class ActionDispatch::Journey::Nodes::Dummy < ::ActionDispatch::Journey::Nodes::Literal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:123 + def initialize(x = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:127 + def literal?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:159 +class ActionDispatch::Journey::Nodes::Group < ::ActionDispatch::Journey::Nodes::Unary + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:161 + def group?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:160 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:117 +class ActionDispatch::Journey::Nodes::Literal < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:118 + def literal?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:119 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:69 +class ActionDispatch::Journey::Nodes::Node + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:74 + def initialize(left); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:108 + def cat?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:80 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:109 + def group?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:72 + def left; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:72 + def left=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:105 + def literal?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:72 + def memo; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:72 + def memo=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:96 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:107 + def star?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:104 + def symbol?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:106 + def terminal?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:88 + def to_dot; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:84 + def to_s; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:92 + def to_sym; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:100 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:198 +class ActionDispatch::Journey::Nodes::Or < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:201 + def initialize(children); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:199 + def children; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:205 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:130 +class ActionDispatch::Journey::Nodes::Slash < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:131 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:164 +class ActionDispatch::Journey::Nodes::Star < ::ActionDispatch::Journey::Nodes::Unary + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:167 + def initialize(left); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:177 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:165 + def regexp; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:165 + def regexp=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:174 + def star?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:175 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:138 +class ActionDispatch::Journey::Nodes::Symbol < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:145 + def initialize(left, regexp = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:141 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:139 + def regexp; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:139 + def regexp=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:140 + def symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:152 + def symbol?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:151 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:143 +ActionDispatch::Journey::Nodes::Symbol::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:144 +ActionDispatch::Journey::Nodes::Symbol::GREEDY_EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:112 +class ActionDispatch::Journey::Nodes::Terminal < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:113 + def symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:114 + def terminal?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:155 +class ActionDispatch::Journey::Nodes::Unary < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:156 + def children; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:8 +class ActionDispatch::Journey::Parser + include ::ActionDispatch::Journey::Nodes + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:15 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:20 + def parse(string); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:27 + def advance_token; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:31 + def do_parse; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:58 + def parse_expression; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:35 + def parse_expressions; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:74 + def parse_group; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:52 + def parse_or(lhs); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:68 + def parse_star; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:86 + def parse_terminal; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:11 + def parse(string); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:7 +module ActionDispatch::Journey::Path; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:8 +class ActionDispatch::Journey::Path::Pattern + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:11 + def initialize(ast, requirements, separators, anchored); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:163 + def =~(other); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:9 + def anchored; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:9 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:25 + def build_formatter; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:29 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:159 + def match(other); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:165 + def match?(other); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:9 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:62 + def optional_names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:58 + def required_names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:9 + def requirements; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:36 + def requirements_anchored?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:177 + def requirements_for_missing_keys_check; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:169 + def source; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:9 + def spec; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:173 + def to_regexp; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:188 + def offsets; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:184 + def regexp_visitor; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:68 +class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ::ActionDispatch::Journey::Visitors::Visitor + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:69 + def initialize(separator, matchers); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:76 + def accept(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:80 + def visit_CAT(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:100 + def visit_DOT(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:93 + def visit_GROUP(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:97 + def visit_LITERAL(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:111 + def visit_OR(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:102 + def visit_SLASH(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:106 + def visit_STAR(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:84 + def visit_SYMBOL(node); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:124 +class ActionDispatch::Journey::Path::Pattern::MatchData + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:127 + def initialize(names, offsets, match); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:141 + def [](x); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:133 + def captures; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:146 + def length; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:137 + def named_captures; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:125 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:150 + def post_match; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:154 + def to_s; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:117 +class ActionDispatch::Journey::Path::Pattern::UnanchoredRegexp < ::ActionDispatch::Journey::Path::Pattern::AnchoredRegexp + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:118 + def accept(node); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:8 +class ActionDispatch::Journey::Route + # +path+ is a path constraint. + # `constraints` is a hash of constraints to be applied to this route. + # + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:79 + def initialize(name:, path:, app: T.unsafe(nil), constraints: T.unsafe(nil), required_defaults: T.unsafe(nil), defaults: T.unsafe(nil), via: T.unsafe(nil), precedence: T.unsafe(nil), scope_options: T.unsafe(nil), internal: T.unsafe(nil), source_location: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:12 + def conditions; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:165 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:101 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:143 + def format(path_options); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:161 + def glob?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def internal; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:189 + def ip; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:169 + def matches?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:138 + def parts; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def precedence; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:151 + def required_default?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:155 + def required_defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:126 + def required_keys; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:147 + def required_parts; end + + # Needed for `bin/rails routes`. Picks up succinctly defined requirements for a + # route, for example route + # + # get 'photo/:id', :controller => 'photos', :action => 'show', + # :id => /[A-Z]\d{5}/ + # + # will have {:controller=>"photos", :action=>"show", :[id=>/](A-Z){5}/} as + # requirements. + # + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:116 + def requirements; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:193 + def requires_matching_verb?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def scope_options; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:130 + def score(supplied_keys); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:141 + def segment_keys; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:122 + def segments; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:9 + def source_location; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:197 + def verb; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:14 +module ActionDispatch::Journey::Route::VerbMatchers + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:65 + def for(verbs); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:36 +class ActionDispatch::Journey::Route::VerbMatchers::All + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:37 + def call(_); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:38 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::DELETE + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::GET + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::HEAD + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::LINK + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::OPTIONS + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:41 +class ActionDispatch::Journey::Route::VerbMatchers::Or + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:44 + def initialize(verbs); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:49 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:42 + def verb; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::PATCH + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::POST + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::PUT + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::TRACE + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 +class ActionDispatch::Journey::Route::VerbMatchers::UNLINK + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:17 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:26 +class ActionDispatch::Journey::Route::VerbMatchers::Unknown + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:29 + def initialize(verb); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:33 + def call(request); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:27 + def verb; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +ActionDispatch::Journey::Route::VerbMatchers::VERBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:54 +ActionDispatch::Journey::Route::VerbMatchers::VERB_TO_CLASS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:7 +class ActionDispatch::Journey::Router + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:19 + def initialize(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:23 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:43 + def recognize(req, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:17 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:17 + def routes=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:30 + def serve(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:107 + def custom_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:111 + def filter_routes(path); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:115 + def match_head_routes(routes, req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:103 + def simulator; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:8 +class ActionDispatch::Journey::Router::Utils + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:93 + def escape_fragment(fragment); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:85 + def escape_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:89 + def escape_segment(segment); end + + # Normalizes URI path. + # + # Strips off trailing slash and ensures there is a leading slash. Also converts + # downcase URL encoded string to uppercase. + # + # normalize_path("/foo") # => "/foo" + # normalize_path("/foo/") # => "/foo" + # normalize_path("foo") # => "/foo" + # normalize_path("") # => "/" + # normalize_path("/%ab") # => "/%AB" + # + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:19 + def normalize_path(path); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:83 +ActionDispatch::Journey::Router::Utils::ENCODER = T.let(T.unsafe(nil), ActionDispatch::Journey::Router::Utils::UriEncoder) + +# URI path and fragment escaping https://tools.ietf.org/html/rfc3986 +# +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:41 +class ActionDispatch::Journey::Router::Utils::UriEncoder + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:59 + def escape_fragment(fragment); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:63 + def escape_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:67 + def escape_segment(segment); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:72 + def escape(component, pattern); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:76 + def percent_encode(unsafe); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:48 +ActionDispatch::Journey::Router::Utils::UriEncoder::ALPHA = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:46 +ActionDispatch::Journey::Router::Utils::UriEncoder::DEC2HEX = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:49 +ActionDispatch::Journey::Router::Utils::UriEncoder::DIGIT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:45 +ActionDispatch::Journey::Router::Utils::UriEncoder::EMPTY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:42 +ActionDispatch::Journey::Router::Utils::UriEncoder::ENCODE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:53 +ActionDispatch::Journey::Router::Utils::UriEncoder::ESCAPED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:55 +ActionDispatch::Journey::Router::Utils::UriEncoder::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:57 +ActionDispatch::Journey::Router::Utils::UriEncoder::PATH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:56 +ActionDispatch::Journey::Router::Utils::UriEncoder::SEGMENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:51 +ActionDispatch::Journey::Router::Utils::UriEncoder::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:50 +ActionDispatch::Journey::Router::Utils::UriEncoder::UNRESERVED = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:43 +ActionDispatch::Journey::Router::Utils::UriEncoder::US_ASCII = T.let(T.unsafe(nil), Encoding) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:44 +ActionDispatch::Journey::Router::Utils::UriEncoder::UTF_8 = T.let(T.unsafe(nil), Encoding) + +# The Routing table. Contains all routes for a system. Routes can be added to +# the table by calling Routes#add_route. +# +# pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:9 +class ActionDispatch::Journey::Routes + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:14 + def initialize(routes = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:67 + def add_route(name, mapping); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:12 + def anchored_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:53 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:39 + def clear; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:12 + def custom_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:35 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:22 + def empty?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:31 + def last; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:26 + def length; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:45 + def partition_route(route); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:12 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:60 + def simulator; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:29 + def size; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:75 + def visualizer; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:83 + def clear_cache!; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:9 +class ActionDispatch::Journey::Scanner + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:28 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:48 + def last_literal; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:44 + def last_string; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:37 + def next_token; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:33 + def scan_setup(str); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:69 + def next_byte_is_not_a_token?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:55 + def scan; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:10 +ActionDispatch::Journey::Scanner::STATIC_TOKENS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:20 +class ActionDispatch::Journey::Scanner::Scanner < ::StringScanner; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:55 +module ActionDispatch::Journey::Visitors; end + +# private +# def binary(node, seed) +# visit(node.right, visit(node.left, seed)) +# end +# +# def nary(node, seed) +# last_child = node.children.last +# node.children.inject(seed) { |s, c| +# string = visit(c, s) +# string << "|" unless last_child == c +# string +# } +# end +# +# def terminal(node, seed) +# seed + node.left +# end +# +# def visit_GROUP(node, seed) +# visit(node.left, seed.dup << "(") << ")" +# end +# +# INSTANCE = new +# end +# +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:228 +class ActionDispatch::Journey::Visitors::Dot < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:229 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:234 + def accept(node, seed = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:249 + def binary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:256 + def nary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:288 + def terminal(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:263 + def unary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:273 + def visit_CAT(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:268 + def visit_GROUP(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:283 + def visit_OR(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:278 + def visit_STAR(node, seed); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:294 +ActionDispatch::Journey::Visitors::Dot::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Dot) + +# Loop through the requirements AST. +# +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:161 +class ActionDispatch::Journey::Visitors::Each < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:162 + def visit(node, block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:167 +ActionDispatch::Journey::Visitors::Each::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Each) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:136 +class ActionDispatch::Journey::Visitors::FormatBuilder < ::ActionDispatch::Journey::Visitors::Visitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:137 + def accept(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:140 + def binary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:138 + def terminal(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:144 + def visit_GROUP(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:146 + def visit_STAR(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:150 + def visit_SYMBOL(n); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:97 +class ActionDispatch::Journey::Visitors::FunctionalVisitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:100 + def accept(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:108 + def binary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:113 + def nary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:124 + def terminal(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:118 + def unary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:104 + def visit(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:111 + def visit_CAT(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:128 + def visit_DOT(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:121 + def visit_GROUP(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:125 + def visit_LITERAL(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:116 + def visit_OR(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:127 + def visit_SLASH(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:122 + def visit_STAR(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:126 + def visit_SYMBOL(n, seed); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:98 +ActionDispatch::Journey::Visitors::FunctionalVisitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:170 +class ActionDispatch::Journey::Visitors::String + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:171 + def accept(node, seed); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:199 +ActionDispatch::Journey::Visitors::String::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:56 +class ActionDispatch::Journey::Visitors::Visitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:59 + def accept(node); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:68 + def binary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:74 + def nary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:85 + def terminal(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:79 + def unary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:64 + def visit(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:72 + def visit_CAT(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:89 + def visit_DOT(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:82 + def visit_GROUP(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:86 + def visit_LITERAL(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:77 + def visit_OR(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:88 + def visit_SLASH(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:83 + def visit_STAR(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:87 + def visit_SYMBOL(n); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:57 +ActionDispatch::Journey::Visitors::Visitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:4 +class ActionDispatch::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def backtrace_cleaner=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def backtrace_cleaner?; end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:7 + def redirect(event); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def backtrace_cleaner=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def backtrace_cleaner?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def __class_attr_backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def __class_attr_backtrace_cleaner=(new_value); end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:25 + def __class_attr_log_levels; end + + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:25 + def __class_attr_log_levels=(new_value); end + end +end + +# # Action Dispatch MiddlewareStack +# +# Read more about [Rails middleware +# stack](https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack) +# in the guides. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:14 +class ActionDispatch::MiddlewareStack + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:76 + def initialize(*args); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:93 + def [](i); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:166 + def build(app = T.unsafe(nil), &block); end + + # Deletes a middleware from the middleware stack. + # + # Returns the array of middlewares not including the deleted item, or returns + # nil if the target is not found. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:131 + def delete(target); end + + # Deletes a middleware from the middleware stack. + # + # Returns the array of middlewares not including the deleted item, or raises + # `RuntimeError` if the target is not found. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:139 + def delete!(target); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:81 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:106 + def insert(index, klass, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:114 + def insert_after(index, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:112 + def insert_before(index, klass, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:89 + def last; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:74 + def middlewares; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:74 + def middlewares=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:143 + def move(target, source); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:153 + def move_after(target, source); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:151 + def move_before(target, source); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:85 + def size; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:120 + def swap(target, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:97 + def unshift(klass, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:161 + def use(klass, *args, **, &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:178 + def assert_index(index, where); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:184 + def build_middleware(klass, args, block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:188 + def index_of(klass); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:102 + def initialize_copy(other); end +end + +# This class is used to instrument the execution of a single middleware. It +# proxies the `call` method transparently and instruments the method call. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:54 +class ActionDispatch::MiddlewareStack::InstrumentationProxy + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:57 + def initialize(middleware, class_name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:65 + def call(env); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:55 +ActionDispatch::MiddlewareStack::InstrumentationProxy::EVENT_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:15 +class ActionDispatch::MiddlewareStack::Middleware + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:18 + def initialize(klass, args, block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:26 + def ==(middleware); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:16 + def args; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:16 + def block; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:43 + def build(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:47 + def build_instrumented(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:35 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:16 + def klass; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:24 + def name; end +end + +# pkg:gem/actionpack#lib/action_dispatch.rb:50 +class ActionDispatch::MissingController < ::NameError; end + +# pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:4 +class ActionDispatch::ParamBuilder + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:15 + def initialize(param_depth_limit); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:19 + def default; end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:19 + def default=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:62 + def from_hash(hash, encoding_template: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:46 + def from_pairs(pairs, encoding_template: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:42 + def from_query_string(qs, separator: T.unsafe(nil), encoding_template: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:13 + def param_depth_limit; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:163 + def make_params; end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:167 + def new_depth_limit(param_depth_limit); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:175 + def params_hash_has_key?(hash, key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:171 + def params_hash_type?(obj); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:77 + def store_nested_param(params, name, v, depth, encoding_template = T.unsafe(nil)); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:19 + def default; end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:19 + def default=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:23 + def from_hash(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:23 + def from_pairs(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:23 + def from_query_string(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:25 + def ignore_leading_brackets; end + + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:33 + def ignore_leading_brackets=(value); end + + # -- + # This implementation is based on Rack::QueryParser, + # Copyright (C) 2007-2021 Leah Neukirchen + # + # pkg:gem/actionpack#lib/action_dispatch/http/param_builder.rb:9 + def make_default(param_depth_limit); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/param_error.rb:4 +class ActionDispatch::ParamError < ::ActionDispatch::Http::Parameters::ParseError + # pkg:gem/actionpack#lib/action_dispatch/http/param_error.rb:5 + def initialize(message = T.unsafe(nil)); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/param_error.rb:9 + def ===(other); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/param_error.rb:18 +class ActionDispatch::ParameterTypeError < ::ActionDispatch::ParamError; end + +# pkg:gem/actionpack#lib/action_dispatch/http/param_error.rb:24 +class ActionDispatch::ParamsTooDeepError < ::ActionDispatch::ParamError; end + +# # Action Dispatch PermissionsPolicy +# +# Configures the HTTP +# [Feature-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy) +# response header to specify which browser features the current +# document and its iframes can use. +# +# Example global policy: +# +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end +# +# The Feature-Policy header has been renamed to Permissions-Policy. The +# Permissions-Policy requires a different implementation and isn't yet supported +# by all browsers. To avoid having to rename this middleware in the future we +# use the new name for the middleware but keep the old header name and +# implementation for now. +# +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:31 +class ActionDispatch::PermissionsPolicy + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:113 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def accelerometer(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def ambient_light_sensor(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def autoplay(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:132 + def build(context = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def camera(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:111 + def directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def display_capture(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def encrypted_media(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def fullscreen(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def geolocation(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def gyroscope(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def hid(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def idle_detection(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def keyboard_map(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def magnetometer(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def microphone(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def midi(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def payment(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def picture_in_picture(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def screen_wake_lock(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def serial(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def sync_xhr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def usb(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:123 + def web_share(*sources); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:150 + def apply_mapping(source); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:137 + def apply_mappings(sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:168 + def build_directive(sources, context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:156 + def build_directives(context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:118 + def initialize_copy(other); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:172 + def resolve_source(source, context); end +end + +# List of available permissions can be found at +# https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md#policy-controlled-features +# +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:84 +ActionDispatch::PermissionsPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:77 +ActionDispatch::PermissionsPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:32 +class ActionDispatch::PermissionsPolicy::Middleware + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:33 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:37 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:60 + def policy_empty?(policy); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:56 + def policy_present?(headers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:65 +module ActionDispatch::PermissionsPolicy::Request + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:68 + def permissions_policy; end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:72 + def permissions_policy=(policy); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:66 +ActionDispatch::PermissionsPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# # Action Dispatch PublicExceptions +# +# When called, this middleware renders an error page. By default if an HTML +# response is expected it will render static error pages from the `/public` +# directory. For example when this middleware receives a 500 response it will +# render the template found in `/public/500.html`. If an internationalized +# locale is set, this middleware will attempt to render the template in +# `/public/500..html`. If an internationalized template is not found it +# will fall back on `/public/500.html`. +# +# When a request with a content type other than HTML is made, this middleware +# will attempt to convert error information into the appropriate response type. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:18 +class ActionDispatch::PublicExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:21 + def initialize(public_path); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:25 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:19 + def public_path; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:19 + def public_path=(_arg0); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:39 + def render(status, content_type, body); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:48 + def render_format(status, content_type, body); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:53 + def render_html(status); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/query_parser.rb:7 +class ActionDispatch::QueryParser + class << self + # -- + # Note this departs from WHATWG's specified parsing algorithm by + # giving a nil value for keys that do not use '='. Callers that need + # the standard's interpretation can use `v.to_s`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/query_parser.rb:29 + def each_pair(s, separator = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/query_parser.rb:11 + def strict_query_string_separator; end + + # pkg:gem/actionpack#lib/action_dispatch/http/query_parser.rb:18 + def strict_query_string_separator=(value); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/query_parser.rb:9 +ActionDispatch::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/query_parser.rb:8 +ActionDispatch::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/railtie.rb:12 +class ActionDispatch::Railtie < ::Rails::Railtie; end + +# # Action Dispatch Reloader +# +# ActionDispatch::Reloader wraps the request with callbacks provided by +# ActiveSupport::Reloader, intended to assist with code reloading during +# development. +# +# ActionDispatch::Reloader is included in the middleware stack only if reloading +# is enabled, which it is by the default in `development` mode. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/reloader.rb:14 +class ActionDispatch::Reloader < ::ActionDispatch::Executor; end + +# # Action Dispatch RemoteIp +# +# This middleware calculates the IP address of the remote client that is making +# the request. It does this by checking various headers that could contain the +# address, and then picking the last-set address that is not on the list of +# trusted IPs. This follows the precedent set by e.g. [the Tomcat +# server](https://issues.apache.org/bugzilla/show_bug.cgi?id=50453). A more +# detailed explanation of the algorithm is given at GetIp#calculate_ip. +# +# Some Rack servers concatenate repeated headers, like [HTTP RFC +# 2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2) requires. +# Some Rack servers simply drop preceding headers, and only report the value +# that was [given in the last +# header](https://andre.arko.net/2011/12/26/repeated-headers-and-ruby-web-servers). +# If you are behind multiple proxy servers (like NGINX to HAProxy to +# Unicorn) then you should test your Rack server to make sure your data is good. +# +# IF YOU DON'T USE A PROXY, THIS MAKES YOU VULNERABLE TO IP SPOOFING. This +# middleware assumes that there is at least one proxy sitting around and setting +# headers with the client's remote IP address. If you don't use a proxy, because +# you are hosted on e.g. Heroku without SSL, any client can claim to have any IP +# address by setting the `X-Forwarded-For` header. If you care about that, then +# you need to explicitly drop or ignore those headers sometime before this +# middleware runs. Alternatively, remove this middleware to avoid inadvertently +# relying on it. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:33 +class ActionDispatch::RemoteIp + # Create a new `RemoteIp` middleware instance. + # + # The `ip_spoofing_check` option is on by default. When on, an exception is + # raised if it looks like the client is trying to lie about its own IP address. + # It makes sense to turn off this check on sites aimed at non-IP clients (like + # WAP devices), or behind proxies that set headers in an incorrect or confusing + # way (like AWS ELB). + # + # The `custom_proxies` argument can take an enumerable which will be used + # instead of `TRUSTED_PROXIES`. Any proxy setup will put the value you want in + # the middle (or at the beginning) of the `X-Forwarded-For` list, with your + # proxy servers after it. If your proxies aren't removed, pass them in via the + # `custom_proxies` parameter. That way, the middleware will ignore those IP + # addresses, and return the one that you want. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:67 + def initialize(app, ip_spoofing_check = T.unsafe(nil), custom_proxies = T.unsafe(nil)); end + + # Since the IP address may not be needed, we store the object here without + # calculating the IP to keep from slowing down the majority of requests. For + # those requests that do need to know the IP, the GetIp#calculate_ip method will + # calculate the memoized client IP address. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:95 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:51 + def check_ip; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:51 + def proxies; end +end + +# The GetIp class exists as a way to defer processing of the request data into +# an actual IP address. If the ActionDispatch::Request#remote_ip method is +# called, this class will calculate the value and then memoize it. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:104 +class ActionDispatch::RemoteIp::GetIp + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:105 + def initialize(req, check_ip, proxies); end + + # Sort through the various IP address headers, looking for the IP most likely to + # be the address of the actual remote client making this request. + # + # REMOTE_ADDR will be correct if the request is made directly against the Ruby + # process, on e.g. Heroku. When the request is proxied by another server like + # HAProxy or NGINX, the IP address that made the original request will be put in + # an `X-Forwarded-For` header. If there are multiple proxies, that header may + # contain a list of IPs. Other proxy services set the `Client-Ip` header + # instead, so we check that too. + # + # As discussed in [this post about Rails IP + # Spoofing](https://web.archive.org/web/20170626095448/https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/), + # while the first IP in the list is likely to be the "originating" IP, it + # could also have been set by the client maliciously. + # + # In order to find the first address that is (probably) accurate, we take the + # list of IPs, remove known and trusted proxies, and then take the last address + # left, which was presumably set by one of those proxies. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:129 + def calculate_ip; end + + # Memoizes the value returned by #calculate_ip and returns it for + # ActionDispatch::Request to use. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:174 + def to_s; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:197 + def filter_proxies(ips); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:179 + def ips_from(header); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:185 + def sanitize_ips(ips); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:34 +class ActionDispatch::RemoteIp::IpSpoofAttackError < ::StandardError; end + +# The default trusted IPs list simply includes IP addresses that are guaranteed +# by the IP specification to be private addresses. Those will not be the +# ultimate client IP in production, and so are discarded. See +# https://en.wikipedia.org/wiki/Private_network for details. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:40 +ActionDispatch::RemoteIp::TRUSTED_PROXIES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:20 +class ActionDispatch::Request + include ::ActionDispatch::Flash::RequestMethods + include ::Rack::Request::Helpers + include ::ActionDispatch::Http::Cache::Request + include ::ActionDispatch::Http::MimeNegotiation + include ::ActionDispatch::Http::Parameters + include ::ActionDispatch::Http::FilterParameters + include ::ActionDispatch::Http::URL + include ::ActionDispatch::ContentSecurityPolicy::Request + include ::Rack::Request::Env + include ::ActionDispatch::PermissionsPolicy::Request + include ::ActionDispatch::RequestCookieMethods + extend ::ActionDispatch::Http::Parameters::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:63 + def initialize(env); end + + # Override Rack's GET method to support indifferent access. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:400 + def GET; end + + # Override Rack's POST method to support indifferent access. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:413 + def POST; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def accept; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def accept_charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def accept_encoding; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def accept_language; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def auth_type; end + + # Returns the authorization header regardless of whether it was specified + # directly or through one of the proxy alternatives. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:465 + def authorization; end + + # The request body is an IO input stream. If the RAW_POST_DATA environment + # variable is already set, wrap it in a StringIO. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:362 + def body; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:382 + def body_stream; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def cache_control; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def client_ip; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:78 + def commit_cookie_jar!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:497 + def commit_csrf_token; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:486 + def commit_flash; end + + # Returns the content length of the request as an integer. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:297 + def content_length; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:87 + def controller_class; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:93 + def controller_class_for(name); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:195 + def controller_instance; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:199 + def controller_instance=(controller); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:181 + def engine_script_name(_routes); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:185 + def engine_script_name=(name); end + + # Determine whether the request body contains form-data by checking the request + # `Content-Type` for one of the media-types: `application/x-www-form-urlencoded` + # or `multipart/form-data`. The list of form-data media types can be modified + # through the `FORM_DATA_MEDIA_TYPES` array. + # + # A request body is not assumed to contain form-data when no `Content-Type` + # header is provided and the request_method is POST. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:378 + def form_data?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def from; end + + # Returns the `String` full path including params of the last URL requested. + # + # # get "/articles" + # request.fullpath # => "/articles" + # + # # get "/articles?page=2" + # request.fullpath # => "/articles?page=2" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:276 + def fullpath; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def gateway_interface; end + + # Provides access to the request's HTTP headers, for example: + # + # request.headers["Content-Type"] # => "text/plain" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:237 + def headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:203 + def http_auth_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:23 + def ignore_accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:23 + def ignore_accept_header=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:489 + def inspect; end + + # Returns the IP address of client as a `String`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:311 + def ip; end + + # Returns true if the request has a header matching the given key parameter. + # + # request.key? :ip_spoofing_check # => true + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:114 + def key?(key); end + + # True if the request came from localhost, 127.0.0.1, or ::1. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:473 + def local?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:482 + def logger; end + + # The `String` MIME type of the request. + # + # # get "/articles" + # request.media_type # => "application/x-www-form-urlencoded" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:292 + def media_type; end + + # Returns the original value of the environment's REQUEST_METHOD, even if it was + # overridden by middleware. See #request_method for more information. + # + # For debugging purposes, when called with arguments this method will fall back + # to Object#method + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:217 + def method(*args, **); end + + # Returns a symbol form of the #method. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:230 + def method_symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def negotiate; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def origin; end + + # Returns a `String` with the last requested path including their params. + # + # # get '/foo' + # request.original_fullpath # => '/foo' + # + # # get '/foo?bar' + # request.original_fullpath # => '/foo?bar' + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:265 + def original_fullpath; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def original_script_name; end + + # Returns the original request URL as a `String`. + # + # # get "/articles?page=2" + # request.original_url # => "http://www.example.com/articles?page=2" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:284 + def original_url; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def path_translated; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def pragma; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:410 + def query_parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:76 + def rack_request; end + + # Read the request body. This is useful for web services that need to work with + # raw requests directly. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:353 + def raw_post; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:144 + def raw_request_method; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def remote_addr; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def remote_host; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def remote_ident; end + + # Returns the IP address of client as a `String`, usually set by the RemoteIp + # middleware. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:317 + def remote_ip; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:321 + def remote_ip=(remote_ip); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def remote_user; end + + # Returns the unique request id, which is based on either the `X-Request-Id` + # header that can be generated by a firewall, load balancer, or web server, or + # by the RequestId middleware (which sets the `action_dispatch.request_id` + # environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of + # logging or debugging. This relies on the Rack variable set by the + # ActionDispatch::RequestId middleware. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:336 + def request_id; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:340 + def request_id=(id); end + + # Returns the HTTP method that the application should see. In the case where the + # method was overridden by a middleware (for instance, if a HEAD request was + # converted to a GET, or if a _method parameter was used to determine the method + # the application should use), this method returns the overridden value, not the + # original. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:151 + def request_method; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:189 + def request_method=(request_method); end + + # Returns a symbol form of the #request_method. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:208 + def request_method_symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:440 + def request_parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:477 + def request_parameters=(params); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:442 + def request_parameters_list; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:493 + def reset_csrf_token; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:386 + def reset_session; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:169 + def route=(route); end + + # Returns the URI pattern of the matched route for the request, using the same + # format as `bin/rails routes`: + # + # request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:159 + def route_uri_pattern; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:173 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:177 + def routes=(routes); end + + # Early Hints is an HTTP/2 status code that indicates hints to help a client + # start making preparations for processing the final response. + # + # If the env contains `rack.early_hints` then the server accepts HTTP2 push for + # link headers. + # + # The `send_early_hints` method accepts a hash of links as follows: + # + # send_early_hints("link" => "; rel=preload; as=style,; rel=preload") + # + # If you are using {javascript_include_tag}[rdoc-ref:ActionView::Helpers::AssetTagHelper#javascript_include_tag] + # or {stylesheet_link_tag}[rdoc-ref:ActionView::Helpers::AssetTagHelper#stylesheet_link_tag] + # the Early Hints headers are included by default if supported. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:254 + def send_early_hints(links); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def server_name; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def server_protocol; end + + # Returns the lowercase name of the HTTP server software. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:347 + def server_software; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:391 + def session=(session); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:395 + def session_options=(options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:344 + def uuid; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def version; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def x_csrf_token; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def x_forwarded_for; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def x_forwarded_host; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:49 + def x_request_id; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:308 + def xhr?; end + + # Returns true if the `X-Requested-With` header contains "XMLHttpRequest" + # (case-insensitive), which may need to be manually added depending on the + # choice of JavaScript libraries and frameworks. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:305 + def xml_http_request?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:502 + def check_method(name); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:510 + def default_session; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:540 + def fallback_request_parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:514 + def read_body_stream; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:526 + def reset_stream(body_stream); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:59 + def empty; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:23 + def ignore_accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:23 + def ignore_accept_header=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:24 + def parameter_parsers; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:326 +ActionDispatch::Request::ACTION_DISPATCH_REQUEST_ID = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:35 +ActionDispatch::Request::ENV_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:135 +ActionDispatch::Request::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:137 +ActionDispatch::Request::HTTP_METHOD_LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:33 +ActionDispatch::Request::LOCALHOST = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:81 +class ActionDispatch::Request::PASS_NOT_FOUND + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:82 + def action(_); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:84 + def action_encoding_template(action); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:83 + def call(_); end + end +end + +# HTTP methods from [RFC 2518: HTTP Extensions for Distributed Authoring -- WEBDAV](https://www.ietf.org/rfc/rfc2518.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:121 +ActionDispatch::Request::RFC2518 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1](https://www.ietf.org/rfc/rfc2616.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:119 +ActionDispatch::Request::RFC2616 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3253: Versioning Extensions to WebDAV](https://www.ietf.org/rfc/rfc3253.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:123 +ActionDispatch::Request::RFC3253 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3648: WebDAV Ordered Collections Protocol](https://www.ietf.org/rfc/rfc3648.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:125 +ActionDispatch::Request::RFC3648 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3744: WebDAV Access Control Protocol](https://www.ietf.org/rfc/rfc3744.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:127 +ActionDispatch::Request::RFC3744 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 4791: Calendaring Extensions to WebDAV](https://www.ietf.org/rfc/rfc4791.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:131 +ActionDispatch::Request::RFC4791 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 5323: WebDAV SEARCH](https://www.ietf.org/rfc/rfc5323.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:129 +ActionDispatch::Request::RFC5323 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 5789: PATCH Method for HTTP](https://www.ietf.org/rfc/rfc5789.txt) +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:133 +ActionDispatch::Request::RFC5789 = T.let(T.unsafe(nil), Array) + +# Session is responsible for lazily loading the session from store. +# +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:10 +class ActionDispatch::Request::Session + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:76 + def initialize(by, req, enabled: T.unsafe(nil)); end + + # Returns value of the key stored in the session or `nil` if the given key is + # not found in the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:114 + def [](key); end + + # Writes given value to given key of the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:154 + def []=(key, value); end + + # Clears the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:161 + def clear; end + + # Deletes given key from the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:194 + def delete(key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:99 + def destroy; end + + # Returns the nested value specified by the sequence of keys, returning `nil` if + # any intermediate step is `nil`. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:127 + def dig(*keys); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:245 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:240 + def empty?; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:91 + def enabled?; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:230 + def exists?; end + + # Returns value of the given key from the session, or raises `KeyError` if can't + # find the given key and no default value is set. Returns default value if + # specified. + # + # session.fetch(:foo) + # # => KeyError: key not found: "foo" + # + # session.fetch(:foo, :bar) + # # => :bar + # + # session.fetch(:foo) do + # :bar + # end + # # => :bar + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:213 + def fetch(key, default = T.unsafe(nil), &block); end + + # Returns true if the session has the given key or false. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:134 + def has_key?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:87 + def id; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:249 + def id_was; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:139 + def include?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:222 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:138 + def key?(key); end + + # Returns keys of the session as Array. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:142 + def keys; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:236 + def loaded?; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:191 + def merge!(hash); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:95 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:158 + def store(key, value); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:171 + def to_h; end + + # Returns the session as Hash. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:167 + def to_hash; end + + # Updates the session with given Hash. + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} + # + # session.update({ "foo" => "bar" }) + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:183 + def update(hash); end + + # Returns values of the session as Array. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:148 + def values; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:271 + def load!; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:267 + def load_for_delete!; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:255 + def load_for_read!; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:259 + def load_for_write!; end + + class << self + # Creates a session hash, merging the properties of the previous session if any. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:19 + def create(store, req, default_options); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:43 + def delete(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:29 + def disabled(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:35 + def find(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:39 + def set(req, session); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:11 +class ActionDispatch::Request::Session::DisabledSessionError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:12 +ActionDispatch::Request::Session::ENV_SESSION_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:13 +ActionDispatch::Request::Session::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:47 +class ActionDispatch::Request::Session::Options + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:56 + def initialize(by, default_options); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:61 + def [](key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:71 + def []=(k, v); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:65 + def id(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:72 + def to_hash; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:73 + def values_at(*args); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:52 + def find(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:48 + def set(req, options); end + end +end + +# Singleton object used to determine if an optional param wasn't specified. +# +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:16 +ActionDispatch::Request::Session::Unspecified = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:57 +ActionDispatch::Request::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:9 +class ActionDispatch::Request::Utils + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:10 + def perform_deep_munge; end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:10 + def perform_deep_munge=(val); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:31 + def check_param_encoding(params); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:12 + def each_param_value(params, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:23 + def normalize_encode_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:10 + def perform_deep_munge; end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:10 + def perform_deep_munge=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:46 + def set_binary_encoding(request, params, controller, action); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:85 +class ActionDispatch::Request::Utils::CustomParamEncoder + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:106 + def action_encoding_template(request, controller, action); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:101 + def encode(request, params, controller, action); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:86 + def encode_for_template(params, encoding_template); end + end +end + +# Remove nils from the params hash. +# +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:77 +class ActionDispatch::Request::Utils::NoNilParamEncoder < ::ActionDispatch::Request::Utils::ParamEncoder + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:78 + def handle_array(params); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:50 +class ActionDispatch::Request::Utils::ParamEncoder + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:71 + def handle_array(params); end + + # Convert nested Hash to HashWithIndifferentAccess. + # + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:52 + def normalize_encode_params(params); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:12 +module ActionDispatch::RequestCookieMethods + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:50 + def authenticated_encrypted_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:13 + def cookie_jar; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:30 + def cookie_jar=(jar); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:78 + def cookies_digest; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:82 + def cookies_rotations; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:74 + def cookies_same_site_protection; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:70 + def cookies_serializer; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:58 + def encrypted_cookie_cipher; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:42 + def encrypted_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:46 + def encrypted_signed_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:26 + def have_cookie_jar?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:34 + def key_generator; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:66 + def secret_key_base; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:62 + def signed_cookie_digest; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:38 + def signed_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:54 + def use_authenticated_cookie_encryption; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:86 + def use_cookies_with_metadata; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:9 +class ActionDispatch::RequestEncoder + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:21 + def initialize(mime_name, param_encoder, response_parser, content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:34 + def accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:19 + def content_type; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:38 + def encode_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:19 + def response_parser; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:47 + def encoder(name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:42 + def parser(content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:51 + def register_encoder(mime_name, param_encoder: T.unsafe(nil), response_parser: T.unsafe(nil), content_type: T.unsafe(nil)); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:10 +class ActionDispatch::RequestEncoder::IdentityEncoder + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:12 + def accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:11 + def content_type; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:13 + def encode_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:14 + def response_parser; end +end + +# # Action Dispatch RequestId +# +# Makes a unique request id available to the `action_dispatch.request_id` env +# variable (which is then accessible through ActionDispatch::Request#request_id +# or the alias ActionDispatch::Request#uuid) and sends the same id to the client +# via the `X-Request-Id` header. +# +# The unique request id is either based on the `X-Request-Id` header in the +# request, which would typically be generated by a firewall, load balancer, or +# the web server, or, if this header is not available, a random uuid. If the +# header is accepted from the outside world, we sanitize it to a max of 255 +# chars and alphanumeric and dashes only. +# +# The unique request id can be used to trace a request end-to-end and would +# typically end up being part of log files from multiple pieces of the stack. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:24 +class ActionDispatch::RequestId + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:25 + def initialize(app, header:); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:31 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:46 + def internal_request_id; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:38 + def make_request_id(request_id); end +end + +# # Action Dispatch Response +# +# Represents an HTTP response generated by a controller action. Use it to +# retrieve the current state of the response, or customize the response. It can +# either represent a real HTTP response (i.e. one that is meant to be sent back +# to the web browser) or a TestResponse (i.e. one that is generated from +# integration tests). +# +# The Response object for the current request is exposed on controllers as +# ActionController::Metal#response. ActionController::Metal also provides a few +# additional methods that delegate to attributes of the Response such as +# ActionController::Metal#headers. +# +# Integration tests will likely also want to inspect responses in more detail. +# Methods such as Integration::RequestHelpers#get and +# Integration::RequestHelpers#post return instances of TestResponse (which +# inherits from Response) for this purpose. +# +# For example, the following demo integration test prints the body of the +# controller response to the console: +# +# class DemoControllerTest < ActionDispatch::IntegrationTest +# def test_print_root_path_to_console +# get('/') +# puts response.body +# end +# end +# +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:38 +class ActionDispatch::Response + include ::Rack::Response::Helpers + include ::ActionDispatch::Http::FilterRedirect + include ::ActionDispatch::Http::Cache::Response + include ::MonitorMixin + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:198 + def initialize(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:89 + def [](*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:89 + def []=(*, **, &); end + + # Aliasing these off because AD::Http::Cache::Response defines them. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:107 + def _cache_control; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:108 + def _cache_control=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:447 + def abort; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:224 + def await_commit; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:230 + def await_sent; end + + # Returns the content of the response as a string. This contains the contents of + # any calls to `render`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:370 + def body; end + + # Allows you to manually set or override the response body. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:385 + def body=(body); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:434 + def body_parts; end + + # The charset of the response. HTML wants to know the encoding of the content + # you're giving them, so we need to send that along. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:340 + def charset; end + + # Sets the HTTP character set. In case of `nil` parameter it sets the charset to + # `default_charset`. + # + # response.charset = 'utf-16' # => 'utf-16' + # response.charset = nil # => 'utf-8' + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:329 + def charset=(charset); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:443 + def close; end + + # Returns a string to ensure compatibility with `Net::HTTPResponse`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:351 + def code; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:234 + def commit!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:258 + def committed?; end + + # Content type of response. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:309 + def content_type; end + + # Sets the HTTP response's content MIME type. For example, in the controller you + # could write this: + # + # response.content_type = "text/html" + # + # This method also accepts a symbol with the extension of the MIME type: + # + # response.content_type = :html + # + # If a character set has been defined for this response (see #charset=) then the + # character set information will also be included in the content type + # information. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:290 + def content_type=(content_type); end + + # Returns the response cookies, converted to a Hash of (name => value) pairs + # + # assert_equal 'AuthorOfNewPage', r.cookies['author'] + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:470 + def cookies; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:102 + def default_charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:102 + def default_charset=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:103 + def default_headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:103 + def default_headers=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:222 + def delete_header(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:91 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:220 + def get_header(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:219 + def has_header?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:87 + def header; end + + # The headers for the response. + # + # header["Content-Type"] # => "text/plain" + # header["Content-Type"] = "application/json" + # header["Content-Type"] # => "application/json" + # + # Also aliased as `headers`. + # + # headers["Content-Type"] # => "text/plain" + # headers["Content-Type"] = "application/json" + # headers["Content-Type"] # => "application/json" + # + # Also aliased as `header` for compatibility. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:85 + def headers; end + + # Media type of response. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:314 + def media_type; end + + # Returns the corresponding message for the current HTTP status code: + # + # response.status = 200 + # response.message # => "OK" + # + # response.status = 404 + # response.message # => "Not Found" + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:363 + def message; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:465 + def prepare!; end + + # The location header we'll be responding with. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:441 + def redirect_url; end + + # The request that the response is responding to. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:67 + def request; end + + # The request that the response is responding to. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:67 + def request=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:430 + def reset_body!; end + + # The response code of the request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:346 + def response_code; end + + # Send the file stored at `path` as the response body. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:425 + def send_file(path); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:242 + def sending!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:257 + def sending?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:318 + def sending_file=(v); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:250 + def sent!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:259 + def sent?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:221 + def set_header(key, v); end + + # The HTTP status code. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:70 + def status; end + + # Sets the HTTP status code. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:274 + def status=(status); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:366 + def status_message; end + + # The underlying body, as a streamable object. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:196 + def stream; end + + # Turns the Response into a Rack-compatible array of the status, headers, and + # body. Allows explicit splatting: + # + # status, headers, body = *response + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:461 + def to_a; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:380 + def write(string); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:536 + def assign_default_content_type_and_charset!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:514 + def before_committed; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:522 + def before_sending; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:532 + def build_buffer(response, body); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:588 + def handle_no_content!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:494 + def parse_content_type(content_type); end + + # Small internal convenience method to get the parsed version of the current + # content type header. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:504 + def parsed_content_type_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:595 + def rack_response(status, headers); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:508 + def set_content_type(content_type, charset); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:186 + def create(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil), default_headers: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:102 + def default_charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:102 + def default_charset=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:103 + def default_headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:103 + def default_headers=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:191 + def merge_default_headers(original, default); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:51 + def rack_status_code(status); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:114 +class ActionDispatch::Response::Buffer + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:115 + def initialize(response, buf); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:156 + def <<(string); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:168 + def abort; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:140 + def body; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:171 + def close; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:176 + def closed?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:158 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:124 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:132 + def to_ary; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:148 + def write(string); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:181 + def each_chunk(&block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:122 +ActionDispatch::Response::Buffer::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:98 +ActionDispatch::Response::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:488 +ActionDispatch::Response::CONTENT_TYPE_PARSER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 +class ActionDispatch::Response::ContentTypeHeader < ::Struct + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def charset=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def mime_type; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def mime_type=(_); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def [](*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def keyword_init?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def members; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 + def new(*_arg0); end + end +end + +# Avoid having to pass an open file handle as the response body. Rack::Sendfile +# will usually intercept the response and uses the path directly, so there is no +# reason to open the file. +# +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:403 +class ActionDispatch::Response::FileBody + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:406 + def initialize(path); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:410 + def body; end + + # Stream the file's contents if Rack::Sendfile isn't present. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:415 + def each; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:404 + def to_path; end +end + +# To be deprecated: +# +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:64 +ActionDispatch::Response::Header = Rack::Headers + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:42 +ActionDispatch::Response::Headers = Rack::Headers + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:100 +ActionDispatch::Response::NO_CONTENT_CODES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:486 +ActionDispatch::Response::NullContentTypeHeader = T.let(T.unsafe(nil), ActionDispatch::Response::ContentTypeHeader) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:544 +class ActionDispatch::Response::RackBody + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:545 + def initialize(response); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:557 + def body; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:579 + def call(*arguments, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:551 + def close; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:575 + def each(*args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:563 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:549 + def response; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:571 + def to_ary; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:583 + def to_path; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:561 +ActionDispatch::Response::RackBody::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:99 +ActionDispatch::Response::SET_COOKIE = T.let(T.unsafe(nil), String) + +# The routing module provides URL rewriting in native Ruby. It's a way to +# redirect incoming requests to controllers and actions. This replaces +# mod_rewrite rules. Best of all, Rails' Routing works with any web server. +# Routes are defined in `config/routes.rb`. +# +# Think of creating routes as drawing a map for your requests. The map tells +# them where to go based on some predefined pattern: +# +# Rails.application.routes.draw do +# Pattern 1 tells some request to go to one place +# Pattern 2 tell them to go to another +# ... +# end +# +# The following symbols are special: +# +# :controller maps to your controller name +# :action maps to an action with your controllers +# +# Other names simply map to a parameter as in the case of `:id`. +# +# ## Resources +# +# Resource routing allows you to quickly declare all of the common routes for a +# given resourceful controller. Instead of declaring separate routes for your +# `index`, `show`, `new`, `edit`, `create`, `update`, and `destroy` actions, a +# resourceful route declares them in a single line of code: +# +# resources :photos +# +# Sometimes, you have a resource that clients always look up without referencing +# an ID. A common example, /profile always shows the profile of the currently +# logged in user. In this case, you can use a singular resource to map /profile +# (rather than /profile/:id) to the show action. +# +# resource :profile +# +# It's common to have resources that are logically children of other resources: +# +# resources :magazines do +# resources :ads +# end +# +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# Alternatively, you can add prefixes to your path without using a separate +# directory by using `scope`. `scope` takes additional options which apply to +# all enclosed routes. +# +# scope path: "/cpanel", as: 'admin' do +# resources :posts, :comments +# end +# +# For more, see Routing::Mapper::Resources#resources, +# Routing::Mapper::Scoping#namespace, and Routing::Mapper::Scoping#scope. +# +# ## Non-resourceful routes +# +# For routes that don't fit the `resources` mold, you can use the HTTP helper +# methods `get`, `post`, `patch`, `put` and `delete`. +# +# get 'post/:id', to: 'posts#show' +# post 'post/:id', to: 'posts#create_comment' +# +# Now, if you POST to `/posts/:id`, it will route to the `create_comment` +# action. A GET on the same URL will route to the `show` action. +# +# If your route needs to respond to more than one HTTP method (or all methods) +# then using the `:via` option on `match` is preferable. +# +# match 'post/:id', to: 'posts#show', via: [:get, :post] +# +# ## Named routes +# +# Routes can be named by passing an `:as` option, allowing for easy reference +# within your source as `name_of_route_url` for the full URL and +# `name_of_route_path` for the URI path. +# +# Example: +# +# # In config/routes.rb +# get '/login', to: 'accounts#login', as: 'login' +# +# # With render, redirect_to, tests, etc. +# redirect_to login_url +# +# Arguments can be passed as well. +# +# redirect_to show_item_path(id: 25) +# +# Use `root` as a shorthand to name a route for the root path "/". +# +# # In config/routes.rb +# root to: 'blogs#index' +# +# # would recognize http://www.example.com/ as +# params = { controller: 'blogs', action: 'index' } +# +# # and provide these named routes +# root_url # => 'http://www.example.com/' +# root_path # => '/' +# +# Note: when using `controller`, the route is simply named after the method you +# call on the block parameter rather than map. +# +# # In config/routes.rb +# controller :blog do +# get 'blog/show' => :list +# get 'blog/delete' => :delete +# get 'blog/edit' => :edit +# end +# +# # provides named routes for show, delete, and edit +# link_to @article.title, blog_show_path(id: @article.id) +# +# ## Pretty URLs +# +# Routes can generate pretty URLs. For example: +# +# get '/articles/:year/:month/:day', to: 'articles#find_by_id', constraints: { +# year: /\d{4}/, +# month: /\d{1,2}/, +# day: /\d{1,2}/ +# } +# +# Using the route above, the URL "http://localhost:3000/articles/2005/11/06" +# maps to +# +# params = {year: '2005', month: '11', day: '06'} +# +# ## Regular Expressions and parameters +# You can specify a regular expression to define a format for a parameter. +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /\d{5}(-\d{4})?/ +# } +# end +# +# Constraints can include the 'ignorecase' and 'extended syntax' regular +# expression modifiers: +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /hx\d\d\s\d[a-z]{2}/i +# } +# end +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /# Postalcode format +# \d{5} #Prefix +# (-\d{4})? #Suffix +# /x +# } +# end +# +# Using the multiline modifier will raise an `ArgumentError`. Encoding regular +# expression modifiers are silently ignored. The match will always use the +# default encoding or ASCII. +# +# ## External redirects +# +# You can redirect any path to another path using the redirect helper in your +# router: +# +# get "/stories", to: redirect("/posts") +# +# ## Unicode character routes +# +# You can specify unicode character routes in your router: +# +# get "こんにちは", to: "welcome#index" +# +# ## Routing to Rack Applications +# +# Instead of a String, like `posts#index`, which corresponds to the index action +# in the PostsController, you can specify any Rack application as the endpoint +# for a matcher: +# +# get "/application.js", to: Sprockets +# +# ## Reloading routes +# +# You can reload routes if you feel you must: +# +# Rails.application.reload_routes! +# +# This will clear all named routes and reload config/routes.rb if the file has +# been modified from last load. To absolutely force reloading, use `reload!`. +# +# ## Testing Routes +# +# The two main methods for testing your routes: +# +# ### `assert_routing` +# +# def test_movie_route_properly_splits +# opts = {controller: "plugin", action: "checkout", id: "2"} +# assert_routing "plugin/checkout/2", opts +# end +# +# `assert_routing` lets you test whether or not the route properly resolves into +# options. +# +# ### `assert_recognizes` +# +# def test_route_has_options +# opts = {controller: "plugin", action: "show", id: "12"} +# assert_recognizes opts, "/plugins/show/12" +# end +# +# Note the subtle difference between the two: `assert_routing` tests that a URL +# fits options while `assert_recognizes` tests that a URL breaks into parameters +# properly. +# +# In tests you can simply pass the URL or named route to `get` or `post`. +# +# def send_to_jail +# get '/jail' +# assert_response :success +# end +# +# def goes_to_login +# get login_url +# #... +# end +# +# ## View a list of all your routes +# +# $ bin/rails routes +# +# Target a specific controller with `-c`, or grep routes using `-g`. Useful in +# conjunction with `--expanded` which displays routes vertically. +# +# pkg:gem/actionpack#lib/action_dispatch/routing.rb:248 +module ActionDispatch::Routing + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:158 +module ActionDispatch::Routing::ConsoleFormatter; end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:159 +class ActionDispatch::Routing::ConsoleFormatter::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:160 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:177 + def footer(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:174 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:180 + def no_routes(engine, routes, filter); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:164 + def result; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:171 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:168 + def section_title(title); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:244 +class ActionDispatch::Routing::ConsoleFormatter::Expanded < ::ActionDispatch::Routing::ConsoleFormatter::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:245 + def initialize(width: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:258 + def footer(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:254 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:250 + def section_title(title); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:263 + def draw_expanded_section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:278 + def route_header(index:); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:204 +class ActionDispatch::Routing::ConsoleFormatter::Sheet < ::ActionDispatch::Routing::ConsoleFormatter::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:217 + def footer(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:213 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:209 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:205 + def section_title(title); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:231 + def draw_header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:222 + def draw_section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:237 + def widths(routes); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:283 +class ActionDispatch::Routing::ConsoleFormatter::Unused < ::ActionDispatch::Routing::ConsoleFormatter::Sheet + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:284 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:292 + def no_routes(engine, routes, filter); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:7 +class ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:11 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:8 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:14 + def engine?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:10 + def matches?(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:12 + def rack_app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:9 + def redirect?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing.rb:260 +ActionDispatch::Routing::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:305 +class ActionDispatch::Routing::HtmlTableFormatter + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:306 + def initialize(view); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:323 + def footer(routes); end + + # The header is part of the HTML page, so we don't construct it here. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:320 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:326 + def no_routes(*); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:339 + def result; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:315 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:311 + def section_title(title); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:14 +class ActionDispatch::Routing::Mapper + include ::ActionDispatch::Routing::Mapper::Base + include ::ActionDispatch::Routing::Mapper::HttpHelpers + include ::ActionDispatch::Routing::Redirection + include ::ActionDispatch::Routing::Mapper::Scoping + include ::ActionDispatch::Routing::Mapper::Concerns + include ::ActionDispatch::Routing::Mapper::Resources + include ::ActionDispatch::Routing::Mapper::CustomUrls + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2530 + def initialize(set); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:27 + def backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:27 + def backtrace_cleaner=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:407 + def normalize_name(name); end + + # Invokes Journey::Router::Utils.normalize_path, then ensures that /(:locale) + # becomes (/:locale). Except for root cases, where the former is the correct + # one. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:392 + def normalize_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:26 + def route_source_locations; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:26 + def route_source_locations=(val); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:15 +class ActionDispatch::Routing::Mapper::BacktraceCleaner < ::ActiveSupport::BacktraceCleaner + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:16 + def initialize; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:411 +module ActionDispatch::Routing::Mapper::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:653 + def default_url_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:650 + def default_url_options=(options); end + + # Query if the following named route was already defined. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:662 + def has_named_route?(name); end + + # Matches a URL pattern to one or more routes. + # + # You should not use the `match` method in your router without specifying an + # HTTP method. + # + # If you want to expose your action to both GET and POST, use: + # + # # sets :controller, :action, and :id in params + # match ':controller/:action/:id', via: [:get, :post] + # + # Note that `:controller`, `:action`, and `:id` are interpreted as URL query + # parameters and thus available through `params` in an action. + # + # If you want to expose your action to GET, use `get` in the router: + # + # Instead of: + # + # match ":controller/:action/:id" + # + # Do: + # + # get ":controller/:action/:id" + # + # Two of these symbols are special, `:controller` maps to the controller and + # `:action` to the controller's action. A pattern can also map wildcard segments + # (globs) to params: + # + # get 'songs/*category/:title', to: 'songs#show' + # + # # 'songs/rock/classic/stairway-to-heaven' sets + # # params[:category] = 'rock/classic' + # # params[:title] = 'stairway-to-heaven' + # + # To match a wildcard parameter, it must have a name assigned to it. Without a + # variable name to attach the glob parameter to, the route can't be parsed. + # + # When a pattern points to an internal route, the route's `:action` and + # `:controller` should be set in options or hash shorthand. Examples: + # + # match 'photos/:id', to: 'photos#show', via: :get + # match 'photos/:id', controller: 'photos', action: 'show', via: :get + # + # A pattern can also point to a `Rack` endpoint i.e. anything that responds to + # `call`: + # + # match 'photos/:id', to: -> (hash) { [200, {}, ["Coming soon"]] }, via: :get + # match 'photos/:id', to: PhotoRackApp, via: :get + # # Yes, controller actions are just rack endpoints + # match 'photos/:id', to: PhotosController.action(:show), via: :get + # + # Because requesting various HTTP verbs with a single action has security + # implications, you must either specify the actions in the via options or use + # one of the [HttpHelpers](rdoc-ref:HttpHelpers) instead `match` + # + # ### Options + # + # Any options not seen here are passed on as params with the URL. + # + # :controller + # + # :action + # + # :param + # segment used to generate the routes). You can access that segment from + # your controller using `params[<:param>]`. In your router: + # + # resources :users, param: :name + # + # The `users` resource here will have the following routes generated for it: + # + # GET /users(.:format) + # POST /users(.:format) + # GET /users/new(.:format) + # GET /users/:name/edit(.:format) + # GET /users/:name(.:format) + # PATCH/PUT /users/:name(.:format) + # DELETE /users/:name(.:format) + # + # You can override `ActiveRecord::Base#to_param` of a related model to + # construct a URL: + # + # class User < ActiveRecord::Base + # def to_param + # name + # end + # end + # + # user = User.find_by(name: 'Phusion') + # user_path(user) # => "/users/Phusion" + # + # :path + # + # :module + # + # match 'path', to: 'c#a', module: 'sekret', controller: 'posts', via: :get + # # => Sekret::PostsController + # + # See `Scoping#namespace` for its scope equivalent. + # + # :as + # + # :via + # + # match 'path', to: 'c#a', via: :get + # match 'path', to: 'c#a', via: [:get, :post] + # match 'path', to: 'c#a', via: :all + # + # :to + # string representing a controller's action. + # + # match 'path', to: 'controller#action', via: :get + # match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get + # match 'path', to: RackApp, via: :get + # + # :on + # are `:member`, `:collection`, and `:new`. Only use within `resource(s)` + # block. For example: + # + # resource :bar do + # match 'foo', to: 'c#a', on: :member, via: [:get, :post] + # end + # + # Is equivalent to: + # + # resource :bar do + # member do + # match 'foo', to: 'c#a', via: [:get, :post] + # end + # end + # + # :constraints + # responds to `matches?`. In addition, constraints other than path can also + # be specified with any object that responds to `===` (e.g. String, Array, + # Range, etc.). + # + # match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }, via: :get + # + # match 'json_only', constraints: { format: 'json' }, via: :get + # + # class PermitList + # def matches?(request) request.remote_ip == '1.2.3.4' end + # end + # match 'path', to: 'c#a', constraints: PermitList.new, via: :get + # + # See `Scoping#constraints` for more examples with its scope equivalent. + # + # :defaults + # + # # Sets params[:format] to 'jpg' by default + # match 'path', to: 'c#a', defaults: { format: 'jpg' }, via: :get + # + # See `Scoping#defaults` for its scope equivalent. + # + # :anchor + # the pattern matches any request prefixed with the given path. + # + # # Matches any request starting with 'path' + # match 'path', to: 'c#a', anchor: false, via: :get + # + # :format + # disable it by supplying `false`. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:587 + def match(path, options = T.unsafe(nil)); end + + # Mount a Rack-based application to be used within the application. + # + # mount SomeRackApp, at: "some_route" + # + # For options, see `match`, as `mount` uses it internally. + # + # All mounted applications come with routing helpers to access them. These are + # named after the class specified, so for the above example the helper is either + # `some_rack_app_path` or `some_rack_app_url`. To customize this helper's name, + # use the `:as` option: + # + # mount(SomeRackApp, at: "some_route", as: "exciting") + # + # This will generate the `exciting_path` and `exciting_url` helpers which can be + # used to navigate to this mounted app. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:605 + def mount(app = T.unsafe(nil), deprecated_options = T.unsafe(nil), as: T.unsafe(nil), via: T.unsafe(nil), at: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:655 + def with_default_scope(scope, &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:689 + def app_name(app, rails_app); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:667 + def assign_deprecated_option(deprecated_options, key, method_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:676 + def assign_deprecated_options(deprecated_options, options, method_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:698 + def define_generate_prefix(app, name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:685 + def rails_app?(app); end +end + +# Routing Concerns allow you to declare common routes that can be reused inside +# others resources and routes. +# +# concern :commentable do +# resources :comments +# end +# +# concern :image_attachable do +# resources :images, only: :index +# end +# +# These concerns are used in Resources routing: +# +# resources :messages, concerns: [:commentable, :image_attachable] +# +# or in a scope or namespace: +# +# namespace :posts do +# concerns :commentable +# end +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2242 +module ActionDispatch::Routing::Mapper::Concerns + # Define a routing concern using a name. + # + # Concerns may be defined inline, using a block, or handled by another object, + # by passing that object as the second parameter. + # + # The concern object, if supplied, should respond to `call`, which will receive + # two parameters: + # + # * The current mapper + # * A hash of options which the concern object may use + # + # Options may also be used by concerns defined in a block by accepting a block + # parameter. So, using a block, you might do something as simple as limit the + # actions available on certain resources, passing standard resource options + # through the concern: + # + # concern :commentable do |options| + # resources :comments, options + # end + # + # resources :posts, concerns: :commentable + # resources :archived_posts do + # # Don't allow comments on archived posts + # concerns :commentable, only: [:index, :show] + # end + # + # Or, using a callable object, you might implement something more specific to + # your application, which would be out of place in your routes file. + # + # # purchasable.rb + # class Purchasable + # def initialize(defaults = {}) + # @defaults = defaults + # end + # + # def call(mapper, options = {}) + # options = @defaults.merge(options) + # mapper.resources :purchases + # mapper.resources :receipts + # mapper.resources :returns if options[:returnable] + # end + # end + # + # # routes.rb + # concern :purchasable, Purchasable.new(returnable: true) + # + # resources :toys, concerns: :purchasable + # resources :electronics, concerns: :purchasable + # resources :pets do + # concerns :purchasable, returnable: false + # end + # + # Any routing helpers can be used inside a concern. If using a callable, they're + # accessible from the Mapper that's passed to `call`. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2297 + def concern(name, callable = T.unsafe(nil), &block); end + + # Use the named concerns + # + # resources :posts do + # concerns :commentable + # end + # + # Concerns also work in any routes helper that you want to use: + # + # namespace :posts do + # concerns :commentable + # end + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2313 + def concerns(*args, **options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:29 +class ActionDispatch::Routing::Mapper::Constraints < ::ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:35 + def initialize(app, constraints, strategy); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:30 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:30 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:50 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:52 + def matches?(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:59 + def serve(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:66 + def constraint_args(constraint, request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:33 +ActionDispatch::Routing::Mapper::Constraints::CALL = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:32 +ActionDispatch::Routing::Mapper::Constraints::SERVE = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2324 +module ActionDispatch::Routing::Mapper::CustomUrls + # Define custom URL helpers that will be added to the application's routes. This + # allows you to override and/or replace the default behavior of routing helpers, + # e.g: + # + # direct :homepage do + # "https://rubyonrails.org" + # end + # + # direct :commentable do |model| + # [ model, anchor: model.dom_id ] + # end + # + # direct :main do + # { controller: "pages", action: "index", subdomain: "www" } + # end + # + # The return value from the block passed to `direct` must be a valid set of + # arguments for `url_for` which will actually build the URL string. This can be + # one of the following: + # + # * A string, which is treated as a generated URL + # * A hash, e.g. `{ controller: "pages", action: "index" }` + # * An array, which is passed to `polymorphic_url` + # * An Active Model instance + # * An Active Model class + # + # + # NOTE: Other URL helpers can be called in the block but be careful not to + # invoke your custom URL helper again otherwise it will result in a stack + # overflow error. + # + # You can also specify default options that will be passed through to your URL + # helper definition, e.g: + # + # direct :browse, page: 1, size: 10 do |options| + # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] + # end + # + # In this instance the `params` object comes from the context in which the block + # is executed, e.g. generating a URL inside a controller action or a view. If + # the block is executed where there isn't a `params` object such as this: + # + # Rails.application.routes.url_helpers.browse_path + # + # then it will raise a `NameError`. Because of this you need to be aware of the + # context in which you will use your custom URL helper when defining it. + # + # NOTE: The `direct` method can't be used inside of a scope block such as + # `namespace` or `scope` and will raise an error if it detects that it is. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2374 + def direct(name, options = T.unsafe(nil), &block); end + + # Define custom polymorphic mappings of models to URLs. This alters the behavior + # of `polymorphic_url` and consequently the behavior of `link_to`, `form_with` + # and `form_for` when passed a model instance, e.g: + # + # resource :basket + # + # resolve "Basket" do + # [:basket] + # end + # + # This will now generate "/basket" when a `Basket` instance is passed to + # `link_to`, `form_with` or `form_for` instead of the standard "/baskets/:id". + # + # NOTE: This custom behavior only applies to simple polymorphic URLs where a + # single model instance is passed and not more complicated forms, e.g: + # + # # config/routes.rb + # resource :profile + # namespace :admin do + # resources :users + # end + # + # resolve("User") { [:profile] } + # + # # app/views/application/_menu.html.erb + # link_to "Profile", @current_user + # link_to "Profile", [:admin, @current_user] + # + # The first `link_to` will generate "/profile" but the second will generate the + # standard polymorphic URL of "/admin/users/1". + # + # You can pass options to a polymorphic mapping - the arity for the block needs + # to be two as the instance is passed as the first argument, e.g: + # + # resolve "Basket", anchor: "items" do |basket, options| + # [:basket, options] + # end + # + # This generates the URL "/basket#items" because when the last item in an array + # passed to `polymorphic_url` is a hash then it's treated as options to the URL + # helper that gets called. + # + # NOTE: The `resolve` method can't be used inside of a scope block such as + # `namespace` or `scope` and will raise an error if it detects that it is. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2426 + def resolve(*args, &block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2528 +ActionDispatch::Routing::Mapper::DEFAULT = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:733 +module ActionDispatch::Routing::Mapper::HttpHelpers + # Define a route that recognizes HTTP CONNECT (and GET) requests. More + # specifically this recognizes HTTP/1 protocol upgrade requests and HTTP/2 + # CONNECT requests with the protocol pseudo header. For supported arguments, + # see [match](rdoc-ref:Base#match) + # + # connect 'live', to: 'live#index' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:884 + def connect(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP DELETE. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # delete 'broccoli', to: 'food#broccoli' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:834 + def delete(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP GET. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # get 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:738 + def get(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP OPTIONS. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # options 'carrots', to: 'food#carrots' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:858 + def options(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP PATCH. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # patch 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:786 + def patch(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP POST. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # post 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:762 + def post(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP PUT. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # put 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:810 + def put(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:83 +class ActionDispatch::Routing::Mapper::Mapping + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:132 + def initialize(set:, ast:, controller:, default_action:, to:, formatted:, via:, options_constraints:, anchor:, scope_params:, internal:, options:); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:190 + def application; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:194 + def conditions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def default_action; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def default_controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:183 + def make_route(name, precedence); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def required_defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def requirements; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def scope_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:87 + def to; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:329 + def add_controller_module(controller, modyoule); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:290 + def app(blocks); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:348 + def blocks(callable_constraint); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:198 + def build_conditions(current_conditions, request_class); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:302 + def check_controller_and_action(path_params, controller, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:317 + def check_part(name, part, path_params, hash); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:355 + def constraints(options, path_params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:369 + def dispatcher(raise_on_name_error); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:208 + def intern(object); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:286 + def normalize_defaults(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:254 + def normalize_format(formatted); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:212 + def normalize_options!(options, path_params, modyoule); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:373 + def route_source_location; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:248 + def split_constraints(path_params, constraints); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:341 + def translate_controller(controller); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:270 + def verify_regexp_requirements(requirements, wildcard_options); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:90 + def build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, internal, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:104 + def check_via(via); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:116 + def normalize_path(path, format); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:128 + def optional_format?(path, format); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:84 +ActionDispatch::Routing::Mapper::Mapping::ANCHOR_CHARACTERS_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:181 +ActionDispatch::Routing::Mapper::Mapping::JOINED_SEPARATORS = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:85 +ActionDispatch::Routing::Mapper::Mapping::OPTIONAL_FORMAT_REGEX = T.let(T.unsafe(nil), Regexp) + +# Resource routing allows you to quickly declare all of the common routes for a +# given resourceful controller. Instead of declaring separate routes for your +# `index`, `show`, `new`, `edit`, `create`, `update`, and `destroy` actions, a +# resourceful route declares them in a single line of code: +# +# resources :photos +# +# Sometimes, you have a resource that clients always look up without referencing +# an ID. A common example, /profile always shows the profile of the currently +# logged in user. In this case, you can use a singular resource to map /profile +# (rather than /profile/:id) to the show action. +# +# resource :profile +# +# It's common to have resources that are logically children of other resources: +# +# resources :magazines do +# resources :ads +# end +# +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# By default the `:id` parameter doesn't accept dots. If you need to use dots as +# part of the `:id` parameter add a constraint which overrides this restriction, +# e.g: +# +# resources :articles, id: /[^\/]+/ +# +# This allows any character other than a slash as part of your `:id`. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1299 +module ActionDispatch::Routing::Mapper::Resources + # To add a route to the collection: + # + # resources :photos do + # collection do + # get 'search' + # end + # end + # + # This will enable Rails to recognize paths such as `/photos/search` with GET, + # and route to the search action of `PhotosController`. It will also create the + # `search_photos_url` and `search_photos_path` route helpers. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1707 + def collection(&block); end + + # Loads another routes file with the given `name` located inside the + # `config/routes` directory. In that file, you can use the normal routing DSL, + # but *do not* surround it with a `Rails.application.routes.draw` block. + # + # # config/routes.rb + # Rails.application.routes.draw do + # draw :admin # Loads `config/routes/admin.rb` + # draw "third_party/some_gem" # Loads `config/routes/third_party/some_gem.rb` + # end + # + # # config/routes/admin.rb + # namespace :admin do + # resources :accounts + # end + # + # # config/routes/third_party/some_gem.rb + # mount SomeGem::Engine, at: "/some_gem" + # + # **CAUTION:** Use this feature with care. Having multiple routes files can + # negatively impact discoverability and readability. For most applications — + # even those with a few hundred routes — it's easier for developers to have a + # single routes file. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1816 + def draw(name); end + + # Matches a URL pattern to one or more routes. For more information, see + # [match](rdoc-ref:Base#match). + # + # match 'path', to: 'controller#action', via: :post + # match 'otherpath', on: :member, via: :get + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1837 + def match(*path_or_actions, as: T.unsafe(nil), via: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # To add a member route, add a member block into the resource block: + # + # resources :photos do + # member do + # get 'preview' + # end + # end + # + # This will recognize `/photos/1/preview` with GET, and route to the preview + # action of `PhotosController`. It will also create the `preview_photo_url` and + # `preview_photo_path` helpers. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1728 + def member(&block); end + + # See ActionDispatch::Routing::Mapper::Scoping#namespace. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1775 + def namespace(name, deprecated_options = T.unsafe(nil), as: T.unsafe(nil), path: T.unsafe(nil), shallow_path: T.unsafe(nil), shallow_prefix: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1754 + def nested(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1744 + def new(&block); end + + # Sometimes, you have a resource that clients always look up without referencing + # an ID. A common example, /profile always shows the profile of the currently + # logged in user. In this case, you can use a singular resource to map /profile + # (rather than /profile/:id) to the show action: + # + # resource :profile + # + # This creates six different routes in your application, all mapping to the + # `Profiles` controller (note that the controller is named after the plural): + # + # GET /profile/new + # GET /profile + # GET /profile/edit + # PATCH/PUT /profile + # DELETE /profile + # POST /profile + # + # If you want instances of a model to work with this resource via record + # identification (e.g. in `form_with` or `redirect_to`), you will need to call + # [resolve](rdoc-ref:CustomUrls#resolve): + # + # resource :profile + # resolve('Profile') { [:profile] } + # + # # Enables this to work with singular routes: + # form_with(model: @profile) {} + # + # ### Options + # Takes same options as [resources](rdoc-ref:#resources) + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1490 + def resource(*resources, concerns: T.unsafe(nil), **options, &block); end + + # In Rails, a resourceful route provides a mapping between HTTP verbs and URLs + # and controller actions. By convention, each action also maps to particular + # CRUD operations in a database. A single entry in the routing file, such as + # + # resources :photos + # + # creates seven different routes in your application, all mapping to the + # `Photos` controller: + # + # GET /photos + # GET /photos/new + # POST /photos + # GET /photos/:id + # GET /photos/:id/edit + # PATCH/PUT /photos/:id + # DELETE /photos/:id + # + # Resources can also be nested infinitely by using this block syntax: + # + # resources :photos do + # resources :comments + # end + # + # This generates the following comments routes: + # + # GET /photos/:photo_id/comments + # GET /photos/:photo_id/comments/new + # POST /photos/:photo_id/comments + # GET /photos/:photo_id/comments/:id + # GET /photos/:photo_id/comments/:id/edit + # PATCH/PUT /photos/:photo_id/comments/:id + # DELETE /photos/:photo_id/comments/:id + # + # ### Options + # Takes same options as [match](rdoc-ref:Base#match) as well as: + # + # :path_names + # actions. Actions not specified are not changed. + # + # resources :posts, path_names: { new: "brand_new" } + # + # The above example will now change /posts/new to /posts/brand_new. + # + # :path + # + # resources :posts, path: 'postings' + # + # The resource and all segments will now route to /postings instead of + # /posts. + # + # :only + # + # resources :cows, only: :show + # resources :cows, only: [:show, :index] + # + # :except + # + # resources :cows, except: :show + # resources :cows, except: [:show, :index] + # + # :shallow + # resource, generates shallow routes for all nested resources. + # + # resources :posts, shallow: true do + # resources :comments + # end + # + # Is the same as: + # + # resources :posts do + # resources :comments, except: [:show, :edit, :update, :destroy] + # end + # resources :comments, only: [:show, :edit, :update, :destroy] + # + # This allows URLs for resources that otherwise would be deeply nested such + # as a comment on a blog post like `/posts/a-long-permalink/comments/1234` + # to be shortened to just `/comments/1234`. + # + # Set `shallow: false` on a child resource to ignore a parent's shallow + # parameter. + # + # :shallow_path + # + # scope shallow_path: "sekret" do + # resources :posts do + # resources :comments, shallow: true + # end + # end + # + # The `comments` resource here will have the following routes generated for + # it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_comment GET /sekret/comments/:id/edit(.:format) + # comment GET /sekret/comments/:id(.:format) + # comment PATCH/PUT /sekret/comments/:id(.:format) + # comment DELETE /sekret/comments/:id(.:format) + # + # :shallow_prefix + # + # scope shallow_prefix: "sekret" do + # resources :posts do + # resources :comments, shallow: true + # end + # end + # + # The `comments` resource here will have the following routes generated for + # it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_sekret_comment GET /comments/:id/edit(.:format) + # sekret_comment GET /comments/:id(.:format) + # sekret_comment PATCH/PUT /comments/:id(.:format) + # sekret_comment DELETE /comments/:id(.:format) + # + # :format + # disable it by supplying `false`. + # + # :param + # + # + # ### Examples + # + # # routes call Admin::PostsController + # resources :posts, module: "admin" + # + # # resource actions are at /admin/posts. + # resources :posts, path: "admin/posts" + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1663 + def resources(*resources, concerns: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1457 + def resources_path_names(options); end + + # You can specify what Rails should route "/" to with the root method: + # + # root to: 'pages#main' + # + # For options, see `match`, as `root` uses it internally. + # + # You can also pass a string which will expand + # + # root 'pages#main' + # + # You should put the root route at the top of `config/routes.rb`, because this + # means it will be matched first. As this is the most popular route of most + # Rails applications, this is beneficial. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1903 + def root(path, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1783 + def shallow; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1790 + def shallow?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1968 + def action_options?(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2066 + def action_path(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2195 + def add_route(action, controller, as, options_action, _path, to, via, formatted, anchor, options_constraints, internal, options_mapping); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2120 + def api_only?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1982 + def applicable_actions_for(method); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1963 + def apply_action_options(method, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1928 + def apply_common_behavior_for(method, resources, shallow: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2041 + def canonical_action?(action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2180 + def decomposed_match(path, controller, as, action, _path, to, via, formatted, anchor, options_constraints, internal, options_mapping, on = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2165 + def get_to_from_path(path, to, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2131 + def map_match(path_or_action, constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), as: T.unsafe(nil), via: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), internal: T.unsafe(nil), mapping: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2217 + def match_root_route(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2082 + def name_for_action(as, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2018 + def nested_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1999 + def nested_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2037 + def param_constraint; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2033 + def param_constraint?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1924 + def parent_resource; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2056 + def path_for_action(action, path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2124 + def path_scope(path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2070 + def prefix_name_for_action(as, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1995 + def resource_method_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2010 + def resource_scope(resource, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1991 + def resource_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1972 + def scope_action_options(method); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2108 + def set_member_mappings_for_resource; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2027 + def shallow_nesting_depth; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2045 + def shallow_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2176 + def using_match_shorthand?(path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2003 + def with_scope_level(kind); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1304 +ActionDispatch::Routing::Mapper::Resources::CANONICAL_ACTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1303 +ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1306 +class ActionDispatch::Routing::Mapper::Resources::Resource + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1319 + def initialize(entities, api_only, shallow, only: T.unsafe(nil), except: T.unsafe(nil), **options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1346 + def actions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1354 + def available_actions; end + + # Checks for uncountable plurals, and appends "_index" if the plural and + # singular form are the same. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1378 + def collection_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1386 + def collection_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1317 + def controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1342 + def default_actions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1374 + def member_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1388 + def member_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1362 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1398 + def nested_param; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1402 + def nested_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1394 + def new_scope(new_path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1317 + def param; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1317 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1366 + def plural; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1382 + def resource_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1406 + def shallow?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1392 + def shallow_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1410 + def singleton?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1370 + def singular; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1413 + def invalid_only_except_options(valid_actions, only:, except:); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1308 + def default_actions(api_only); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1418 +class ActionDispatch::Routing::Mapper::Resources::SingletonResource < ::ActionDispatch::Routing::Mapper::Resources::Resource + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1429 + def initialize(entities, api_only, shallow, **options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1449 + def collection_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1436 + def default_actions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1448 + def member_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1451 + def member_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1452 + def nested_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1440 + def plural; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1454 + def singleton?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1444 + def singular; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1420 + def default_actions(api_only); end + end +end + +# CANONICAL_ACTIONS holds all actions that does not need a prefix or a path +# appended since they fit properly in their scope level. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1302 +ActionDispatch::Routing::Mapper::Resources::VALID_ON_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2440 +class ActionDispatch::Routing::Mapper::Scope + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2450 + def initialize(hash, parent = T.unsafe(nil), scope_level = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2509 + def [](key); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2476 + def action_name(name_prefix, prefix, collection_name, member_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2517 + def each; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2513 + def frame; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2456 + def nested?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2501 + def new(hash); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2505 + def new_level(level); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2460 + def null?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2497 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2448 + def parent; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2472 + def resource_method_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2493 + def resource_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2468 + def resources?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2464 + def root?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2448 + def scope_level; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2441 +ActionDispatch::Routing::Mapper::Scope::OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2446 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_METHOD_SCOPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2445 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_SCOPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2525 +ActionDispatch::Routing::Mapper::Scope::ROOT = T.let(T.unsafe(nil), ActionDispatch::Routing::Mapper::Scope) + +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# This will create a number of routes for each of the posts and comments +# controller. For `Admin::PostsController`, Rails will create: +# +# GET /admin/posts +# GET /admin/posts/new +# POST /admin/posts +# GET /admin/posts/1 +# GET /admin/posts/1/edit +# PATCH/PUT /admin/posts/1 +# DELETE /admin/posts/1 +# +# If you want to route /posts (without the prefix /admin) to +# `Admin::PostsController`, you could use +# +# scope module: "admin" do +# resources :posts +# end +# +# or, for a single case +# +# resources :posts, module: "admin" +# +# If you want to route /admin/posts to `PostsController` (without the `Admin::` +# module prefix), you could use +# +# scope "/admin" do +# resources :posts +# end +# +# or, for a single case +# +# resources :posts, path: "/admin/posts" +# +# In each of these cases, the named routes remain the same as if you did not use +# scope. In the last case, the following paths map to `PostsController`: +# +# GET /admin/posts +# GET /admin/posts/new +# POST /admin/posts +# GET /admin/posts/1 +# GET /admin/posts/1/edit +# PATCH/PUT /admin/posts/1 +# DELETE /admin/posts/1 +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:958 +module ActionDispatch::Routing::Mapper::Scoping + # ### Parameter Restriction + # Allows you to constrain the nested routes based on a set of rules. For + # instance, in order to change the routes to allow for a dot character in the + # `id` parameter: + # + # constraints(id: /\d+\.\d+/) do + # resources :posts + # end + # + # Now routes such as `/posts/1` will no longer be valid, but `/posts/1.1` will + # be. The `id` parameter must match the constraint passed in for this example. + # + # You may use this to also restrict other parameters: + # + # resources :posts do + # constraints(post_id: /\d+\.\d+/) do + # resources :comments + # end + # end + # + # ### Restricting based on IP + # + # Routes can also be constrained to an IP or a certain range of IP addresses: + # + # constraints(ip: /192\.168\.\d+\.\d+/) do + # resources :posts + # end + # + # Any user connecting from the 192.168.* range will be able to see this + # resource, where as any user connecting outside of this range will be told + # there is no such route. + # + # ### Dynamic request matching + # + # Requests to routes can be constrained based on specific criteria: + # + # constraints(-> (req) { /iPhone/.match?(req.env["HTTP_USER_AGENT"]) }) do + # resources :iphones + # end + # + # You are able to move this logic out into a class if it is too complex for + # routes. This class must have a `matches?` method defined on it which either + # returns `true` if the user should be given access to that route, or `false` if + # the user should not. + # + # class Iphone + # def self.matches?(request) + # /iPhone/.match?(request.env["HTTP_USER_AGENT"]) + # end + # end + # + # An expected place for this code would be `lib/constraints`. + # + # This class is then used like this: + # + # constraints(Iphone) do + # resources :iphones + # end + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1176 + def constraints(constraints = T.unsafe(nil), &block); end + + # Scopes routes to a specific controller + # + # controller "food" do + # match "bacon", action: :bacon, via: :get + # end + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1052 + def controller(controller); end + + # Allows you to set default parameters for a route, such as this: + # + # defaults id: 'home' do + # match 'scoped_pages/(:id)', to: 'pages#show' + # end + # + # Using this, the `:id` parameter here will default to 'home'. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1187 + def defaults(defaults = T.unsafe(nil)); end + + # Scopes routes to a specific namespace. For example: + # + # namespace :admin do + # resources :posts + # end + # + # This generates the following routes: + # + # admin_posts GET /admin/posts(.:format) admin/posts#index + # admin_posts POST /admin/posts(.:format) admin/posts#create + # new_admin_post GET /admin/posts/new(.:format) admin/posts#new + # edit_admin_post GET /admin/posts/:id/edit(.:format) admin/posts#edit + # admin_post GET /admin/posts/:id(.:format) admin/posts#show + # admin_post PATCH/PUT /admin/posts/:id(.:format) admin/posts#update + # admin_post DELETE /admin/posts/:id(.:format) admin/posts#destroy + # + # ### Options + # + # The `:path`, `:as`, `:module`, `:shallow_path`, and `:shallow_prefix` options + # all default to the name of the namespace. + # + # For options, see `Base#match`. For `:shallow_path` option, see + # `Resources#resources`. + # + # # accessible through /sekret/posts rather than /admin/posts + # namespace :admin, path: "sekret" do + # resources :posts + # end + # + # # maps to Sekret::PostsController rather than Admin::PostsController + # namespace :admin, module: "sekret" do + # resources :posts + # end + # + # # generates sekret_posts_path rather than admin_posts_path + # namespace :admin, as: "sekret" do + # resources :posts + # end + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1097 + def namespace(name, deprecated_options = T.unsafe(nil), as: T.unsafe(nil), path: T.unsafe(nil), shallow_path: T.unsafe(nil), shallow_prefix: T.unsafe(nil), **options, &block); end + + # Scopes a set of routes to the given default options. + # + # Take the following route definition as an example: + # + # scope path: ":account_id", as: "account" do + # resources :projects + # end + # + # This generates helpers such as `account_projects_path`, just like `resources` + # does. The difference here being that the routes generated are like + # /:account_id/projects, rather than /accounts/:account_id/projects. + # + # ### Options + # + # Takes same options as `Base#match` and `Resources#resources`. + # + # # route /posts (without the prefix /admin) to Admin::PostsController + # scope module: "admin" do + # resources :posts + # end + # + # # prefix the posts resource's requests with '/admin' + # scope path: "/admin" do + # resources :posts + # end + # + # # prefix the routing helper name: sekret_posts_path instead of posts_path + # scope as: "sekret" do + # resources :posts + # end + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:989 + def scope(*args, only: T.unsafe(nil), except: T.unsafe(nil), **options); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1219 + def merge_action_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1203 + def merge_as_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1243 + def merge_blocks_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1235 + def merge_constraints_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1215 + def merge_controller_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1239 + def merge_defaults_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1227 + def merge_format_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1211 + def merge_module_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1249 + def merge_options_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1231 + def merge_path_names_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1195 + def merge_path_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1199 + def merge_shallow_path_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1207 + def merge_shallow_prefix_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1253 + def merge_shallow_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1257 + def merge_to_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1223 + def merge_via_scope(parent, child); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1045 +ActionDispatch::Routing::Mapper::Scoping::POISON = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:24 +ActionDispatch::Routing::Mapper::URL_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:116 +class ActionDispatch::Routing::OptionRedirect < ::ActionDispatch::Routing::Redirect + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:145 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:117 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:119 + def path(params, request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:91 +class ActionDispatch::Routing::PathRedirect < ::ActionDispatch::Routing::Redirect + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:106 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:94 + def path(params, request); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:111 + def interpolation_required?(string, params); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:92 +ActionDispatch::Routing::PathRedirect::URL_PARTS = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch Routing PolymorphicRoutes +# +# Polymorphic URL helpers are methods for smart resolution to a named route call +# when given an Active Record model instance. They are to be used in combination +# with ActionController::Resources. +# +# These methods are useful when you want to generate the correct URL or path to +# a RESTful resource without having to know the exact type of the record in +# question. +# +# Nested resources and/or namespaces are also supported, as illustrated in the +# example: +# +# polymorphic_url([:admin, @article, @comment]) +# +# results in: +# +# admin_article_comment_url(@article, @comment) +# +# ## Usage within the framework +# +# Polymorphic URL helpers are used in a number of places throughout the Rails +# framework: +# +# * `url_for`, so you can use it with a record as the argument, e.g. +# `url_for(@article)`; +# * ActionView::Helpers::FormHelper uses `polymorphic_path`, so you can write +# `form_with(model: @article)` without having to specify `:url` parameter for the +# form action; +# * `redirect_to` (which, in fact, uses `url_for`) so you can write +# `redirect_to(post)` in your controllers; +# * ActionView::Helpers::AtomFeedHelper, so you don't have to explicitly +# specify URLs for feed entries. +# +# +# ## Prefixed polymorphic helpers +# +# In addition to `polymorphic_url` and `polymorphic_path` methods, a number of +# prefixed helpers are available as a shorthand to `action: "..."` in options. +# Those are: +# +# * `edit_polymorphic_url`, `edit_polymorphic_path` +# * `new_polymorphic_url`, `new_polymorphic_path` +# +# +# Example usage: +# +# edit_polymorphic_path(@post) # => "/posts/1/edit" +# polymorphic_path(@post, format: :pdf) # => "/posts/1.pdf" +# +# ## Usage with mounted engines +# +# If you are using a mounted engine and you need to use a polymorphic_url +# pointing at the engine's routes, pass in the engine's route proxy as the first +# argument to the method. For example: +# +# polymorphic_url([blog, @post]) # calls blog.post_path(@post) +# form_with(model: [blog, @post]) # => "/blog/posts/1" +# +# pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:66 +module ActionDispatch::Routing::PolymorphicRoutes + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:156 + def edit_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:156 + def edit_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:156 + def new_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:156 + def new_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # Returns the path component of a URL for the given record. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:133 + def polymorphic_path(record_or_hash_or_array, options = T.unsafe(nil)); end + + # Constructs a call to a named RESTful route for the given record and returns + # the resulting URL string. For example: + # + # # calls post_url(post) + # polymorphic_url(post) # => "http://example.com/posts/1" + # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1" + # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1" + # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1" + # polymorphic_url(Comment) # => "http://example.com/comments" + # + # #### Options + # + # * `:action` - Specifies the action prefix for the named route: `:new` or + # `:edit`. Default is no prefix. + # * `:routing_type` - Allowed values are `:path` or `:url`. Default is `:url`. + # + # + # Also includes all the options from `url_for`. These include such things as + # `:anchor` or `:trailing_slash`. Example usage is given below: + # + # polymorphic_url([blog, post], anchor: 'my_anchor') + # # => "http://example.com/blogs/1/posts/1#my_anchor" + # polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app") + # # => "http://example.com/my_app/blogs/1/posts/1#my_anchor" + # + # For all of these options, see the documentation for + # [url_for](rdoc-ref:ActionDispatch::Routing::UrlFor). + # + # #### Functionality + # + # # an Article record + # polymorphic_url(record) # same as article_url(record) + # + # # a Comment record + # polymorphic_url(record) # same as comment_url(record) + # + # # it recognizes new records and maps to the collection + # record = Comment.new + # polymorphic_url(record) # same as comments_url() + # + # # the class of a record will also map to the collection + # polymorphic_url(Comment) # same as comments_url() + # + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:110 + def polymorphic_url(record_or_hash_or_array, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:177 + def polymorphic_mapping(record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:173 + def polymorphic_path_for_action(action, record_or_hash, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:169 + def polymorphic_url_for_action(action, record_or_hash, options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:185 +class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:248 + def initialize(key_strategy, prefix, suffix); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:262 + def handle_class(klass); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:266 + def handle_class_call(target, klass); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:293 + def handle_list(list); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:270 + def handle_model(record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:284 + def handle_model_call(target, record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:254 + def handle_string(record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:258 + def handle_string_call(target, str); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:246 + def prefix; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:246 + def suffix; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:347 + def get_method_for_class(klass); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:352 + def get_method_for_string(str); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:339 + def polymorphic_mapping(target, record); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:196 + def build(action, type); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:188 + def get(action, type); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:194 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:210 + def plural(prefix, suffix); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:214 + def polymorphic_method(recipient, record_or_hash_or_array, action, type, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:206 + def singular(prefix, suffix); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:193 + def url; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:186 +ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder::CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:12 +class ActionDispatch::Routing::Redirect < ::ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:15 + def initialize(status, block, source_location); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:13 + def block; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:37 + def build_response(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:23 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:69 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:65 + def path(params, request); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:21 + def redirect?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:13 + def status; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:78 + def escape(params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:82 + def escape_fragment(params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:86 + def escape_path(params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:74 + def relative_path?(path); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:150 +module ActionDispatch::Routing::Redirection + # Redirect any path to another path: + # + # get "/stories" => redirect("/posts") + # + # This will redirect the user, while ignoring certain parts of the request, + # including query string, etc. `/stories`, `/stories?foo=bar`, etc all redirect + # to `/posts`. + # + # The redirect will use a `301 Moved Permanently` status code by default. This + # can be overridden with the `:status` option: + # + # get "/stories" => redirect("/posts", status: 307) + # + # You can also use interpolation in the supplied redirect argument: + # + # get 'docs/:article', to: redirect('/wiki/%{article}') + # + # Note that if you return a path without a leading slash then the URL is + # prefixed with the current SCRIPT_NAME environment variable. This is typically + # '/' but may be different in a mounted engine or where the application is + # deployed to a subdirectory of a website. + # + # Alternatively you can use one of the other syntaxes: + # + # The block version of redirect allows for the easy encapsulation of any logic + # associated with the redirect in question. Either the params and request are + # supplied as arguments, or just params, depending of how many arguments your + # block accepts. A string is required as a return value. + # + # get 'jokes/:number', to: redirect { |params, request| + # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp") + # "http://#{request.host_with_port}/#{path}" + # } + # + # Note that the `do end` syntax for the redirect block wouldn't work, as Ruby + # would pass the block to `get` instead of `redirect`. Use `{ ... }` instead. + # + # The options version of redirect allows you to supply only the parts of the URL + # which need to change, it also supports interpolation of the path similar to + # the first example. + # + # get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}') + # get 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}') + # get '/stories', to: redirect(path: '/posts') + # + # This will redirect the user, while changing only the specified parts of the + # request, for example the `path` option in the last example. `/stories`, + # `/stories?foo=bar`, redirect to `/posts` and `/posts?foo=bar` respectively. + # + # Finally, an object which responds to call can be supplied to redirect, + # allowing you to reuse common redirect routes. The call method must accept two + # arguments, params and request, and return a string. + # + # get 'accounts/:name' => redirect(SubdomainRedirector.new('api')) + # + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:206 + def redirect(*args, &block); end +end + +# The RouteSet contains a collection of Route instances, representing the routes +# typically defined in `config/routes.rb`. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:17 +class ActionDispatch::Routing::RouteSet + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:386 + def initialize(config = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:674 + def add_polymorphic_mapping(klass, options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:643 + def add_route(mapping, name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:678 + def add_url_helper(name, options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:417 + def api_only?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:464 + def append(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:903 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:488 + def clear!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:438 + def default_env; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:421 + def default_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:425 + def default_scope=(new_default_scope); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:354 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:354 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:509 + def define_mounted_helper(name, script_namer = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:353 + def disable_clear_and_finalize; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:353 + def disable_clear_and_finalize=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:457 + def draw(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:354 + def draw_paths; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:354 + def draw_paths=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:406 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:639 + def empty?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:355 + def env_key; end + + # Generate the path indicated by the arguments, and return an array of the keys + # that were not used to generate it. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:818 + def extra_keys(options, recall = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:482 + def finalize!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:846 + def find_script_name(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def formatter; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def formatter=(_arg0); end + + # Returns a Route matching the given requirements, or `nil` if none are found. + # + # This is intended for use by tools such as Language Servers. + # + # Given the routes are defined as: + # + # resources :posts + # + # Then the following will return the Route for the `show` action: + # + # Rails.application.routes.from_requirements(controller: "posts", action: "show") + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:29 + def from_requirements(requirements); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:822 + def generate_extras(options, recall = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:536 + def generate_url_helpers(supports_path); end + + # Since the router holds references to many parts of the system like engines, + # controllers and the application itself, inspecting the route set can actually + # be really slow, therefore we default alias inspect to to_s. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:37 + def inspect; end + + # Contains all the mounted helpers across different engines and the `main_app` + # helper for the application. You can include this in your classes if you want + # to access routes for other engines. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:505 + def mounted_helpers; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def named_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def named_routes=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:842 + def optimize_routes_generation?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:850 + def path_for(options, route_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:355 + def polymorphic_mappings; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:468 + def prepend(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:909 + def recognize_path(path, environment = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:924 + def recognize_path_with_request(req, path, extras, raise_on_missing: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:413 + def relative_url_root; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:429 + def request_class; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:353 + def resources_path_names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:353 + def resources_path_names=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def router; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def router=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:357 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def set; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:352 + def set=(_arg0); end + + # The `options` argument must be a hash whose keys are **symbols**. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:855 + def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:528 + def url_helpers(supports_path = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:472 + def eval_block(block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:833 + def generate(route_name, options, recall = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:433 + def make_request(env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:359 + def default_resources_path_names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:363 + def new_with_config(config); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 +class ActionDispatch::Routing::RouteSet::Config < ::Struct + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def api_only; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def api_only=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def default_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def default_scope=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def relative_url_root; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def relative_url_root=(_); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def [](*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def keyword_init?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def members; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:382 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:682 +class ActionDispatch::Routing::RouteSet::CustomUrlHelper + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:685 + def initialize(name, defaults, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:683 + def block; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:691 + def call(t, args, only_path = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:683 + def defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:683 + def name; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:703 + def eval_block(t, args, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:707 + def merge_defaults(options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:384 +ActionDispatch::Routing::RouteSet::DEFAULT_CONFIG = T.let(T.unsafe(nil), ActionDispatch::Routing::RouteSet::Config) + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:39 +class ActionDispatch::Routing::RouteSet::Dispatcher < ::ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:40 + def initialize(raise_on_name_error); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:44 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:46 + def serve(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:60 + def controller(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:64 + def dispatch(controller, action, req, res); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:712 +class ActionDispatch::Routing::RouteSet::Generator + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:715 + def initialize(named_route, options, recall, set); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:727 + def controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:731 + def current_controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:801 + def different_controller?; end + + # Generates a path from routes, returns a RouteWithParams or MissingRoute. + # MissingRoute will raise ActionController::UrlGenerationError. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:797 + def generate; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:713 + def named_route; end + + # Remove leading slashes from controllers + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:785 + def normalize_controller!; end + + # This pulls :controller, :action, and :id out of the recall. The recall key is + # only used if there is no key in the options or if the key in the options is + # identical. If any of :controller, :action or :id is not found, don't pull any + # more keys from the recall. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:767 + def normalize_controller_action_id!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:743 + def normalize_options!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:713 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:713 + def recall; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:713 + def set; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:735 + def use_recall_for(key); end + + # if the current controller is "foo/bar/baz" and controller: "baz/bat" is + # specified, the controller becomes "foo/baz/bat" + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:775 + def use_relative_controller!; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:807 + def named_route_exists?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:811 + def segment_keys; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:497 +module ActionDispatch::Routing::RouteSet::MountedHelpers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# A NamedRouteCollection instance is a collection of named routes, and also +# maintains an anonymous module that can be used to install helpers for the +# named routes. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:82 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:87 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:147 + def [](name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:146 + def []=(name, route); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:118 + def add(name, route); end + + # Given a `name`, defines name_path and name_url helpers. Used by 'direct', + # 'resolve', and 'polymorphic' route helpers. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:165 + def add_url_helper(name, defaults, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:148 + def clear; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:104 + def clear!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:150 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:137 + def get(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:100 + def helper_names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:141 + def key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:159 + def length; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:155 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:84 + def path_helpers_module; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:95 + def route_defined?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:84 + def url_helpers_module; end + + private + + # Create a URL helper allowing ordered parameters to be associated with + # corresponding dynamic segments, so you can do: + # + # foo_url(bar, baz, bang) + # + # Instead of: + # + # foo_url(bar: bar, baz: baz, bang: bang) + # + # Also allow options hash, so you can do: + # + # foo_url(bar, baz, bang, sort_by: 'baz') + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:333 + def define_url_helper(mod, name, helper, url_strategy); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:84 + def routes; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:188 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:271 + def initialize(route, options, route_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:278 + def call(t, method_name, args, inner_options, url_strategy); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:290 + def handle_positional_args(controller_options, inner_options, args, result, path_params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:201 + def route_name; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:189 + def create(route, options, route_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:197 + def optimize_helper?(route); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:203 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:206 + def initialize(route, options, route_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:204 + def arg_size; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:212 + def call(t, method_name, args, inner_options, url_strategy); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:243 + def optimize_routes_generation?(t); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:235 + def optimized_helper(args); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:247 + def parameterize_args(args); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:258 + def raise_generation_error(args); end +end + +# strategy for building URLs to send to the client +# +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:349 +ActionDispatch::Routing::RouteSet::PATH = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:838 +ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:69 +class ActionDispatch::Routing::RouteSet::StaticDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:70 + def initialize(controller_class); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:76 + def controller(_); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:350 +ActionDispatch::Routing::RouteSet::UNKNOWN = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:10 +class ActionDispatch::Routing::RouteWrapper < ::SimpleDelegator + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:56 + def action; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:28 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:52 + def controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:17 + def endpoint; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:64 + def engine?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:60 + def internal?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:11 + def matches_filter?(filter, value); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:40 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:36 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:32 + def rack_app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:44 + def reqs; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:68 + def to_h; end +end + +# This class is just used for displaying route information when someone +# executes `bin/rails routes` or looks at the RoutingError page. People should +# not use this class. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:81 +class ActionDispatch::Routing::RoutesInspector + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:82 + def initialize(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:87 + def format(formatter, filter = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:147 + def filter_routes(routes, filter); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:98 + def format_routes(formatter, filter, engine_name, routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:115 + def load_engines_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:128 + def normalize_filter(filter); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:111 + def wrap_routes(routes); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:9 +class ActionDispatch::Routing::RoutesProxy + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:15 + def initialize(routes, scope, helpers, script_namer = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:13 + def _routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:12 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:12 + def routes=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:12 + def scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:12 + def scope=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:21 + def url_options; end + + private + + # Keeps the part of the script name provided by the global context via + # [ENV]("SCRIPT_NAME"), which `mount` doesn't know about since it depends on the + # specific request, but use our script name resolver for the mount point + # dependent part. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:55 + def merge_script_names(previous_script_name, new_script_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:32 + def method_missing(method, *args); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:28 + def respond_to_missing?(method, _); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def default_url_options?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def __class_attr_default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def __class_attr_default_url_options=(new_value); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing.rb:259 +ActionDispatch::Routing::SEPARATORS = T.let(T.unsafe(nil), Array) + +# # Action Dispatch Routing UrlFor +# +# In `config/routes.rb` you define URL-to-controller mappings, but the reverse +# is also possible: a URL can be generated from one of your routing definitions. +# URL generation functionality is centralized in this module. +# +# See ActionDispatch::Routing for general information about routing and +# `config/routes.rb`. +# +# **Tip:** If you need to generate URLs from your models or some other place, +# then ActionDispatch::Routing::UrlFor is what you're looking for. Read on for +# an introduction. In general, this module should not be included on its own, as +# it is usually included by `url_helpers` (as in +# `Rails.application.routes.url_helpers`). +# +# ## URL generation from parameters +# +# As you may know, some functions, such as `ActionController::Base#url_for` and +# ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set of +# parameters. For example, you've probably had the chance to write code like +# this in one of your views: +# +# <%= link_to('Click here', controller: 'users', +# action: 'new', message: 'Welcome!') %> +# # => Click here +# +# `link_to`, and all other functions that require URL generation functionality, +# actually use ActionDispatch::Routing::UrlFor under the hood. And in +# particular, they use the ActionDispatch::Routing::UrlFor#url_for method. One +# can generate the same path as the above example by using the following code: +# +# include ActionDispatch::Routing::UrlFor +# url_for(controller: 'users', +# action: 'new', +# message: 'Welcome!', +# only_path: true) +# # => "/users/new?message=Welcome%21" +# +# Notice the `only_path: true` part. This is because UrlFor has no information +# about the website hostname that your Rails app is serving. So if you want to +# include the hostname as well, then you must also pass the `:host` argument: +# +# include UrlFor +# url_for(controller: 'users', +# action: 'new', +# message: 'Welcome!', +# host: 'www.example.com') +# # => "http://www.example.com/users/new?message=Welcome%21" +# +# By default, all controllers and views have access to a special version of +# `url_for`, that already knows what the current hostname is. So if you use +# `url_for` in your controllers or your views, then you don't need to explicitly +# pass the `:host` argument. +# +# For convenience, mailers also include ActionDispatch::Routing::UrlFor. So +# within mailers, you can use url_for. However, mailers cannot access incoming +# web requests in order to derive hostname information, so you have to provide +# the `:host` option or set the default host using `default_url_options`. For +# more information on url_for in mailers see the ActionMailer::Base +# documentation. +# +# ## URL generation for named routes +# +# UrlFor also allows one to access methods that have been auto-generated from +# named routes. For example, suppose that you have a 'users' resource in your +# `config/routes.rb`: +# +# resources :users +# +# This generates, among other things, the method `users_path`. By default, this +# method is accessible from your controllers, views, and mailers. If you need to +# access this auto-generated method from other places (such as a model), then +# you can do that by including `Rails.application.routes.url_helpers` in your +# class: +# +# class User < ActiveRecord::Base +# include Rails.application.routes.url_helpers +# +# def base_uri +# user_path(self) +# end +# end +# +# User.find(1).base_uri # => "/users/1" +# +# pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:92 +module ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:111 + def initialize(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:182 + def full_url_for(options = T.unsafe(nil)); end + + # Allows calling direct or regular named route. + # + # resources :buckets + # + # direct :recordable do |recording| + # route_for(:bucket, recording.bucket) + # end + # + # direct :threadable do |threadable| + # route_for(:recordable, threadable.parent) + # end + # + # This maintains the context of the original caller on whether to return a path + # or full URL, e.g: + # + # threadable_path(threadable) # => "/buckets/1" + # threadable_url(threadable) # => "http://example.com/buckets/1" + # + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:222 + def route_for(name, *args); end + + # Generate a URL based on the options provided, `default_url_options`, and the + # routes defined in `config/routes.rb`. The following options are supported: + # + # * `:only_path` - If true, the relative URL is returned. Defaults to `false`. + # * `:protocol` - The protocol to connect to. Defaults to `"http"`. + # * `:host` - Specifies the host the link should be targeted at. If + # `:only_path` is false, this option must be provided either explicitly, or + # via `default_url_options`. + # * `:subdomain` - Specifies the subdomain of the link, using the `tld_length` + # to split the subdomain from the host. If false, removes all subdomains + # from the host part of the link. + # * `:domain` - Specifies the domain of the link, using the `tld_length` to + # split the domain from the host. + # * `:tld_length` - Number of labels the TLD id composed of, only used if + # `:subdomain` or `:domain` are supplied. Defaults to + # `ActionDispatch::Http::URL.tld_length`, which in turn defaults to 1. + # * `:port` - Optionally specify the port to connect to. + # * `:anchor` - An anchor name to be appended to the path. + # * `:params` - The query parameters to be appended to the path. + # * `:path_params` - The query parameters that will only be used for the named + # dynamic segments of path. If unused, they will be discarded. + # * `:trailing_slash` - If true, adds a trailing slash, as in + # `"/archive/2009/"`. + # * `:script_name` - Specifies application path relative to domain root. If + # provided, prepends application path. + # + # + # Any other key (`:controller`, `:action`, etc.) given to `url_for` is forwarded + # to the Routes module. + # + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080' + # # => 'http://somehost.org:8080/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', anchor: 'ok', only_path: true + # # => '/tasks/testing#ok' + # url_for controller: 'tasks', action: 'testing', trailing_slash: true + # # => 'http://somehost.org/tasks/testing/' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' + # # => 'http://somehost.org/tasks/testing?number=33' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp" + # # => 'http://somehost.org/myapp/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp", only_path: true + # # => '/myapp/tasks/testing' + # + # Missing routes keys may be filled in from the current request's parameters + # (e.g. `:controller`, `:action`, `:id`, and any other parameters that are + # placed in the path). Given that the current action has been reached through + # `GET /users/1`: + # + # url_for(only_path: true) # => '/users/1' + # url_for(only_path: true, action: 'edit') # => '/users/1/edit' + # url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit' + # + # Notice that no `:id` parameter was provided to the first `url_for` call and + # the helper used the one from the route's path. Any path parameter implicitly + # used by `url_for` can always be overwritten like shown on the last `url_for` + # calls. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:178 + def url_for(options = T.unsafe(nil)); end + + # Hook overridden in controller to add request information with + # `default_url_options`. Application logic should not go into url_options. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:118 + def url_options; end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:227 + def optimize_routes_generation?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:239 + def _routes_context; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:232 + def _with_routes(routes); end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# # Action Dispatch SSL +# +# This middleware is added to the stack when `config.force_ssl = true`, and is +# passed the options set in `config.ssl_options`. It does three jobs to enforce +# secure HTTP requests: +# +# 1. **TLS redirect**: Permanently redirects `http://` requests to `https://` +# with the same URL host, path, etc. Enabled by default. Set +# `config.ssl_options` to modify the destination URL: +# +# config.ssl_options = { redirect: { host: "secure.widgets.com", port: 8080 }` +# +# Or set `redirect: false` to disable redirection. +# +# Requests can opt-out of redirection with `exclude`: +# +# config.ssl_options = { redirect: { exclude: -> request { request.path == "/up" } } } +# +# Cookies will not be flagged as secure for excluded requests. +# +# When proxying through a load balancer that terminates SSL, the forwarded +# request will appear as though it's HTTP instead of HTTPS to the application. +# This makes redirects and cookie security target HTTP instead of HTTPS. +# To make the server assume that the proxy already terminated SSL, and +# that the request really is HTTPS, set `config.assume_ssl` to `true`: +# +# config.assume_ssl = true +# +# 2. **Secure cookies**: Sets the `secure` flag on cookies to tell browsers +# they must not be sent along with `http://` requests. Enabled by default. +# Set `config.ssl_options` with `secure_cookies: false` to disable this +# feature. +# +# 3. **HTTP Strict Transport Security (HSTS)**: Tells the browser to remember +# this site as TLS-only and automatically redirect non-TLS requests. Enabled +# by default. Configure `config.ssl_options` with `hsts: false` to disable. +# +# Set `config.ssl_options` with `hsts: { ... }` to configure HSTS: +# +# * `expires`: How long, in seconds, these settings will stick. The +# minimum required to qualify for browser preload lists is 1 year. +# Defaults to 2 years (recommended). +# +# * `subdomains`: Set to `true` to tell the browser to apply these +# settings to all subdomains. This protects your cookies from +# interception by a vulnerable site on a subdomain. Defaults to `true`. +# +# * `preload`: Advertise that this site may be included in browsers' +# preloaded HSTS lists. HSTS protects your site on every visit *except +# the first visit* since it hasn't seen your HSTS header yet. To close +# this gap, browser vendors include a baked-in list of HSTS-enabled +# sites. Go to https://hstspreload.org to submit your site for +# inclusion. Defaults to `false`. +# +# +# To turn off HSTS, omitting the header is not enough. Browsers will +# remember the original HSTS directive until it expires. Instead, use the +# header to tell browsers to expire HSTS immediately. Setting `hsts: false` +# is a shortcut for `hsts: { expires: 0 }`. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:66 +class ActionDispatch::SSL + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:76 + def initialize(app, redirect: T.unsafe(nil), hsts: T.unsafe(nil), secure_cookies: T.unsafe(nil), ssl_default_redirect_status: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:88 + def call(env); end + + private + + # https://tools.ietf.org/html/rfc6797#section-6.1 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:122 + def build_hsts_header(hsts); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:129 + def flag_cookies_as_secure!(headers); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:170 + def https_location_for(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:107 + def normalize_hsts_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:153 + def redirect_to_https(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:160 + def redirection_status(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:103 + def set_hsts_header!(headers); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:72 + def default_hsts_options; end + end +end + +# :stopdoc: Default to 2 years as recommended on hstspreload.org. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:68 +ActionDispatch::SSL::HSTS_EXPIRES_IN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:70 +ActionDispatch::SSL::PERMANENT_REDIRECT_REQUEST_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:8 +class ActionDispatch::ServerTiming + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:52 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:58 + def call(env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:48 + def unsubscribe; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:9 +class ActionDispatch::ServerTiming::Subscriber + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:13 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:17 + def call(event); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:23 + def collect_events; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:32 + def ensure_subscribed; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:40 + def unsubscribe; end + + class << self + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:10 + def allocate; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:10 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:11 +ActionDispatch::ServerTiming::Subscriber::KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/actionpack#lib/action_dispatch.rb:106 +module ActionDispatch::Session + class << self + # pkg:gem/actionpack#lib/action_dispatch.rb:113 + def resolve_store(session_store); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:97 +class ActionDispatch::Session::AbstractSecureStore < ::Rack::Session::Abstract::PersistedSecure + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:102 + def generate_sid; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:107 + def set_cookie(request, response, cookie); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:86 +class ActionDispatch::Session::AbstractStore < ::Rack::Session::Abstract::Persisted + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:92 + def set_cookie(request, response, cookie); end +end + +# # Action Dispatch Session CacheStore +# +# A session store that uses an ActiveSupport::Cache::Store to store the +# sessions. This store is most useful if you don't store critical data in your +# sessions and you don't need them to live for extended periods of time. +# +# #### Options +# * `cache` - The cache to use. If it is not specified, `Rails.cache` +# will be used. +# * `expire_after` - The length of time a session will be stored before +# automatically expiring. By default, the `:expires_in` option of the cache +# is used. +# * `check_collisions` - Check if newly generated session ids aren't already in use. +# If for some reason 128 bits of randomness aren't considered secure enough to avoid +# collisions, this option can be enabled to ensure newly generated ids aren't in use. +# By default, it is set to `false` to avoid additional cache write operations. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:26 +class ActionDispatch::Session::CacheStore < ::ActionDispatch::Session::AbstractSecureStore + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:27 + def initialize(app, options = T.unsafe(nil)); end + + # Remove a session from the cache. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:54 + def delete_session(env, sid, options); end + + # Get a session from the cache. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:35 + def find_session(env, sid); end + + # Set a session in the cache. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:43 + def write_session(env, sid, session, options); end + + private + + # Turn the session id into a cache key. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:62 + def cache_key(id); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:70 + def generate_sid; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:66 + def get_session_with_fallback(sid); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:22 +module ActionDispatch::Session::Compatibility + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:23 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:28 + def generate_sid; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:35 + def initialize_sid; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:40 + def make_request(env); end +end + +# # Action Dispatch Session CookieStore +# +# This cookie-based session store is the Rails default. It is dramatically +# faster than the alternatives. +# +# Sessions typically contain at most a user ID and flash message; both fit +# within the 4096 bytes cookie size limit. A `CookieOverflow` exception is +# raised if you attempt to store more than 4096 bytes of data. +# +# The cookie jar used for storage is automatically configured to be the best +# possible option given your application's configuration. +# +# Your cookies will be encrypted using your application's `secret_key_base`. +# This goes a step further than signed cookies in that encrypted cookies cannot +# be altered or read by users. This is the default starting in Rails 4. +# +# Configure your session store in an initializer: +# +# Rails.application.config.session_store :cookie_store, key: '_your_app_session' +# +# In the development and test environments your application's `secret_key_base` +# is generated by Rails and stored in a temporary file in +# `tmp/local_secret.txt`. In all other environments, it is stored encrypted in +# the `config/credentials.yml.enc` file. +# +# If your application was not updated to Rails 5.2 defaults, the +# `secret_key_base` will be found in the old `config/secrets.yml` file. +# +# Note that changing your `secret_key_base` will invalidate all existing +# session. Additionally, you should take care to make sure you are not relying +# on the ability to decode signed cookies generated by your app in external +# applications or JavaScript before changing it. +# +# Because CookieStore extends `Rack::Session::Abstract::Persisted`, many of the +# options described there can be used to customize the session cookie that is +# generated. For example: +# +# Rails.application.config.session_store :cookie_store, expire_after: 14.days +# +# would set the session cookie to expire automatically 14 days after creation. +# Other useful options include `:key`, `:secure`, `:httponly`, and `:same_site`. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:52 +class ActionDispatch::Session::CookieStore < ::ActionDispatch::Session::AbstractSecureStore + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:64 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:70 + def delete_session(req, session_id, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:77 + def load_session(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:124 + def cookie_jar(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:86 + def extract_session_id(req); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:120 + def get_cookie(req); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:105 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:116 + def set_cookie(request, session_id, cookie); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:93 + def unpacked_cookie_data(req); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:111 + def write_session(req, sid, session_data, options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:62 +ActionDispatch::Session::CookieStore::DEFAULT_SAME_SITE = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:53 +class ActionDispatch::Session::CookieStore::SessionId + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:56 + def initialize(session_id, cookie_value = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:54 + def cookie_value; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:71 +module ActionDispatch::Session::SessionObject + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:72 + def commit_session(req, res); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:81 + def loaded_session?(session); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:77 + def prepare_session(req); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:13 +class ActionDispatch::Session::SessionRestoreError < ::StandardError + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:14 + def initialize; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:45 +module ActionDispatch::Session::StaleSessionCheck + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:50 + def extract_session_id(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:46 + def load_session(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:54 + def stale_session_check!; end +end + +# # Action Dispatch ShowExceptions +# +# This middleware rescues any exception returned by the application and calls an +# exceptions app that will wrap it in a format for the end user. +# +# The exceptions app should be passed as a parameter on initialization of +# `ShowExceptions`. Every time there is an exception, `ShowExceptions` will +# store the exception in `env["action_dispatch.exception"]`, rewrite the +# `PATH_INFO` to the exception status code, and call the Rack app. +# +# In Rails applications, the exceptions app can be configured with +# `config.exceptions_app`, which defaults to ActionDispatch::PublicExceptions. +# +# If the application returns a response with the `X-Cascade` header set to +# `"pass"`, this middleware will send an empty response as a result with the +# correct status code. If any exception happens inside the exceptions app, this +# middleware catches the exceptions and returns a failsafe response. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:25 +class ActionDispatch::ShowExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:26 + def initialize(app, exceptions_app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:31 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:67 + def fallback_to_html_format_if_invalid_mime_type(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:83 + def pass_response(status); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:48 + def render_exception(request, wrapper); end +end + +# # Action Dispatch Static +# +# This middleware serves static files from disk, if available. If no file is +# found, it hands off to the main app. +# +# In Rails apps, this middleware is configured to serve assets from the +# `public/` directory. +# +# Only GET and HEAD requests are served. POST and other HTTP methods are handed +# off to the main app. +# +# Only files in the root directory are served; path traversal is denied. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:20 +class ActionDispatch::Static + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:21 + def initialize(app, path, index: T.unsafe(nil), headers: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:26 + def call(env); end +end + +# pkg:gem/actionpack#lib/action_dispatch/structured_event_subscriber.rb:4 +class ActionDispatch::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # pkg:gem/actionpack#lib/action_dispatch/structured_event_subscriber.rb:5 + def redirect(event); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:4 +module ActionDispatch::TestHelpers; end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:5 +module ActionDispatch::TestHelpers::PageDumpHelper + # Saves the content of response body to a file and tries to open it in your browser. + # Launchy must be present in your Gemfile for the page to open automatically. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:10 + def save_and_open_page(path = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:30 + def html_dump_default_path; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:23 + def open_file(path); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:15 + def save_page(path = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_helpers/page_dump_helper.rb:6 +class ActionDispatch::TestHelpers::PageDumpHelper::InvalidResponse < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:9 +module ActionDispatch::TestProcess + include ::ActionDispatch::TestProcess::FixtureFile + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:34 + def assigns(key = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:48 + def cookies; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:44 + def flash; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:52 + def redirect_to_url; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:40 + def session; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:10 +module ActionDispatch::TestProcess::FixtureFile + # Shortcut for + # `Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)`: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png') } + # + # Default fixture files location is `test/fixtures/files`. + # + # To upload binary files on Windows, pass `:binary` as the last parameter. This + # will not affect other platforms: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png', :binary) } + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:22 + def file_fixture_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:29 + def fixture_file_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:9 +class ActionDispatch::TestRequest < ::ActionDispatch::Request + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:68 + def accept=(mime_types); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:48 + def action=(action_name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:32 + def host=(host); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:52 + def if_modified_since=(last_modified); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:56 + def if_none_match=(etag); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:44 + def path=(path); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:36 + def port=(number); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:60 + def remote_addr=(addr); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:28 + def request_method=(method); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:40 + def request_uri=(uri); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:64 + def user_agent=(user_agent); end + + class << self + # Create a new test request with default `env` values. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:17 + def create(env = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:23 + def default_env; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:10 +ActionDispatch::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# Integration test methods such as Integration::RequestHelpers#get and +# Integration::RequestHelpers#post return objects of class TestResponse, which +# represent the HTTP response results of the requested controller actions. +# +# See Response for more information on controller response objects. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:13 +class ActionDispatch::TestResponse < ::ActionDispatch::Response + # Returns a parsed body depending on the response MIME type. When a parser + # corresponding to the MIME type is not found, it returns the raw body. + # + # #### Examples + # get "/posts" + # response.content_type # => "text/html; charset=utf-8" + # response.parsed_body.class # => Nokogiri::HTML5::Document + # response.parsed_body.to_html # => "\n\n..." + # + # assert_pattern { response.parsed_body.at("main") => { content: "Hello, world" } } + # + # response.parsed_body.at("main") => {name:, content:} + # assert_equal "main", name + # assert_equal "Some main content", content + # + # get "/posts.json" + # response.content_type # => "application/json; charset=utf-8" + # response.parsed_body.class # => Array + # response.parsed_body # => [{"id"=>42, "title"=>"Title"},... + # + # assert_pattern { response.parsed_body => [{ id: 42 }] } + # + # get "/posts/42.json" + # response.content_type # => "application/json; charset=utf-8" + # response.parsed_body.class # => ActiveSupport::HashWithIndifferentAccess + # response.parsed_body # => {"id"=>42, "title"=>"Title"} + # + # assert_pattern { response.parsed_body => [{ title: /title/i }] } + # + # response.parsed_body => {id:, title:} + # assert_equal 42, id + # assert_equal "Title", title + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:50 + def parsed_body; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:54 + def response_parser; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:14 + def from_response(response); end + end +end + +# :markup: markdown +# +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:5 +module ActionPack + class << self + # Returns the currently loaded version of Action Pack as a `Gem::Version`. + # + # pkg:gem/actionpack#lib/action_pack/gem_version.rb:7 + def gem_version; end + + # Returns the currently loaded version of Action Pack as a `Gem::Version`. + # + # pkg:gem/actionpack#lib/action_pack/version.rb:9 + def version; end + end +end + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:11 +module ActionPack::VERSION; end + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:12 +ActionPack::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:13 +ActionPack::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:15 +ActionPack::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:17 +ActionPack::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:14 +ActionPack::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:7 +module Mime + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:51 + def [](type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:64 + def fetch(type, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:56 + def symbols; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:60 + def valid_symbols?(symbols); end + end +end + +# ALL isn't a real MIME type, so we don't register it for lookup with the other +# concrete types. It's a wildcard match that we use for `respond_to` negotiation +# internals. +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:363 +Mime::ALL = T.let(T.unsafe(nil), Mime::AllType) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:349 +class Mime::AllType < ::Mime::Type + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:352 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:356 + def all?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:357 + def html?; end + + class << self + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:350 + def allocate; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:350 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:47 +Mime::EXTENSION_LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:48 +Mime::LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:8 +class Mime::Mimes + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:13 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:23 + def <<(type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:30 + def delete_if; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:19 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:9 + def symbols; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:41 + def valid_symbols?(symbols); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:365 +class Mime::NullType + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:368 + def nil?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:376 + def ref; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:372 + def to_s; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:383 + def method_missing(method, *, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:379 + def respond_to_missing?(method, _); end + + class << self + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:366 + def allocate; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:366 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:46 +Mime::SET = T.let(T.unsafe(nil), Mime::Mimes) + +# Encapsulates the notion of a MIME type. Can be used at render time, for +# example, with: +# +# class PostsController < ActionController::Base +# def show +# @post = Post.find(params[:id]) +# +# respond_to do |format| +# format.html +# format.ics { render body: @post.to_ics, mime_type: Mime::Type.lookup("text/calendar") } +# format.xml { render xml: @post } +# end +# end +# end +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:84 +class Mime::Type + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:264 + def initialize(string, symbol = T.unsafe(nil), synonyms = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:297 + def ==(mime_type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:289 + def ===(list); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:311 + def =~(mime_type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:327 + def all?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:304 + def eql?(other); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:255 + def hash; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:323 + def html?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:317 + def match?(mime_type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:285 + def ref; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:85 + def symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:273 + def to_s; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:277 + def to_str; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:281 + def to_sym; end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:330 + def string; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:330 + def synonyms; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:336 + def method_missing(method, *, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:344 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:334 + def to_a; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:333 + def to_ary; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:167 + def lookup(string); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:175 + def lookup_by_extension(extension); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:200 + def parse(accept_header); end + + # For an input of `'text'`, returns `[Mime[:json], Mime[:xml], Mime[:ics], + # Mime[:html], Mime[:css], Mime[:csv], Mime[:js], Mime[:yaml], Mime[:text]]`. + # + # For an input of `'application'`, returns `[Mime[:html], Mime[:js], Mime[:xml], + # Mime[:yaml], Mime[:atom], Mime[:json], Mime[:rss], Mime[:url_encoded_form]]`. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:236 + def parse_data_with_trailing_star(type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:227 + def parse_trailing_star(accept_header); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:186 + def register(string, symbol, mime_type_synonyms = T.unsafe(nil), extension_synonyms = T.unsafe(nil), skip_lookup = T.unsafe(nil)); end + + # Registers an alias that's not used on MIME type lookup, but can be referenced + # directly. Especially useful for rendering different HTML versions depending on + # the user agent, like an iPhone. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:182 + def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:163 + def register_callback(&block); end + + # This method is opposite of register method. + # + # To unregister a MIME type: + # + # Mime::Type.unregister(:mobile) + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:245 + def unregister(symbol); end + end +end + +# A simple helper class used in parsing the accept header. +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:90 +class Mime::Type::AcceptItem + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:94 + def initialize(index, name, q = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:101 + def <=>(item); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def index; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def index=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def name=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def q; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def q=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:92 + def to_s; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:108 +class Mime::Type::AcceptList + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:151 + def find_item_by_name(array, name); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:109 + def sort!(list); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:262 +class Mime::Type::InvalidMimeType < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:257 +Mime::Type::MIME_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:259 +Mime::Type::MIME_PARAMETER = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:258 +Mime::Type::MIME_PARAMETER_VALUE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:260 +Mime::Type::MIME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch.rb:35 +module Rack; end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:42 +class Rack::Headers < ::Hash; end diff --git a/sorbet/rbi/gems/actionview@8.1.4.rbi b/sorbet/rbi/gems/actionview@8.1.4.rbi new file mode 100644 index 0000000..c6e1e04 --- /dev/null +++ b/sorbet/rbi/gems/actionview@8.1.4.rbi @@ -0,0 +1,14743 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionview` gem. +# Please instead update this file by running `bin/tapioca gem actionview`. + + +class ActionController::Base < ::ActionController::Metal + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionController::Head + include ::AbstractController::Caching::ConfigMethods + include ::ActionController::BasicImplicitRender + extend ::AbstractController::Helpers::Resolution + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses +end + +# :include: ../README.rdoc +# :markup: markdown +# +# pkg:gem/actionview#lib/action_view/gem_version.rb:3 +module ActionView + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionview#lib/action_view/deprecator.rb:4 + def deprecator; end + + # pkg:gem/actionview#lib/action_view.rb:110 + def eager_load!; end + + # Returns the currently loaded version of Action View as a +Gem::Version+. + # + # pkg:gem/actionview#lib/action_view/gem_version.rb:5 + def gem_version; end + + # pkg:gem/actionview#lib/action_view.rb:95 + def render_tracker; end + + # pkg:gem/actionview#lib/action_view.rb:97 + def render_tracker=(value); end + + # Returns the currently loaded version of Action View as a +Gem::Version+. + # + # pkg:gem/actionview#lib/action_view/version.rb:7 + def version; end + end +end + +# This class defines the interface for a renderer. Each class that +# subclasses +AbstractRenderer+ is used by the base +Renderer+ class to +# render a specific type of object. +# +# The base +Renderer+ class uses its +render+ method to delegate to the +# renderers. These currently consist of +# +# PartialRenderer - Used for rendering partials +# TemplateRenderer - Used for rendering other types of templates +# StreamingTemplateRenderer - Used for streaming +# +# Whenever the +render+ method is called on the base +Renderer+ class, a new +# renderer object of the correct type is created, and the +render+ method on +# that new object is called in turn. This abstracts the set up and rendering +# into a separate classes for partials and templates. +# +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:21 +class ActionView::AbstractRenderer + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:24 + def initialize(lookup_context); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def any_templates?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def formats(*, **, &); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:28 + def render; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def template_exists?(*, **, &); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:182 + def build_rendered_collection(templates, spacer); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:178 + def build_rendered_template(content, template); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:159 + def extract_details(options); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:171 + def prepend_formats(formats); end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:157 +ActionView::AbstractRenderer::NO_DETAILS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:32 +module ActionView::AbstractRenderer::ObjectRendering + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:37 + def initialize(lookup_context, options); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:43 + def local_variable(path); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:92 + def merge_prefix_into_object_path(prefix, object_path); end + + # Obtains the path to where the object's partial is located. If the object + # responds to +to_partial_path+, then +to_partial_path+ will be called and + # will provide the path. If the object does not respond to +to_partial_path+, + # then an +ArgumentError+ is raised. + # + # If +prefix_partial_path_with_controller_namespace+ is true, then this + # method will prefix the partial paths with a namespace. + # + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:76 + def partial_path(object, view); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:61 + def raise_invalid_identifier(path); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:65 + def raise_invalid_option_as(as); end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:54 +ActionView::AbstractRenderer::ObjectRendering::IDENTIFIER_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:57 +ActionView::AbstractRenderer::ObjectRendering::OPTION_AS_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:33 +ActionView::AbstractRenderer::ObjectRendering::PREFIXED_PARTIAL_NAMES = T.let(T.unsafe(nil), Concurrent::Map) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:110 +class ActionView::AbstractRenderer::RenderedCollection + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:117 + def initialize(rendered_templates, spacer); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:122 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:126 + def format; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:115 + def rendered_templates; end + + class << self + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:111 + def empty(format); end + end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:130 +class ActionView::AbstractRenderer::RenderedCollection::EmptyCollection + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:133 + def initialize(format); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:137 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:131 + def format; end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:141 +class ActionView::AbstractRenderer::RenderedTemplate + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:144 + def initialize(body, template); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:142 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:149 + def format; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:142 + def template; end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:153 +ActionView::AbstractRenderer::RenderedTemplate::EMPTY_SPACER = T.let(T.unsafe(nil), T.untyped) + +# = Action View Errors +# +# pkg:gem/actionview#lib/action_view/template/error.rb:8 +class ActionView::ActionViewError < ::StandardError; end + +# = Action View \Base +# +# Action View templates can be written in several ways. +# If the template file has a .erb extension, then it uses the erubi[https://rubygems.org/gems/erubi] +# template system which can embed Ruby into an HTML document. +# If the template file has a .builder extension, then Jim Weirich's Builder::XmlMarkup library is used. +# +# == ERB +# +# You trigger ERB by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the +# following loop for names: +# +# Names of all the people +# <% @people.each do |person| %> +# Name: <%= person.name %>
+# <% end %> +# +# The loop is set up in regular embedding tags <% %>, and the name is written using the output embedding tag <%= %>. Note that this +# is not just a usage suggestion. Regular output functions like print or puts won't work with ERB templates. So this would be wrong: +# +# <%# WRONG %> +# Hi, Mr. <% puts "Frodo" %> +# +# If you absolutely must write from within a function use +concat+. +# +# When on a line that only contains whitespaces except for the tag, <% %> suppresses leading and trailing whitespace, +# including the trailing newline. <% %> and <%- -%> are the same. +# Note however that <%= %> and <%= -%> are different: only the latter removes trailing whitespaces. +# +# === Using sub templates +# +# Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The +# classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts): +# +# <%= render "application/header" %> +# Something really specific and terrific +# <%= render "application/footer" %> +# +# As you see, we use the output embeddings for the render methods. The render call itself will just return a string holding the +# result of the rendering. The output embedding writes it to the current template. +# +# But you don't have to restrict yourself to static includes. Templates can share variables amongst themselves by using instance +# variables defined using the regular embedding tags. Like this: +# +# <% @page_title = "A Wonderful Hello" %> +# <%= render "application/header" %> +# +# Now the header can pick up on the @page_title variable and use it for outputting a title tag: +# +# <%= @page_title %> +# +# === Passing local variables to sub templates +# +# You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values: +# +# <%= render "application/header", { headline: "Welcome", person: person } %> +# +# These can now be accessed in application/header with: +# +# Headline: <%= headline %> +# First name: <%= person.first_name %> +# +# The local variables passed to sub templates can be accessed as a hash using the local_assigns hash. This lets you access the +# variables as: +# +# Headline: <%= local_assigns[:headline] %> +# +# This is useful in cases where you aren't sure if the local variable has been assigned. Alternatively, you could also use +# defined? headline to first check if the variable has been assigned before using it. +# +# By default, templates will accept any locals as keyword arguments. To restrict what locals a template accepts, add a locals: magic comment: +# +# <%# locals: (headline:) %> +# +# Headline: <%= headline %> +# +# In cases where the local variables are optional, declare the keyword argument with a default value: +# +# <%# locals: (headline: nil) %> +# +# <% unless headline.nil? %> +# Headline: <%= headline %> +# <% end %> +# +# Read more about strict locals in {Action View Overview}[https://guides.rubyonrails.org/action_view_overview.html#strict-locals] +# in the guides. +# +# === Template caching +# +# By default, \Rails will compile each template to a method in order to render it. When you alter a template, +# \Rails will check the file's modification time and recompile it in development mode. +# +# == Builder +# +# Builder templates are a more programmatic alternative to ERB. They are especially useful for generating XML content. An XmlMarkup object +# named +xml+ is automatically made available to templates with a .builder extension. +# +# Here are some basic examples: +# +# xml.em("emphasized") # => emphasized +# xml.em { xml.b("emph & bold") } # => emph & bold +# xml.a("A Link", "href" => "http://onestepback.org") # => A Link +# xml.target("name" => "compile", "option" => "fast") # => +# # NOTE: order of attributes is not specified. +# +# Any method with a block will be treated as an XML markup tag with nested markup in the block. For example, the following: +# +# xml.div do +# xml.h1(@person.name) +# xml.p(@person.bio) +# end +# +# would produce something like: +# +#
+#

David Heinemeier Hansson

+#

A product of Danish Design during the Winter of '79...

+#
+# +# Here is a full-length RSS example actually used on Basecamp: +# +# xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do +# xml.channel do +# xml.title(@feed_title) +# xml.link(@url) +# xml.description "Basecamp: Recent items" +# xml.language "en-us" +# xml.ttl "40" +# +# @recent_items.each do |item| +# xml.item do +# xml.title(item_title(item)) +# xml.description(item_description(item)) if item_description(item) +# xml.pubDate(item_pubDate(item)) +# xml.guid(@person.firm.account.url + @recent_items.url(item)) +# xml.link(@person.firm.account.url + @recent_items.url(item)) +# +# xml.tag!("dc:creator", item.author_name) if item_has_creator?(item) +# end +# end +# end +# end +# +# For more information on Builder please consult the {source code}[https://github.com/rails/builder]. +# +# pkg:gem/actionview#lib/action_view/base.rb:158 +class ActionView::Base + include ::ActionView::Context + include ::ERB::Escape + include ::ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + include ::ActionView::Helpers + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # :startdoc: + # + # pkg:gem/actionview#lib/action_view/base.rb:249 + def initialize(lookup_context, assigns, controller); end + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def _routes; end + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def _routes=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def _routes?; end + + # pkg:gem/actionview#lib/action_view/base.rb:264 + def _run(method, template, locals, buffer, add_to_stack: T.unsafe(nil), has_strict_locals: T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/base.rb:180 + def annotate_rendered_view_with_filenames; end + + # pkg:gem/actionview#lib/action_view/base.rb:180 + def annotate_rendered_view_with_filenames=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:228 + def assign(new_assigns); end + + # pkg:gem/actionview#lib/action_view/base.rb:224 + def assigns; end + + # pkg:gem/actionview#lib/action_view/base.rb:224 + def assigns=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:177 + def automatically_disable_submit_tag; end + + # pkg:gem/actionview#lib/action_view/base.rb:177 + def automatically_disable_submit_tag=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:287 + def compiled_method_container; end + + # pkg:gem/actionview#lib/action_view/base.rb:224 + def config; end + + # pkg:gem/actionview#lib/action_view/base.rb:224 + def config=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:159 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/base.rb:159 + def debug_missing_translation=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:174 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/base.rb:174 + def default_formats=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:162 + def field_error_proc; end + + # pkg:gem/actionview#lib/action_view/base.rb:162 + def field_error_proc=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:226 + def formats(*, **, &); end + + # pkg:gem/actionview#lib/action_view/base.rb:226 + def formats=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:295 + def in_rendering_context(options); end + + # pkg:gem/actionview#lib/action_view/base.rb:226 + def locale(*, **, &); end + + # pkg:gem/actionview#lib/action_view/base.rb:226 + def locale=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def logger; end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def logger=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def logger?; end + + # pkg:gem/actionview#lib/action_view/base.rb:223 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def prefix_partial_path_with_controller_namespace; end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def prefix_partial_path_with_controller_namespace=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def prefix_partial_path_with_controller_namespace?; end + + # pkg:gem/actionview#lib/action_view/base.rb:187 + def remove_hidden_field_autocomplete; end + + # pkg:gem/actionview#lib/action_view/base.rb:187 + def remove_hidden_field_autocomplete=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def streaming_completion_on_exception; end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def streaming_completion_on_exception=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:226 + def view_paths(*, **, &); end + + # pkg:gem/actionview#lib/action_view/base.rb:226 + def view_paths=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:223 + def view_renderer; end + + class << self + # pkg:gem/actionview#lib/action_view/base.rb:182 + def _routes; end + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def _routes=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def _routes?; end + + # pkg:gem/actionview#lib/action_view/base.rb:180 + def annotate_rendered_view_with_filenames; end + + # pkg:gem/actionview#lib/action_view/base.rb:180 + def annotate_rendered_view_with_filenames=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:177 + def automatically_disable_submit_tag; end + + # pkg:gem/actionview#lib/action_view/base.rb:177 + def automatically_disable_submit_tag=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:192 + def cache_template_loading; end + + # pkg:gem/actionview#lib/action_view/base.rb:196 + def cache_template_loading=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:218 + def changed?(other); end + + # pkg:gem/actionview#lib/action_view/base.rb:159 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/base.rb:159 + def debug_missing_translation=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:314 + def default_form_builder; end + + # pkg:gem/actionview#lib/action_view/base.rb:314 + def default_form_builder=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:174 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/base.rb:174 + def default_formats=(val); end + + # :stopdoc: + # + # pkg:gem/actionview#lib/action_view/base.rb:235 + def empty; end + + # pkg:gem/actionview#lib/action_view/base.rb:190 + def erb_trim_mode=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:162 + def field_error_proc; end + + # pkg:gem/actionview#lib/action_view/base.rb:162 + def field_error_proc=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def logger; end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def logger=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def logger?; end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def prefix_partial_path_with_controller_namespace; end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def prefix_partial_path_with_controller_namespace=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def prefix_partial_path_with_controller_namespace?; end + + # pkg:gem/actionview#lib/action_view/base.rb:187 + def remove_hidden_field_autocomplete; end + + # pkg:gem/actionview#lib/action_view/base.rb:187 + def remove_hidden_field_autocomplete=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def streaming_completion_on_exception; end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def streaming_completion_on_exception=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:243 + def with_context(context, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/base.rb:204 + def with_empty_template_cache; end + + # pkg:gem/actionview#lib/action_view/base.rb:239 + def with_view_paths(view_paths, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/base.rb:200 + def xss_safe?; end + + private + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def __class_attr__routes; end + + # pkg:gem/actionview#lib/action_view/base.rb:182 + def __class_attr__routes=(new_value); end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def __class_attr_logger; end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def __class_attr_logger=(new_value); end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def __class_attr_prefix_partial_path_with_controller_namespace; end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def __class_attr_prefix_partial_path_with_controller_namespace=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/cache_expiry.rb:4 +module ActionView::CacheExpiry; end + +# pkg:gem/actionview#lib/action_view/cache_expiry.rb:5 +class ActionView::CacheExpiry::ViewReloader + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:6 + def initialize(watcher:, &block); end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:21 + def execute; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:16 + def updated?; end + + private + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:64 + def all_view_paths; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:37 + def build_watcher; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:60 + def dirs_to_watch; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:55 + def rebuild_watcher; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:33 + def reload!; end +end + +# pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:6 +module ActionView::CollectionCaching + extend ::ActiveSupport::Concern + + private + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:20 + def cache_collection_render(instrumentation_payload, view, template, collection); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:54 + def callable_cache_key?; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:58 + def collection_by_cache_keys(view, template, collection); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:71 + def expanded_cache_key(key, view, template, digest_path); end + + # `order_by` is an enumerable object containing keys of the cache, + # all keys are passed in whether found already or not. + # + # `cached_partials` is a hash. If the value exists + # it represents the rendered partial from the cache + # otherwise `Hash#fetch` will take the value of its block. + # + # This method expects a block that will return the rendered + # partial. An example is to render all results + # for each element that was not found in the cache and store it as an array. + # Order it so that the first empty cache element in `cached_partials` + # corresponds to the first element in `rendered_partials`. + # + # If the partial is not already cached it will also be + # written back to the underlying cache store. + # + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:91 + def fetch_or_cache_partial(cached_partials, template, order_by:); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:16 + def will_cache?(options, view); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:33 +class ActionView::CollectionRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:130 + def render_collection_derive_partial(collection, context, block); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:112 + def render_collection_with_partial(collection, partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:182 + def collection_with_template(view, template, layout, collection); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:153 + def render_collection(collection, view, path, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:148 + def retrieve_variable(path); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:36 +class ActionView::CollectionRenderer::CollectionIterator + include ::Enumerable + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:39 + def initialize(collection); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:43 + def each(&blk); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:51 + def length; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:55 + def preload!; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:47 + def size; end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:100 +class ActionView::CollectionRenderer::MixedCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:101 + def initialize(collection, paths); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:106 + def each_with_info; end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:78 +class ActionView::CollectionRenderer::PreloadCollectionIterator < ::ActionView::CollectionRenderer::SameCollectionIterator + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:79 + def initialize(collection, path, variables, relation); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:89 + def each_with_info; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:85 + def from_collection(collection); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:95 + def preload!; end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:60 +class ActionView::CollectionRenderer::SameCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:61 + def initialize(collection, path, variables); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:71 + def each_with_info; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:67 + def from_collection(collection); end +end + +# = Action View Context +# +# Action View contexts are supplied to Action Controller to render a template. +# The default Action View context is ActionView::Base. +# +# In order to work with Action Controller, a Context must just include this +# module. The initialization of the variables used by the context +# (@output_buffer, @view_flow, and @virtual_path) is responsibility of the +# object that includes this module (although you can call _prepare_context +# defined below). +# +# pkg:gem/actionview#lib/action_view/context.rb:14 +module ActionView::Context + # Encapsulates the interaction with the view flow so it + # returns the correct buffer on +yield+. This is usually + # overwritten by helpers to add more behavior. + # + # pkg:gem/actionview#lib/action_view/context.rb:27 + def _layout_for(name = T.unsafe(nil)); end + + # Prepares the context by setting the appropriate instance variables. + # + # pkg:gem/actionview#lib/action_view/context.rb:18 + def _prepare_context; end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def output_buffer; end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def output_buffer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def view_flow; end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def view_flow=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker.rb:8 +class ActionView::DependencyTracker + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionview#lib/action_view/dependency_tracker.rb:17 + def find_dependencies(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker.rb:24 + def register_tracker(extension, tracker); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker.rb:35 + def remove_tracker(handler); end + end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:5 +class ActionView::DependencyTracker::ERBTracker + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:72 + def initialize(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:76 + def dependencies; end + + private + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:104 + def add_dependencies(render_dependencies, arguments, pattern); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:112 + def add_dynamic_dependency(dependencies, dependency); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:118 + def add_static_dependency(dependencies, dependency, quote_type); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:88 + def directory; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:158 + def explicit_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:80 + def name; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:92 + def render_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:84 + def source; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:80 + def template; end + + class << self + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:68 + def call(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:64 + def supports_view_paths?; end + end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:6 +ActionView::DependencyTracker::ERBTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# A valid ruby identifier - suitable for class, method and specially variable names +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:9 +ActionView::DependencyTracker::ERBTracker::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:58 +ActionView::DependencyTracker::ERBTracker::LAYOUT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# Part of any hash containing the :layout key +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:36 +ActionView::DependencyTracker::ERBTracker::LAYOUT_HASH_KEY = T.let(T.unsafe(nil), Regexp) + +# Part of any hash containing the :partial key +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:30 +ActionView::DependencyTracker::ERBTracker::PARTIAL_HASH_KEY = T.let(T.unsafe(nil), Regexp) + +# Matches: +# partial: "comments/comment", collection: @all_comments => "comments/comment" +# (object: @single_comment, partial: "comments/comment") => "comments/comment" +# +# "comments/comments" +# 'comments/comments' +# ('comments/comments') +# +# (@topic) => "topics/topic" +# topics => "topics/topic" +# (message.topics) => "topics/topic" +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:52 +ActionView::DependencyTracker::ERBTracker::RENDER_ARGUMENTS = T.let(T.unsafe(nil), Regexp) + +# A simple string literal. e.g. "School's out!" +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:23 +ActionView::DependencyTracker::ERBTracker::STRING = T.let(T.unsafe(nil), Regexp) + +# Any kind of variable name. e.g. @instance, @@class, $global or local. +# Possibly following a method call chain +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:16 +ActionView::DependencyTracker::ERBTracker::VARIABLE_OR_METHOD_CHAIN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:5 +class ActionView::DependencyTracker::RubyTracker + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:20 + def initialize(name, template, view_paths = T.unsafe(nil), parser_class: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:12 + def dependencies; end + + private + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:38 + def explicit_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:26 + def name; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:28 + def render_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:26 + def template; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:26 + def view_paths; end + + class << self + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:8 + def call(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:16 + def supports_view_paths?; end + end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker/ruby_tracker.rb:6 +ActionView::DependencyTracker::RubyTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:5 +class ActionView::DependencyTracker::WildcardResolver + # pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:6 + def initialize(view_paths, dependencies); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:13 + def resolve; end + + private + + # pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:20 + def explicit_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:22 + def resolved_wildcard_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:20 + def view_paths; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/wildcard_resolver.rb:20 + def wildcard_dependencies; end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:6 +class ActionView::Digestor + class << self + # Supported options: + # + # * name - Template name + # * format - Template format + # * +finder+ - An instance of ActionView::LookupContext + # * dependencies - An array of dependent views + # + # pkg:gem/actionview#lib/action_view/digestor.rb:16 + def digest(name:, finder:, format: T.unsafe(nil), dependencies: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:38 + def logger; end + + # Create a dependency tree for template named +name+. + # + # pkg:gem/actionview#lib/action_view/digestor.rb:43 + def tree(name, finder, partial = T.unsafe(nil), seen = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/digestor.rb:71 + def find_template(finder, name, prefixes, partial, keys); end + end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:125 +class ActionView::Digestor::Injected < ::ActionView::Digestor::Node + # pkg:gem/actionview#lib/action_view/digestor.rb:126 + def digest(finder, _ = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:121 +class ActionView::Digestor::Missing < ::ActionView::Digestor::Node + # pkg:gem/actionview#lib/action_view/digestor.rb:122 + def digest(finder, _ = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:78 +class ActionView::Digestor::Node + # pkg:gem/actionview#lib/action_view/digestor.rb:86 + def initialize(name, logical_name, template, children = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def children; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:97 + def dependency_digest(finder, stack); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:93 + def digest(finder, stack = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def logical_name; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def name; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def template; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:110 + def to_dep_map(seen = T.unsafe(nil)); end + + class << self + # pkg:gem/actionview#lib/action_view/digestor.rb:81 + def create(name, logical_name, template, partial); end + end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:129 +class ActionView::Digestor::NullLogger + class << self + # pkg:gem/actionview#lib/action_view/digestor.rb:130 + def debug(_); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:131 + def error(_); end + end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:119 +class ActionView::Digestor::Partial < ::ActionView::Digestor::Node; end + +# pkg:gem/actionview#lib/action_view.rb:35 +ActionView::ENCODING_FLAG = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/template/error.rb:11 +class ActionView::EncodingError < ::StandardError; end + +# A resolver that loads files from the filesystem. +# +# pkg:gem/actionview#lib/action_view/template/resolver.rb:90 +class ActionView::FileSystemResolver < ::ActionView::Resolver + # pkg:gem/actionview#lib/action_view/template/resolver.rb:93 + def initialize(path); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:115 + def ==(resolver); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:117 + def all_template_paths; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:126 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:101 + def clear_cache; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:112 + def eql?(resolver); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:91 + def path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:110 + def to_path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:107 + def to_s; end + + private + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:131 + def _find_all(name, prefix, partial, details, key, locals); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:150 + def build_unbound_template(template); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:208 + def escape_entry(entry); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:180 + def filter_and_sort_by_details(templates, requested_details); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:146 + def source_for_template(template); end + + # Safe glob within @path + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:195 + def template_glob(glob); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:163 + def unbound_templates_from_path(path); end +end + +# pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:6 +module ActionView::Helpers + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + class << self + # pkg:gem/actionview#lib/action_view/helpers.rb:35 + def eager_load!; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:8 +module ActionView::Helpers::ActiveModelHelper; end + +# = Active \Model Instance Tag \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:12 +module ActionView::Helpers::ActiveModelInstanceTag + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:20 + def content_tag(type, options, *); end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:36 + def error_message; end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:28 + def error_wrapping(html_tag); end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:13 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:24 + def tag(type, options, *); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:41 + def object_has_errors?; end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:45 + def select_markup_helper?(type); end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:49 + def tag_generate_errors?(options); end +end + +# = Action View Asset Tag \Helpers +# +# This module provides methods for generating HTML that links views to assets such +# as images, JavaScripts, stylesheets, and feeds. These methods do not verify +# the assets exist before linking to them: +# +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:21 +module ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default=(val); end + + # Returns an HTML audio tag for the +sources+. If +sources+ is a string, + # a single audio tag will be returned. If +sources+ is an array, an audio + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public audios + # directory, or Active Storage attachments. + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. + # + # audio_tag("sound") + # # => + # audio_tag("sound.wav") + # # => + # audio_tag("sound.wav", autoplay: true, controls: true) + # # => + # audio_tag("sound.wav", "sound.mid") + # # => + # + # Active Storage blobs (audios that are uploaded by the users of your app): + # + # audio_tag(user.name_pronunciation_audio) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:612 + def audio_tag(*sources); end + + # Returns a link tag that browsers and feed readers can use to auto-detect + # an RSS, Atom, or JSON feed. The +type+ can be :rss (default), + # :atom, or :json. Control the link options in url_for format + # using the +url_options+. You can modify the LINK tag itself in +tag_options+. + # + # ==== Options + # + # * :rel - Specify the relation of this link, defaults to "alternate" + # * :type - Override the auto-generated mime type + # * :title - Specify the title of the link, defaults to the +type+ + # + # ==== Examples + # + # auto_discovery_link_tag + # # => + # auto_discovery_link_tag(:atom) + # # => + # auto_discovery_link_tag(:json) + # # => + # auto_discovery_link_tag(:rss, {action: "feed"}) + # # => + # auto_discovery_link_tag(:rss, {action: "feed"}, {title: "My RSS"}) + # # => + # auto_discovery_link_tag(:rss, {controller: "news", action: "feed"}) + # # => + # auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {title: "Example RSS"}) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:279 + def auto_discovery_link_tag(type = T.unsafe(nil), url_options = T.unsafe(nil), tag_options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:29 + def auto_include_nonce_for_scripts; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:29 + def auto_include_nonce_for_scripts=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:30 + def auto_include_nonce_for_styles; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:30 + def auto_include_nonce_for_styles=(val); end + + # Returns a link tag for a favicon managed by the asset pipeline. + # + # If a page has no link like the one generated by this helper, browsers + # ask for /favicon.ico automatically, and cache the file if the + # request succeeds. If the favicon changes it is hard to get it updated. + # + # To have better control applications may let the asset pipeline manage + # their favicon storing the file under app/assets/images, and + # using this helper to generate its corresponding link tag. + # + # The helper gets the name of the favicon file as first argument, which + # defaults to "favicon.ico", and also supports +:rel+ and +:type+ options + # to override their defaults, "icon" and "image/x-icon" + # respectively: + # + # favicon_link_tag + # # => + # + # favicon_link_tag 'myicon.ico' + # # => + # + # Mobile Safari looks for a different link tag, pointing to an image that + # will be used if you add the page to the home screen of an iOS device. + # The following call would generate such a tag: + # + # favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:320 + def favicon_link_tag(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading=(val); end + + # Returns an HTML image tag for the +source+. The +source+ can be a full + # path, a file, or an Active Storage attachment. + # + # ==== Options + # + # You can add HTML attributes using the +options+. The +options+ supports + # additional keys for convenience and conformance: + # + # * :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes + # width="30" height="45", and "50" becomes width="50" height="50". + # :size will be ignored if the value is not in the correct format. + # * :srcset - If supplied as a hash or array of [source, descriptor] + # pairs, each image path will be expanded before the list is formatted as a string. + # + # ==== Examples + # + # Assets (images that are part of your app): + # + # image_tag("icon") + # # => + # image_tag("icon.png") + # # => + # image_tag("icon.png", size: "16x10", alt: "Edit Entry") + # # => Edit Entry + # image_tag("/icons/icon.gif", size: "16") + # # => + # image_tag("/icons/icon.gif", height: '32', width: '32') + # # => + # image_tag("/icons/icon.gif", class: "menu_icon") + # # => + # image_tag("/icons/icon.gif", data: { title: 'Rails Application' }) + # # => + # image_tag("icon.png", srcset: { "icon_2x.png" => "2x", "icon_4x.png" => "4x" }) + # # => + # image_tag("pic.jpg", srcset: [["pic_1024.jpg", "1024w"], ["pic_1980.jpg", "1980w"]], sizes: "100vw") + # # => + # + # Active Storage blobs (images that are uploaded by the users of your app): + # + # image_tag(user.avatar) + # # => + # image_tag(user.avatar.variant(resize_to_limit: [100, 100])) + # # => + # image_tag(user.avatar.variant(resize_to_limit: [100, 100]), size: '100') + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:449 + def image_tag(source, options = T.unsafe(nil)); end + + # Returns an HTML script tag for each of the +sources+ provided. + # + # Sources may be paths to JavaScript files. Relative paths are assumed to be relative + # to assets/javascripts, full paths are assumed to be relative to the document + # root. Relative paths are idiomatic, use absolute paths only when needed. + # + # When passing paths, the ".js" extension is optional. If you do not want ".js" + # appended to the path extname: false can be set on the options. + # + # You can modify the HTML attributes of the script tag by passing a hash as the + # last argument. + # + # When the Asset Pipeline is enabled, you can pass the name of your manifest as + # source, and include other JavaScript or CoffeeScript files inside the manifest. + # + # If the server supports HTTP Early Hints, and the +defer+ option is not + # enabled, \Rails will push a 103 Early Hints response that links + # to the assets. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. This includes but is not limited to the following options: + # + # * :extname - Append an extension to the generated URL unless the extension + # already exists. This only applies for relative URLs. + # * :protocol - Sets the protocol of the generated URL. This option only + # applies when a relative URL and +host+ options are provided. + # * :host - When a relative URL is provided the host is added to the + # that path. + # * :skip_pipeline - This option is used to bypass the asset pipeline + # when it is set to true. + # * :nonce - When set to true, adds an automatic nonce value if + # you have Content Security Policy enabled. + # * :async - When set to +true+, adds the +async+ HTML + # attribute, allowing the script to be fetched in parallel to be parsed + # and evaluated as soon as possible. + # * :defer - When set to +true+, adds the +defer+ HTML + # attribute, which indicates to the browser that the script is meant to + # be executed after the document has been parsed. Additionally, prevents + # sending the Preload Links header. + # * :nopush - Specify if the use of server push is not desired + # for the script. Defaults to +true+. + # + # Any other specified options will be treated as HTML attributes for the + # +script+ tag. + # + # For more information regarding how the :async and :defer + # options affect the + # + # javascript_include_tag "xmlhr", host: "localhost", protocol: "https" + # # => + # + # javascript_include_tag "template.jst", extname: false + # # => + # + # javascript_include_tag "xmlhr.js" + # # => + # + # javascript_include_tag "common.javascript", "/elsewhere/cools" + # # => + # # + # + # javascript_include_tag "http://www.example.com/xmlhr" + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js" + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", nonce: true + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", async: true + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", defer: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:115 + def javascript_include_tag(*sources); end + + # Returns an HTML picture tag for the +sources+. If +sources+ is a string, + # a single picture tag will be returned. If +sources+ is an array, a picture + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public images + # directory, or Active Storage attachments. Since the picture tag requires + # an img tag, the last element you provide will be used for the img tag. + # For complete control over the picture tag, a block can be passed, which + # will populate the contents of the tag accordingly. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. Apart from all the HTML supported options, the following are supported: + # + # * :image - Hash of options that are passed directly to the +image_tag+ helper. + # + # ==== Examples + # + # picture_tag("picture.webp") + # # => + # picture_tag("gold.png", :image => { :size => "20" }) + # # => + # picture_tag("gold.png", :image => { :size => "45x70" }) + # # => + # picture_tag("picture.webp", "picture.png") + # # => + # picture_tag("picture.webp", "picture.png", :image => { alt: "Image" }) + # # => Image + # picture_tag(["picture.webp", "picture.png"], :image => { alt: "Image" }) + # # => Image + # picture_tag(:class => "my-class") { tag(:source, :srcset => image_path("picture.webp")) + image_tag("picture.png", :alt => "Image") } + # # => Image + # picture_tag { tag(:source, :srcset => image_path("picture-small.webp"), :media => "(min-width: 600px)") + tag(:source, :srcset => image_path("picture-big.webp")) + image_tag("picture.png", :alt => "Image") } + # # => Image + # + # Active Storage blobs (images that are uploaded by the users of your app): + # + # picture_tag(user.profile_picture) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:510 + def picture_tag(*sources, &block); end + + # Returns a link tag that browsers can use to preload the +source+. + # The +source+ can be the path of a resource managed by asset pipeline, + # a full path, or an URI. + # + # ==== Options + # + # * :type - Override the auto-generated mime type, defaults to the mime type for +source+ extension. + # * :as - Override the auto-generated value for as attribute, calculated using +source+ extension and mime type. + # * :crossorigin - Specify the crossorigin attribute, required to load cross-origin resources. + # * :nopush - Specify if the use of server push is not desired for the resource. Defaults to +false+. + # * :integrity - Specify the integrity attribute. + # + # ==== Examples + # + # preload_link_tag("custom_theme.css") + # # => + # + # preload_link_tag("/videos/video.webm") + # # => + # + # preload_link_tag(post_path(format: :json), as: "fetch") + # # => + # + # preload_link_tag("worker.js", as: "worker") + # # => + # + # preload_link_tag("//example.com/font.woff2") + # # => + # + # preload_link_tag("//example.com/font.woff2", crossorigin: "use-credentials") + # # => + # + # preload_link_tag("/media/audio.ogg", nopush: true) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:363 + def preload_link_tag(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:27 + def preload_links_header; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:27 + def preload_links_header=(val); end + + # Returns a stylesheet link tag for the sources specified as arguments. + # + # When passing paths, the .css extension is optional. + # If you don't specify an extension, .css will be appended automatically. + # If you do not want .css appended to the path, + # set extname: false in the options. + # You can modify the link attributes by passing a hash as the last argument. + # + # If the server supports HTTP Early Hints, \Rails will push a 103 Early + # Hints response that links to the assets. + # + # ==== Options + # + # * :extname - Append an extension to the generated URL unless the extension + # already exists. This only applies for relative URLs. + # * :protocol - Sets the protocol of the generated URL. This option only + # applies when a relative URL and +host+ options are provided. + # * :host - When a relative URL is provided the host is added to the + # that path. + # * :skip_pipeline - This option is used to bypass the asset pipeline + # when it is set to true. + # * :nonce - When set to true, adds an automatic nonce value if + # you have Content Security Policy enabled. + # * :nopush - Specify if the use of server push is not desired + # for the stylesheet. Defaults to +true+. + # + # ==== Examples + # + # stylesheet_link_tag "style" + # # => + # + # stylesheet_link_tag "style.css" + # # => + # + # stylesheet_link_tag "http://www.example.com/style.css" + # # => + # + # stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less" + # # => + # + # stylesheet_link_tag "style", media: "all" + # # => + # + # stylesheet_link_tag "style", media: "print" + # # => + # + # stylesheet_link_tag "random.styles", "/css/stylish" + # # => + # # + # + # stylesheet_link_tag "style", nonce: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:207 + def stylesheet_link_tag(*sources); end + + # Returns an HTML video tag for the +sources+. If +sources+ is a string, + # a single video tag will be returned. If +sources+ is an array, a video + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public videos + # directory, or Active Storage attachments. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. The following options are supported: + # + # * :poster - Set an image (like a screenshot) to be shown + # before the video loads. The path is calculated like the +src+ of +image_tag+. + # * :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes + # width="30" height="45", and "50" becomes width="50" height="50". + # :size will be ignored if the value is not in the correct format. + # * :poster_skip_pipeline will bypass the asset pipeline when using + # the :poster option instead using an asset in the public folder. + # + # ==== Examples + # + # video_tag("trailer") + # # => + # video_tag("trailer.ogg") + # # => + # video_tag("trailer.ogg", controls: true, preload: 'none') + # # => + # video_tag("trailer.m4v", size: "16x10", poster: "screenshot.png") + # # => + # video_tag("trailer.m4v", size: "16x10", poster: "screenshot.png", poster_skip_pipeline: true) + # # => + # video_tag("/trailers/hd.avi", size: "16x16") + # # => + # video_tag("/trailers/hd.avi", size: "16") + # # => + # video_tag("/trailers/hd.avi", height: '32', width: '32') + # # => + # video_tag("trailer.ogg", "trailer.flv") + # # => + # video_tag(["trailer.ogg", "trailer.flv"]) + # # => + # video_tag(["trailer.ogg", "trailer.flv"], size: "160x120") + # # => + # + # Active Storage blobs (videos that are uploaded by the users of your app): + # + # video_tag(user.intro_video) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:580 + def video_tag(*sources); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:653 + def check_for_image_tag_errors(options); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:644 + def extract_dimensions(size); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:617 + def multiple_sources_tag_builder(type, sources); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:634 + def resolve_asset_source(asset_type, source, skip_pipeline); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:659 + def resolve_link_as(extname, mime_type); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:673 + def send_preload_links_header(preload_links, max_header_size: T.unsafe(nil)); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:29 + def auto_include_nonce_for_scripts; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:29 + def auto_include_nonce_for_scripts=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:30 + def auto_include_nonce_for_styles; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:30 + def auto_include_nonce_for_styles=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:27 + def preload_links_header; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:27 + def preload_links_header=(val); end + end +end + +# Some HTTP client and proxies have a 4kiB header limit, but more importantly +# including preload links has diminishing returns so it's best to not go overboard +# +# pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:671 +ActionView::Helpers::AssetTagHelper::MAX_HEADER_SIZE = T.let(T.unsafe(nil), Integer) + +# = Action View Asset URL \Helpers +# +# This module provides methods for generating asset paths and +# URLs. +# +# image_path("rails.png") +# # => "/assets/rails.png" +# +# image_url("rails.png") +# # => "http://www.example.com/assets/rails.png" +# +# === Using asset hosts +# +# By default, \Rails links to these assets on the current host in the public +# folder, but you can direct \Rails to link to assets from a dedicated asset +# server by setting ActionController::Base.asset_host in the application +# configuration, typically in config/environments/production.rb. +# For example, you'd define assets.example.com to be your asset +# host this way, inside the configure block of your environment-specific +# configuration files or config/application.rb: +# +# config.action_controller.asset_host = "assets.example.com" +# +# Helpers take that into account: +# +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# Browsers open a limited number of simultaneous connections to a single +# host. The exact number varies by browser and version. This limit may cause +# some asset downloads to wait for previous assets to finish before they can +# begin. You can use the %d wildcard in the +asset_host+ to +# distribute the requests over four hosts. For example, +# assets%d.example.com will spread the asset requests over +# "assets0.example.com", ..., "assets3.example.com". +# +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# This may improve the asset loading performance of your application. +# It is also possible the combination of additional connection overhead +# (DNS, SSL) and the overall browser connection limits may result in this +# solution being slower. You should be sure to measure your actual +# performance across targeted browsers both before and after this change. +# +# To implement the corresponding hosts you can either set up four actual +# hosts or use wildcard DNS to CNAME the wildcard to a single asset host. +# You can read more about setting up your DNS CNAME records from your ISP. +# +# Note: This is purely a browser performance optimization and is not meant +# for server load balancing. See https://www.die.net/musings/page_load_time/ +# for background and https://www.browserscope.org/?category=network for +# connection limit data. +# +# Alternatively, you can exert more control over the asset host by setting +# +asset_host+ to a proc like this: +# +# ActionController::Base.asset_host = Proc.new { |source| +# "http://assets#{OpenSSL::Digest::SHA256.hexdigest(source).to_i(16) % 2 + 1}.example.com" +# } +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# The example above generates "http://assets1.example.com" and +# "http://assets2.example.com". This option is useful for example if +# you need fewer/more than four hosts, custom host names, etc. +# +# As you see the proc takes a +source+ parameter. That's a string with the +# absolute path of the asset, for example "/assets/rails.png". +# +# ActionController::Base.asset_host = Proc.new { |source| +# if source.end_with?('.css') +# "http://stylesheets.example.com" +# else +# "http://assets.example.com" +# end +# } +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# Alternatively you may ask for a second parameter +request+. That one is +# particularly useful for serving assets from an SSL-protected page. The +# example proc below disables asset hosting for HTTPS connections, while +# still sending assets for plain HTTP requests from asset hosts. If you don't +# have SSL certificates for each of the asset hosts this technique allows you +# to avoid warnings in the client about mixed media. +# Note that the +request+ parameter might not be supplied, e.g. when the assets +# are precompiled with the command bin/rails assets:precompile. Make sure to use a +# +Proc+ instead of a lambda, since a +Proc+ allows missing parameters and sets them +# to +nil+. +# +# config.action_controller.asset_host = Proc.new { |source, request| +# if request && request.ssl? +# "#{request.protocol}#{request.host_with_port}" +# else +# "#{request.protocol}assets.example.com" +# end +# } +# +# You can also implement a custom asset host object that responds to +call+ +# and takes either one or two parameters just like the proc. +# +# config.action_controller.asset_host = AssetHostingWithMinimumSsl.new( +# "http://asset%d.example.com", "https://asset1.example.com" +# ) +# +# pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:121 +module ActionView::Helpers::AssetUrlHelper + # This is the entry point for all assets. + # When using an asset pipeline gem (e.g. propshaft or sprockets-rails), the + # behavior is "enhanced". You can bypass the asset pipeline by passing in + # skip_pipeline: true to the options. + # + # All other asset *_path helpers delegate through this method. + # + # === With the asset pipeline + # + # All options passed to +asset_path+ will be passed to +compute_asset_path+ + # which is implemented by asset pipeline gems. + # + # asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js" + # asset_path('application.js', host: 'example.com') # => "//example.com/assets/application.js" + # asset_path("application.js", host: 'example.com', protocol: 'https') # => "https://example.com/assets/application.js" + # + # === Without the asset pipeline (skip_pipeline: true) + # + # Accepts a type option that can specify the asset's extension. No error + # checking is done to verify the source passed into +asset_path+ is valid + # and that the file exists on disk. + # + # asset_path("application.js", skip_pipeline: true) # => "application.js" + # asset_path("filedoesnotexist.png", skip_pipeline: true) # => "filedoesnotexist.png" + # asset_path("application", type: :javascript, skip_pipeline: true) # => "/javascripts/application.js" + # asset_path("application", type: :stylesheet, skip_pipeline: true) # => "/stylesheets/application.css" + # + # === Options applying to all assets + # + # Below lists scenarios that apply to +asset_path+ whether or not you're + # using the asset pipeline. + # + # - All fully qualified URLs are returned immediately. This bypasses the + # asset pipeline and all other behavior described. + # + # asset_path("http://www.example.com/js/xmlhr.js") # => "http://www.example.com/js/xmlhr.js" + # + # - All assets that begin with a forward slash are assumed to be full + # URLs and will not be expanded. This will bypass the asset pipeline. + # + # asset_path("/foo.png") # => "/foo.png" + # + # - All blank strings will be returned immediately. This bypasses the + # asset pipeline and all other behavior described. + # + # asset_path("") # => "" + # + # - If config.relative_url_root is specified, all assets will have that + # root prepended. + # + # Rails.application.config.relative_url_root = "bar" + # asset_path("foo.js", skip_pipeline: true) # => "bar/foo.js" + # + # - A different asset host can be specified via config.action_controller.asset_host + # this is commonly used in conjunction with a CDN. + # + # Rails.application.config.action_controller.asset_host = "assets.example.com" + # asset_path("foo.js", skip_pipeline: true) # => "http://assets.example.com/foo.js" + # + # - An extension name can be specified manually with extname. + # + # asset_path("foo", skip_pipeline: true, extname: ".js") # => "/foo.js" + # asset_path("foo.css", skip_pipeline: true, extname: ".js") # => "/foo.css.js" + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:187 + def asset_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to an asset in the public directory. This + # will use +asset_path+ internally, so most of their behaviors + # will be the same. If +:host+ options is set, it overwrites global + # +config.action_controller.asset_host+ setting. + # + # All other options provided are forwarded to +asset_path+ call. + # + # asset_url "application.js" # => http://example.com/assets/application.js + # asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:231 + def asset_url(source, options = T.unsafe(nil)); end + + # Computes the path to an audio asset in the public audios directory. + # Full paths from the document root will be passed through. + # Used internally by +audio_tag+ to build the audio path. + # + # audio_path("horse") # => /audios/horse + # audio_path("horse.wav") # => /audios/horse.wav + # audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav + # audio_path("/sounds/horse.wav") # => /sounds/horse.wav + # audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:430 + def audio_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to an audio asset in the public audios directory. + # This will use +audio_path+ internally, so most of their behaviors will be the same. + # Since +audio_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:442 + def audio_url(source, options = T.unsafe(nil)); end + + # Compute extname to append to asset path. Returns +nil+ if + # nothing should be added. + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:243 + def compute_asset_extname(source, options = T.unsafe(nil)); end + + # Pick an asset host for this source. Returns +nil+ if no host is set, + # the host if no wildcard is set, the host interpolated with the + # numbers 0-3 if it contains %d (the number is the source hash mod 4), + # or the value returned from invoking call on an object responding to call + # (proc or otherwise). + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:277 + def compute_asset_host(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # Computes asset path to public directory. Plugins and + # extensions can override this method to point to custom assets + # or generate digested paths or query strings. + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:266 + def compute_asset_path(source, options = T.unsafe(nil)); end + + # Computes the path to a font asset. + # Full paths from the document root will be passed through. + # + # font_path("font") # => /fonts/font + # font_path("font.ttf") # => /fonts/font.ttf + # font_path("dir/font.ttf") # => /fonts/dir/font.ttf + # font_path("/dir/font.ttf") # => /dir/font.ttf + # font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:455 + def font_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a font asset. + # This will use +font_path+ internally, so most of their behaviors will be the same. + # Since +font_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:467 + def font_url(source, options = T.unsafe(nil)); end + + # Computes the path to an image asset. + # Full paths from the document root will be passed through. + # Used internally by +image_tag+ to build the image path: + # + # image_path("edit") # => "/assets/edit" + # image_path("edit.png") # => "/assets/edit.png" + # image_path("icons/edit.png") # => "/assets/icons/edit.png" + # image_path("/icons/edit.png") # => "/icons/edit.png" + # image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png" + # + # If you have images as application resources this method may conflict with their named routes. + # The alias +path_to_image+ is provided to avoid that. \Rails uses the alias internally, and + # plugin authors are encouraged to do so. + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:378 + def image_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to an image asset. + # This will use +image_path+ internally, so most of their behaviors will be the same. + # Since +image_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:390 + def image_url(source, options = T.unsafe(nil)); end + + # Computes the path to a JavaScript asset in the public javascripts directory. + # If the +source+ filename has no extension, .js will be appended (except for explicit URIs) + # Full paths from the document root will be passed through. + # Used internally by +javascript_include_tag+ to build the script path. + # + # javascript_path "xmlhr" # => /assets/xmlhr.js + # javascript_path "dir/xmlhr.js" # => /assets/dir/xmlhr.js + # javascript_path "/dir/xmlhr" # => /dir/xmlhr.js + # javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr + # javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:321 + def javascript_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a JavaScript asset in the public javascripts directory. + # This will use +javascript_path+ internally, so most of their behaviors will be the same. + # Since +javascript_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:333 + def javascript_url(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:219 + def path_to_asset(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:433 + def path_to_audio(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:458 + def path_to_font(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:381 + def path_to_image(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:324 + def path_to_javascript(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:351 + def path_to_stylesheet(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:407 + def path_to_video(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:270 + def public_compute_asset_path(source, options = T.unsafe(nil)); end + + # Computes the path to a stylesheet asset in the public stylesheets directory. + # If the +source+ filename has no extension, .css will be appended (except for explicit URIs). + # Full paths from the document root will be passed through. + # Used internally by +stylesheet_link_tag+ to build the stylesheet path. + # + # stylesheet_path "style" # => /assets/style.css + # stylesheet_path "dir/style.css" # => /assets/dir/style.css + # stylesheet_path "/dir/style.css" # => /dir/style.css + # stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style + # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:348 + def stylesheet_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a stylesheet asset in the public stylesheets directory. + # This will use +stylesheet_path+ internally, so most of their behaviors will be the same. + # Since +stylesheet_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:360 + def stylesheet_url(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:234 + def url_to_asset(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:445 + def url_to_audio(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:470 + def url_to_font(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:393 + def url_to_image(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:336 + def url_to_javascript(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:363 + def url_to_stylesheet(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:419 + def url_to_video(source, options = T.unsafe(nil)); end + + # Computes the path to a video asset in the public videos directory. + # Full paths from the document root will be passed through. + # Used internally by +video_tag+ to build the video path. + # + # video_path("hd") # => /videos/hd + # video_path("hd.avi") # => /videos/hd.avi + # video_path("trailers/hd.avi") # => /videos/trailers/hd.avi + # video_path("/trailers/hd.avi") # => /trailers/hd.avi + # video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:404 + def video_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a video asset in the public videos directory. + # This will use +video_path+ internally, so most of their behaviors will be the same. + # Since +video_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:416 + def video_url(source, options = T.unsafe(nil)); end +end + +# aliased to avoid conflicts with an asset_url named route +# +# pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:236 +ActionView::Helpers::AssetUrlHelper::ASSET_EXTENSIONS = T.let(T.unsafe(nil), Hash) + +# Maps asset types to public directory. +# +# pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:254 +ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:122 +ActionView::Helpers::AssetUrlHelper::URI_REGEXP = T.let(T.unsafe(nil), Regexp) + +# = Action View Atom Feed \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:6 +module ActionView::Helpers::AtomFeedHelper + # Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERB or any other + # template languages). + # + # Full usage example: + # + # config/routes.rb: + # Rails.application.routes.draw do + # resources :posts + # root to: "posts#index" + # end + # + # app/controllers/posts_controller.rb: + # class PostsController < ApplicationController + # # GET /posts.html + # # GET /posts.atom + # def index + # @posts = Post.all + # + # respond_to do |format| + # format.html + # format.atom + # end + # end + # end + # + # app/views/posts/index.atom.builder: + # atom_feed do |feed| + # feed.title("My great blog!") + # feed.updated(@posts[0].created_at) if @posts.length > 0 + # + # @posts.each do |post| + # feed.entry(post) do |entry| + # entry.title(post.title) + # entry.content(post.body, type: 'html') + # + # entry.author do |author| + # author.name("DHH") + # end + # end + # end + # end + # + # The options for atom_feed are: + # + # * :language: Defaults to "en-US". + # * :root_url: The HTML alternative that this feed is doubling for. Defaults to / on the current host. + # * :url: The URL for this feed. Defaults to the current URL. + # * :id: The id for this feed. Defaults to "tag:localhost,2005:/posts", in this case. + # * :schema_date: The date at which the tag scheme for the feed was first used. A good default is the year you + # created the feed. See http://feedvalidator.org/docs/error/InvalidTAG.html for more information. If not specified, + # 2005 is used (as an "I don't care" value). + # * :instruct: Hash of XML processing instructions in the form {target => {attribute => value, }} or {target => [{attribute => value, }, ]} + # + # Other namespaces can be added to the root element: + # + # app/views/posts/index.atom.builder: + # atom_feed({'xmlns:app' => 'http://www.w3.org/2007/app', + # 'xmlns:openSearch' => 'http://a9.com/-/spec/opensearch/1.1/'}) do |feed| + # feed.title("My great blog!") + # feed.updated((@posts.first.created_at)) + # feed.tag!('openSearch:totalResults', 10) + # + # @posts.each do |post| + # feed.entry(post) do |entry| + # entry.title(post.title) + # entry.content(post.body, type: 'html') + # entry.tag!('app:edited', Time.now) + # + # entry.author do |author| + # author.name("DHH") + # end + # end + # end + # end + # + # The Atom spec defines five elements (content rights title subtitle + # summary) which may directly contain XHTML content if type: 'xhtml' + # is specified as an attribute. If so, this helper will take care of + # the enclosing div and XHTML namespace declaration. Example usage: + # + # entry.summary type: 'xhtml' do |xhtml| + # xhtml.p pluralize(order.line_items.count, "line item") + # xhtml.p "Shipped to #{order.address}" + # xhtml.p "Paid by #{order.pay_type}" + # end + # + # + # atom_feed yields an +AtomFeedBuilder+ instance. Nested elements yield + # an +AtomBuilder+ instance. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:96 + def atom_feed(options = T.unsafe(nil), &block); end +end + +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:127 +class ActionView::Helpers::AtomFeedHelper::AtomBuilder + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:130 + def initialize(xml); end + + private + + # Delegate to XML Builder, first wrapping the element in an XHTML + # namespaced div element if the method and arguments indicate + # that an xhtml_block? is desired. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:138 + def method_missing(method, *arguments, &block); end + + # True if the method name matches one of the five elements defined + # in the Atom spec as potentially containing XHTML content and + # if type: 'xhtml' is, in fact, specified. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:153 + def xhtml_block?(method, arguments); end +end + +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:128 +ActionView::Helpers::AtomFeedHelper::AtomBuilder::XHTML_TAG_NAMES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:161 +class ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder < ::ActionView::Helpers::AtomFeedHelper::AtomBuilder + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:162 + def initialize(xml, view, feed_options = T.unsafe(nil)); end + + # Creates an entry tag for a specific record and prefills the id using class and id. + # + # ==== Options + # + # * :published: Time first published. Defaults to the created_at attribute on the record if one such exists. + # * :updated: Time of update. Defaults to the updated_at attribute on the record if one such exists. + # * :url: The URL for this entry or +false+ or +nil+ for not having a link tag. Defaults to the +polymorphic_url+ for the record. + # * :id: The ID for this entry. Defaults to "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}" + # * :type: The TYPE for this entry. Defaults to "text/html". + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:180 + def entry(record, options = T.unsafe(nil)); end + + # Accepts a Date or Time object and inserts it in the proper format. If +nil+ is passed, current time in UTC is used. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:167 + def updated(date_or_time = T.unsafe(nil)); end +end + +# = Action View Cache \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:6 +module ActionView::Helpers::CacheHelper + # This helper exposes a method for caching fragments of a view + # rather than an entire action or page. This technique is useful + # caching pieces like menus, lists of new topics, static HTML + # fragments, and so on. This method takes a block that contains + # the content you wish to cache. + # + # The best way to use this is by doing recyclable key-based cache expiration + # on top of a cache store like Memcached or Redis that'll automatically + # kick out old entries. + # + # When using this method, you list the cache dependency as the name of the cache, like so: + # + # <% cache project do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # This approach will assume that when a new topic is added, you'll touch + # the project. The cache key generated from this call will be something like: + # + # views/template/action:7a1156131a6928cb0026877f8b749ac9/projects/123 + # ^template path ^template tree digest ^class ^id + # + # This cache key is stable, but it's combined with a cache version derived from the project + # record. When the project updated_at is touched, the #cache_version changes, even + # if the key stays stable. This means that unlike a traditional key-based cache expiration + # approach, you won't be generating cache trash, unused keys, simply because the dependent + # record is updated. + # + # If your template cache depends on multiple sources (try to avoid this to keep things simple), + # you can name all these dependencies as part of an array: + # + # <% cache [ project, current_user ] do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # This will include both records as part of the cache key and updating either of them will + # expire the cache. + # + # ==== \Template digest + # + # The template digest that's added to the cache key is computed by taking an MD5 of the + # contents of the entire template file. This ensures that your caches will automatically + # expire when you change the template file. + # + # Note that the MD5 is taken of the entire template file, not just what's within the + # cache do/end call. So it's possible that changing something outside of that call will + # still expire the cache. + # + # Additionally, the digestor will automatically look through your template file for + # explicit and implicit dependencies, and include those as part of the digest. + # + # The digestor can be bypassed by passing skip_digest: true as an option to the cache call: + # + # <% cache project, skip_digest: true do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # ==== Implicit dependencies + # + # Most template dependencies can be derived from calls to render in the template itself. + # Here are some examples of render calls that Cache Digests knows how to decode: + # + # render partial: "comments/comment", collection: commentable.comments + # render "comments/comments" + # render 'comments/comments' + # render('comments/comments') + # + # render "header" # translates to render("comments/header") + # + # render(@topic) # translates to render("topics/topic") + # render(topics) # translates to render("topics/topic") + # render(message.topics) # translates to render("topics/topic") + # + # It's not possible to derive all render calls like that, though. + # Here are a few examples of things that can't be derived: + # + # render group_of_attachments + # render @project.documents.where(published: true).order('created_at') + # + # You will have to rewrite those to the explicit form: + # + # render partial: 'attachments/attachment', collection: group_of_attachments + # render partial: 'documents/document', collection: @project.documents.where(published: true).order('created_at') + # + # One last type of dependency can be determined implicitly: + # + # render "maintenance_tasks/runs/info/#{run.status}" + # + # Because the value passed to render ends in interpolation, Action View + # will mark all partials within the "maintenance_tasks/runs/info" folder as + # dependencies. + # + # === Explicit dependencies + # + # Sometimes you'll have template dependencies that can't be derived at all. This is typically + # the case when you have template rendering that happens in helpers. Here's an example: + # + # <%= render_sortable_todolists @project.todolists %> + # + # You'll need to use a special comment format to call those out: + # + # <%# Template Dependency: todolists/todolist %> + # <%= render_sortable_todolists @project.todolists %> + # + # In some cases, like a single table inheritance setup, you might have + # a bunch of explicit dependencies. Instead of writing every template out, + # you can use a wildcard to match any template in a directory: + # + # <%# Template Dependency: events/* %> + # <%= render_categorizable_events @person.events %> + # + # This marks every template in the directory as a dependency. To find those + # templates, the wildcard path must be absolutely defined from app/views or paths + # otherwise added with +prepend_view_path+ or +append_view_path+. + # This way the wildcard for app/views/recordings/events would be recordings/events/* etc. + # + # The pattern used to match explicit dependencies is /# Template Dependency: (\S+)/, + # so it's important that you type it out just so. + # You can only declare one template dependency per line. + # + # === External dependencies + # + # If you use a helper method, for example, inside a cached block and + # you then update that helper, you'll have to bump the cache as well. + # It doesn't really matter how you do it, but the MD5 of the template file + # must change. One recommendation is to simply be explicit in a comment, like: + # + # <%# Helper Dependency Updated: May 6, 2012 at 6pm %> + # <%= some_helper_method(person) %> + # + # Now all you have to do is change that timestamp when the helper method changes. + # + # === Collection Caching + # + # When rendering a collection of objects that each use the same partial, a :cached + # option can be passed. + # + # For collections rendered such: + # + # <%= render partial: 'projects/project', collection: @projects, cached: true %> + # + # The cached: true will make Action View's rendering read several templates + # from cache at once instead of one call per template. + # + # Templates in the collection not already cached are written to cache. + # + # Works great alongside individual template fragment caching. + # For instance if the template the collection renders is cached like: + # + # # projects/_project.html.erb + # <% cache project do %> + # <%# ... %> + # <% end %> + # + # Any collection renders will find those cached templates when attempting + # to read multiple templates at once. + # + # If your collection cache depends on multiple sources (try to avoid this to keep things simple), + # you can name all these dependencies as part of a block that returns an array: + # + # <%= render partial: 'projects/project', collection: @projects, cached: -> project { [ project, current_user ] } %> + # + # This will include both records as part of the cache key and updating either of them will + # expire the cache. + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:176 + def cache(name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # This helper returns the name of a cache key for a given fragment cache + # call. By supplying skip_digest: true to cache, the digestion of cache + # fragments can be manually bypassed. This is useful when cache fragments + # cannot be manually expired unless you know the exact key which is the + # case when using memcached. + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:248 + def cache_fragment_name(name = T.unsafe(nil), skip_digest: T.unsafe(nil), digest_path: T.unsafe(nil)); end + + # Cache fragments of a view if +condition+ is true + # + # <% cache_if admin?, project do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:223 + def cache_if(condition, name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Cache fragments of a view unless +condition+ is true + # + # <% cache_unless admin?, project do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:239 + def cache_unless(condition, name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Returns whether the current view fragment is within a +cache+ block. + # + # Useful when certain fragments aren't cacheable: + # + # <% cache project do %> + # <% raise StandardError, "Caching private data!" if caching? %> + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:196 + def caching?; end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:256 + def digest_path_from_template(template); end + + # Raises UncacheableFragmentError when called from within a +cache+ block. + # + # Useful to denote helper methods that can't participate in fragment caching: + # + # def project_name_with_time(project) + # uncacheable! + # "#{project.name} - #{Time.now}" + # end + # + # # Which will then raise if used within a `cache` block: + # <% cache project do %> + # <%= project_name_with_time(project) %> + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:213 + def uncacheable!; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:278 + def fragment_for(name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:267 + def fragment_name_with_digest(name, digest_path); end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:288 + def read_fragment_for(name, options); end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:292 + def write_fragment_for(name, options, &block); end +end + +# pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:297 +module ActionView::Helpers::CacheHelper::CachingRegistry + extend ::ActionView::Helpers::CacheHelper::CachingRegistry + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:300 + def caching?; end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:304 + def track_caching; end +end + +# pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:7 +class ActionView::Helpers::CacheHelper::UncacheableFragmentError < ::StandardError; end + +# = Action View Capture \Helpers +# +# \CaptureHelper exposes methods to let you extract generated markup which +# can be used in other parts of a template or layout file. +# +# It provides a method to capture blocks into variables through #capture and +# a way to capture a block of markup for use in a layout through #content_for. +# +# As well as provides a method when using streaming responses through #provide. +# See ActionController::Streaming for more information. +# +# pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:17 +module ActionView::Helpers::CaptureHelper + # The capture method extracts part of a template as a string object. + # You can then use this object anywhere in your templates, layout, or helpers. + # + # The capture method can be used in \ERB templates... + # + # <% @greeting = capture do %> + # Welcome to my shiny new web page! The date and time is + # <%= Time.now %> + # <% end %> + # + # ...and Builder (RXML) templates. + # + # @timestamp = capture do + # "The current timestamp is #{Time.now}." + # end + # + # You can then use that variable anywhere else. For example: + # + # + # <%= @greeting %> + # + # <%= @greeting %> + # + # + # + # The return of capture is the string generated by the block. For Example: + # + # @greeting # => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500" + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:47 + def capture(*, **, &block); end + + # Calling content_for stores a block of markup in an identifier for later use. + # In order to access this stored content in other templates, helper modules + # or the layout, you would pass the identifier as an argument to content_for. + # + # Note: yield can still be used to retrieve the stored content, but calling + # yield doesn't work in helper modules, while content_for does. + # + # <% content_for :not_authorized do %> + # alert('You are not authorized to do that!') + # <% end %> + # + # You can then use content_for :not_authorized anywhere in your templates. + # + # <%= content_for :not_authorized if current_user.nil? %> + # + # This is equivalent to: + # + # <%= yield :not_authorized if current_user.nil? %> + # + # content_for, however, can also be used in helper modules. + # + # module StorageHelper + # def stored_content + # content_for(:storage) || "Your storage is empty" + # end + # end + # + # This helper works just like normal helpers. + # + # <%= stored_content %> + # + # You can also use the yield syntax alongside an existing call to + # yield in a layout. For example: + # + # <%# This is the layout %> + # + # + # My Website + # <%= yield :script %> + # + # + # <%= yield %> + # + # + # + # And now, we'll create a view that has a content_for call that + # creates the script identifier. + # + # <%# This is our view %> + # Please login! + # + # <% content_for :script do %> + # + # <% end %> + # + # Then, in another view, you could to do something like this: + # + # <%= link_to 'Logout', action: 'logout', remote: true %> + # + # <% content_for :script do %> + # <%= javascript_include_tag :defaults %> + # <% end %> + # + # That will place +script+ tags for your default set of JavaScript files on the page; + # this technique is useful if you'll only be using these scripts in a few views. + # + # Note that content_for concatenates (default) the blocks it is given for a particular + # identifier in order. For example: + # + # <% content_for :navigation do %> + #
  • <%= link_to 'Home', action: 'index' %>
  • + # <% end %> + # + # And in another place: + # + # <% content_for :navigation do %> + #
  • <%= link_to 'Login', action: 'login' %>
  • + # <% end %> + # + # Then, in another template or layout, this code would render both links in order: + # + #
      <%= content_for :navigation %>
    + # + # If the flush parameter is +true+ content_for replaces the blocks it is given. For example: + # + # <% content_for :navigation do %> + #
  • <%= link_to 'Home', action: 'index' %>
  • + # <% end %> + # + # <%# Add some other content, or use a different template: %> + # + # <% content_for :navigation, flush: true do %> + #
  • <%= link_to 'Login', action: 'login' %>
  • + # <% end %> + # + # Then, in another template or layout, this code would render only the last link: + # + #
      <%= content_for :navigation %>
    + # + # Lastly, simple content can be passed as a parameter: + # + # <% content_for :script, javascript_include_tag(:defaults) %> + # + # WARNING: content_for is ignored in caches. So you shouldn't use it for elements that will be fragment cached. + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:172 + def content_for(name, content = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # content_for? checks whether any content has been captured yet using content_for. + # + # Useful to render parts of your layout differently based on what is in your views. + # + # <%# This is the layout %> + # + # + # My Website + # <%= yield :script %> + # + # + # <%= yield %> + # <%= yield :right_col %> + # + # + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:215 + def content_for?(name); end + + # The same as +content_for+ but when used with streaming flushes + # straight back to the layout. In other words, if you want to + # concatenate several times to the same buffer when rendering a given + # template, you should use +content_for+, if not, use +provide+ to tell + # the layout to stop looking for more contents. + # + # See ActionController::Streaming for more information. + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:194 + def provide(name, content = T.unsafe(nil), &block); end + + # Use an alternate output buffer for the duration of the block. + # Defaults to a new empty string. + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:221 + def with_output_buffer(buf = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:5 +module ActionView::Helpers::ContentExfiltrationPreventionHelper + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention; end + + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:61 + def prevent_content_exfiltration(html); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention; end + + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention=(val); end + end +end + +# Close any open tags that support CDATA (textarea, xmp) before each form tag. +# This prevents attackers from injecting unclosed tags that could capture +# form contents. +# +# For example, an attacker might inject: +# +#
    or +# the end of the document would be captured by the attacker's +# + # + # textarea(:comment, :text, size: "20x30") + # # => + # + # textarea(:application, :notes, cols: 40, rows: 15, class: 'app_input') + # # => + # + # textarea(:entry, :body, size: "20x20", disabled: 'disabled') + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1277 + def textarea(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "time". + # + # The default value is generated by trying to call +strftime+ with "%T.%L" + # on the object's value. If you pass include_seconds: false, it will be + # formatted by trying to call +strftime+ with "%H:%M" on the object's value. + # It is also possible to override this by passing the "value" option. + # + # ==== Options + # + # Supports the same options as FormTagHelper#time_field_tag. + # + # ==== Examples + # + # time_field("task", "started_at") + # # => + # + # You can create values for the "min" and "max" attributes by passing + # instances of Date or Time to the options hash. + # + # time_field("task", "started_at", min: Time.now) + # # => + # + # Alternatively, you can pass a String formatted as an ISO8601 time as the + # values for "min" and "max." + # + # time_field("task", "started_at", min: "01:00:00") + # # => + # + # By default, provided times will be formatted including seconds. You can render just the hour + # and minute by passing include_seconds: false. Some browsers will render a simpler UI + # if you exclude seconds in the timestamp format. + # + # time_field("task", "started_at", value: Time.now, include_seconds: false) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1479 + def time_field(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "url". + # + # url_field("user", "homepage") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1559 + def url_field(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "week". + # + # week_field("user", "born_on") + # # => + # + # The default value is generated by trying to call +strftime+ with "%Y-W%W" + # on the object's value, which makes it behave as expected for instances + # of DateTime and ActiveSupport::TimeWithZone. + # + # @user.born_on = Date.new(1984, 5, 12) + # week_field("user", "born_on") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1550 + def week_field(object_name, method, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:465 + def apply_form_for_options!(object, options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1624 + def default_form_builder_class; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1595 + def html_options_for_form_with(url_for_options = T.unsafe(nil), model = T.unsafe(nil), html: T.unsafe(nil), local: T.unsafe(nil), skip_enforcing_utf8: T.unsafe(nil), **options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1610 + def instantiate_builder(record_name, record_object, options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:481 + def form_with_generates_ids; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:481 + def form_with_generates_ids=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:479 + def form_with_generates_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:479 + def form_with_generates_remote_forms=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:483 + def multiple_file_field_include_hidden; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:483 + def multiple_file_field_include_hidden=(val); end + end +end + +# = Action View Form Option \Helpers +# +# Provides a number of methods for turning different kinds of containers into a set of option tags. +# +# The #collection_select, #select and #time_zone_select methods take an options parameter, a hash: +# +# * :include_blank - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element. +# +# select(:post, :category, Post::CATEGORIES, { include_blank: true }) +# +# could become: +# +# +# +# Another common case is a select tag for a belongs_to-associated object. +# +# Example with @post.person_id => 2: +# +# select(:post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { include_blank: "None" }) +# +# could become: +# +# +# +# * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this prepends an option with a generic prompt -- "Please select" -- or the given prompt string. +# +# select(:post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { prompt: "Select Person" }) +# +# could become: +# +# +# +# * :index - like the other form helpers, #select can accept an :index option to manually set the ID used in the resulting output. Unlike other helpers, #select expects this +# option to be in the +html_options+ parameter. +# +# select("album[]", :genre, %w[ rap rock country ], {}, { index: nil }) +# +# becomes: +# +# +# +# * :disabled - can be a single value or an array of values that will be disabled options in the final output. +# +# select(:post, :category, Post::CATEGORIES, { disabled: "restricted" }) +# +# could become: +# +# +# +# When used with the #collection_select helper, :disabled can also be a Proc that identifies those options that should be disabled. +# +# collection_select(:post, :category_id, Category.all, :id, :name, { disabled: -> (category) { category.archived? } }) +# +# If the categories "2008 stuff" and "Christmas" return true when the method archived? is called, this would return: +# +# +# pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:93 +module ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::TextHelper + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:792 + def collection_check_boxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns check box tags for the collection of existing return values of + # +method+ for +object+'s class. The value returned from calling +method+ + # on the instance +object+ will be selected. If calling +method+ returns + # +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each check box tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # class Post < ActiveRecord::Base + # has_and_belongs_to_many :authors + # end + # class Author < ActiveRecord::Base + # has_and_belongs_to_many :posts + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) + # + # If @post.author_ids is already [1], this would return: + # + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label { b.checkbox } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and check box + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and check box display order or even + # use the label as wrapper, as in the example above. + # + # The builder methods label and checkbox also accept + # extra HTML options: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "checkbox") { b.checkbox(class: "checkbox") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.checkbox + b.text } + # end + # + # ==== Gotcha + # + # When no selection is made for a collection of checkboxes most + # web browsers will not send any value. + # + # For example, if we have a +User+ model with +category_ids+ field and we + # have the following code in our update action: + # + # @user.update(params[:user]) + # + # If no +category_ids+ are selected then we can safely assume this field + # will not be updated. + # + # This is possible thanks to a hidden field generated by the helper method + # for every collection of checkboxes. + # This hidden field is given the same field name as the checkboxes with a + # blank value. + # + # In the rare case you don't want this hidden field, you can pass the + # include_hidden: false option to the helper method. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:789 + def collection_checkboxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns radio button tags for the collection of existing return values + # of +method+ for +object+'s class. The value returned from calling + # +method+ on the instance +object+ will be selected. If calling +method+ + # returns +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each radio button tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # + # class Post < ActiveRecord::Base + # belongs_to :author + # end + # + # class Author < ActiveRecord::Base + # has_many :posts + # + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) + # + # If @post.author_id is already 1, this would return: + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label { b.radio_button } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and radio button + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and radio button display order or + # even use the label as wrapper, as in the example above. + # + # The builder methods label and radio_button also accept + # extra HTML options: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "radio_button") { b.radio_button(class: "radio_button") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.radio_button + b.text } + # end + # + # ==== Gotcha + # + # The HTML specification says when nothing is selected on a collection of radio buttons + # web browsers do not send any value to server. + # Unfortunately this introduces a gotcha: + # if a +User+ model has a +category_id+ field and in the form no category is selected, no +category_id+ parameter is sent. So, + # any strong parameters idiom like: + # + # params.expect(user: [...]) + # + # will raise an error since no {user: ...} will be present. + # + # To prevent this the helper generates an auxiliary hidden field before + # every collection of radio buttons. The hidden field has the same name as collection radio button and blank value. + # + # In case if you don't want the helper to generate this hidden field you can specify + # include_hidden: false option. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:705 + def collection_radio_buttons(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns + # + # + # + # + # + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:198 + def collection_select(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns + # + # + # + # + # + # + # + # + # + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:257 + def grouped_collection_select(object, method, collection, group_method, group_label_method, option_key_method, option_value_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns a string of tags, like #options_for_select, but + # wraps them with tags: + # + # grouped_options = [ + # ['North America', + # [['United States','US'],'Canada']], + # ['Europe', + # ['Denmark','Germany','France']] + # ] + # grouped_options_for_select(grouped_options) + # + # grouped_options = { + # 'North America' => [['United States','US'], 'Canada'], + # 'Europe' => ['Denmark','Germany','France'] + # } + # grouped_options_for_select(grouped_options) + # + # Possible output: + # + # + # + # + # + # + # + # + # + # + # ==== Parameters + # + # * +grouped_options+ - Accepts a nested array or hash of strings. The first value serves as the + # label while the second value must be an array of options. The second value can be a + # nested array of text-value pairs. See options_for_select for more info. + # Ex. ["North America",[["United States","US"],["Canada","CA"]]] + # An optional third value can be provided as HTML attributes for the optgroup. + # Ex. ["North America",[["United States","US"],["Canada","CA"]], { disabled: "disabled" }] + # * +selected_key+ - A value equal to the +value+ attribute for one of the tags, + # which will have the +selected+ attribute set. Note: It is possible for this value to match multiple options + # as you might have the same option in multiple groups. Each will then get selected="selected". + # + # ==== Options + # + # * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this + # prepends an option with a generic prompt - "Please select" - or the given prompt string. + # * :divider - the divider for the options groups. + # + # grouped_options = [ + # [['United States','US'], 'Canada'], + # ['Denmark','Germany','France'] + # ] + # grouped_options_for_select(grouped_options, nil, divider: '---------') + # + # Possible output: + # + # + # + # + # + # + # + # + # + # + # Note: Only the and tags are returned, so you still have to + # wrap the output in an appropriate tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:466 + def option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, selected_key = T.unsafe(nil)); end + + # Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container + # where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and + # the "firsts" as option text. Hashes are turned into this form automatically, so the keys become "firsts" and values + # become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +selected+ + # may also be an array of values to be selected when using a multiple select. + # + # options_for_select([["Dollar", "$"], ["Kroner", "DKK"]]) + # # => + # # => + # + # options_for_select([ "VISA", "MasterCard" ], "MasterCard") + # # => + # # => + # + # options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40") + # # => + # # => + # + # options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"]) + # # => + # # => + # # => + # + # You can optionally provide HTML attributes as the last element of the array. + # + # options_for_select([ "Denmark", ["USA", { class: 'bold' }], "Sweden" ], ["USA", "Sweden"]) + # # => + # # => + # # => + # + # options_for_select([["Dollar", "$", { class: "bold" }], ["Kroner", "DKK", { onclick: "alert('HI');" }]]) + # # => + # # => + # + # If you wish to specify disabled option tags, set +selected+ to be a hash, with :disabled being either a value + # or array of values to be disabled. In this case, you can use :selected to specify selected option tags. + # + # options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], disabled: "Super Platinum") + # # => + # # => + # # => + # # => + # + # options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], disabled: ["Advanced", "Super Platinum"]) + # # => + # # => + # # => + # # => + # + # options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], selected: "Free", disabled: "Super Platinum") + # # => + # # => + # # => + # # => + # + # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:357 + def options_for_select(container, selected = T.unsafe(nil)); end + + # Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning + # the result of a call to the +value_method+ as the option value and the +text_method+ as the option text. + # + # options_from_collection_for_select(@people, 'id', 'name') + # # => + # + # This is more often than not used inside a #select_tag like this example: + # + # select_tag 'person', options_from_collection_for_select(@people, 'id', 'name') + # + # The +value_method+ and +text_method+ can be a method name to call on each member of the +collection+, + # or a Proc that will be called for each member of the +collection+: + # + # options_from_collection_for_select(@people, Proc.new { |person| person.id }, Proc.new { |person| person.name }) + # + # If +selected+ is specified as a value or array of values, the element(s) returning a match on +value_method+ + # will be selected option tag(s). + # + # If +selected+ is specified as a Proc, those members of the collection that return true for the anonymous + # function are the selected values. + # + # +selected+ can also be a hash, specifying both :selected and/or :disabled values as required. + # + # Be sure to specify the same class as the +value_method+ when specifying selected or disabled options. + # Failure to do this will produce undesired results. Example: + # options_from_collection_for_select(@people, 'id', 'name', '1') + # Will not select a person with the id of 1 because 1 (an Integer) is not the same as '1' (a string) + # options_from_collection_for_select(@people, 'id', 'name', 1) + # should produce the desired results. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:405 + def options_from_collection_for_select(collection, value_method, text_method, selected = T.unsafe(nil)); end + + # Create a select tag and a series of contained option tags for the provided object and method. + # The option currently held by the object will be selected, provided that the object is available. + # + # There are two possible formats for the +choices+ parameter, corresponding to other helpers' output: + # + # * A flat collection (see options_for_select). + # * A nested collection (see grouped_options_for_select). + # + # Example with @post.person_id => 2: + # + # select :post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { include_blank: true } + # + # would become: + # + # + # + # This can be used to provide a default set of options in the standard way: before rendering the create form, a + # new model instance is assigned the default options and bound to @model_name. Usually this model is not saved + # to the database. Instead, a second model object is created when the create request is received. + # This allows the user to submit a form page more than once with the expected results of creating multiple records. + # In addition, this allows a single partial to be used to generate form inputs for both edit and create forms. + # + # By default, post.person_id is the selected option. Specify selected: value to use a different selection + # or selected: nil to leave all options unselected. Similarly, you can specify values to be disabled in the option + # tags by specifying the :disabled option. This can either be a single value or an array of values to be disabled. + # + # A block can be passed to #select to customize how the options tags will be rendered. This + # is useful when the options tag has complex attributes. + # + # select(report, :campaign_ids) do + # available_campaigns.each do |c| + # tag.option(c.name, value: c.id, data: { tags: c.tags.to_json }) + # end + # end + # + # ==== Gotcha + # + # The HTML specification says when +multiple+ parameter passed to select and all options got deselected + # web browsers do not send any value to server. Unfortunately this introduces a gotcha: + # if a +User+ model has many +roles+ and have +role_ids+ accessor, and in the form that edits roles of the user + # the user deselects all roles from +role_ids+ multiple select box, no +role_ids+ parameter is sent. So, + # any mass-assignment idiom like + # + # @user.update(params[:user]) + # + # wouldn't update roles. + # + # To prevent this the helper generates an auxiliary hidden field before + # every multiple select. The hidden field has the same name as multiple select and blank value. + # + # Note: The client either sends only the hidden field (representing + # the deselected multiple select box), or both fields. This means that the resulting array + # always contains a blank string. + # + # In case if you don't want the helper to generate this hidden field you can specify + # include_hidden: false option. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:158 + def select(object, method, choices = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns a string of option tags for pretty much any time zone in the + # world. Supply an ActiveSupport::TimeZone name as +selected+ to have it + # marked as the selected option tag. You can also supply an array of + # ActiveSupport::TimeZone objects as +priority_zones+, so that they will + # be listed above the rest of the (long) list. (You can use + # ActiveSupport::TimeZone.us_zones as a convenience for obtaining a list + # of the US time zones, or a Regexp to select the zones of your choice) + # + # The +selected+ parameter must be either +nil+, or a string that names + # an ActiveSupport::TimeZone. + # + # By default, +model+ is the ActiveSupport::TimeZone constant (which can + # be obtained in Active Record as a value object). The +model+ parameter + # must respond to +all+ and return an array of objects that represent time + # zones; each object must respond to +name+. If a Regexp is given it will + # attempt to match the zones using match? method. + # + # NOTE: Only the option tags are returned, you have to wrap this call in + # a regular HTML select tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:585 + def time_zone_options_for_select(selected = T.unsafe(nil), priority_zones = T.unsafe(nil), model = T.unsafe(nil)); end + + # Returns select and option tags for the given object and method, using + # #time_zone_options_for_select to generate the list of option tags. + # + # In addition to the :include_blank option documented above, + # this method also supports a :model option, which defaults + # to ActiveSupport::TimeZone. This may be used by users to specify a + # different time zone model object. (See #time_zone_options_for_select + # for more information.) + # + # You can also supply an array of ActiveSupport::TimeZone objects + # as +priority_zones+ so that they will be listed above the rest of the + # (long) list. You can use ActiveSupport::TimeZone.us_zones for a list + # of US time zones, ActiveSupport::TimeZone.country_zones(country_code) + # for another country's time zones, or a Regexp to select the zones of + # your choice. + # + # Finally, this method supports a :default option, which selects + # a default ActiveSupport::TimeZone if the object's time zone is +nil+. + # + # time_zone_select(:user, :time_zone, nil, include_blank: true) + # + # time_zone_select(:user, :time_zone, nil, default: "Pacific Time (US & Canada)") + # + # time_zone_select(:user, :time_zone, ActiveSupport::TimeZone.us_zones, default: "Pacific Time (US & Canada)") + # + # time_zone_select(:user, :time_zone, [ ActiveSupport::TimeZone["Alaska"], ActiveSupport::TimeZone["Hawaii"] ]) + # + # time_zone_select(:user, :time_zone, /Australia/) + # + # time_zone_select(:user, :time_zone, ActiveSupport::TimeZone.all.sort, model: ActiveSupport::TimeZone) + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:291 + def time_zone_select(object, method, priority_zones = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns a string of option tags for the days of the week. + # + # ====Options + # + # * :index_as_value - Defaults to false, set to true to use the indexes from + # I18n.translate("date.day_names") as the values. By default, Sunday is always 0. + # * :day_format - The I18n key of the array to use for the weekday options. + # Defaults to +:day_names+, set to +:abbr_day_names+ for abbreviations. + # * :beginning_of_week - Defaults to Date.beginning_of_week. + # + # NOTE: Only the option tags are returned, you have to wrap this call in + # a regular HTML select tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:618 + def weekday_options_for_select(selected = T.unsafe(nil), index_as_value: T.unsafe(nil), day_format: T.unsafe(nil), beginning_of_week: T.unsafe(nil)); end + + # Returns select and option tags for the given object and method, using + # #weekday_options_for_select to generate the list of option tags. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:297 + def weekday_select(object, method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:817 + def extract_selected_and_disabled(selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:828 + def extract_values_from_collection(collection, value_method, selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:795 + def option_html_attributes(element); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:803 + def option_text_and_value(option); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:813 + def option_value_selected?(value, selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:842 + def prompt_text(prompt); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:838 + def value_for_collection(item, value); end +end + +# = Action View Form Tag \Helpers +# +# Provides a number of methods for creating form tags that don't rely on an Active Record object assigned to the template like +# FormHelper does. Instead, you provide the names and values manually. +# +# NOTE: The HTML options disabled, readonly, and multiple can all be treated as booleans. So specifying +# disabled: true will give disabled="disabled". +# +# pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:18 +module ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # Creates a button element that defines a submit button, + # reset button or a generic button which can be used in + # JavaScript, for example. You can use the button tag as a regular + # submit tag but it isn't supported in legacy browsers. However, + # the button tag does allow for richer labels such as images and emphasis, + # so this helper will also accept a block. By default, it will create + # a button tag with type submit, if type is not given. + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If true, the user will not be able to + # use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # button_tag + # # => + # + # button_tag 'Reset', type: 'reset' + # # => + # + # button_tag 'Button', type: 'button' + # # => + # + # button_tag 'Reset', type: 'reset', disabled: true + # # => + # + # button_tag(type: 'button') do + # content_tag(:strong, 'Ask me!') + # end + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:571 + def button_tag(content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:469 + def check_box_tag(name, *args); end + + # :call-seq: + # checkbox_tag(name, options = {}) + # checkbox_tag(name, value, options = {}) + # checkbox_tag(name, value, checked, options = {}) + # + # Creates a check box form input tag. + # + # ==== Options + # * :value - The value of the input. Defaults to "1". + # * :checked - If set to true, the checkbox will be checked by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # checkbox_tag 'accept' + # # => + # + # checkbox_tag 'rock', 'rock music' + # # => + # + # checkbox_tag 'receive_email', 'yes', true + # # => + # + # checkbox_tag 'tos', 'yes', false, class: 'accept_tos' + # # => + # + # checkbox_tag 'eula', 'accepted', false, disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:459 + def checkbox_tag(name, *args); end + + # Creates a text field of type "color". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # color_field_tag 'name' + # # => + # + # color_field_tag 'color', '#DEF726' + # # => + # + # color_field_tag 'color', nil, class: 'special_input' + # # => + # + # color_field_tag 'color', '#DEF726', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:671 + def color_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "date". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # date_field_tag 'name' + # # => + # + # date_field_tag 'date', '2014-12-31' + # # => + # + # date_field_tag 'date', nil, class: 'special_input' + # # => + # + # date_field_tag 'date', '2014-12-31', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:741 + def date_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "datetime-local". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds in the output timestamp format (true by default). + # + # ==== Examples + # + # datetime_field_tag 'name' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01' + # # => + # + # datetime_field_tag 'datetime', nil, class: 'special_input' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:800 + def datetime_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:804 + def datetime_local_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8=(val); end + + # Creates a text field of type "email". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # email_field_tag 'name' + # # => + # + # email_field_tag 'email', 'email@example.com' + # # => + # + # email_field_tag 'email', nil, class: 'special_input' + # # => + # + # email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:902 + def email_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms=(val); end + + # Generate an HTML id attribute value for the given name and + # field combination + # + # Return the value generated by the FormBuilder for the given + # attribute name. + # + # <%= label_tag :post, :title %> + # <%= text_field :post, :title, aria: { describedby: field_id(:post, :title, :error) } %> + # <%= tag.span("is blank", id: field_id(:post, :title, :error) %> + # + # In the example above, the element built by + # the call to text_field declares an + # aria-describedby attribute referencing the + # element, sharing a common id root (post_title, in this + # case). + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:101 + def field_id(object_name, method_name, *suffixes, index: T.unsafe(nil), namespace: T.unsafe(nil)); end + + # Generate an HTML name attribute value for the given name and + # field combination + # + # Return the value generated by the FormBuilder for the given + # attribute name. + # + # <%= text_field :post, :title, name: field_name(:post, :title, :subtitle) %> + # <%# => %> + # + # <%= text_field :post, :tag, name: field_name(:post, :tag, multiple: true) %> + # <%# => %> + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:131 + def field_name(object_name, method_name, *method_names, multiple: T.unsafe(nil), index: T.unsafe(nil)); end + + # Creates a field set for grouping HTML form elements. + # + # legend will become the fieldset's title (optional as per W3C). + # options accept the same values as tag. + # + # ==== Examples + # <%= field_set_tag do %> + #

    <%= text_field_tag 'name' %>

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

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

    <%= text_field_tag 'name' %>

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

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

    <%= text_field_tag 'name' %>

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

    + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:643 + def field_set_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:650 + def fieldset_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a file upload field. If you are using file uploads then you will also need + # to set the multipart option for the form tag: + # + # <%= form_tag '/upload', multipart: true do %> + # <%= file_field_tag "file" %> + # <%= submit_tag %> + # <% end %> + # + # The specified URL will then be passed a File object containing the selected file, or if the field + # was left blank, a StringIO object. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # * :disabled - If set to true, the user will not be able to use this input. + # * :multiple - If set to true, *in most updated browsers* the user will be allowed to select multiple files. + # * :accept - If set to one or multiple mime-types, the user will be suggested a filter when choosing a file. You still need to set up model validations. + # + # ==== Examples + # file_field_tag 'attachment' + # # => + # + # file_field_tag 'avatar', class: 'profile_input' + # # => + # + # file_field_tag 'picture', disabled: true + # # => + # + # file_field_tag 'resume', value: '~/resume.doc' + # # => + # + # file_field_tag 'user_pic', accept: 'image/png,image/gif,image/jpeg' + # # => + # + # file_field_tag 'file', accept: 'text/html', class: 'upload', value: 'index.html' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:350 + def file_field_tag(name, options = T.unsafe(nil)); end + + # Starts a form tag that points the action to a URL configured with url_for_options just like + # ActionController::Base#url_for. The method for the form defaults to POST. + # + # ==== Options + # * :multipart - If set to true, the enctype is set to "multipart/form-data". + # * :method - The method to use when submitting the form, usually either "get" or "post". + # If "patch", "put", "delete", or another verb is used, a hidden input with name _method + # is added to simulate the verb over post. + # * :authenticity_token - Authenticity token to use in the form. Use only if you need to + # pass custom authenticity token string, or to not add authenticity_token field at all + # (by passing false). Remote forms may omit the embedded authenticity token + # by setting config.action_view.embed_authenticity_token_in_remote_forms = false. + # This is helpful when you're fragment-caching the form. Remote forms get the + # authenticity token from the meta tag, so embedding is unnecessary unless you + # support browsers without JavaScript. + # * :remote - If set to true, will allow the Unobtrusive JavaScript drivers to control the + # submit behavior. By default this behavior is an ajax submit. + # * :enforce_utf8 - If set to false, a hidden input with name utf8 is not output. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # form_tag('/posts') + # # => + # + # form_tag('/posts/1', method: :put) + # # => ... ... + # + # form_tag('/upload', multipart: true) + # # => + # + # <%= form_tag('/posts') do -%> + #
    <%= submit_tag 'Save' %>
    + # <% end -%> + # # =>
    + # + # <%= form_tag('/posts', remote: true) %> + # # =>
    + # + # form_tag(false, method: :get) + # # => + # + # form_tag('http://far.away.com/form', authenticity_token: false) + # # form without authenticity token + # + # form_tag('http://far.away.com/form', authenticity_token: "cf50faa3fe97702ca1ae") + # # form with custom authenticity token + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:77 + def form_tag(url_for_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or + # data that should be hidden from the user. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # + # ==== Examples + # hidden_field_tag 'tags_list' + # # => + # + # hidden_field_tag 'token', 'VUBJKB23UIVI1UU1VOBVI@' + # # => + # + # hidden_field_tag 'collected_input', '', onchange: "alert('Input collected!')" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:307 + def hidden_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Displays an image which when clicked will submit the form. + # + # source is passed to AssetTagHelper#path_to_image + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Data attributes + # + # * confirm: 'question?' - This will add a JavaScript confirm + # prompt with the question specified. If the user accepts, the form is + # processed normally, otherwise no action is taken. + # + # ==== Examples + # image_submit_tag("login.png") + # # => + # + # image_submit_tag("purchase.png", disabled: true) + # # => + # + # image_submit_tag("search.png", class: 'search_button', alt: 'Find') + # # => + # + # image_submit_tag("agree.png", disabled: true, class: "agree_disagree_button") + # # => + # + # image_submit_tag("save.png", data: { confirm: "Are you sure?" }) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:617 + def image_submit_tag(source, options = T.unsafe(nil)); end + + # Creates a label element. Accepts a block. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # + # ==== Examples + # label_tag 'name' + # # => + # + # label_tag 'name', 'Your name' + # # => + # + # label_tag 'name', nil, class: 'small_label' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:280 + def label_tag(name = T.unsafe(nil), content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a text field of type "month". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # month_field_tag 'name' + # # => + # + # month_field_tag 'month', '2014-01' + # # => + # + # month_field_tag 'month', nil, class: 'special_input' + # # => + # + # month_field_tag 'month', '2014-01', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:829 + def month_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a number field. + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :in - A range specifying the :min and + # :max values. + # * :within - Same as :in. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # number_field_tag 'quantity' + # # => + # + # number_field_tag 'quantity', '1' + # # => + # + # number_field_tag 'quantity', nil, class: 'special_input' + # # => + # + # number_field_tag 'quantity', nil, min: 1 + # # => + # + # number_field_tag 'quantity', nil, max: 9 + # # => + # + # number_field_tag 'quantity', nil, in: 1...10 + # # => + # + # number_field_tag 'quantity', nil, within: 1...10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10, step: 2 + # # => + # + # number_field_tag 'quantity', '1', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:950 + def number_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a password field, a masked text field that will hide the users input behind a mask character. + # + # ==== Options + # * :disabled - If set to true, the user will not be able to use this input. + # * :size - The number of visible characters that will fit in the input. + # * :maxlength - The maximum number of characters that the browser will allow the user to enter. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # password_field_tag 'pass' + # # => + # + # password_field_tag 'secret', 'Your secret here' + # # => + # + # password_field_tag 'masked', nil, class: 'masked_input_field' + # # => + # + # password_field_tag 'token', '', size: 15 + # # => + # + # password_field_tag 'key', nil, maxlength: 16 + # # => + # + # password_field_tag 'confirm_pass', nil, disabled: true + # # => + # + # password_field_tag 'pin', '1234', maxlength: 4, size: 6, class: "pin_input" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:383 + def password_field_tag(name = T.unsafe(nil), value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:720 + def phone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # :call-seq: + # radio_button_tag(name, value, options = {}) + # radio_button_tag(name, value, checked, options = {}) + # + # Creates a radio button; use groups of radio buttons named the same to allow users to + # select from a group of options. + # + # ==== Options + # * :checked - If set to true, the radio button will be selected by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # radio_button_tag 'favorite_color', 'maroon' + # # => + # + # radio_button_tag 'receive_updates', 'no', true + # # => + # + # radio_button_tag 'time_slot', "3:00 p.m.", false, disabled: true + # # => + # + # radio_button_tag 'color', "green", true, class: "color_input" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:496 + def radio_button_tag(name, value, *args); end + + # Creates a range form element. + # + # ==== Options + # + # Supports the same options as #number_field_tag. + # + # ==== Examples + # + # range_field_tag 'quantity', '1' + # # => + # + # range_field_tag 'quantity', in: 1...10 + # # => + # + # range_field_tag 'quantity', min: 1, max: 10, step: 2 + # # => + # + # search_field_tag 'search', 'Enter your search query here' + # # => + # + # search_field_tag 'search', nil, class: 'special_input' + # # => + # + # search_field_tag 'search', 'Enter your search query here', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:694 + def search_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a dropdown selection box, or if the :multiple option is set to true, a multiple + # choice selection box. + # + # Helpers::FormOptions can be used to create common select boxes such as countries, time zones, or + # associated records. option_tags is a string containing the option tags for the select box. + # + # ==== Options + # * :multiple - If set to true, the selection will allow multiple choices. + # * :disabled - If set to true, the user will not be able to use this input. + # * :include_blank - If set to true, an empty option will be created. If set to a string, the string will be used as the option's content and the value will be empty. + # * :prompt - Create a prompt option with blank value and the text asking user to select something. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # select_tag "people", options_from_collection_for_select(@people, "id", "name") + # # + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name", "1") + # # + # + # select_tag "people", raw("") + # # => + # + # select_tag "count", raw("") + # # => + # + # select_tag "colors", raw(""), multiple: true + # # => + # + # select_tag "locations", raw("") + # # => + # + # select_tag "access", raw(""), multiple: true, class: 'form_input', id: 'unique_id' + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: true + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All" + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), prompt: "Select something" + # # => + # + # select_tag "destination", raw(""), disabled: true + # # => + # + # select_tag "credit_card", options_for_select([ "VISA", "MasterCard" ], "MasterCard") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:200 + def select_tag(name, option_tags = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a submit button with the text value as the caption. + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # submit_tag + # # => + # + # submit_tag "Edit this article" + # # => + # + # submit_tag "Save edits", disabled: true + # # => + # + # submit_tag nil, class: "form_submit" + # # => + # + # submit_tag "Edit", class: "edit_button" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:530 + def submit_tag(value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "tel". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # telephone_field_tag 'name' + # # => + # + # telephone_field_tag 'tel', '0123456789' + # # => + # + # telephone_field_tag 'tel', nil, class: 'special_input' + # # => + # + # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:717 + def telephone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:428 + def text_area_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a standard text field; use these text fields to input smaller chunks of text like a username + # or a search query. + # + # ==== Options + # * :disabled - If set to true, the user will not be able to use this input. + # * :size - The number of visible characters that will fit in the input. + # * :maxlength - The maximum number of characters that the browser will allow the user to enter. + # * :placeholder - The text contained in the field by default which is removed when the field receives focus. + # If set to true, use the translation found in the current I18n locale + # (through helpers.placeholder..). + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # text_field_tag 'name' + # # => + # + # text_field_tag 'query', 'Enter your search query here' + # # => + # + # text_field_tag 'search', nil, placeholder: 'Enter search term...' + # # => + # + # text_field_tag 'request', nil, class: 'special_input' + # # => + # + # text_field_tag 'address', '', size: 75 + # # => + # + # text_field_tag 'zip', nil, maxlength: 5 + # # => + # + # text_field_tag 'payment_amount', '$0.00', disabled: true + # # => + # + # text_field_tag 'ip', '0.0.0.0', maxlength: 15, size: 20, class: "ip-input" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:262 + def text_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions. + # + # ==== Options + # * :size - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10"). + # * :rows - Specify the number of rows in the textarea + # * :cols - Specify the number of columns in the textarea + # * :disabled - If set to true, the user will not be able to use this input. + # * :escape - By default, the contents of the text input are HTML escaped. + # If you need unescaped contents, set this to false. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # textarea_tag 'post' + # # => + # + # textarea_tag 'bio', @user.bio + # # => + # + # textarea_tag 'body', nil, rows: 10, cols: 25 + # # => + # + # textarea_tag 'body', nil, size: "25x10" + # # => + # + # textarea_tag 'description', "Description goes here.", disabled: true + # # => + # + # textarea_tag 'comment', nil, class: 'comment_input' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:416 + def textarea_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "time". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds and ms in the output timestamp format (true by default). + # + # ==== Examples + # + # time_field_tag 'name' + # # => + # + # time_field_tag 'time', '01:01' + # # => + # + # time_field_tag 'time', nil, class: 'special_input' + # # => + # + # time_field_tag 'time', '01:01', include_seconds: true + # # => + # + # time_field_tag 'time', '01:01', min: '00:00', max: '23:59', step: 1 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:772 + def time_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "url". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # url_field_tag 'name' + # # => + # + # url_field_tag 'url', 'http://rubyonrails.org' + # # => + # + # url_field_tag 'url', nil, class: 'special_input' + # # => + # + # url_field_tag 'url', 'http://rubyonrails.org', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:879 + def url_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates the hidden UTF-8 enforcer tag. Override this method in a helper + # to customize the tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:981 + def utf8_enforcer_tag; end + + # Creates a text field of type "week". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # week_field_tag 'name' + # # => + # + # week_field_tag 'week', '2014-W01' + # # => + # + # week_field_tag 'week', nil, class: 'special_input' + # # => + # + # week_field_tag 'week', '2014-W01', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:856 + def week_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1083 + def convert_direct_upload_option_to_url(options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1021 + def extra_tags_for_form(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1051 + def form_tag_html(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1057 + def form_tag_with_body(html_options, content); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:994 + def html_options_for_form(url_for_options, options); end + + # see http://www.w3.org/TR/html4/types.html#type-name + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1064 + def sanitize_to_id(name); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1068 + def set_default_disable_with(value, tag_options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:28 + def default_enforce_utf8=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:25 + def embed_authenticity_token_in_remote_forms=(val); end + end +end + +# = Action View JavaScript \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:6 +module ActionView::Helpers::JavaScriptHelper + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce; end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce=(val); end + + # Escapes carriage returns and single and double quotes for JavaScript segments. + # + # Also available through the alias j(). This is particularly helpful in JavaScript + # responses, like: + # + # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); + # + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:30 + def escape_javascript(javascript); end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:40 + def j(javascript); end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:95 + def javascript_cdata_section(content); end + + # Returns a JavaScript tag with the +content+ inside. Example: + # javascript_tag "alert('All is good')" + # + # Returns: + # + # + # +html_options+ may be a hash of attributes for the \ + # + # Instead of passing the content as an argument, you can also use a block + # in which case, you pass your +html_options+ as the first parameter. + # + # <%= javascript_tag type: 'application/javascript' do -%> + # alert('All is good') + # <% end -%> + # + # If you have a content security policy enabled then you can add an automatic + # nonce value by passing nonce: true as part of +html_options+. Example: + # + # <%= javascript_tag nonce: true do -%> + # alert('All is good') + # <% end -%> + # + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:77 + def javascript_tag(content_or_options_with_block = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce; end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 + def auto_include_nonce=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:9 +ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP = T.let(T.unsafe(nil), Hash) + +# = Action View Number \Helpers +# +# Provides methods for converting numbers into formatted strings. +# Methods are provided for phone numbers, currency, percentage, +# precision, positional notation, file size, and pretty printing. +# +# Most methods expect a +number+ argument, and will return it +# unchanged if can't be converted into a valid number. +# +# pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:17 +module ActionView::Helpers::NumberHelper + # Delegates to ActiveSupport::NumberHelper#number_to_currency. + # + # number_to_currency("1234") # => "$1234.00" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_currency("12x34") # => "$12x34" + # number_to_currency("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:55 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human. + # + # number_to_human("1234") # => "1.23 Thousand" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_human("12x34") # => "12x34" + # number_to_human("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:125 + def number_to_human(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human_size. + # + # number_to_human_size("1234") # => "1.21 KB" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_human_size("12x34") # => "12x34" + # number_to_human_size("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:111 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_percentage. + # + # number_to_percentage("99") # => "99.000%" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_percentage("99x") # => "99x%" + # number_to_percentage("99x", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:69 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_phone. + # + # number_to_phone("1234567890") # => "123-456-7890" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_phone("12x34") # => "12x34" + # number_to_phone("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:37 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_delimited. + # + # number_with_delimiter("1234") # => "1,234" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_with_delimiter("12x34") # => "12x34" + # number_with_delimiter("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:83 + def number_with_delimiter(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_rounded. + # + # number_with_precision("1234") # => "1234.000" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_with_precision("12x34") # => "12x34" + # number_with_precision("12x34", raise: true) # => InvalidNumberError + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:97 + def number_with_precision(number, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:130 + def delegate_number_helper_method(method, number, options); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:149 + def escape_units(units); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:139 + def escape_unsafe_options(options); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:172 + def parse_float(number, raise_error); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:168 + def valid_float?(number); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:155 + def wrap_with_output_safety_handling(number, raise_on_invalid, &block); end +end + +# Raised when argument +number+ param given to the helpers is invalid and +# the option +:raise+ is set to +true+. +# +# pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:20 +class ActionView::Helpers::NumberHelper::InvalidNumberError < ::StandardError + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:22 + def initialize(number); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:21 + def number; end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:21 + def number=(_arg0); end +end + +# = Action View Raw Output \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:8 +module ActionView::Helpers::OutputSafetyHelper + # This method outputs without escaping a string. Since escaping tags is + # now default, this can be used when you don't want \Rails to automatically + # escape tags. This is not recommended if the data is coming from the user's + # input. + # + # For example: + # + # raw @user.name + # # => 'Jimmy Tables' + # + # pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:18 + def raw(stringish); end + + # This method returns an HTML safe string similar to what Array#join + # would return. The array is flattened, and all items, including + # the supplied separator, are HTML escaped unless they are HTML + # safe, and the returned string is marked as HTML safe. + # + # safe_join([tag.p("foo"), "

    bar

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

    foo

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

    foo


    bar

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

    Hello, World

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

    Hello, World

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

    Hello, <%= name %>!

    " %> + # # => renders "

    Hello, World!

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

    Hello, World!

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

    Hello, World!

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

    Hello, World!

    " %> + # # => renders "<h1>Hello, World!</h1>" + # + # `:renderable` + # context. The format is determined by calling `format` on the + # renderable if it responds to `format`, falling back to `:html` by + # default. + # + # <%= render renderable: Greeting.new %> + # # => renders "

    Hello, World

    " + # + # + # #### Options + # + # `:locals` + # + # <%= render inline: "

    Hello, <%= name %>!

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

    Hello, World!

    " + # + # `:formats` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", formats: [:text] %> + # # => renders app/views/posts/content.text.erb + # + # `:variants` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", variants: [:tablet] %> + # # => renders app/views/posts/content.html+tablet.erb + # + # `:handlers` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", handlers: [:builder] %> + # # => renders app/views/posts/content.html.builder + # + # pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:138 + def render(options = T.unsafe(nil), locals = T.unsafe(nil), &block); end +end + +# = Action View Sanitize \Helpers +# +# The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements. +# These helper methods extend Action View making them callable within your template files. +# +# pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:11 +module ActionView::Helpers::SanitizeHelper + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # Sanitizes HTML input, stripping all but known-safe tags and attributes. + # + # It also strips +href+ / +src+ attributes with unsafe protocols like +javascript:+, while + # also protecting against attempts to use Unicode, ASCII, and hex character references to work + # around these protocol filters. + # + # The default sanitizer is +Rails::HTML5::SafeListSanitizer+. See {Rails HTML + # Sanitizers}[https://github.com/rails/rails-html-sanitizer] for more information. + # + # Custom sanitization rules can also be provided. + # + # Warning: Adding disallowed tags or attributes to the allowlists may introduce + # vulnerabilities into your application. Please rely on the default allowlists whenever + # possible, because they are curated to maintain security and safety. If you think that the + # default allowlists should be expanded, please {open an issue on the rails-html-sanitizer + # project}[https://github.com/rails/rails-html-sanitizer/issues]. + # + # Please note that sanitizing user-provided text does not guarantee that the + # resulting markup is valid or even well-formed. + # + # ==== Options + # + # [+:tags+] + # An array of allowed tags. + # + # [+:attributes+] + # An array of allowed attributes. + # + # [+:scrubber+] + # A {Rails::HTML scrubber}[https://github.com/rails/rails-html-sanitizer] + # or {Loofah::Scrubber}[https://github.com/flavorjones/loofah] object that + # defines custom sanitization rules. A custom scrubber takes precedence over + # custom tags and attributes. + # + # ==== Examples + # + # ===== Normal use + # + # <%= sanitize @comment.body %> + # + # ===== Providing custom lists of permitted tags and attributes + # + # <%= sanitize @comment.body, tags: %w(strong em a), attributes: %w(href) %> + # + # ===== Providing a custom +Rails::HTML+ scrubber + # + # class CommentScrubber < Rails::HTML::PermitScrubber + # def initialize + # super + # self.tags = %w( form script comment blockquote ) + # self.attributes = %w( style ) + # end + # + # def skip_node?(node) + # node.text? + # end + # end + # + # + # + # <%= sanitize @comment.body, scrubber: CommentScrubber.new %> + # + # See {Rails HTML Sanitizer}[https://github.com/rails/rails-html-sanitizer] for + # documentation about +Rails::HTML+ scrubbers. + # + # ===== Providing a custom +Loofah::Scrubber+ + # + # scrubber = Loofah::Scrubber.new do |node| + # node.remove if node.name == 'script' + # end + # + # + # + # <%= sanitize @comment.body, scrubber: scrubber %> + # + # See {Loofah's documentation}[https://github.com/flavorjones/loofah] for more + # information about defining custom +Loofah::Scrubber+ objects. + # + # ==== Global Configuration + # + # To set the default allowed tags or attributes across your application: + # + # # In config/application.rb + # config.action_view.sanitized_allowed_tags = ['strong', 'em', 'a'] + # config.action_view.sanitized_allowed_attributes = ['href', 'title'] + # + # The default, starting in \Rails 7.1, is to use an HTML5 parser for sanitization (if it is + # available, see NOTE below). If you wish to revert back to the previous HTML4 behavior, you + # can do so by setting the following in your application configuration: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer + # + # Or, if you're upgrading from a previous version of \Rails and wish to opt into the HTML5 + # behavior: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML5::Sanitizer + # + # NOTE: +Rails::HTML5::Sanitizer+ is not supported on JRuby, so on JRuby platforms \Rails will + # fall back to using +Rails::HTML4::Sanitizer+. + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:117 + def sanitize(html, options = T.unsafe(nil)); end + + # Sanitizes a block of CSS code. Used by #sanitize when it comes across a style attribute. + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:122 + def sanitize_css(style); end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor=(val); end + + # Strips all link tags from +html+ leaving just the link text. + # + # strip_links('Ruby on Rails') + # # => Ruby on Rails + # + # strip_links('Please e-mail me at me@email.com.') + # # => Please e-mail me at me@email.com. + # + # strip_links('Blog: Visit.') + # # => Blog: Visit. + # + # strip_links('<malformed & link') + # # => <malformed & link + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:156 + def strip_links(html); end + + # Strips all HTML tags from +html+, including comments and special characters. + # + # strip_tags("Strip these tags!") + # # => Strip these tags! + # + # strip_tags("Bold no more! See more here...") + # # => Bold no more! See more here... + # + # strip_tags("
    Welcome to my website!
    ") + # # => Welcome to my website! + # + # strip_tags("> A quote from Smith & Wesson") + # # => > A quote from Smith & Wesson + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:139 + def strip_tags(html); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:160 +module ActionView::Helpers::SanitizeHelper::ClassMethods + # Gets the Rails::HTML::FullSanitizer instance used by +strip_tags+. Replace with + # any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.full_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:181 + def full_sanitizer; end + + # Gets the Rails::HTML::FullSanitizer instance used by +strip_tags+. Replace with + # any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.full_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def full_sanitizer=(_arg0); end + + # Gets the Rails::HTML::LinkSanitizer instance used by +strip_links+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.link_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:191 + def link_sanitizer; end + + # Gets the Rails::HTML::LinkSanitizer instance used by +strip_links+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.link_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def link_sanitizer=(_arg0); end + + # Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and +sanitize_css+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.safe_list_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:201 + def safe_list_sanitizer; end + + # Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and +sanitize_css+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.safe_list_sanitizer = MySpecialSanitizer.new + # end + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def safe_list_sanitizer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:171 + def sanitized_allowed_attributes; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:167 + def sanitized_allowed_tags; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:163 + def sanitizer_vendor; end +end + +# = Action View Tag \Helpers +# +# Provides methods to generate HTML tags programmatically both as a modern +# HTML5 compliant builder style and legacy XHTML compliant tags. +# +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:16 +module ActionView::Helpers::TagHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + + # Returns a CDATA section with the given +content+. CDATA sections + # are used to escape blocks of text containing characters which would + # otherwise be recognized as markup. CDATA sections begin with the string + # and end with (and may not contain) the string ]]>. + # + # cdata_section("") + # # => ]]> + # + # cdata_section(File.read("hello_world.txt")) + # # => + # + # cdata_section("hello]]>world") + # # => world]]> + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:558 + def cdata_section(content); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:543 + def class_names(*args); end + + # Returns an HTML block tag of type +name+ surrounding the +content+. Add + # HTML attributes by passing an attributes hash to +options+. + # Instead of passing the content as an argument, you can also use a block + # in which case, you pass your +options+ as the second parameter. + # Set escape to false to disable escaping. + # Note: this is legacy syntax, see +tag+ method description for details. + # + # ==== Options + # The +options+ hash can be used with attributes with no value like (disabled and + # readonly), which you can give a value of true in the +options+ hash. You can use + # symbols or strings for the attribute names. + # + # ==== Examples + # content_tag(:p, "Hello world!") + # # =>

    Hello world!

    + # content_tag(:div, content_tag(:p, "Hello world!"), class: "strong") + # # =>

    Hello world!

    + # content_tag(:div, "Hello world!", class: ["strong", "highlight"]) + # # =>
    Hello world!
    + # content_tag(:div, "Hello world!", class: ["strong", { highlight: current_user.admin? }]) + # # =>
    Hello world!
    + # content_tag("select", options, multiple: true) + # # => + # + # <%= content_tag :div, class: "strong" do -%> + # Hello world! + # <% end -%> + # # =>
    Hello world!
    + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:516 + def content_tag(name, content_or_options_with_block = T.unsafe(nil), options = T.unsafe(nil), escape = T.unsafe(nil), &block); end + + # Returns an escaped version of +html+ without affecting existing escaped entities. + # + # escape_once("1 < 2 & 3") + # # => "1 < 2 & 3" + # + # escape_once("<< Accept & Checkout") + # # => "<< Accept & Checkout" + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:570 + def escape_once(html); end + + # Returns an HTML tag. + # + # === Building HTML tags + # + # Builds HTML5 compliant tags with a tag proxy. Every tag can be built with: + # + # tag.(optional content, options) + # + # where tag name can be e.g. br, div, section, article, or any tag really. + # + # ==== Passing content + # + # Tags can pass content to embed within it: + # + # tag.h1 'All titles fit to print' # =>

    All titles fit to print

    + # + # tag.div tag.p('Hello world!') # =>

    Hello world!

    + # + # Content can also be captured with a block, which is useful in templates: + # + # <%= tag.p do %> + # The next great American novel starts here. + # <% end %> + # # =>

    The next great American novel starts here.

    + # + # ==== Options + # + # Use symbol keyed options to add attributes to the generated tag. + # + # tag.section class: %w( kitties puppies ) + # # =>
    + # + # tag.section id: dom_id(@post) + # # =>
    + # + # Pass +true+ for any attributes that can render with no values, like +disabled+ and +readonly+. + # + # tag.input type: 'text', disabled: true + # # => + # + # HTML5 data-* and aria-* attributes can be set with a + # single +data+ or +aria+ key pointing to a hash of sub-attributes. + # + # To play nicely with JavaScript conventions, sub-attributes are dasherized. + # + # tag.article data: { user_id: 123 } + # # =>
    + # + # Thus data-user-id can be accessed as dataset.userId. + # + # Data attribute values are encoded to JSON, with the exception of strings, symbols, and + # BigDecimals. + # This may come in handy when using jQuery's HTML5-aware .data() + # from 1.4.3. + # + # tag.div data: { city_state: %w( Chicago IL ) } + # # =>
    + # + # The generated tag names and attributes are escaped by default. This can be disabled using + # +escape+. + # + # tag.img src: 'open & shut.png' + # # => + # + # tag.img src: 'open & shut.png', escape: false + # # => + # + # The tag builder respects + # {HTML5 void elements}[https://www.w3.org/TR/html5/syntax.html#void-elements] + # if no content is passed, and omits closing tags for those elements. + # + # # A standard element: + # tag.div # =>
    + # + # # A void element: + # tag.br # =>
    + # + # Note that when using the block form options should be wrapped in + # parenthesis. + # + # <%= tag.a(href: "/about", class: "font-bold") do %> + # About the author + # <% end %> + # # => About the author + # + # === Building HTML attributes + # + # Transforms a Hash into HTML attributes, ready to be interpolated into + # ERB. Includes or omits boolean attributes based on their truthiness. + # Transforms keys nested within + # aria: or data: objects into aria- and data- + # prefixed attributes: + # + # > + # # => + # + # + # # => + # + # === Legacy syntax + # + # The following format is for legacy syntax support. It will be deprecated in future versions of \Rails. + # + # tag(name, options = nil, open = false, escape = true) + # + # It returns an empty HTML tag of type +name+ which by default is XHTML + # compliant. Set +open+ to true to create an open tag compatible + # with HTML 4.0 and below. Add HTML attributes by passing an attributes + # hash to +options+. Set +escape+ to false to disable attribute value + # escaping. + # + # ==== Options + # + # You can use symbols or strings for the attribute names. + # + # Use +true+ with boolean attributes that can render with no value, like + # +disabled+ and +readonly+. + # + # HTML5 data-* attributes can be set with a single +data+ key + # pointing to a hash of sub-attributes. + # + # ==== Examples + # + # tag("br") + # # =>
    + # + # tag("br", nil, true) + # # =>
    + # + # tag("input", type: 'text', disabled: true) + # # => + # + # tag("input", type: 'text', class: ["strong", "highlight"]) + # # => + # + # tag("img", src: "open & shut.png") + # # => + # + # tag("img", { src: "open & shut.png" }, false, false) + # # => + # + # tag("div", data: { name: 'Stephen', city_state: %w(Chicago IL) }) + # # =>
    + # + # tag("div", class: { highlight: current_user.admin? }) + # # =>
    + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:479 + def tag(name = T.unsafe(nil), options = T.unsafe(nil), open = T.unsafe(nil), escape = T.unsafe(nil)); end + + # Returns a string of tokens built from +args+. + # + # ==== Examples + # token_list("foo", "bar") + # # => "foo bar" + # token_list("foo", "foo bar") + # # => "foo bar" + # token_list({ foo: true, bar: false }) + # # => "foo" + # token_list(nil, false, 123, "", "foo", { bar: true }) + # # => "123 foo bar" + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:538 + def token_list(*args); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:580 + def build_tag_values(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:575 + def ensure_valid_html5_tag_name(name); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:600 + def tag_builder; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:598 + def build_tag_values(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:578 + def ensure_valid_html5_tag_name(name); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:33 +ActionView::Helpers::TagHelper::ARIA_PREFIXES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:20 +ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:34 +ActionView::Helpers::TagHelper::DATA_PREFIXES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:42 +ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:36 +ActionView::Helpers::TagHelper::TAG_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:46 +class ActionView::Helpers::TagHelper::TagBuilder + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:213 + def initialize(view_context); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def a(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def abbr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def address(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def animate(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def animate_motion(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def animate_transform(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def area(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def article(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def aside(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # Transforms a Hash into HTML Attributes, ready to be interpolated into + # ERB. + # + # > + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:222 + def attributes(attributes); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def audio(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def b(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def base(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def bdi(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def bdo(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def blockquote(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def body(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def br(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def button(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def canvas(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def caption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def circle(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def cite(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def code(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def col(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def colgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:226 + def content_tag_string(name, content, options, escape = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def data(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def datalist(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def del(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def details(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dfn(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dialog(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def div(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dl(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def dt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ellipse(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def em(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def embed(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def fieldset(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def figcaption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def figure(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def footer(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def form(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h1(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h2(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h3(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h4(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h5(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def h6(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def head(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def header(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def hgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def hr(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def html(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def i(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def iframe(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def img(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def input(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ins(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def kbd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def keygen(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def label(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def legend(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def li(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def line(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def link(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def main(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def map(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def mark(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def menu(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def meta(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def meter(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def nav(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def noscript(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def object(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ol(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def optgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def option(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def output(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def p(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def path(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def picture(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def polygon(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def polyline(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def portal(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def pre(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def progress(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def q(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def rect(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def rp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def rt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ruby(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def s(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def samp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def script(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def search(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def section(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def select(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def set(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def slot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def small(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def source(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def span(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def stop(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def strong(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def style(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def sub(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def summary(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def sup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def table(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:235 + def tag_options(options, escape = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def tbody(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def td(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def template(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def textarea(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def tfoot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def th(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def thead(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def time(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def title(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def tr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def track(escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def u(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def ul(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def use(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def var(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def video(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def view(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:80 + def wbr(escape: T.unsafe(nil), **options, &block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:291 + def boolean_tag_option(key); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:324 + def method_missing(called, *args, escape: T.unsafe(nil), **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:312 + def prefix_tag_option(prefix, key, value, escape); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:320 + def respond_to_missing?(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:287 + def self_closing_tag_string(name, options, escape = T.unsafe(nil), tag_suffix = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:295 + def tag_option(key, value, escape); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:281 + def tag_string(name, content = T.unsafe(nil), options, escape: T.unsafe(nil), &block); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:47 + def define_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:67 + def define_self_closing_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:58 + def define_void_element(name, code_generator:, method_name: T.unsafe(nil)); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags.rb:5 +module ActionView::Helpers::Tags + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:6 +class ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ActiveModelInstanceTag + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:11 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:9 + def object; end + + # This is what child classes implement. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:31 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:97 + def add_default_name_and_field(options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:83 + def add_default_name_and_field_for_value(tag_value, options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:108 + def add_default_name_and_id(options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:95 + def add_default_name_and_id_for_value(tag_value, options, field = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:134 + def generate_ids?; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:126 + def name_and_id_index(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:74 + def retrieve_autoindex(pre_match); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:63 + def retrieve_object(object); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:118 + def sanitized_method_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:122 + def sanitized_value(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:114 + def tag_id(index = T.unsafe(nil), namespace = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:110 + def tag_name(multiple = T.unsafe(nil), index = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:36 + def value; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:46 + def value_before_type_cast; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:58 + def value_came_from_user?; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:8 +class ActionView::Helpers::Tags::CheckBox < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:11 + def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:17 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:42 + def checked?(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:59 + def hidden_field_for_checkbox(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/checkable.rb:6 +module ActionView::Helpers::Tags::Checkable + # pkg:gem/actionview#lib/action_view/helpers/tags/checkable.rb:7 + def input_checked?(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:8 +class ActionView::Helpers::Tags::CollectionCheckBoxes < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:22 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:31 + def hidden_field_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:27 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:12 +class ActionView::Helpers::Tags::CollectionCheckBoxes::CheckBoxBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:19 + def check_box(extra_html_options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:13 + def checkbox(extra_html_options = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:6 +module ActionView::Helpers::Tags::CollectionHelpers + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:30 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + private + + # Generate default options for collection helpers, such as :checked and + # :disabled. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:47 + def default_html_options_for_collection(item, value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:117 + def hidden_field; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:123 + def hidden_field_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:40 + def instantiate_builder(builder_class, item, value, text, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:85 + def render_collection; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:96 + def render_collection_for(builder_class, &block); end + + # Sanitize the attribute name used for the label's `for` attribute + # in collection helpers. When the value is nil or results in an + # empty sanitized string, skip the trailing underscore to match the + # id generated by add_default_name_and_id_for_value. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:75 + def sanitize_attribute_name(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:7 +class ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:10 + def initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:22 + def label(label_html_options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def text; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def value; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:8 +class ActionView::Helpers::Tags::CollectionRadioButtons < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:20 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:25 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:12 +class ActionView::Helpers::Tags::CollectionRadioButtons::RadioButtonBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:13 + def radio_button(extra_html_options = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:6 +class ActionView::Helpers::Tags::CollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:10 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:19 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:6 +class ActionView::Helpers::Tags::ColorField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:15 + def validate_color_string(string); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/date_field.rb:6 +class ActionView::Helpers::Tags::DateField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:8 +class ActionView::Helpers::Tags::DateSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:11 + def initialize(object_name, method_name, template_object, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:17 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:32 + def datetime_selector(options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:45 + def default_datetime(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:28 + def select_type; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:22 + def select_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:6 +class ActionView::Helpers::Tags::DatetimeField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:17 + def datetime_value(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:25 + def format_datetime(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:29 + def parse_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:6 +class ActionView::Helpers::Tags::DatetimeLocalField < ::ActionView::Helpers::Tags::DatetimeField + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:19 + def format_datetime(value); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:13 + def field_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_select.rb:6 +class ActionView::Helpers::Tags::DatetimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/email_field.rb:6 +class ActionView::Helpers::Tags::EmailField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:6 +class ActionView::Helpers::Tags::FileField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:23 + def hidden_field_for_multiple_file(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:6 +class ActionView::Helpers::Tags::GroupedCollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:10 + def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:21 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/hidden_field.rb:6 +class ActionView::Helpers::Tags::HiddenField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/hidden_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:6 +class ActionView::Helpers::Tags::Label < ::ActionView::Helpers::Tags::Base + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:34 + def initialize(object_name, method_name, template_object, content_or_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:48 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:71 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:7 +class ActionView::Helpers::Tags::Label::LabelBuilder + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:10 + def initialize(template_object, object_name, method_name, object, tag_value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:8 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:29 + def to_s; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:18 + def translation; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/month_field.rb:6 +class ActionView::Helpers::Tags::MonthField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/month_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/number_field.rb:6 +class ActionView::Helpers::Tags::NumberField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/number_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/password_field.rb:6 +class ActionView::Helpers::Tags::PasswordField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/password_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/placeholderable.rb:6 +module ActionView::Helpers::Tags::Placeholderable + # pkg:gem/actionview#lib/action_view/helpers/tags/placeholderable.rb:7 + def initialize(*); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:8 +class ActionView::Helpers::Tags::RadioButton < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:11 + def initialize(object_name, method_name, template_object, tag_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:16 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:26 + def checked?(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/range_field.rb:6 +class ActionView::Helpers::Tags::RangeField < ::ActionView::Helpers::Tags::NumberField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/search_field.rb:6 +class ActionView::Helpers::Tags::SearchField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/search_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:6 +class ActionView::Helpers::Tags::Select < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:10 + def initialize(object_name, method_name, template_object, choices, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:19 + def render; end + + private + + # Grouped choices look like this: + # + # [nil, []] + # { nil => [] } + # + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:39 + def grouped_choices?; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:6 +module ActionView::Helpers::Tags::SelectRenderer + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:38 + def add_options(option_tags, options, value = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:33 + def placeholder_required?(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:8 + def select_content_tag(option_tags, options, html_options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/tel_field.rb:6 +class ActionView::Helpers::Tags::TelField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/text_area.rb:8 +class ActionView::Helpers::Tags::TextArea < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_area.rb:11 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:8 +class ActionView::Helpers::Tags::TextField < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:11 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:27 + def field_type; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:21 + def field_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:6 +class ActionView::Helpers::Tags::TimeField < ::ActionView::Helpers::Tags::DatetimeField + # pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:13 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_select.rb:6 +class ActionView::Helpers::Tags::TimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:6 +class ActionView::Helpers::Tags::TimeZoneSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:10 + def initialize(object_name, method_name, template_object, priority_zones, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:17 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:6 +class ActionView::Helpers::Tags::Translator + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:7 + def initialize(object, object_name, method_and_value, scope:); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:14 + def translate; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:31 + def human_attribute_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:22 + def i18n_default; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def method_and_value; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def model; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def object_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def scope; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/url_field.rb:6 +class ActionView::Helpers::Tags::UrlField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/week_field.rb:6 +class ActionView::Helpers::Tags::WeekField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/week_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:6 +class ActionView::Helpers::Tags::WeekdaySelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:10 + def initialize(object_name, method_name, template_object, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:16 + def render; end +end + +# = Action View Text \Helpers +# +# The TextHelper module provides a set of methods for filtering, formatting +# and transforming strings, which can reduce the amount of inline Ruby code in +# your views. These helper methods extend Action View making them callable +# within your template files. +# +# ==== Sanitization +# +# Most text helpers that generate HTML output sanitize the given input by default, +# but do not escape it. This means HTML tags will appear in the page but all malicious +# code will be removed. Let's look at some examples using the +simple_format+ method: +# +# simple_format('Example') +# # => "

    Example

    " +# +# simple_format('Example') +# # => "

    Example

    " +# +# If you want to escape all content, you should invoke the +h+ method before +# calling the text helper. +# +# simple_format h('Example') +# # => "

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

    " +# +# pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:36 +module ActionView::Helpers::TextHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::SanitizeHelper + + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # The preferred method of outputting text in your views is to use the + # <%= "text" %> eRuby syntax. The regular +puts+ and +print+ methods + # do not operate as expected in an eRuby code block. If you absolutely must + # output text within a non-output code block (i.e., <% %>), you + # can use the +concat+ method. + # + # <% concat "hello" %> is equivalent to <%= "hello" %> + # + # <% + # unless signed_in? + # concat link_to("Sign In", action: :sign_in) + # end + # %> + # + # is equivalent to + # + # <% unless signed_in? %> + # <%= link_to "Sign In", action: :sign_in %> + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:63 + def concat(string); end + + # Returns the current cycle string after a cycle has been started. Useful + # for complex table highlighting or any other design need which requires + # the current cycle string in more than one place. + # + # <%# Alternate background colors %> + # <% @items = [1,2,3,4] %> + # <% @items.each do |item| %> + #
    "> + # <%= item %> + #
    + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:461 + def current_cycle(name = T.unsafe(nil)); end + + # Creates a Cycle object whose +to_s+ method cycles through elements of an + # array every time it is called. This can be used for example, to alternate + # classes for table rows. You can use named cycles to allow nesting in loops. + # Passing a Hash as the last parameter with a :name key will create a + # named cycle. The default name for a cycle without a +:name+ key is + # "default". You can manually reset a cycle by calling reset_cycle + # and passing the name of the cycle. The current cycle string can be obtained + # anytime using the current_cycle method. + # + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [1,2,3,4] %> + # + # <% @items.each do |item| %> + # "> + # + # + # <% end %> + #
    <%= item %>
    + # + # + # <%# Cycle CSS classes for rows, and text colors for values within each row %> + # <% @items = [ + # { first: "Robert", middle: "Daniel", last: "James" }, + # { first: "Emily", middle: "Shannon", maiden: "Pike", last: "Hicks" }, + # { first: "June", middle: "Dae", last: "Jones" }, + # ] %> + # <% @items.each do |item| %> + # "> + # + # <% item.values.each do |value| %> + # <%# Create a named cycle "colors" %> + # "> + # <%= value %> + # + # <% end %> + # <% reset_cycle("colors") %> + # + # + # <% end %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:437 + def cycle(first_value, *values); end + + # Extracts the first occurrence of +phrase+ plus surrounding text from + # +text+. An omission marker is prepended / appended if the start / end of + # the result does not coincide with the start / end of +text+. The result + # is always stripped in any case. Returns +nil+ if +phrase+ isn't found. + # + # ==== Options + # + # [+:radius+] + # The number of characters (or tokens — see +:separator+ option) around + # +phrase+ to include in the result. Defaults to 100. + # + # [+:omission+] + # The marker to prepend / append when the start / end of the excerpt + # does not coincide with the start / end of +text+. Defaults to + # "...". + # + # [+:separator+] + # The separator between tokens to count for +:radius+. Defaults to + # "", which treats each character as a token. + # + # ==== Examples + # + # excerpt('This is an example', 'an', radius: 5) + # # => "...s is an exam..." + # + # excerpt('This is an example', 'is', radius: 5) + # # => "This is a..." + # + # excerpt('This is an example', 'is') + # # => "This is an example" + # + # excerpt('This next thing is an example', 'ex', radius: 2) + # # => "...next..." + # + # excerpt('This is also an example', 'an', radius: 8, omission: ' ') + # # => " is also an example" + # + # excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1) + # # => "...a very beautiful..." + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:235 + def excerpt(text, phrase, options = T.unsafe(nil)); end + + # Highlights occurrences of +phrases+ in +text+ by formatting them with a + # highlighter string. +phrases+ can be one or more strings or regular + # expressions. The result will be marked HTML safe. By default, +text+ is + # sanitized before highlighting to prevent possible XSS attacks. + # + # If a block is specified, it will be used instead of the highlighter + # string. Each occurrence of a phrase will be passed to the block, and its + # return value will be inserted into the final result. + # + # ==== Options + # + # [+:highlighter+] + # The highlighter string. Uses \1 as the placeholder for a + # phrase, similar to +String#sub+. Defaults to "\1". + # This option is ignored if a block is specified. + # + # [+:sanitize+] + # Whether to sanitize +text+ before highlighting. Defaults to true. + # + # ==== Examples + # + # highlight('You searched for: rails', 'rails') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', /for|rails/) + # # => "You searched for: rails" + # + # highlight('You searched for: ruby, rails, dhh', 'actionpack') + # # => "You searched for: ruby, rails, dhh" + # + # highlight('You searched for: rails', ['for', 'rails'], highlighter: '\1') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', 'rails', highlighter: '\1') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', 'rails') { |match| link_to(search_path(q: match)) } + # # => "You searched for: rails" + # + # highlight('ruby on rails', 'rails', sanitize: false) + # # => "ruby on rails" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:174 + def highlight(text, phrases, options = T.unsafe(nil), &block); end + + # Attempts to pluralize the +singular+ word unless +count+ is 1. If + # +plural+ is supplied, it will use that when count is > 1, otherwise + # it will use the Inflector to determine the plural form for the given locale, + # which defaults to +I18n.locale+. + # + # The word will be pluralized using rules defined for the locale + # (you must define your own inflection rules for languages other than English). + # See ActiveSupport::Inflector.pluralize. + # + # pluralize(1, 'person') + # # => "1 person" + # + # pluralize(2, 'person') + # # => "2 people" + # + # pluralize(3, 'person', plural: 'users') + # # => "3 users" + # + # pluralize(0, 'person') + # # => "0 people" + # + # pluralize(2, 'Person', locale: :de) + # # => "2 Personen" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:297 + def pluralize(count, singular, plural_arg = T.unsafe(nil), plural: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Resets a cycle so that it starts from the first element the next time + # it is called. Pass in +name+ to reset a named cycle. + # + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [[1,2,3,4], [5,6,3], [3,4,5,6,7,4]] %> + # + # <% @items.each do |item| %> + # "> + # <% item.each do |value| %> + # "> + # <%= value %> + # + # <% end %> + # + # <% reset_cycle("colors") %> + # + # <% end %> + #
    + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:484 + def reset_cycle(name = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:67 + def safe_concat(string); end + + # Returns +text+ transformed into HTML using simple formatting rules. + # Two or more consecutive newlines (\n\n or \r\n\r\n) are + # considered a paragraph and wrapped in

    tags. One newline + # (\n or \r\n) is considered a linebreak and a + #
    tag is appended. This method does not remove the + # newlines from the +text+. + # + # You can pass any HTML attributes into html_options. These + # will be added to all created paragraphs. + # + # ==== Options + # * :sanitize - If +false+, does not sanitize +text+. + # * :sanitize_options - Any extra options you want appended to the sanitize. + # * :wrapper_tag - String representing the wrapper tag, defaults to "p". + # + # ==== Examples + # my_text = "Here is some basic text...\n...with a line break." + # + # simple_format(my_text) + # # => "

    Here is some basic text...\n
    ...with a line break.

    " + # + # simple_format(my_text, {}, wrapper_tag: "div") + # # => "
    Here is some basic text...\n
    ...with a line break.
    " + # + # more_text = "We want to put a paragraph...\n\n...right there." + # + # simple_format(more_text) + # # => "

    We want to put a paragraph...

    \n\n

    ...right there.

    " + # + # simple_format("Look ma! A class!", class: 'description') + # # => "

    Look ma! A class!

    " + # + # simple_format("Unblinkable.") + # # => "

    Unblinkable.

    " + # + # simple_format("Blinkable! It's true.", {}, sanitize: false) + # # => "

    Blinkable! It's true.

    " + # + # simple_format("Continue", {}, { sanitize_options: { attributes: %w[target href] } }) + # # => "

    Continue

    " + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:383 + def simple_format(text, html_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # Truncates +text+ if it is longer than a specified +:length+. If +text+ + # is truncated, an omission marker will be appended to the result for a + # total length not exceeding +:length+. + # + # You can also pass a block to render and append extra content after the + # omission marker when +text+ is truncated. However, this content _can_ + # cause the total length to exceed +:length+ characters. + # + # The result will be escaped unless escape: false is specified. + # In any case, the result will be marked HTML-safe. Care should be taken + # if +text+ might contain HTML tags or entities, because truncation could + # produce invalid HTML, such as unbalanced or incomplete tags. + # + # ==== Options + # + # [+:length+] + # The maximum number of characters that should be returned, excluding + # any extra content from the block. Defaults to 30. + # + # [+:omission+] + # The string to append after truncating. Defaults to "...". + # + # [+:separator+] + # A string or regexp used to find a breaking point at which to truncate. + # By default, truncation can occur at any character in +text+. + # + # [+:escape+] + # Whether to escape the result. Defaults to true. + # + # ==== Examples + # + # truncate("Once upon a time in a world far far away") + # # => "Once upon a time in a world..." + # + # truncate("Once upon a time in a world far far away", length: 17) + # # => "Once upon a ti..." + # + # truncate("Once upon a time in a world far far away", length: 17, separator: ' ') + # # => "Once upon a..." + # + # truncate("And they found that many people were sleeping better.", length: 25, omission: '... (continued)') + # # => "And they f... (continued)" + # + # truncate("

    Once upon a time in a world far far away

    ") + # # => "<p>Once upon a time in a wo..." + # + # truncate("

    Once upon a time in a world far far away

    ", escape: false) + # # => "

    Once upon a time in a wo..." + # + # truncate("Once upon a time in a world far far away") { link_to "Continue", "#" } + # # => "Once upon a time in a world...Continue" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:122 + def truncate(text, options = T.unsafe(nil), &block); end + + # Wraps the +text+ into lines no longer than +line_width+ width. This method + # breaks on the first whitespace character that does not exceed +line_width+ + # (which is 80 by default). + # + # word_wrap('Once upon a time') + # # => "Once upon a time" + # + # word_wrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...') + # # => "Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined..." + # + # word_wrap('Once upon a time', line_width: 8) + # # => "Once\nupon a\ntime" + # + # word_wrap('Once upon a time', line_width: 1) + # # => "Once\nupon\na\ntime" + # + # You can also specify a custom +break_sequence+ ("\n" by default): + # + # word_wrap('Once upon a time', line_width: 1, break_sequence: "\r\n") + # # => "Once\r\nupon\r\na\r\ntime" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:327 + def word_wrap(text, line_width: T.unsafe(nil), break_sequence: T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:547 + def cut_excerpt_part(part_position, part, separator, options); end + + # The cycle helpers need to store the cycles in a place that is + # guaranteed to be reset every time a page is rendered, so it + # uses an instance variable of ActionView::Base. + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:529 + def get_cycle(name); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:534 + def set_cycle(name, cycle_object); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:539 + def split_paragraphs(text); end +end + +# pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:489 +class ActionView::Helpers::TextHelper::Cycle + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:492 + def initialize(first_value, *values); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:501 + def current_value; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:497 + def reset; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:505 + def to_s; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:490 + def values; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:512 + def next_index; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:516 + def previous_index; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:520 + def step_index(n); end +end + +# = Action View Translation \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:9 +module ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + extend ::ActiveSupport::Concern + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:119 + def l(object, **options); end + + # Delegates to I18n.localize with no additional functionality. + # + # See https://www.rubydoc.info/gems/i18n/I18n/Backend/Base:localize + # for more information. + # + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:116 + def localize(object, **options); end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:110 + def t(key, **options); end + + # Delegates to I18n#translate but also performs three additional + # functions. + # + # First, it will ensure that any thrown +MissingTranslation+ messages will + # be rendered as inline spans that: + # + # * Have a translation-missing class applied + # * Contain the missing key as the value of the +title+ attribute + # * Have a titleized version of the last key segment as text + # + # For example, the value returned for the missing translation key + # "blog.post.title" will be: + # + # Title + # + # This allows for views to display rather reasonable strings while still + # giving developers a way to find missing translations. + # + # If you would prefer missing translations to raise an error, you can + # opt out of span-wrapping behavior globally by setting + # config.i18n.raise_on_missing_translations = true or + # individually by passing raise: true as an option to + # translate. + # + # Second, if the key starts with a period translate will scope + # the key by the current partial. Calling translate(".foo") from + # the people/index.html.erb template is equivalent to calling + # translate("people.index.foo"). This makes it less + # repetitive to translate many keys within the same partial and provides + # a convention to scope keys consistently. + # + # Third, the translation will be marked as html_safe if the key + # has the suffix "_html" or the last element of the key is "html". Calling + # translate("footer_html") or translate("footer.html") + # will return an HTML safe string that won't be escaped by other HTML + # helper methods. This naming convention helps to identify translations + # that include HTML tags so that you know what kind of output to expect + # when you call translate in a template and translators know which keys + # they can provide HTML values for. + # + # To access the translated text along with the fully resolved + # translation key, translate accepts a block: + # + # <%= translate(".relative_key") do |translation, resolved_key| %> + # <%= translation %> + # <% end %> + # + # This enables annotate translated text to be aware of the scope it was + # resolved against. + # + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:73 + def translate(key, **options); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:142 + def missing_translation(key, options); end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:128 + def scope_key_by_partial(key); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:15 + def raise_on_missing_translations; end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:15 + def raise_on_missing_translations=(_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:122 +ActionView::Helpers::TranslationHelper::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:125 +ActionView::Helpers::TranslationHelper::NO_DEFAULT = T.let(T.unsafe(nil), Array) + +# = Action View URL \Helpers +# +# Provides a set of methods for making links and getting URLs that +# depend on the routing subsystem (see ActionDispatch::Routing). +# This allows you to use the same format for links in views +# and controllers. +# +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:17 +module ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + + # Generates a form containing a single button that submits to the URL created + # by the set of +options+. This is the safest method to ensure links that + # cause changes to your data are not triggered by search bots or accelerators. + # + # You can control the form and button behavior with +html_options+. Most + # values in +html_options+ are passed through to the button element. For + # example, passing a +:class+ option within +html_options+ will set the + # class attribute of the button element. + # + # The class attribute of the form element can be set by passing a + # +:form_class+ option within +html_options+. It defaults to + # "button_to" to allow styling of the form and its children. + # + # The form submits a POST request by default if the object is not persisted; + # conversely, if the object is persisted, it will submit a PATCH request. + # To specify a different HTTP verb use the +:method+ option within +html_options+. + # + # If the HTML button generated from +button_to+ does not work with your layout, you can + # consider using the +link_to+ method with the +data-turbo-method+ + # attribute as described in the +link_to+ documentation. + # + # ==== Options + # The +options+ hash accepts the same options as +url_for+. To generate a + # element without an [action] attribute, pass + # false: + # + # <%= button_to "New", false %> + # # => " + # # + # # + # #

    " + # + # Most values in +html_options+ are passed through to the button element, + # but there are a few special options: + # + # * :method - \Symbol of HTTP verb. Supported verbs are :post, :get, + # :delete, :patch, and :put. By default it will be :post. + # * :disabled - If set to true, it will generate a disabled button. + # * :data - This option can be used to add custom data attributes. + # * :form - This hash will be form attributes + # * :form_class - This controls the class of the form within which the submit button will + # be placed + # * :params - \Hash of parameters to be rendered as hidden fields within the form. + # + # ==== Examples + # <%= button_to "New", action: "new" %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "New", new_article_path %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "New", new_article_path, params: { time: Time.now } %> + # # => "
    + # # + # # + # # + # #
    " + # + # <%= button_to [:make_happy, @user] do %> + # Make happy <%= @user.name %> + # <% end %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "New", { action: "new" }, form_class: "new-thing" %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "Create", { action: "create" }, form: { "data-type" => "json" } %> + # # => "
    + # # + # # + # #
    " + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:296 + def button_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag=(val); end + + # True if the current request URI was generated by the given +options+. + # + # ==== Examples + # Let's say we're in the http://www.example.com/shop/checkout?order=desc&page=1 action. + # + # current_page?(action: 'process') + # # => false + # + # current_page?(action: 'checkout') + # # => true + # + # current_page?(controller: 'library', action: 'checkout') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'asc') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2') + # # => false + # + # current_page?('http://www.example.com/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout', check_parameters: true) + # # => false + # + # current_page?('/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout?order=desc&page=1') + # # => true + # + # Different actions may share the same URL path but have a different HTTP method. Let's say we + # sent a POST to http://www.example.com/products and rendered a validation error. + # + # current_page?(controller: 'product', action: 'index') + # # => false + # + # current_page?(controller: 'product', action: 'create') + # # => false + # + # current_page?(controller: 'product', action: 'create', method: :post) + # # => true + # + # current_page?(controller: 'product', action: 'index', method: [:get, :post]) + # # => true + # + # We can also pass in the symbol arguments instead of strings. + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:559 + def current_page?(options = T.unsafe(nil), check_parameters: T.unsafe(nil), method: T.unsafe(nil), **options_as_kwargs); end + + # Creates an anchor element of the given +name+ using a URL created by the set of +options+. + # See the valid options in the documentation for +url_for+. It's also possible to + # pass a \String instead of an options hash, which generates an anchor element that uses the + # value of the \String as the href for the link. Using a :back \Symbol instead + # of an options hash will generate a link to the referrer (a JavaScript back link + # will be used in place of a referrer if none exists). If +nil+ is passed as the name + # the value of the link itself will become the name. + # + # ==== Signatures + # + # link_to(body, url, html_options = {}) + # # url is a String; you can use URL helpers like + # # posts_path + # + # link_to(body, url_options = {}, html_options = {}) + # # url_options, except :method, is passed to url_for + # + # link_to(options = {}, html_options = {}) do + # # name + # end + # + # link_to(url, html_options = {}) do + # # name + # end + # + # link_to(active_record_model) + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # + # ==== Examples + # + # Because it relies on +url_for+, +link_to+ supports both older-style controller/action/id arguments + # and newer RESTful routes. Current \Rails style favors RESTful routes whenever possible, so base + # your application on resources and use + # + # link_to "Profile", profile_path(@profile) + # # => Profile + # + # or the even pithier + # + # link_to "Profile", @profile + # # => Profile + # + # in place of the older more verbose, non-resource-oriented + # + # link_to "Profile", controller: "profiles", action: "show", id: @profile + # # => Profile + # + # Similarly, + # + # link_to "Profiles", profiles_path + # # => Profiles + # + # is better than + # + # link_to "Profiles", controller: "profiles" + # # => Profiles + # + # When name is +nil+ the href is presented instead + # + # link_to nil, "http://example.com" + # # => http://www.example.com + # + # More concise yet, when +name+ is an Active Record model that defines a + # +to_s+ method returning a default value or a model instance attribute + # + # link_to @profile + # # => Eileen + # + # You can use a block as well if your link target is hard to fit into the name parameter. ERB example: + # + # <%= link_to(@profile) do %> + # <%= @profile.name %> -- Check it out! + # <% end %> + # # => + # David -- Check it out! + # + # + # Classes and ids for CSS are easy to produce: + # + # link_to "Articles", articles_path, id: "news", class: "article" + # # => Articles + # + # Be careful when using the older argument style, as an extra literal hash is needed: + # + # link_to "Articles", { controller: "articles" }, id: "news", class: "article" + # # => Articles + # + # Leaving the hash off gives the wrong link: + # + # link_to "WRONG!", controller: "articles", id: "news", class: "article" + # # => WRONG! + # + # +link_to+ can also produce links with anchors or query strings: + # + # link_to "Comment wall", profile_path(@profile, anchor: "wall") + # # => Comment wall + # + # link_to "Ruby on Rails search", controller: "searches", query: "ruby on rails" + # # => Ruby on Rails search + # + # link_to "Nonsense search", searches_path(foo: "bar", baz: "quux") + # # => Nonsense search + # + # You can set any link attributes such as target, rel, type: + # + # link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow" + # # => External link + # + # ==== Turbo + # + # Rails 7 ships with Turbo enabled by default. Turbo provides the following +:data+ options: + # + # * turbo_method: symbol of HTTP verb - Performs a Turbo link visit + # with the given HTTP verb. Forms are recommended when performing non-+GET+ requests. + # Only use data-turbo-method where a form is not possible. + # + # * turbo_confirm: "question?" - Adds a confirmation dialog to the link with the + # given value. + # + # {Consult the Turbo Handbook for more information on the options + # above.}[https://turbo.hotwired.dev/handbook/drive#performing-visits-with-a-different-method] + # + # ===== \Examples + # + # link_to "Delete profile", @profile, data: { turbo_method: :delete } + # # => Delete profile + # + # link_to "Visit Other Site", "https://rubyonrails.org/", data: { turbo_confirm: "Are you sure?" } + # # => Visit Other Site + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:198 + def link_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ if +condition+ is true, otherwise only the name is + # returned. To specialize the default behavior, you can pass a block that + # accepts the name or the full argument list for +link_to_if+. + # + # ==== Examples + # <%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) %> + # # If the user isn't logged in... + # # => Login + # + # <%= + # link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do + # link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user }) + # end + # %> + # # If the user isn't logged in... + # # => Login + # # If they are logged in... + # # => my_username + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:438 + def link_to_if(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ unless +condition+ is true, in which case only the name is + # returned. To specialize the default behavior (i.e., show a login link rather + # than just the plaintext link text), you can pass a block that + # accepts the name or the full argument list for +link_to_unless+. + # + # ==== Examples + # <%= link_to_unless(@current_user.nil?, "Reply", { action: "reply" }) %> + # # If the user is logged in... + # # => Reply + # + # <%= + # link_to_unless(@current_user.nil?, "Reply", { action: "reply" }) do |name| + # link_to(name, { controller: "accounts", action: "signup" }) + # end + # %> + # # If the user is logged in... + # # => Reply + # # If not... + # # => Reply + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:415 + def link_to_unless(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ unless the current request URI is the same as the links, in + # which case only the name is returned (or the given block is yielded, if + # one exists). You can give +link_to_unless_current+ a block which will + # specialize the default behavior (e.g., show a "Start Here" link rather + # than the link's text). + # + # ==== Examples + # Let's say you have a navigation menu... + # + # + # + # If in the "about" action, it will render... + # + # + # + # ...but if in the "index" action, it will render: + # + # + # + # The implicit block given to +link_to_unless_current+ is evaluated if the current + # action is the action given. So, if we had a comments page and wanted to render a + # "Go Back" link instead of a link to the comments page, we could do something like this... + # + # <%= + # link_to_unless_current("Comment", { controller: "comments", action: "new" }) do + # link_to("Go back", { controller: "posts", action: "index" }) + # end + # %> + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:391 + def link_to_unless_current(name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a mailto link tag to the specified +email_address+, which is + # also used as the name of the link unless +name+ is specified. Additional + # HTML attributes for the link can be passed in +html_options+. + # + # +mail_to+ has several methods for customizing the email itself by + # passing special keys to +html_options+. + # + # ==== Options + # * :subject - Preset the subject line of the email. + # * :body - Preset the body of the email. + # * :cc - Carbon Copy additional recipients on the email. + # * :bcc - Blind Carbon Copy additional recipients on the email. + # * :reply_to - Preset the +Reply-To+ field of the email. + # + # ==== Obfuscation + # Prior to \Rails 4.0, +mail_to+ provided options for encoding the address + # in order to hinder email harvesters. To take advantage of these options, + # install the +actionview-encoded_mail_to+ gem. + # + # ==== Examples + # mail_to "me@domain.com" + # # => me@domain.com + # + # mail_to "me@domain.com", "My email" + # # => My email + # + # mail_to "me@domain.com", cc: "ccaddress@domain.com", + # subject: "This is an example email" + # # => me@domain.com + # + # You can use a block as well if your link target is hard to fit into the name parameter. ERB example: + # + # <%= mail_to "me@domain.com" do %> + # Email me: me@domain.com + # <% end %> + # # => + # Email me: me@domain.com + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:488 + def mail_to(email_address, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a TEL anchor link tag to the specified +phone_number+. When the + # link is clicked, the default app to make phone calls is opened and + # prepopulated with the phone number. + # + # If +name+ is not specified, +phone_number+ will be used as the name of + # the link. + # + # A +country_code+ option is supported, which prepends a plus sign and the + # given country code to the linked phone number. For example, + # country_code: "01" will prepend +01 to the linked + # phone number. + # + # Additional HTML attributes for the link can be passed via +html_options+. + # + # ==== Options + # * :country_code - Prepends the country code to the phone number + # + # ==== Examples + # phone_to "1234567890" + # # => 1234567890 + # + # phone_to "1234567890", "Phone me" + # # => Phone me + # + # phone_to "1234567890", country_code: "01" + # # => 1234567890 + # + # You can use a block as well if your link target is hard to fit into the name parameter. \ERB example: + # + # <%= phone_to "1234567890" do %> + # Phone me: + # <% end %> + # # => + # Phone me: + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:693 + def phone_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates an SMS anchor link tag to the specified +phone_number+. When the + # link is clicked, the default SMS messaging app is opened ready to send a + # message to the linked phone number. If the +body+ option is specified, + # the contents of the message will be preset to +body+. + # + # If +name+ is not specified, +phone_number+ will be used as the name of + # the link. + # + # A +country_code+ option is supported, which prepends a plus sign and the + # given country code to the linked phone number. For example, + # country_code: "01" will prepend +01 to the linked + # phone number. + # + # Additional HTML attributes for the link can be passed via +html_options+. + # + # ==== Options + # * :country_code - Prepend the country code to the phone number. + # * :body - Preset the body of the message. + # + # ==== Examples + # sms_to "5155555785" + # # => 5155555785 + # + # sms_to "5155555785", country_code: "01" + # # => 5155555785 + # + # sms_to "5155555785", "Text me" + # # => Text me + # + # sms_to "5155555785", body: "I have a question about your product." + # # => 5155555785 + # + # You can use a block as well if your link target is hard to fit into the name parameter. \ERB example: + # + # <%= sms_to "5155555785" do %> + # Text me: + # <% end %> + # # => + # Text me: + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:642 + def sms_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Basic implementation of url_for to allow use helpers without routes existence + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:38 + def url_for(options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:50 + def _back_url; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:55 + def _filtered_referrer; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:736 + def add_method_to_attributes!(html_options, method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:707 + def convert_options_to_data_attributes(options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:730 + def link_to_remote_options?(options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:747 + def method_for_options(options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:765 + def method_not_get_method?(method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:786 + def method_tag(method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:834 + def remove_trailing_slash!(url_string); end + + # Returns an array of hashes each containing :name and :value keys + # suitable for use as the names and values of form input fields: + # + # to_form_params(name: 'David', nationality: 'Danish') + # # => [{name: 'name', value: 'David'}, {name: 'nationality', value: 'Danish'}] + # + # to_form_params(country: { name: 'Denmark' }) + # # => [{name: 'country[name]', value: 'Denmark'}] + # + # to_form_params(countries: ['Denmark', 'Sweden']}) + # # => [{name: 'countries[]', value: 'Denmark'}, {name: 'countries[]', value: 'Sweden'}] + # + # An optional namespace can be passed to enclose key names: + # + # to_form_params({ name: 'Denmark' }, 'country') + # # => [{name: 'country[name]', value: 'Denmark'}] + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:808 + def to_form_params(attribute, namespace = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:770 + def token_tag(token = T.unsafe(nil), form_options: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:722 + def url_target(name, options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag=(val); end + end +end + +# This helper may be included in any class that includes the +# URL helpers of a routes (routes.url_helpers). Some methods +# provided here will only work in the context of a request +# (link_to_unless_current, for instance), which must be provided +# as a method called #request on the context. +# +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:23 +ActionView::Helpers::UrlHelper::BUTTON_TAG_METHOD_VERBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:29 +module ActionView::Helpers::UrlHelper::ClassMethods + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:30 + def _url_for_modules; end +end + +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:757 +ActionView::Helpers::UrlHelper::STRINGIFIED_COMMON_METHODS = T.let(T.unsafe(nil), Hash) + +# This is a class to fix I18n global state. Whenever you provide I18n.locale during a request, +# it will trigger the lookup_context and consequently expire the cache. +# +# pkg:gem/actionview#lib/action_view/rendering.rb:8 +class ActionView::I18nProxy < ::I18n::Config + # pkg:gem/actionview#lib/action_view/rendering.rb:11 + def initialize(original_config, lookup_context); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:17 + def locale; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:21 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:9 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:9 + def original_config; end +end + +# = Action View \Layouts +# +# Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in +# repeated setups. The inclusion pattern has pages that look like this: +# +# <%= render "application/header" %> +# Hello World +# <%= render "application/footer" %> +# +# This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose +# and if you ever want to change the structure of these two includes, you'll have to change all the templates. +# +# With layouts, you can flip it around and have the common structure know where to insert changing content. This means +# that the header and footer are only mentioned in one place, like this: +# +# // The header part of this layout +# <%= yield %> +# // The footer part of this layout +# +# And then you have content pages that look like this: +# +# hello world +# +# At rendering time, the content page is computed and then inserted in the layout, like this: +# +# // The header part of this layout +# hello world +# // The footer part of this layout +# +# == Accessing shared variables +# +# Layouts have access to variables specified in the content pages and vice versa. This allows you to have layouts with +# references that won't materialize before rendering time: +# +#

    <%= @page_title %>

    +# <%= yield %> +# +# ...and content pages that fulfill these references _at_ rendering time: +# +# <% @page_title = "Welcome" %> +# Off-world colonies offers you a chance to start a new life +# +# The result after rendering is: +# +#

    Welcome

    +# Off-world colonies offers you a chance to start a new life +# +# == Layout assignment +# +# You can either specify a layout declaratively (using the #layout class method) or give +# it the same name as your controller, and place it in app/views/layouts. +# If a subclass does not have a layout specified, it inherits its layout using normal Ruby inheritance. +# +# For instance, if you have PostsController and a template named app/views/layouts/posts.html.erb, +# that template will be used for all actions in PostsController and controllers inheriting +# from PostsController. +# +# If you use a module, for instance Weblog::PostsController, you will need a template named +# app/views/layouts/weblog/posts.html.erb. +# +# Since all your controllers inherit from ApplicationController, they will use +# app/views/layouts/application.html.erb if no other layout is specified +# or provided. +# +# == Inheritance Examples +# +# class BankController < ActionController::Base +# # bank.html.erb exists +# +# class ExchangeController < BankController +# # exchange.html.erb exists +# +# class CurrencyController < BankController +# +# class InformationController < BankController +# layout "information" +# +# class TellerController < InformationController +# # teller.html.erb exists +# +# class EmployeeController < InformationController +# # employee.html.erb exists +# layout nil +# +# class VaultController < BankController +# layout :access_level_layout +# +# class TillController < BankController +# layout false +# +# In these examples, we have three implicit lookup scenarios: +# * The +BankController+ uses the "bank" layout. +# * The +ExchangeController+ uses the "exchange" layout. +# * The +CurrencyController+ inherits the layout from BankController. +# +# However, when a layout is explicitly set, the explicitly set layout wins: +# * The +InformationController+ uses the "information" layout, explicitly set. +# * The +TellerController+ also uses the "information" layout, because the parent explicitly set it. +# * The +EmployeeController+ uses the "employee" layout, because it set the layout to +nil+, resetting the parent configuration. +# * The +VaultController+ chooses a layout dynamically by calling the access_level_layout method. +# * The +TillController+ does not use a layout at all. +# +# == Types of layouts +# +# Layouts are basically just regular templates, but the name of this template needs not be specified statically. Sometimes +# you want to alternate layouts depending on runtime information, such as whether someone is logged in or not. This can +# be done either by specifying a method reference as a symbol or using an inline method (as a proc). +# +# The method reference is the preferred approach to variable layouts and is used like this: +# +# class WeblogController < ActionController::Base +# layout :writers_and_readers +# +# def index +# # fetching posts +# end +# +# private +# def writers_and_readers +# logged_in? ? "writer_layout" : "reader_layout" +# end +# end +# +# Now when a new request for the index action is processed, the layout will vary depending on whether the person accessing +# is logged in or not. +# +# If you want to use an inline method, such as a proc, do something like this: +# +# class WeblogController < ActionController::Base +# layout proc { |controller| controller.logged_in? ? "writer_layout" : "reader_layout" } +# end +# +# If an argument isn't given to the proc, it's evaluated in the context of +# the current controller anyway. +# +# class WeblogController < ActionController::Base +# layout proc { logged_in? ? "writer_layout" : "reader_layout" } +# end +# +# Of course, the most common way of specifying a layout is still just as a plain template name: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard" +# end +# +# The template will be looked always in app/views/layouts/ folder. But you can point +# layouts folder direct also. layout "layouts/demo" is the same as layout "demo". +# +# Setting the layout to +nil+ forces it to be looked up in the filesystem and falls back to the parent behavior if none exists. +# Setting it to +nil+ is useful to re-enable template lookup overriding a previous configuration set in the parent: +# +# class ApplicationController < ActionController::Base +# layout "application" +# end +# +# class PostsController < ApplicationController +# # Will use "application" layout +# end +# +# class CommentsController < ApplicationController +# # Will search for "comments" layout and fall back to "application" layout +# layout nil +# end +# +# == Conditional layouts +# +# If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering +# a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The +# :only and :except options can be passed to the layout call. For example: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard", except: :rss +# +# # ... +# +# end +# +# This will assign "weblog_standard" as the WeblogController's layout for all actions except for the +rss+ action, which will +# be rendered directly, without wrapping a layout around the rendered view. +# +# Both the :only and :except condition can accept an arbitrary number of method references, so +# except: [ :rss, :text_only ] is valid, as is except: :rss. +# +# == Using a different layout in the action render call +# +# If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above. +# Sometimes you'll have exceptions where one action wants to use a different layout than the rest of the controller. +# You can do this by passing a :layout option to the render call. For example: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard" +# +# def help +# render action: "help", layout: "help" +# end +# end +# +# This will override the controller-wide "weblog_standard" layout, and will render the help action with the "help" layout instead. +# +# pkg:gem/actionview#lib/action_view/layouts.rb:205 +module ActionView::Layouts + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionView::ViewPaths + include ::ActionView::Rendering + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + mixes_in_class_methods ::ActionView::Layouts::ClassMethods + + # pkg:gem/actionview#lib/action_view/layouts.rb:361 + def initialize(*); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:350 + def _process_render_template_options(options); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:359 + def action_has_layout=(_arg0); end + + # Controls whether an action should be rendered using a layout. + # If you want to disable any layout settings for the + # current action so that it is rendered without a layout then + # either override this method in your controller to return false + # for that action or set the action_has_layout attribute + # to false before rendering. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:372 + def action_has_layout?; end + + private + + # pkg:gem/actionview#lib/action_view/layouts.rb:377 + def _conditional_layout?; end + + # Returns the default layout for this controller. + # Optionally raises an exception if the layout could not be found. + # + # ==== Parameters + # * formats - The formats accepted to this layout + # * require_layout - If set to +true+ and layout is not found, + # an +ArgumentError+ exception is raised (defaults to +false+) + # + # ==== Returns + # * template - The template object for the default layout (or +nil+) + # + # pkg:gem/actionview#lib/action_view/layouts.rb:415 + def _default_layout(lookup_context, formats, keys, require_layout = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:430 + def _include_layout?(options); end + + # This will be overwritten by _write_layout_method + # + # pkg:gem/actionview#lib/action_view/layouts.rb:382 + def _layout(*); end + + # Determine the layout for a given name, taking into account the name type. + # + # ==== Parameters + # * name - The name of the template + # + # pkg:gem/actionview#lib/action_view/layouts.rb:388 + def _layout_for_option(name); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:401 + def _normalize_layout(value); end + + module GeneratedClassMethods + def _layout; end + def _layout=(value); end + def _layout?; end + def _layout_conditions; end + def _layout_conditions=(value); end + def _layout_conditions?; end + end + + module GeneratedInstanceMethods + def _layout_conditions; end + def _layout_conditions?; end + end +end + +# pkg:gem/actionview#lib/action_view/layouts.rb:217 +module ActionView::Layouts::ClassMethods + # Creates a _layout method to be called by _default_layout . + # + # If a layout is not explicitly mentioned then look for a layout with the controller's name. + # if nothing is found then try same procedure to find super class's layout. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:283 + def _write_layout_method; end + + # pkg:gem/actionview#lib/action_view/layouts.rb:218 + def inherited(klass); end + + # Specify the layout to use for this class. + # + # If the specified layout is a: + # String:: the String is the template name + # Symbol:: call the method specified by the symbol + # Proc:: call the passed Proc + # false:: There is no layout + # true:: raise an ArgumentError + # nil:: Force default layout behavior with inheritance + # + # Return value of +Proc+ and +Symbol+ arguments should be +String+, +false+, +true+, or +nil+ + # with the same meaning as described above. + # + # ==== Parameters + # + # * layout - The layout to use. + # + # ==== Options (conditions) + # + # * +:only+ - A list of actions to apply this layout to. + # * +:except+ - Apply this layout to all actions but this one. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:269 + def layout(layout, conditions = T.unsafe(nil)); end + + private + + # If no layout is supplied, look for a template named the return + # value of this method. + # + # ==== Returns + # * String - A template name + # + # pkg:gem/actionview#lib/action_view/layouts.rb:345 + def _implied_layout_name; end +end + +# This module is mixed in if layout conditions are provided. This means +# that if no layout conditions are used, this method is not used +# +# pkg:gem/actionview#lib/action_view/layouts.rb:225 +module ActionView::Layouts::ClassMethods::LayoutConditions + private + + # Determines whether the current action has a layout definition by + # checking the action name against the :only and :except conditions + # set by the layout method. + # + # ==== Returns + # * Boolean - True if the action has a layout definition, false otherwise. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:233 + def _conditional_layout?; end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:6 +class ActionView::LogSubscriber < ::ActiveSupport::LogSubscriber + include ::ActionView::LogSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:9 + def initialize; end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:42 + def render_collection(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:34 + def render_layout(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:23 + def render_partial(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:14 + def render_template(event); end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:118 + def cache_message(payload); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:110 + def render_count(payload); end + + class << self + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:102 + def attach_to(*); end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:21 + def __class_attr_log_levels; end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:21 + def __class_attr_log_levels=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:73 +class ActionView::LogSubscriber::Start + include ::ActionView::LogSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:94 + def finish(name, id, payload); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:97 + def silenced?(_); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:76 + def start(name, id, payload); end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:54 +module ActionView::LogSubscriber::Utils + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:55 + def logger; end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:60 + def from_rails_root(string); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:66 + def rails_root; end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:7 +ActionView::LogSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# = Action View Lookup Context +# +# LookupContext is the object responsible for holding all information +# required for looking up templates, i.e. view paths and details. +# LookupContext is also responsible for generating a key, given to +# view paths, used in the resolver cache lookup. Since this key is generated +# only once during the request, it speeds up all cache accesses. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:15 +class ActionView::LookupContext + include ::ActionView::LookupContext::Accessors + include ::ActionView::LookupContext::DetailsCache + include ::ActionView::LookupContext::ViewPaths + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:232 + def initialize(view_paths, details = T.unsafe(nil), prefixes = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:242 + def digest_cache; end + + # Override formats= to expand ["*/*"] values and automatically + # add :html as fallback to :js. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:263 + def formats=(values); end + + # Override locale to return a symbol instead of array. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:283 + def locale; end + + # Overload locale= to also set the I18n.locale. If the current I18n.config object responds + # to original_config, it means that it has a copy of the original I18n configuration and it's + # acting as proxy, which we need to skip. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:290 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:16 + def prefixes; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:16 + def prefixes=(_arg0); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:246 + def with_prepended_formats(formats); end + + private + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:253 + def initialize_details(target, details); end + + class << self + # pkg:gem/actionview#lib/action_view/lookup_context.rb:21 + def register_detail(name, &block); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:18 + def registered_details; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:18 + def registered_details=(_arg0); end + end +end + +# Holds accessors for the registered details. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:39 +module ActionView::LookupContext::Accessors + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_handlers; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_locale; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_variants; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def formats; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def formats=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def handlers; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def handlers=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def locale; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def variants; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def variants=(value); end +end + +# pkg:gem/actionview#lib/action_view/lookup_context.rb:40 +ActionView::LookupContext::Accessors::DEFAULT_PROCS = T.let(T.unsafe(nil), Hash) + +# Add caching behavior on top of Details. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:98 +module ActionView::LookupContext::DetailsCache + # pkg:gem/actionview#lib/action_view/lookup_context.rb:99 + def cache; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:99 + def cache=(_arg0); end + + # Calculate the details key. Remove the handlers from calculation to improve performance + # since the user cannot modify it explicitly. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:103 + def details_key; end + + # Temporary skip passing the details_key forward. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:108 + def disable_cache; end + + private + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:116 + def _set_detail(key, value); end +end + +# pkg:gem/actionview#lib/action_view/lookup_context.rb:54 +class ActionView::LookupContext::DetailsKey + # pkg:gem/actionview#lib/action_view/lookup_context.rb:55 + def eql?(_arg0); end + + class << self + # pkg:gem/actionview#lib/action_view/lookup_context.rb:77 + def clear; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:65 + def details_cache_key(details); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:61 + def digest_cache(details); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:86 + def digest_caches; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:90 + def view_context_class; end + end +end + +# Helpers related to template lookup using the lookup context information. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:125 +module ActionView::LookupContext::ViewPaths + # pkg:gem/actionview#lib/action_view/lookup_context.rb:148 + def any?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:153 + def any_templates?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:155 + def append_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:141 + def exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:128 + def find(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:135 + def find_all(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:133 + def find_template(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:126 + def html_fallback_for_js; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:159 + def prepend_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:146 + def template_exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:126 + def view_paths; end + + private + + # Whenever setting view paths, makes a copy so that we can manipulate them in + # instance objects as we wish. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:166 + def build_view_paths(paths); end + + # Compute details hash and key according to user options (e.g. passed from #render). + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:175 + def detail_args_for(options); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:188 + def detail_args_for_any; end + + # Fix when prefix is specified as part of the template name + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:209 + def normalize_name(name, prefixes); end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:41 +class ActionView::MissingTemplate < ::ActionView::ActionViewError + include ::DidYouMean::Correctable + + # pkg:gem/actionview#lib/action_view/template/error.rb:44 + def initialize(paths, path, prefixes, partial, details, *); end + + # Apps may have thousands of candidate templates so we attempt to + # generate the suggestions as efficiently as possible. + # First we split templates into prefixes and basenames, so that those can + # be matched separately. + # + # pkg:gem/actionview#lib/action_view/template/error.rb:104 + def corrections; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def partial; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def path; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def paths; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:42 + def prefixes; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:71 +class ActionView::MissingTemplate::Results + # pkg:gem/actionview#lib/action_view/template/error.rb:74 + def initialize(size); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:91 + def add(path, score); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:83 + def should_record?(score); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:79 + def to_a; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:72 +class ActionView::MissingTemplate::Results::Result < ::Struct + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def path; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def path=(_); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def score; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def score=(_); end + + class << self + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def [](*_arg0); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def keyword_init?; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def members; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def new(*_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/model_naming.rb:4 +module ActionView::ModelNaming + # Converts the given object to an Active Model compliant one. + # + # pkg:gem/actionview#lib/action_view/model_naming.rb:6 + def convert_to_model(object); end + + # pkg:gem/actionview#lib/action_view/model_naming.rb:10 + def model_name_from_record_or_class(record_or_class); end +end + +# pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:4 +class ActionView::ObjectRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:7 + def initialize(lookup_context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:19 + def render_object_derive_partial(object, context, block); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:13 + def render_object_with_partial(object, partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:29 + def render_partial_template(view, locals, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:25 + def template_keys(path); end +end + +# Used as a buffer for views +# +# The main difference between this and ActiveSupport::SafeBuffer +# is for the methods `<<` and `safe_expr_append=` the inputs are +# checked for nil before they are assigned and `to_s` is called on +# the input. For example: +# +# obuf = ActionView::OutputBuffer.new "hello" +# obuf << 5 +# puts obuf # => "hello5" +# +# sbuf = ActiveSupport::SafeBuffer.new "hello" +# sbuf << 5 +# puts sbuf # => "hello\u0005" +# +# pkg:gem/actionview#lib/action_view/buffers.rb:21 +class ActionView::OutputBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:22 + def initialize(buffer = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:42 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:81 + def ==(other); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:54 + def append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def blank?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:72 + def capture(*args); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:53 + def concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def empty?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encode!(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encoding(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def force_encoding(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:32 + def html_safe; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:38 + def html_safe?; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def length(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:85 + def raw; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:89 + def raw_buffer; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:60 + def safe_append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:56 + def safe_concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:62 + def safe_expr_append=(val); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:29 + def to_s; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:34 + def to_str; end + + private + + # pkg:gem/actionview#lib/action_view/buffers.rb:68 + def initialize_copy(other); end +end + +# pkg:gem/actionview#lib/action_view/flows.rb:6 +class ActionView::OutputFlow + # pkg:gem/actionview#lib/action_view/flows.rb:9 + def initialize; end + + # Called by content_for + # + # pkg:gem/actionview#lib/action_view/flows.rb:24 + def append(key, value); end + + # pkg:gem/actionview#lib/action_view/flows.rb:27 + def append!(key, value); end + + # pkg:gem/actionview#lib/action_view/flows.rb:7 + def content; end + + # Called by _layout_for to read stored values. + # + # pkg:gem/actionview#lib/action_view/flows.rb:14 + def get(key); end + + # Called by each renderer object to set the layout contents. + # + # pkg:gem/actionview#lib/action_view/flows.rb:19 + def set(key, value); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:6 +class ActionView::PartialIteration + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:13 + def initialize(size); end + + # Check if this is the first iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:19 + def first?; end + + # The current iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:11 + def index; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:28 + def iterate!; end + + # Check if this is the last iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:24 + def last?; end + + # The number of iterations that will be done by the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:8 + def size; end +end + +# = Action View Partials +# +# There's also a convenience method for rendering sub templates within the current controller that depends on a +# single object (we call this kind of sub templates for partials). It relies on the fact that partials should +# follow the naming convention of being prefixed with an underscore -- as to separate them from regular +# templates that could be rendered on their own. +# +# In a template for Advertiser#account: +# +# <%= render partial: "account" %> +# +# This would render "advertiser/_account.html.erb". +# +# In another template for Advertiser#buy, we could have: +# +# <%= render partial: "account", locals: { account: @buyer } %> +# +# <% @advertisements.each do |ad| %> +# <%= render partial: "ad", locals: { ad: ad } %> +# <% end %> +# +# This would first render advertiser/_account.html.erb with @buyer passed in as the local variable +account+, then +# render advertiser/_ad.html.erb and pass the local variable +ad+ to the template for display. +# +# == The +:as+ and +:object+ options +# +# By default ActionView::PartialRenderer doesn't have any local variables. +# The :object option can be used to pass an object to the partial. For instance: +# +# <%= render partial: "account", object: @buyer %> +# +# would provide the @buyer object to the partial, available under the local variable +account+ and is +# equivalent to: +# +# <%= render partial: "account", locals: { account: @buyer } %> +# +# With the :as option we can specify a different name for said local variable. For example, if we +# wanted it to be +user+ instead of +account+ we'd do: +# +# <%= render partial: "account", object: @buyer, as: 'user' %> +# +# This is equivalent to +# +# <%= render partial: "account", locals: { user: @buyer } %> +# +# == \Rendering variants of a partial +# +# The :variants option can be used to render a different template variant of a partial. For instance: +# +# <%= render partial: "account", variants: :mobile %> +# +# This will render _account.html+mobile.erb. This option also accepts multiple variants +# like so: +# +# <%= render partial: "account", variants: [:desktop, :mobile] %> +# +# This will look for the following templates and render the first one that exists: +# * _account.html+desktop.erb +# * _account.html+mobile.erb +# * _account.html.erb +# +# == \Rendering a collection of partials +# +# The example of partial use describes a familiar pattern where a template needs to iterate over an array and +# render a sub template for each of the elements. This pattern has been implemented as a single method that +# accepts an array and renders a partial by the same name as the elements contained within. So the three-lined +# example in "Using partials" can be rewritten with a single line: +# +# <%= render partial: "ad", collection: @advertisements %> +# +# This will render advertiser/_ad.html.erb and pass the local variable +ad+ to the template for display. An +# iteration object will automatically be made available to the template with a name of the form +# +partial_name_iteration+. The iteration object has knowledge about which index the current object has in +# the collection and the total size of the collection. The iteration object also has two convenience methods, +# +first?+ and +last?+. In the case of the example above, the template would be fed +ad_iteration+. +# For backwards compatibility the +partial_name_counter+ is still present and is mapped to the iteration's +# +index+ method. +# +# The :as option may be used when rendering partials. +# +# You can specify a partial to be rendered between elements via the :spacer_template option. +# The following example will render advertiser/_ad_divider.html.erb between each ad partial: +# +# <%= render partial: "ad", collection: @advertisements, spacer_template: "ad_divider" %> +# +# If the given :collection is +nil+ or empty, render will return +nil+. This will allow you +# to specify a text which will be displayed instead by using this form: +# +# <%= render(partial: "ad", collection: @advertisements) || "There's no ad to be displayed" %> +# +# == \Rendering shared partials +# +# Two controllers can share a set of partials and render them like this: +# +# <%= render partial: "advertisement/ad", locals: { ad: @advertisement } %> +# +# This will render the partial advertisement/_ad.html.erb regardless of which controller this is being called from. +# +# == \Rendering objects that respond to +to_partial_path+ +# +# Instead of explicitly naming the location of a partial, you can also let PartialRenderer do the work +# and pick the proper path by checking +to_partial_path+ method. +# +# # @account.to_partial_path returns 'accounts/account', so it can be used to replace: +# # <%= render partial: "accounts/account", locals: { account: @account} %> +# <%= render partial: @account %> +# +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, +# # that's why we can replace: +# # <%= render partial: "posts/post", collection: @posts %> +# <%= render partial: @posts %> +# +# == \Rendering the default case +# +# If you're not going to be using any of the options like collections or layouts, you can also use the short-hand +# defaults of render to render partials. Examples: +# +# # Instead of <%= render partial: "account" %> +# <%= render "account" %> +# +# # Instead of <%= render partial: "account", locals: { account: @buyer } %> +# <%= render "account", account: @buyer %> +# +# # @account.to_partial_path returns 'accounts/account', so it can be used to replace: +# # <%= render partial: "accounts/account", locals: { account: @account} %> +# <%= render @account %> +# +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, +# # that's why we can replace: +# # <%= render partial: "posts/post", collection: @posts %> +# <%= render @posts %> +# +# == \Rendering partials with layouts +# +# Partials can have their own layouts applied to them. These layouts are different than the ones that are +# specified globally for the entire action, but they work in a similar fashion. Imagine a list with two types +# of users: +# +# <%# app/views/users/index.html.erb %> +# Here's the administrator: +# <%= render partial: "user", layout: "administrator", locals: { user: administrator } %> +# +# Here's the editor: +# <%= render partial: "user", layout: "editor", locals: { user: editor } %> +# +# <%# app/views/users/_user.html.erb %> +# Name: <%= user.name %> +# +# <%# app/views/users/_administrator.html.erb %> +#
    +# Budget: $<%= user.budget %> +# <%= yield %> +#
    +# +# <%# app/views/users/_editor.html.erb %> +#
    +# Deadline: <%= user.deadline %> +# <%= yield %> +#
    +# +# ...this will return: +# +# Here's the administrator: +#
    +# Budget: $<%= user.budget %> +# Name: <%= user.name %> +#
    +# +# Here's the editor: +#
    +# Deadline: <%= user.deadline %> +# Name: <%= user.name %> +#
    +# +# If a collection is given, the layout will be rendered once for each item in +# the collection. For example, these two snippets have the same output: +# +# <%# app/views/users/_user.html.erb %> +# Name: <%= user.name %> +# +# <%# app/views/users/index.html.erb %> +# <%# This does not use layouts %> +#
      +# <% users.each do |user| -%> +#
    • +# <%= render partial: "user", locals: { user: user } %> +#
    • +# <% end -%> +#
    +# +# <%# app/views/users/_li_layout.html.erb %> +#
  • +# <%= yield %> +#
  • +# +# <%# app/views/users/index.html.erb %> +#
      +# <%= render partial: "user", layout: "li_layout", collection: users %> +#
    +# +# Given two users whose names are Alice and Bob, these snippets return: +# +#
      +#
    • +# Name: Alice +#
    • +#
    • +# Name: Bob +#
    • +#
    +# +# The current object being rendered, as well as the object_counter, will be +# available as local variables inside the layout template under the same names +# as available in the partial. +# +# You can also apply a layout to a block within any template: +# +# <%# app/views/users/_chief.html.erb %> +# <%= render(layout: "administrator", locals: { user: chief }) do %> +# Title: <%= chief.title %> +# <% end %> +# +# ...this will return: +# +#
    +# Budget: $<%= user.budget %> +# Title: <%= chief.name %> +#
    +# +# As you can see, the :locals hash is shared between both the partial and its layout. +# +# pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:236 +class ActionView::PartialRenderer < ::ActionView::AbstractRenderer + include ::ActionView::CollectionCaching + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:239 + def initialize(lookup_context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache=(val); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:246 + def render(partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:278 + def find_template(path, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:261 + def render_partial_template(view, locals, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:257 + def template_keys(_); end + + class << self + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:237 + def collection_cache=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/path_registry.rb:4 +module ActionView::PathRegistry + class << self + # pkg:gem/actionview#lib/action_view/path_registry.rb:53 + def all_file_system_resolvers; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:47 + def all_resolvers; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:22 + def cast_file_system_resolvers(paths); end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:11 + def file_system_resolver_hooks; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:14 + def get_view_paths(klass); end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:18 + def set_view_paths(klass, paths); end + end +end + +# = Action View PathSet +# +# This class is used to store and access paths in Action View. A number of +# operations are defined so that you can search among the paths in this +# set and also perform operations on other +PathSet+ objects. +# +# A +LookupContext+ will use a +PathSet+ to store the paths in its context. +# +# pkg:gem/actionview#lib/action_view/path_set.rb:11 +class ActionView::PathSet + include ::Enumerable + + # pkg:gem/actionview#lib/action_view/path_set.rb:18 + def initialize(paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:35 + def +(other); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def [](*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:31 + def compact; end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def each(*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:53 + def exists?(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:40 + def find(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:45 + def find_all(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def include?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:14 + def paths; end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def size(*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:27 + def to_ary; end + + private + + # pkg:gem/actionview#lib/action_view/path_set.rb:22 + def initialize_copy(other); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:58 + def search_combinations(prefixes); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:67 + def typecast(paths); end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:92 +class ActionView::RawOutputBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:93 + def initialize(buffer); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:97 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:103 + def raw; end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:150 +class ActionView::RawStreamingBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:151 + def initialize(buffer); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:155 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:161 + def raw; end +end + +# = Action View \Record \Identifier +# +# RecordIdentifier encapsulates methods used by various ActionView helpers +# to associate records with DOM elements. +# +# Consider for example the following code that form of post: +# +# <%= form_with(model: post) do |f| %> +# <%= f.text_field :body %> +# <% end %> +# +# When +post+ is a new, unsaved ActiveRecord::Base instance, the resulting HTML +# is: +# +#
    +# +#
    +# +# When +post+ is a persisted ActiveRecord::Base instance, the resulting HTML +# is: +# +#
    +# +#
    +# +# In both cases, the +id+ and +class+ of the wrapping DOM element are +# automatically generated, following naming conventions encapsulated by the +# RecordIdentifier methods #dom_id and #dom_class: +# +# dom_id(Post) # => "new_post" +# dom_class(Post) # => "post" +# dom_id(Post.new) # => "new_post" +# dom_class(Post.new) # => "post" +# dom_id(Post.find 42) # => "post_42" +# dom_class(Post.find 42) # => "post" +# +# Note that these methods do not strictly require +Post+ to be a subclass of +# ActiveRecord::Base. +# Any +Post+ class will work as long as its instances respond to +to_key+ +# and +model_name+, given that +model_name+ responds to +param_key+. +# For instance: +# +# class Post +# attr_accessor :to_key +# +# def model_name +# OpenStruct.new param_key: 'post' +# end +# +# def self.find(id) +# new.tap { |post| post.to_key = [id] } +# end +# end +# +# pkg:gem/actionview#lib/action_view/record_identifier.rb:60 +module ActionView::RecordIdentifier + include ::ActionView::ModelNaming + extend ::ActionView::RecordIdentifier + extend ::ActionView::ModelNaming + + # The DOM class convention is to use the singular form of an object or class. + # + # dom_class(post) # => "post" + # dom_class(Person) # => "person" + # + # If you need to address multiple instances of the same class in the same view, you can prefix the dom_class: + # + # dom_class(post, :edit) # => "edit_post" + # dom_class(Person, :edit) # => "edit_person" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:78 + def dom_class(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM id convention is to use the singular form of an object or class with the id following an underscore. + # If no id is found, prefix with "new_" instead. + # + # dom_id(Post.find(45)) # => "post_45" + # dom_id(Post) # => "new_post" + # + # If you need to address multiple instances of the same class in the same view, you can prefix the dom_id: + # + # dom_id(Post.find(45), :edit) # => "edit_post_45" + # dom_id(Post, :custom) # => "custom_post" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:93 + def dom_id(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM target convention is to concatenate any number of parameters into a string. + # Records are passed through dom_id, while string and symbols are retained. + # + # dom_target(Post.find(45)) # => "post_45" + # dom_target(Post.find(45), :edit) # => "post_45_edit" + # dom_target(Post.find(45), :edit, :special) # => "post_45_edit_special" + # dom_target(Post.find(45), Comment.find(1)) # => "post_45_comment_1" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:111 + def dom_target(*objects); end + + private + + # Returns a string representation of the key attribute(s) that is suitable for use in an HTML DOM id. + # This can be overwritten to customize the default generated string representation if desired. + # If you need to read back a key from a dom_id in order to query for the underlying database record, + # you should write a helper like 'person_record_from_dom_id' that will extract the key either based + # on the default implementation (which just joins all key attributes with '_') or on your own + # overwritten version of the method. By default, this implementation passes the key string through a + # method that replaces all characters that are invalid inside DOM ids, with valid ones. You need to + # make sure yourself that your dom ids are valid, in case you override this method. + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:134 + def record_key_for_dom_id(record); end +end + +# pkg:gem/actionview#lib/action_view/record_identifier.rb:66 +ActionView::RecordIdentifier::JOIN = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/record_identifier.rb:67 +ActionView::RecordIdentifier::NEW = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/render_parser.rb:4 +module ActionView::RenderParser; end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:5 +ActionView::RenderParser::ALL_KNOWN_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/render_parser.rb:8 +class ActionView::RenderParser::Base + # pkg:gem/actionview#lib/action_view/render_parser.rb:9 + def initialize(name, code); end + + private + + # pkg:gem/actionview#lib/action_view/render_parser.rb:15 + def directory; end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:19 + def partial_to_virtual_path(render_type, partial_path); end +end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:37 +ActionView::RenderParser::Default = ActionView::RenderParser::PrismRenderParser + +# pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:5 +class ActionView::RenderParser::PrismRenderParser < ::ActionView::RenderParser::Base + # pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:6 + def render_calls; end + + private + + # Accept a call node and return a hash of options for the render call. + # If it doesn't match the expected format, return nil. + # + # pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:43 + def render_call_options(node); end + + # Accept the node that is being passed in the position of the template + # and return the template name and whether or not it is an object + # template. + # + # pkg:gem/actionview#lib/action_view/render_parser/prism_render_parser.rb:97 + def render_call_template(node); end +end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:6 +ActionView::RenderParser::RENDER_TYPE_KEYS = T.let(T.unsafe(nil), Array) + +# = Action View \Renderer +# +# This is the main entry point for rendering. It basically delegates +# to other objects like TemplateRenderer and PartialRenderer which +# actually renders the template. +# +# The Renderer will parse the options from the +render+ or +render_body+ +# method and render a partial or a template based on the options. The +# +TemplateRenderer+ and +PartialRenderer+ objects are wrappers which do all +# the setup and logic necessary to render a view and a new object is created +# each time +render+ is called. +# +# pkg:gem/actionview#lib/action_view/renderer/renderer.rb:15 +class ActionView::Renderer + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:18 + def initialize(lookup_context); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:52 + def cache_hits; end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:16 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:16 + def lookup_context=(_arg0); end + + # Main render entry point shared by Action View and Action Controller. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:23 + def render(context, options); end + + # Render but returns a valid Rack body. If fibers are defined, we return + # a streaming body that renders the template piece by piece. + # + # Note that partials are not supported to be rendered with streaming, + # so in such cases, we just wrap them in an array. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:40 + def render_body(context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:48 + def render_partial(context, options, &block); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:27 + def render_to_object(context, options); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:103 + def collection_from_object(object); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:96 + def collection_from_options(options); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:61 + def render_partial_to_object(context, options, &block); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:57 + def render_template_to_object(context, options); end +end + +# pkg:gem/actionview#lib/action_view/rendering.rb:26 +module ActionView::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + + # pkg:gem/actionview#lib/action_view/rendering.rb:32 + def initialize; end + + # Override process to set up I18n proxy. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:38 + def process(*, **, &); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:119 + def render_to_body(options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:30 + def rendered_format; end + + # An instance of a view class. The default view class is ActionView::Base. + # + # The view class must have the following methods: + # + # * View.new(lookup_context, assigns, controller) — Create a new + # ActionView instance for a controller and we can also pass the arguments. + # + # * View#render(option) — Returns String with the rendered template. + # + # Override this method in a module to change the default behavior. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:109 + def view_context; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:95 + def view_context_class; end + + # Returns an object that is able to render templates. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:114 + def view_renderer; end + + private + + # Normalize args by converting render "foo" to render action: "foo" and + # render "foo/bar" to render template: "foo/bar". + # + # pkg:gem/actionview#lib/action_view/rendering.rb:153 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Assign the rendered format to look up context. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:146 + def _process_format(format); end + + # Normalize options. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:177 + def _process_render_template_options(options); end + + # Find and render a template based on the options given. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:127 + def _render_template(options); end +end + +# pkg:gem/actionview#lib/action_view/rendering.rb:45 +module ActionView::Rendering::ClassMethods + # pkg:gem/actionview#lib/action_view/rendering.rb:49 + def _helpers; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:46 + def _routes; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:59 + def build_view_context_class(klass, supports_path, routes, helpers); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:76 + def eager_load!; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:52 + def inherit_view_context_class?; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:82 + def view_context_class; end +end + +# = Action View Resolver +# +# pkg:gem/actionview#lib/action_view/template/resolver.rb:11 +class ActionView::Resolver + # pkg:gem/actionview#lib/action_view/template/resolver.rb:69 + def all_template_paths; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:64 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching=(val); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:79 + def caching?(&); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:56 + def clear_cache; end + + # Normalizes the arguments and passes it on to find_templates. + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:60 + def find_all(name, prefix = T.unsafe(nil), partial = T.unsafe(nil), details = T.unsafe(nil), key = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:75 + def _find_all(name, prefix, partial, details, key, locals); end + + # This is what child classes implement. No defaults are needed + # because Resolver guarantees that the arguments are present and + # normalized. + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:84 + def find_templates(name, prefix, partial, details, locals = T.unsafe(nil)); end + + class << self + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:50 + def caching=(val); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:53 + def caching?; end + end +end + +# pkg:gem/actionview#lib/action_view/template/resolver.rb:12 +class ActionView::Resolver::PathParser + # pkg:gem/actionview#lib/action_view/template/resolver.rb:15 + def build_path_regex; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:36 + def parse(path); end +end + +# pkg:gem/actionview#lib/action_view/template/resolver.rb:13 +class ActionView::Resolver::PathParser::ParsedPath < ::Struct + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def details; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def details=(_); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def path=(_); end + + class << self + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def [](*_arg0); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def keyword_init?; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def members; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:13 + def new(*_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/routing_url_for.rb:6 +module ActionView::RoutingUrlFor + # Returns the URL for the set of +options+ provided. This takes the + # same options as +url_for+ in Action Controller (see the + # documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default + # :only_path is true so you'll get the relative "/controller/action" + # instead of the fully qualified URL like "http://example.com/controller/action". + # + # ==== Options + # * :anchor - Specifies the anchor name to be appended to the path. + # * :only_path - If true, returns the relative URL (omitting the protocol, host name, and port) (true by default unless :host is specified). + # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2005/". Note that this + # is currently not recommended since it breaks caching. + # * :host - Overrides the default (current) host if provided. + # * :protocol - Overrides the default (current) protocol if provided. + # * :user - Inline HTTP authentication (only plucked out if :password is also present). + # * :password - Inline HTTP authentication (only plucked out if :user is also present). + # + # ==== Relying on named routes + # + # Passing a record (like an Active Record) instead of a hash as the options parameter will + # trigger the named route for that record. The lookup will happen on the name of the class. So passing a + # Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as + # +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route). + # + # ==== Implicit Controller Namespacing + # + # Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one. + # + # ==== Examples + # <%= url_for(action: 'index') %> + # # => /blogs/ + # + # <%= url_for(action: 'find', controller: 'books') %> + # # => /books/find + # + # <%= url_for(action: 'login', controller: 'members', only_path: false, protocol: 'https') %> + # # => https://www.example.com/members/login/ + # + # <%= url_for(action: 'play', anchor: 'player') %> + # # => /messages/play/#player + # + # <%= url_for(action: 'jump', anchor: 'tax&ship') %> + # # => /testing/jump/#tax&ship + # + # <%= url_for(Workshop) %> + # # => /workshops + # + # <%= url_for(Workshop.new) %> + # # relies on Workshop answering a persisted? call (and in this case returning false) + # # => /workshops + # + # <%= url_for(@workshop) %> + # # calls @workshop.to_param which by default returns the id + # # => /workshops/5 + # + # # to_param can be re-defined in a model to provide different URL names: + # # => /workshops/1-workshop-name + # + # <%= url_for("http://www.example.com") %> + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is set to "http://www.example.com" + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is not set or is blank + # # => javascript:history.back() + # + # <%= url_for(action: 'index', controller: 'users') %> + # # Assuming an "admin" namespace + # # => /admin/users + # + # <%= url_for(action: 'index', controller: '/users') %> + # # Specify absolute path with beginning slash + # # => /users + # + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:82 + def url_for(options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:124 + def url_options; end + + private + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:139 + def _generate_paths_by_default; end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:130 + def _routes_context; end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:143 + def ensure_only_path_option(options); end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:134 + def optimize_routes_generation?; end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:108 +class ActionView::StreamingBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:109 + def initialize(block); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:113 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:119 + def append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:147 + def block; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:126 + def capture; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:118 + def concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:139 + def html_safe; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:135 + def html_safe?; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:143 + def raw; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:124 + def safe_append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:121 + def safe_concat(value); end +end + +# pkg:gem/actionview#lib/action_view/flows.rb:30 +class ActionView::StreamingFlow < ::ActionView::OutputFlow + # pkg:gem/actionview#lib/action_view/flows.rb:31 + def initialize(view, fiber); end + + # Appends the contents for the given key. This is called + # by providing and resuming back to the fiber, + # if that's the key it's waiting for. + # + # pkg:gem/actionview#lib/action_view/flows.rb:65 + def append!(key, value); end + + # Try to get stored content. If the content + # is not available and we're inside the layout fiber, + # then it will begin waiting for the given key and yield. + # + # pkg:gem/actionview#lib/action_view/flows.rb:43 + def get(key); end + + private + + # pkg:gem/actionview#lib/action_view/flows.rb:71 + def inside_fiber?; end +end + +# == TODO +# +# * Support streaming from child templates, partials and so on. +# * Rack::Cache needs to support streaming bodies +# +# pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:9 +class ActionView::StreamingTemplateRenderer < ::ActionView::TemplateRenderer + # For streaming, instead of rendering a given a template, we return a Body + # object that responds to each. This object is initialized with a block + # that knows how to render the template. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:51 + def render_template(view, template, layout_name = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:63 + def delayed_render(buffer, template, layout, view, locals); end +end + +# A valid Rack::Body (i.e. it responds to each). +# It is initialized with a block that, when called, starts +# rendering the template. +# +# pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:13 +class ActionView::StreamingTemplateRenderer::Body + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:14 + def initialize(&start); end + + # Returns the complete body as a string. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:29 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:18 + def each(&block); end + + private + + # This is the same logging logic as in ShowExceptions middleware. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:37 + def log_error(exception); end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:30 +class ActionView::StrictLocalsError < ::ArgumentError + # pkg:gem/actionview#lib/action_view/template/error.rb:31 + def initialize(argument_error, template); end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:6 +class ActionView::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + include ::ActionView::StructuredEventSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:9 + def initialize; end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:44 + def render_collection(event); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:35 + def render_layout(event); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:24 + def render_partial(event); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:14 + def render_template(event); end + + class << self + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:88 + def attach_to(*); end + + private + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:22 + def __class_attr_debug_methods; end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:22 + def __class_attr_debug_methods=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:73 +class ActionView::StructuredEventSubscriber::Start + include ::ActionView::StructuredEventSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:84 + def finish(name, id, payload); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:76 + def start(name, id, payload); end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:56 +module ActionView::StructuredEventSubscriber::Utils + private + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:58 + def from_rails_root(string); end + + # pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:66 + def rails_root; end +end + +# pkg:gem/actionview#lib/action_view/structured_event_subscriber.rb:7 +ActionView::StructuredEventSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/error.rb:256 +class ActionView::SyntaxErrorInTemplate < ::ActionView::Template::Error + # pkg:gem/actionview#lib/action_view/template/error.rb:257 + def initialize(template, offending_code_string); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:272 + def annotated_source_code; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:262 + def message; end +end + +# = Action View \Template +# +# pkg:gem/actionview#lib/action_view/template.rb:7 +class ActionView::Template + extend ::ActiveSupport::Autoload + extend ::ActionView::Template::Handlers + + # pkg:gem/actionview#lib/action_view/template.rb:199 + def initialize(source, identifier, handler, locals:, format: T.unsafe(nil), variant: T.unsafe(nil), virtual_path: T.unsafe(nil)); end + + # This method is responsible for properly setting the encoding of the + # source. Until this point, we assume that the source is BINARY data. + # If no additional information is supplied, we assume the encoding is + # the same as Encoding.default_external. + # + # The user can also specify the encoding via a comment on the first + # with any template engine, as we process out the encoding comment + # before passing the source on to the template engine, leaving a + # blank line in its stead. + # + # pkg:gem/actionview#lib/action_view/template.rb:321 + def encode!; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def format; end + + # pkg:gem/actionview#lib/action_view/template.rb:194 + def handler; end + + # pkg:gem/actionview#lib/action_view/template.rb:194 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template.rb:300 + def inspect; end + + # The locals this template has been or will be compiled for, or nil if this + # is a strict locals template. + # + # pkg:gem/actionview#lib/action_view/template.rb:223 + def locals; end + + # Exceptions are marshalled when using the parallel test runner with DRb, so we need + # to ensure that references to the template object can be marshalled as well. This means forgoing + # the marshalling of the compiler mutex and instantiating that again on unmarshalling. + # + # pkg:gem/actionview#lib/action_view/template.rb:393 + def marshal_dump; end + + # pkg:gem/actionview#lib/action_view/template.rb:397 + def marshal_load(array); end + + # pkg:gem/actionview#lib/action_view/template.rb:402 + def method_name; end + + # Render a template. If the template was not compiled yet, it is done + # exactly before rendering. + # + # This method is instrumented as "!render_template.action_view". Notice that + # we use a bang in this instrumentation because you don't want to + # consume this in production. This is only slow if it's being listened to. + # + # pkg:gem/actionview#lib/action_view/template.rb:271 + def render(view, locals, buffer = T.unsafe(nil), implicit_locals: T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:296 + def short_identifier; end + + # pkg:gem/actionview#lib/action_view/template.rb:304 + def source; end + + # pkg:gem/actionview#lib/action_view/template.rb:231 + def spot(location); end + + # This method is responsible for marking a template as having strict locals + # which means the template can only accept the locals defined in a magic + # comment. For example, if your template accepts the locals +title+ and + # +comment_count+, add the following to your template file: + # + # <%# locals: (title: "Default title", comment_count: 0) %> + # + # Strict locals are useful for validating template arguments and for + # specifying defaults. + # + # pkg:gem/actionview#lib/action_view/template.rb:366 + def strict_locals!; end + + # Returns whether a template is using strict locals. + # + # pkg:gem/actionview#lib/action_view/template.rb:386 + def strict_locals?; end + + # Returns whether the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it starts rendering. + # + # pkg:gem/actionview#lib/action_view/template.rb:261 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # pkg:gem/actionview#lib/action_view/template.rb:251 + def translate_location(backtrace_location, spot); end + + # pkg:gem/actionview#lib/action_view/template.rb:292 + def type; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def variable; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def variant; end + + # pkg:gem/actionview#lib/action_view/template.rb:195 + def virtual_path; end + + private + + # Among other things, this method is responsible for properly setting + # the encoding of the compiled template. + # + # If the template engine handles encodings, we send the encoded + # String to the engine without further processing. This allows + # the template engine to support additional mechanisms for + # + # Otherwise, after we figure out the correct encoding, we then + # encode the source into Encoding.default_internal. + # In general, this means that templates will be UTF-8 inside of Rails, + # regardless of the original source encoding. + # + # pkg:gem/actionview#lib/action_view/template.rb:507 + def compile(mod); end + + # Compile a template. This method ensures a template is compiled + # just once and removes the source after it is compiled. + # + # pkg:gem/actionview#lib/action_view/template.rb:424 + def compile!(view); end + + # This method compiles the source of the template. The compilation of templates + # involves setting strict_locals! if applicable, encoding the template, and setting + # frozen string literal. + # + # pkg:gem/actionview#lib/action_view/template.rb:449 + def compiled_source; end + + # pkg:gem/actionview#lib/action_view/template.rb:411 + def find_node_by_id(node, node_id); end + + # pkg:gem/actionview#lib/action_view/template.rb:556 + def handle_render_error(view, e); end + + # pkg:gem/actionview#lib/action_view/template.rb:581 + def identifier_method_name; end + + # pkg:gem/actionview#lib/action_view/template.rb:585 + def instrument(action, &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:593 + def instrument_payload; end + + # pkg:gem/actionview#lib/action_view/template.rb:589 + def instrument_render_template(&block); end + + # pkg:gem/actionview#lib/action_view/template.rb:568 + def locals_code; end + + # pkg:gem/actionview#lib/action_view/template.rb:548 + def offset; end + + class << self + # pkg:gem/actionview#lib/action_view/template.rb:180 + def frozen_string_literal; end + + # pkg:gem/actionview#lib/action_view/template.rb:180 + def frozen_string_literal=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template.rb:184 + def mime_types_implementation=(implementation); end + end +end + +# The Template::Error exception is raised when the compilation or rendering of the template +# fails. This exception then gathers a bunch of intimate details and uses it to report a +# precise exception message. +# +# pkg:gem/actionview#lib/action_view/template/error.rb:165 +class ActionView::Template::Error < ::ActionView::ActionViewError + # pkg:gem/actionview#lib/action_view/template/error.rb:173 + def initialize(template); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:231 + def annotated_source_code; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:182 + def backtrace; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:186 + def backtrace_locations; end + + # Override to prevent #cause resetting during re-raise. + # + # pkg:gem/actionview#lib/action_view/template/error.rb:169 + def cause; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:190 + def file_name; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:223 + def line_number; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:203 + def source_extract(indentation = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:194 + def sub_template_message; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:218 + def sub_template_of(template_path); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:171 + def template; end + + private + + # pkg:gem/actionview#lib/action_view/template/error.rb:244 + def formatted_code_for(source_code, line_counter, indent); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:236 + def source_location; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:166 +ActionView::Template::Error::SOURCE_CODE_RADIUS = T.let(T.unsafe(nil), Integer) + +# = Action View HTML Template +# +# pkg:gem/actionview#lib/action_view/template/html.rb:6 +class ActionView::Template::HTML + # pkg:gem/actionview#lib/action_view/template/html.rb:9 + def initialize(string, type); end + + # pkg:gem/actionview#lib/action_view/template/html.rb:28 + def format; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:14 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:18 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:24 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/html.rb:20 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:7 + def type; end +end + +# = Action View Template Handlers +# +# pkg:gem/actionview#lib/action_view/template/handlers.rb:6 +module ActionView::Template::Handlers + # pkg:gem/actionview#lib/action_view/template/handlers.rb:61 + def handler_for_extension(extension); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:56 + def register_default_template_handler(extension, klass); end + + # Register an object that knows how to handle template files with the given + # extensions. This can be used to implement new template types. + # The handler must respond to +:call+, which will be passed the template + # and should return the rendered template as a String. + # + # pkg:gem/actionview#lib/action_view/template/handlers.rb:31 + def register_template_handler(*extensions, handler); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:52 + def registered_template_handler(extension); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:48 + def template_handler_extensions; end + + # Opposite to register_template_handler. + # + # pkg:gem/actionview#lib/action_view/template/handlers.rb:40 + def unregister_template_handler(*extensions); end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers.rb:12 + def extended(base); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:23 + def extensions; end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:5 +class ActionView::Template::Handlers::Builder + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:8 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:17 + def require_engine; end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def __class_attr_default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def __class_attr_default_format=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:9 +class ActionView::Template::Handlers::ERB + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:65 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:37 + def handles_encoding?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:33 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:43 + def translate_location(spot, _backtrace_location, source); end + + private + + # Return the offset between the error lineno and the source lineno. + # Searches in reverse from the backtrace lineno so we have a better + # chance of finding the correct line + # + # The compiled template is likely to be longer than the source. + # Use the difference between the compiled and source sizes to + # determine the earliest line that could contain the highlight. + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:119 + def find_lineno_offset(compiled, source_lines, highlight, error_lineno); end + + # Find which token in the source template spans the byte range that + # contains the error_column, then return the offset compared to the + # original source template. + # + # Iterate consecutive pairs of CODE or TEXT tokens, requiring + # a match of the first token before matching either token. + # + # For example, if we want to find tokens A, B, C, we do the following: + # 1. Find a match for A: test error_column or advance scanner. + # 2. Find a match for B or A: + # a. If B: start over with next token set (B, C). + # b. If A: test error_column or advance scanner. + # c. Otherwise: Advance 1 byte + # + # Prioritize matching the next token over the current token once + # a match for the current token has been found. This is to prevent + # the current token from looping past the next token if they both + # match (i.e. if the current token is a single space character). + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:152 + def find_offset(compiled, source_tokens, error_column); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:177 + def offset_source_tokens(source_tokens); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:97 + def valid_encoding(string, encoding); end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:29 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def __class_attr_erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def __class_attr_erb_implementation=(new_value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def __class_attr_erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def __class_attr_erb_trim_mode=(new_value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def __class_attr_escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def __class_attr_escape_ignore_list=(new_value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def __class_attr_strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def __class_attr_strip_trailing_newlines=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:25 +ActionView::Template::Handlers::ERB::ENCODING_TAG = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:9 +class ActionView::Template::Handlers::ERB::Erubi < ::Erubi::Engine + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:11 + def initialize(input, properties = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:65 + def add_code(code); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:47 + def add_expression(indicator, code); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:70 + def add_postamble(_); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:30 + def add_text(text); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:75 + def flush_newline_if_pending(src); end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:45 +ActionView::Template::Handlers::ERB::Erubi::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:27 +class ActionView::Template::Handlers::ERB::LocationParsingError < ::StandardError; end + +# pkg:gem/actionview#lib/action_view/template/handlers/html.rb:5 +class ActionView::Template::Handlers::Html < ::ActionView::Template::Handlers::Raw + # pkg:gem/actionview#lib/action_view/template/handlers/html.rb:6 + def call(template, source); end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/raw.rb:5 +class ActionView::Template::Handlers::Raw + # pkg:gem/actionview#lib/action_view/template/handlers/raw.rb:6 + def call(template, source); end +end + +# pkg:gem/actionview#lib/action_view/template/inline.rb:5 +class ActionView::Template::Inline < ::ActionView::Template + # pkg:gem/actionview#lib/action_view/template/inline.rb:16 + def compile(mod); end +end + +# This finalizer is needed (and exactly with a proc inside another proc) +# otherwise templates leak in development. +# +# pkg:gem/actionview#lib/action_view/template/inline.rb:8 +ActionView::Template::Inline::Finalizer = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionview#lib/action_view/template.rb:308 +ActionView::Template::LEADING_ENCODING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template.rb:197 +ActionView::Template::NONE = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionview#lib/action_view/template.rb:565 +ActionView::Template::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# = Action View RawFile Template +# +# pkg:gem/actionview#lib/action_view/template/raw_file.rb:6 +class ActionView::Template::RawFile + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:9 + def initialize(filename); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def format; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def format=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:16 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:20 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:24 + def supports_streaming?; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def type; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def type=(_arg0); end +end + +# = Action View Renderable Template for objects that respond to #render_in +# +# pkg:gem/actionview#lib/action_view/template/renderable.rb:6 +class ActionView::Template::Renderable + # pkg:gem/actionview#lib/action_view/template/renderable.rb:7 + def initialize(renderable); end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:25 + def format; end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:11 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:15 + def render(context, *args); end +end + +# pkg:gem/actionview#lib/action_view/template.rb:10 +ActionView::Template::STRICT_LOCALS_REGEX = T.let(T.unsafe(nil), Regexp) + +# SimpleType is mostly just a stub implementation for when Action View +# is used without Action Dispatch. +# +# pkg:gem/actionview#lib/action_view/template/types.rb:9 +class ActionView::Template::SimpleType + # pkg:gem/actionview#lib/action_view/template/types.rb:29 + def initialize(symbol); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:43 + def ==(type); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:38 + def ref; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:27 + def symbol; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:33 + def to_s; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:36 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:41 + def to_sym; end + + class << self + # pkg:gem/actionview#lib/action_view/template/types.rb:14 + def [](type); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:12 + def symbols; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:22 + def valid_symbols?(symbols); end + end +end + +# pkg:gem/actionview#lib/action_view/template/sources.rb:5 +module ActionView::Template::Sources + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionview#lib/action_view/template/sources/file.rb:6 +class ActionView::Template::Sources::File + # pkg:gem/actionview#lib/action_view/template/sources/file.rb:7 + def initialize(filename); end + + # pkg:gem/actionview#lib/action_view/template/sources/file.rb:11 + def to_s; end +end + +# = Action View Text Template +# +# pkg:gem/actionview#lib/action_view/template/text.rb:6 +class ActionView::Template::Text + # pkg:gem/actionview#lib/action_view/template/text.rb:9 + def initialize(string); end + + # pkg:gem/actionview#lib/action_view/template/text.rb:27 + def format; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:13 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:17 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:23 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/text.rb:19 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:7 + def type; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:7 + def type=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/template.rb:189 +ActionView::Template::Types = Mime + +# pkg:gem/actionview#lib/action_view/template_details.rb:4 +class ActionView::TemplateDetails + # pkg:gem/actionview#lib/action_view/template_details.rb:35 + def initialize(locale, handler, format, variant); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def format; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:62 + def format_or_default; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def handler; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:58 + def handler_class; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def locale; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:42 + def matches?(requested); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:49 + def sort_key_for(requested); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def variant; end +end + +# pkg:gem/actionview#lib/action_view/template_details.rb:5 +class ActionView::TemplateDetails::Requested + # pkg:gem/actionview#lib/action_view/template_details.rb:11 + def initialize(locale:, handlers:, formats:, variants:); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def formats; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def formats_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def handlers; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def handlers_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def locale; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def locale_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def variants; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def variants_idx; end + + private + + # pkg:gem/actionview#lib/action_view/template_details.rb:28 + def build_idx_hash(arr); end +end + +# pkg:gem/actionview#lib/action_view/template_details.rb:9 +ActionView::TemplateDetails::Requested::ANY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/template/error.rb:254 +ActionView::TemplateError = ActionView::Template::Error + +# = Action View \TemplatePath +# +# Represents a template path within ActionView's lookup and rendering system, +# like "users/show" +# +# TemplatePath makes it convenient to convert between separate name, prefix, +# partial arguments and the virtual path. +# +# pkg:gem/actionview#lib/action_view/template_path.rb:11 +class ActionView::TemplatePath + # pkg:gem/actionview#lib/action_view/template_path.rb:47 + def initialize(name, prefix, partial, virtual); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:64 + def ==(other); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:61 + def eql?(other); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:57 + def hash; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def name; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def partial; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:13 + def partial?; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def prefix; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:55 + def to_s; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:54 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def virtual; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:14 + def virtual_path; end + + class << self + # Convert name, prefix, and partial into a TemplatePath + # + # pkg:gem/actionview#lib/action_view/template_path.rb:43 + def build(name, prefix, partial); end + + # Build a TemplatePath form a virtual path + # + # pkg:gem/actionview#lib/action_view/template_path.rb:28 + def parse(virtual); end + + # Convert name, prefix, and partial into a virtual path string + # + # pkg:gem/actionview#lib/action_view/template_path.rb:17 + def virtual(name, prefix, partial); end + end +end + +# pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:4 +class ActionView::TemplateRenderer < ::ActionView::AbstractRenderer + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:5 + def render(context, options); end + + private + + # Determine the template to be rendered using the given options. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:16 + def determine_template(options); end + + # This is the method which actually finds the layout using details in the lookup + # context object. If no layout is found, it checks if at least a layout with + # the given name exists across all details before raising the error. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:88 + def find_layout(layout, keys, formats); end + + # Renders the given template. A string representing the layout can be + # supplied as well. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:58 + def render_template(view, template, layout_name, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:71 + def render_with_layout(view, template, path, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:92 + def resolve_layout(layout, keys, formats); end +end + +# = Action View Test Case +# +# Read more about ActionView::TestCase in {Testing Rails Applications}[https://guides.rubyonrails.org/testing.html#testing-view-partials] +# in the guides. +# +# pkg:gem/actionview#lib/action_view/test_case.rb:15 +class ActionView::TestCase < ::ActiveSupport::TestCase + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionView::RoutingUrlFor + include ::ActionView::TestCase::Behavior + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionView::TestCase::Behavior::ClassMethods + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helper_methods=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helper_methods?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:251 + def _run_setup_callbacks(&block); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def debug_missing_translation=(val); end + + class << self + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helper_methods=(value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helper_methods?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def _helpers; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def content_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def content_class=(value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def content_class?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def debug_missing_translation=(val); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:251 + def __class_attr___callbacks; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:251 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def __class_attr__helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:459 + def __class_attr__helper_methods=(new_value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def __class_attr_content_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:249 + def __class_attr_content_class=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:45 +module ActionView::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::RoutingUrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionView::TestCase::Behavior::ClassMethods + + # pkg:gem/actionview#lib/action_view/test_case.rb:305 + def _routes; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:281 + def config; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def controller; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def controller=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:62 + def lookup_context(*, **, &); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def output_buffer; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def output_buffer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:285 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil), &block); end + + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # pkg:gem/actionview#lib/action_view/test_case.rb:112 + def rendered; end + + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # pkg:gem/actionview#lib/action_view/test_case.rb:112 + def rendered=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:301 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def request; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def request=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:269 + def setup_with_controller; end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:426 + def _reset_rendered; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:412 + def _user_defined_ivars; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:374 + def _view; end + + # Need to experiment if this priority is the best one: rendered => output_buffer + # + # pkg:gem/actionview#lib/action_view/test_case.rb:339 + def document_root_element; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:430 + def method_missing(selector, *, **, &); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:446 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # The instance of ActionView::Base that is used by +render+. + # + # pkg:gem/actionview#lib/action_view/test_case.rb:363 + def view; end + + # Returns a Hash of instance variables and their values, as defined by + # the user in the test case, which are then assigned to the view being + # rendered. This is generally intended for internal use and extension + # frameworks. + # + # pkg:gem/actionview#lib/action_view/test_case.rb:420 + def view_assigns; end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def content_class; end + def content_class=(value); end + def content_class?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:114 +module ActionView::TestCase::Behavior::ClassMethods + # pkg:gem/actionview#lib/action_view/test_case.rb:213 + def determine_default_helper_class(name); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:232 + def helper_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:230 + def helper_class=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:219 + def helper_method(*methods); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:115 + def inherited(descendant); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:236 + def new(*); end + + # Register a callable to parse rendered content for a given template + # format. + # + # Each registered parser will also define a +#rendered.[FORMAT]+ helper + # method, where +[FORMAT]+ corresponds to the value of the + # +format+ argument. + # + # By default, ActionView::TestCase defines parsers for: + # + # * +:html+ - returns an instance of +Nokogiri::XML::Node+ + # * +:json+ - returns an instance of ActiveSupport::HashWithIndifferentAccess + # + # These pre-registered parsers also define corresponding helpers: + # + # * +:html+ - defines +rendered.html+ + # * +:json+ - defines +rendered.json+ + # + # ==== Parameters + # + # [+format+] + # The name (as a +Symbol+) of the format used to render the content. + # + # [+callable+] + # The parser. A callable object that accepts the rendered string as + # its sole argument. Alternatively, the parser can be specified as a + # block. + # + # ==== Examples + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # To parse the rendered content into RSS, register a call to +RSS::Parser.parse+: + # + # register_parser :rss, -> rendered { RSS::Parser.parse(rendered) } + # + # test "renders RSS" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :rss, partial: article + # + # assert_equal "Hello, world", rendered.rss.items.last.title + # end + # + # To parse the rendered content into a +Capybara::Simple::Node+, + # re-register an +:html+ parser with a call to +Capybara.string+: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # pkg:gem/actionview#lib/action_view/test_case.rb:197 + def register_parser(format, callable = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:204 + def tests(helper_class); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:242 + def include_helper_modules!; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:376 +ActionView::TestCase::Behavior::INTERNAL_IVARS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/test_case.rb:343 +module ActionView::TestCase::Behavior::Locals + # pkg:gem/actionview#lib/action_view/test_case.rb:346 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:344 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:344 + def rendered_views=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:309 +class ActionView::TestCase::Behavior::RenderedViewContent < ::String + # pkg:gem/actionview#lib/action_view/test_case.rb:199 + def html; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:199 + def json; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:312 +class ActionView::TestCase::Behavior::RenderedViewsCollection + # pkg:gem/actionview#lib/action_view/test_case.rb:313 + def initialize; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:317 + def add(view, locals); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:322 + def locals_for(view); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:326 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:330 + def view_rendered?(view, expected_locals); end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:459 +module ActionView::TestCase::HelperMethods + # pkg:gem/actionview#lib/action_view/test_case.rb:263 + def _test_case; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:259 + def protect_against_forgery?; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:16 +class ActionView::TestCase::TestController < ::ActionController::Base + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + + # pkg:gem/actionview#lib/action_view/test_case.rb:34 + def initialize; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:26 + def controller_path=(path); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def params; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def params=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def request; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def request=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def response; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def response=(_arg0); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def _layout(lookup_context, formats, keys); end + + class << self + # pkg:gem/actionview#lib/action_view/test_case.rb:30 + def controller_name; end + + # Overrides AbstractController::Base#controller_path + # + # pkg:gem/actionview#lib/action_view/test_case.rb:23 + def controller_path; end + + # Overrides AbstractController::Base#controller_path + # + # pkg:gem/actionview#lib/action_view/test_case.rb:23 + def controller_path=(_arg0); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_config; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_config=(new_value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_middleware_stack; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def __class_attr_middleware_stack=(new_value); end + end +end + +# pkg:gem/actionview#lib/action_view/unbound_template.rb:6 +class ActionView::UnboundTemplate + # pkg:gem/actionview#lib/action_view/unbound_template.rb:10 + def initialize(source, identifier, details:, virtual_path:); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:20 + def bind_locals(locals); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:44 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:7 + def details; end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def format(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def handler(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def locale(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def variant(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:7 + def virtual_path; end + + private + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:49 + def build_template(locals); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:63 + def normalize_locals(locals); end +end + +# pkg:gem/actionview#lib/action_view/gem_version.rb:9 +module ActionView::VERSION; end + +# pkg:gem/actionview#lib/action_view/gem_version.rb:10 +ActionView::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:11 +ActionView::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:13 +ActionView::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:15 +ActionView::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:12 +ActionView::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/view_paths.rb:4 +module ActionView::ViewPaths + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + + # The prefixes used in render "foo" shortcuts. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:81 + def _prefixes; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def any_templates?(*, **, &); end + + # Append a path to the list of view paths for the current LookupContext. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:103 + def append_view_path(path); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:93 + def details_for_lookup; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def formats(*, **, &); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def formats=(arg); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def locale(*, **, &); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def locale=(arg); end + + # LookupContext is the object responsible for holding all + # information required for looking up templates, i.e. view paths and + # details. Check ActionView::LookupContext for more information. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:88 + def lookup_context; end + + # Prepend a path to the list of view paths for the current LookupContext. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:113 + def prepend_view_path(path); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def template_exists?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def view_paths(*, **, &); end +end + +# pkg:gem/actionview#lib/action_view/view_paths.rb:14 +module ActionView::ViewPaths::ClassMethods + # pkg:gem/actionview#lib/action_view/view_paths.rb:31 + def _build_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:23 + def _prefixes; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:15 + def _view_paths; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:19 + def _view_paths=(paths); end + + # Append a path to the list of view paths for this controller. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:44 + def append_view_path(path); end + + # Prepend a path to the list of view paths for this controller. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:54 + def prepend_view_path(path); end + + # A list of all of the default view paths for this controller. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:59 + def view_paths; end + + # Set the view paths. + # + # ==== Parameters + # * paths - If a PathSet is provided, use that; + # otherwise, process the parameter into a PathSet. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:68 + def view_paths=(paths); end + + private + + # Override this method in your controller if you want to change paths prefixes for finding views. + # Prefixes defined here will still be added to parents' ._prefixes. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:75 + def local_prefixes; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:14 +class ActionView::WrongEncodingError < ::ActionView::EncodingError + # pkg:gem/actionview#lib/action_view/template/error.rb:15 + def initialize(string, encoding); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:19 + def message; end +end diff --git a/sorbet/rbi/gems/activejob@8.1.4.rbi b/sorbet/rbi/gems/activejob@8.1.4.rbi new file mode 100644 index 0000000..97fd742 --- /dev/null +++ b/sorbet/rbi/gems/activejob@8.1.4.rbi @@ -0,0 +1,3325 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activejob` gem. +# Please instead update this file by running `bin/tapioca gem activejob`. + + +# :markup: markdown +# :include: ../README.md +# +# pkg:gem/activejob#lib/active_job/gem_version.rb:3 +module ActiveJob + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:7 + def adapter_name(adapter); end + + # pkg:gem/activejob#lib/active_job/deprecator.rb:4 + def deprecator; end + + # Returns the currently loaded version of Active Job as a +Gem::Version+. + # + # pkg:gem/activejob#lib/active_job/gem_version.rb:5 + def gem_version; end + + # Push many jobs onto the queue at once without running enqueue callbacks. + # Queue adapters may communicate the enqueue status of each job by setting + # successfully_enqueued and/or enqueue_error on the passed-in job instances. + # + # pkg:gem/activejob#lib/active_job.rb:66 + def perform_all_later(*jobs); end + + # pkg:gem/activejob#lib/active_job.rb:60 + def verbose_enqueue_logs; end + + # pkg:gem/activejob#lib/active_job.rb:60 + def verbose_enqueue_logs=(_arg0); end + + # Returns the currently loaded version of Active Job as a +Gem::Version+. + # + # pkg:gem/activejob#lib/active_job/version.rb:7 + def version; end + + private + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:6 + def instrument_enqueue_all(queue_adapter, jobs); end + end +end + +# pkg:gem/activejob#lib/active_job/arguments.rb:28 +module ActiveJob::Arguments + extend ::ActiveJob::Arguments + + # Deserializes a set of arguments. Intrinsic types that can safely be + # deserialized without mutation are returned as-is. Arrays/Hashes are + # deserialized element by element. All other types are deserialized using + # GlobalID. + # + # pkg:gem/activejob#lib/active_job/arguments.rb:82 + def deserialize(arguments); end + + # Serializes a set of arguments. Intrinsic types that can safely be + # serialized without mutation are returned as-is. Arrays/Hashes are + # serialized element by element. All other types are serialized using + # GlobalID. + # + # pkg:gem/activejob#lib/active_job/arguments.rb:34 + def serialize(arguments); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:38 + def serialize_argument(argument); end + + private + + # pkg:gem/activejob#lib/active_job/arguments.rb:191 + def convert_to_global_id_hash(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:136 + def custom_serialized?(hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:109 + def deserialize_argument(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:132 + def deserialize_global_id(hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:146 + def deserialize_hash(serialized_hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:140 + def serialize_hash(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:159 + def serialize_hash_key(key); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:172 + def serialize_indifferent_hash(indifferent_hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:128 + def serialized_global_id?(hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:178 + def transform_symbol_keys(hash, symbol_keys); end +end + +# pkg:gem/activejob#lib/active_job/arguments.rb:90 +ActiveJob::Arguments::GLOBALID_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:99 +ActiveJob::Arguments::RESERVED_KEYS = T.let(T.unsafe(nil), Set) + +# pkg:gem/activejob#lib/active_job/arguments.rb:94 +ActiveJob::Arguments::RUBY2_KEYWORDS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:92 +ActiveJob::Arguments::SYMBOL_KEYS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:96 +ActiveJob::Arguments::WITH_INDIFFERENT_ACCESS_KEY = T.let(T.unsafe(nil), String) + +# = Active Job \Base +# +# Active Job objects can be configured to work with different backend +# queuing frameworks. To specify a queue adapter to use: +# +# ActiveJob::Base.queue_adapter = :inline +# +# A list of supported adapters can be found in QueueAdapters. +# +# Active Job objects can be defined by creating a class that inherits +# from the ActiveJob::Base class. The only necessary method to +# implement is the "perform" method. +# +# To define an Active Job object: +# +# class ProcessPhotoJob < ActiveJob::Base +# def perform(photo) +# photo.watermark!('Rails') +# photo.rotate!(90.degrees) +# photo.resize_to_fit!(300, 300) +# photo.upload! +# end +# end +# +# Records that are passed in are serialized/deserialized using Global +# ID. More information can be found in ActiveJob::Arguments. +# +# To enqueue a job to be performed as soon as the queuing system is free: +# +# ProcessPhotoJob.perform_later(photo) +# +# To enqueue a job to be processed at some point in the future: +# +# ProcessPhotoJob.set(wait_until: Date.tomorrow.noon).perform_later(photo) +# +# More information can be found in ActiveJob::Core::ClassMethods#set. +# +# A job can also be processed immediately without sending to the queue: +# +# ProcessPhotoJob.perform_now(photo) +# +# == Exceptions +# +# * DeserializationError - Error class for deserialization errors. +# * SerializationError - Error class for serialization errors. +# +# pkg:gem/activejob#lib/active_job/base.rb:63 +class ActiveJob::Base + include ::ActiveJob::Core + include ::ActiveJob::QueueAdapter + include ::ActiveJob::QueueName + include ::ActiveJob::QueuePriority + include ::ActiveJob::Enqueuing + include ::ActiveSupport::Rescuable + include ::ActiveJob::Execution + include ::ActiveSupport::Callbacks + include ::ActiveJob::Callbacks + include ::ActiveJob::Exceptions + include ::ActiveJob::Instrumentation + include ::ActiveJob::Logging + include ::ActiveJob::ExecutionState + include ::ActiveJob::TestHelper::TestQueueAdapter + extend ::ActiveJob::Core::ClassMethods + extend ::ActiveJob::QueueAdapter::ClassMethods + extend ::ActiveJob::QueueName::ClassMethods + extend ::ActiveJob::QueuePriority::ClassMethods + extend ::ActiveJob::Enqueuing::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActiveJob::Execution::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveJob::Callbacks::ClassMethods + extend ::ActiveJob::Exceptions::ClassMethods + extend ::ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _enqueue_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _perform_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _run_enqueue_callbacks(&block); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _run_enqueue_callbacks!(&block); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _run_perform_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _run_perform_callbacks!(&block); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs?; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger=(val); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def queue_adapter(&); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix=(_arg0); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix?; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers=(_arg0); end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers?; end + + class << self + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _enqueue_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _enqueue_callbacks=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _perform_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _perform_callbacks=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter; end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter_name; end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter_name=(value); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:19 + def _test_adapter; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:19 + def _test_adapter=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs?; end + + # pkg:gem/activejob#lib/active_job/base.rb:68 + def enqueue_after_transaction_commit; end + + # pkg:gem/activejob#lib/active_job/base.rb:68 + def enqueue_after_transaction_commit=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def log_arguments; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def log_arguments=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def log_arguments?; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger=(val); end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def priority; end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def priority=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def priority?; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name?; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_delimiter; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_delimiter=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_delimiter?; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix?; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers?; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def retry_jitter; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def retry_jitter=(value); end + + private + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __class_attr___callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def __class_attr__queue_adapter; end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def __class_attr__queue_adapter=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def __class_attr__queue_adapter_name; end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def __class_attr__queue_adapter_name=(new_value); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:19 + def __class_attr__test_adapter; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:19 + def __class_attr__test_adapter=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def __class_attr_after_discard_procs; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def __class_attr_after_discard_procs=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:68 + def __class_attr_enqueue_after_transaction_commit; end + + # pkg:gem/activejob#lib/active_job/base.rb:68 + def __class_attr_enqueue_after_transaction_commit=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def __class_attr_log_arguments; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def __class_attr_log_arguments=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def __class_attr_priority; end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def __class_attr_priority=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def __class_attr_queue_name; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def __class_attr_queue_name=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def __class_attr_queue_name_delimiter; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def __class_attr_queue_name_delimiter=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def __class_attr_queue_name_prefix; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def __class_attr_queue_name_prefix=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def __class_attr_rescue_handlers; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def __class_attr_rescue_handlers=(new_value); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def __class_attr_retry_jitter; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def __class_attr_retry_jitter=(new_value); end + end +end + +# = Active Job \Callbacks +# +# Active Job provides hooks during the life cycle of a job. Callbacks allow you +# to trigger logic during this cycle. Available callbacks are: +# +# * before_enqueue +# * around_enqueue +# * after_enqueue +# * before_perform +# * around_perform +# * after_perform +# +# pkg:gem/activejob#lib/active_job/callbacks.rb:18 +module ActiveJob::Callbacks + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Callbacks + 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 ::ActiveJob::Callbacks::ClassMethods + + class << self + # pkg:gem/activejob#lib/active_job/callbacks.rb:23 + def __callbacks; end + + # pkg:gem/activejob#lib/active_job/callbacks.rb:24 + def _execute_callbacks; end + + # pkg:gem/activejob#lib/active_job/callbacks.rb:24 + def _run_execute_callbacks; end + + # pkg:gem/activejob#lib/active_job/callbacks.rb:24 + def _run_execute_callbacks!(&block); end + + private + + # pkg:gem/activejob#lib/active_job/callbacks.rb:23 + def __class_attr___callbacks; end + end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# These methods will be included into any Active Job object, adding +# callbacks for +perform+ and +enqueue+ methods. +# +# pkg:gem/activejob#lib/active_job/callbacks.rb:34 +module ActiveJob::Callbacks::ClassMethods + # Defines a callback that will get called right after the + # job is enqueued. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # after_enqueue do |job| + # result = job.successfully_enqueued? ? "success" : "failure" + # $statsd.increment "enqueue-video-job.#{result}" + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:141 + def after_enqueue(*filters, &blk); end + + # Defines a callback that will get called right after the + # job's perform method has finished. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # after_perform do |job| + # UserMailer.notify_video_processed(job.arguments.first) + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:69 + def after_perform(*filters, &blk); end + + # Defines a callback that will get called around the enqueuing + # of the job. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # around_enqueue do |job, block| + # $statsd.time "video-job.process" do + # block.call + # end + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:162 + def around_enqueue(*filters, &blk); end + + # Defines a callback that will get called around the job's perform method. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # around_perform do |job, block| + # UserMailer.notify_video_started_processing(job.arguments.first) + # block.call + # UserMailer.notify_video_processed(job.arguments.first) + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # You can access the return value of the job only if the execution wasn't halted. + # + # class VideoProcessJob < ActiveJob::Base + # around_perform do |job, block| + # value = block.call + # puts value # => "Hello World!" + # end + # + # def perform + # "Hello World!" + # end + # end + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:102 + def around_perform(*filters, &blk); end + + # Defines a callback that will get called right before the + # job is enqueued. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # before_enqueue do |job| + # $statsd.increment "enqueue-video-job.try" + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:121 + def before_enqueue(*filters, &blk); end + + # Defines a callback that will get called right before the + # job's perform method is executed. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # before_perform do |job| + # UserMailer.notify_video_started_processing(job.arguments.first) + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:50 + def before_perform(*filters, &blk); end +end + +# pkg:gem/activejob#lib/active_job/configured_job.rb:4 +class ActiveJob::ConfiguredJob + # pkg:gem/activejob#lib/active_job/configured_job.rb:5 + def initialize(job_class, options = T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/configured_job.rb:14 + def perform_later(*, **, &); end + + # pkg:gem/activejob#lib/active_job/configured_job.rb:10 + def perform_now(*, **, &); end +end + +# = Active Job Continuable +# +# The Continuable module provides the ability to track the progress of your +# jobs, and continue from where they left off if interrupted. +# +# Mix ActiveJob::Continuable into your job to enable continuations. +# +# See {ActiveJob::Continuation}[rdoc-ref:ActiveJob::Continuation] for usage. +# +# pkg:gem/activejob#lib/active_job/continuable.rb:13 +module ActiveJob::Continuable + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # pkg:gem/activejob#lib/active_job/continuable.rb:62 + def checkpoint!; end + + # pkg:gem/activejob#lib/active_job/continuable.rb:33 + def continuation; end + + # pkg:gem/activejob#lib/active_job/continuable.rb:33 + def continuation=(_arg0); end + + # pkg:gem/activejob#lib/active_job/continuable.rb:56 + def deserialize(job_data); end + + # pkg:gem/activejob#lib/active_job/continuable.rb:66 + def interrupt!(reason:); end + + # The number of times the job has been resumed. + # + # pkg:gem/activejob#lib/active_job/continuable.rb:31 + def resumptions; end + + # The number of times the job has been resumed. + # + # pkg:gem/activejob#lib/active_job/continuable.rb:31 + def resumptions=(_arg0); end + + # pkg:gem/activejob#lib/active_job/continuable.rb:52 + def serialize; end + + # Start a new continuation step + # + # pkg:gem/activejob#lib/active_job/continuable.rb:36 + def step(step_name, start: T.unsafe(nil), isolated: T.unsafe(nil), &block); end + + private + + # pkg:gem/activejob#lib/active_job/continuable.rb:72 + def continue(&block); end + + # pkg:gem/activejob#lib/active_job/continuable.rb:91 + def resume_job(exception); end + + module GeneratedClassMethods + def max_resumptions; end + def max_resumptions=(value); end + def max_resumptions?; end + def resume_errors_after_advancing; end + def resume_errors_after_advancing=(value); end + def resume_errors_after_advancing?; end + def resume_options; end + def resume_options=(value); end + def resume_options?; end + end + + module GeneratedInstanceMethods + def max_resumptions; end + def max_resumptions?; end + def resume_errors_after_advancing; end + def resume_errors_after_advancing?; end + def resume_options; end + def resume_options?; end + end +end + +# = Active Job \Continuation +# +# Continuations provide a mechanism for interrupting and resuming jobs. This allows +# long-running jobs to make progress across application restarts. +# +# Jobs should include the ActiveJob::Continuable module to enable continuations. +# \Continuable jobs are automatically retried when interrupted. +# +# Use the +step+ method to define the steps in your job. Steps can use an optional +# cursor to track progress in the step. +# +# Steps are executed as soon as they are encountered. If a job is interrupted, previously +# completed steps will be skipped. If a step is in progress, it will be resumed +# with the last recorded cursor. +# +# Code that is not part of a step will be executed on each job run. +# +# You can pass a block or a method name to the step method. The block will be called with +# the step object as an argument. Methods can either take no arguments or a single argument +# for the step object. +# +# class ProcessImportJob < ApplicationJob +# include ActiveJob::Continuable +# +# def perform(import_id) +# # This always runs, even if the job is resumed. +# @import = Import.find(import_id) +# +# step :validate do +# @import.validate! +# end +# +# step(:process_records) do |step| +# @import.records.find_each(start: step.cursor) do |record| +# record.process +# step.advance! from: record.id +# end +# end +# +# step :reprocess_records +# step :finalize +# end +# +# def reprocess_records(step) +# @import.records.find_each(start: step.cursor) do |record| +# record.reprocess +# step.advance! from: record.id +# end +# end +# +# def finalize +# @import.finalize! +# end +# end +# +# === Cursors +# +# Cursors are used to track progress within a step. The cursor can be any object that is +# serializable as an argument to +ActiveJob::Base.serialize+. It defaults to +nil+. +# +# When a step is resumed, the last cursor value is restored. The code in the step is responsible +# for using the cursor to continue from the right point. +# +# +set!+ sets the cursor to a specific value. +# +# step :iterate_items do |step| +# items[step.cursor..].each do |item| +# process(item) +# step.set! (step.cursor || 0) + 1 +# end +# end +# +# An starting value for the cursor can be set when defining the step: +# +# step :iterate_items, start: 0 do |step| +# items[step.cursor..].each do |item| +# process(item) +# step.set! step.cursor + 1 +# end +# end +# +# The cursor can be advanced with +advance!+. This calls +succ+ on the current cursor value. +# It raises an ActiveJob::Continuation::UnadvanceableCursorError if the cursor does not implement +succ+. +# +# step :iterate_items, start: 0 do |step| +# items[step.cursor..].each do |item| +# process(item) +# step.advance! +# end +# end +# +# You can optionally pass a +from+ argument to +advance!+. This is useful when iterating +# over a collection of records where IDs may not be contiguous. +# +# step :process_records do |step| +# import.records.find_each(start: step.cursor) do |record| +# record.process +# step.advance! from: record.id +# end +# end +# +# You can use an array to iterate over nested records: +# +# step :process_nested_records, start: [ 0, 0 ] do |step| +# Account.find_each(start: step.cursor[0]) do |account| +# account.records.find_each(start: step.cursor[1]) do |record| +# record.process +# step.set! [ account.id, record.id + 1 ] +# end +# step.set! [ account.id + 1, 0 ] +# end +# end +# +# Setting or advancing the cursor creates a checkpoint. You can also create a checkpoint +# manually by calling the +checkpoint!+ method on the step. This is useful if you want to +# allow interruptions, but don't need to update the cursor. +# +# step :destroy_records do |step| +# import.records.find_each do |record| +# record.destroy! +# step.checkpoint! +# end +# end +# +# === Checkpoints +# +# A checkpoint is where a job can be interrupted. At a checkpoint the job will call +# +queue_adapter.stopping?+. If it returns true, the job will raise an +# ActiveJob::Continuation::Interrupt exception. +# +# There is an automatic checkpoint before the start of each step except for the first for +# each job execution. Within a step one is created when calling +set!+, +advance!+ or +checkpoint!+. +# +# Jobs are not automatically interrupted when the queue adapter is marked as stopping - they +# will continue to run either until the next checkpoint, or when the process is stopped. +# +# This is to allow jobs to be interrupted at a safe point, but it also means that the jobs +# should checkpoint more frequently than the shutdown timeout to ensure a graceful restart. +# +# When interrupted, the job will automatically retry with the progress serialized +# in the job data under the +continuation+ key. +# +# The serialized progress contains: +# - a list of the completed steps +# - the current step and its cursor value (if one is in progress) +# +# === Isolated Steps +# +# Steps run sequentially in a single job execution, unless the job is interrupted. +# +# You can specify that a step should always run in its own execution by passing the +isolated: true+ option. +# +# This is useful for long-running steps where it may not be possible to checkpoint within +# the job grace period - it ensures that progress is serialized back into the job data before +# the step starts. +# +# step :quick_step1 +# step :slow_step, isolated: true +# step :quick_step2 +# step :quick_step3 +# +# === Errors +# +# If a job raises an error and is not retried via Active Job, it will be passed back to the underlying +# queue backend and any progress in this execution will be lost. +# +# To mitigate this, the job will be automatically retried if it raises an error after it has made progress. +# Making progress is defined as having completed a step or advanced the cursor within the current step. +# +# === Configuration +# +# Continuable jobs have several configuration options: +# * :max_resumptions - The maximum number of times a job can be resumed. Defaults to +nil+ which means +# unlimited resumptions. +# * :resume_options - Options to pass to +retry_job+ when resuming the job. +# Defaults to { wait: 5.seconds }. +# See {ActiveJob::Exceptions#retry_job}[rdoc-ref:ActiveJob::Exceptions#retry_job] for available options. +# * :resume_errors_after_advancing - Whether to resume errors after advancing the continuation. +# Defaults to +true+. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:186 +class ActiveJob::Continuation + include ::ActiveJob::Continuation::Validation + extend ::ActiveSupport::Autoload + + # pkg:gem/activejob#lib/active_job/continuation.rb:214 + def initialize(job, serialized_progress); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:256 + def advanced?; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:242 + def description; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:260 + def instrumentation; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:252 + def started?; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:224 + def step(name, **options, &block); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:235 + def to_h; end + + private + + # pkg:gem/activejob#lib/active_job/continuation.rb:267 + def completed; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:277 + def completed?(name); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:267 + def current; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:267 + def encountered; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:326 + def instrument(*, **, &); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:315 + def instrumenting_step(step, &block); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:273 + def isolating?; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:267 + def job; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:281 + def new_step(*args, **options); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:289 + def run_step(name, start:, isolated:, &block); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:299 + def run_step_inline(name, start:, **options, &block); end + + # pkg:gem/activejob#lib/active_job/continuation.rb:269 + def running_step?; end + + # pkg:gem/activejob#lib/active_job/continuation.rb:285 + def skip_step(name); end +end + +# Raised when there is an error with a checkpoint, such as open database transactions. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:203 +class ActiveJob::Continuation::CheckpointError < ::ActiveJob::Continuation::Error; end + +# Base class for all Continuation errors. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:197 +class ActiveJob::Continuation::Error < ::StandardError; end + +# Raised when a job is interrupted, allowing Active Job to requeue it. +# This inherits from +Exception+ rather than +StandardError+, so it's not +# caught by normal exception handling. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:194 +class ActiveJob::Continuation::Interrupt < ::Exception; end + +# Raised when a step is invalid. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:200 +class ActiveJob::Continuation::InvalidStepError < ::ActiveJob::Continuation::Error; end + +# Raised when a job has reached its limit of the number of resumes. +# The limit is defined by the +max_resumptions+ class attribute. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:210 +class ActiveJob::Continuation::ResumeLimitError < ::ActiveJob::Continuation::Error; end + +# = Active Job Continuation Step +# +# Represents a step within a continuable job. +# +# When a step is completed, it is recorded in the job's continuation state. +# If the job is interrupted, it will be resumed from after the last completed step. +# +# Steps also have an optional cursor that can be used to track progress within the step. +# If a job is interrupted during a step, the cursor will be saved and passed back when +# the job is resumed. +# +# It is the responsibility of the code in the step to use the cursor correctly to resume +# from where it left off. +# +# pkg:gem/activejob#lib/active_job/continuation/step.rb:18 +class ActiveJob::Continuation::Step + # pkg:gem/activejob#lib/active_job/continuation/step.rb:25 + def initialize(name, cursor, job:, resumed:); end + + # Advance the cursor from the current or supplied value + # + # The cursor will be advanced by calling the +succ+ method on the cursor. + # An UnadvanceableCursorError error will be raised if the cursor does not implement +succ+. + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:49 + def advance!(from: T.unsafe(nil)); end + + # Has the cursor been advanced during this job execution? + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:67 + def advanced?; end + + # Check if the job should be interrupted, and if so raise an Interrupt exception. + # The job will be requeued for retry. + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:35 + def checkpoint!; end + + # The cursor for the step. + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:23 + def cursor; end + + # pkg:gem/activejob#lib/active_job/continuation/step.rb:75 + def description; end + + # The name of the step. + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:20 + def name; end + + # Has this step been resumed from a previous job execution? + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:62 + def resumed?; end + + # Set the cursor and interrupt the job if necessary. + # + # pkg:gem/activejob#lib/active_job/continuation/step.rb:40 + def set!(cursor); end + + # pkg:gem/activejob#lib/active_job/continuation/step.rb:71 + def to_a; end + + private + + # pkg:gem/activejob#lib/active_job/continuation/step.rb:80 + def initial_cursor; end + + # pkg:gem/activejob#lib/active_job/continuation/step.rb:80 + def job; end +end + +# Raised when attempting to advance a cursor that doesn't implement `succ`. +# +# pkg:gem/activejob#lib/active_job/continuation.rb:206 +class ActiveJob::Continuation::UnadvanceableCursorError < ::ActiveJob::Continuation::Error; end + +# pkg:gem/activejob#lib/active_job/continuation/validation.rb:5 +module ActiveJob::Continuation::Validation + private + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:45 + def raise_step_error!(message); end + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:7 + def validate_step!(name); end + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:39 + def validate_step_expected_order!(name); end + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:21 + def validate_step_not_encountered!(name); end + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:27 + def validate_step_not_nested!(name); end + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:33 + def validate_step_resume_expected!(name); end + + # pkg:gem/activejob#lib/active_job/continuation/validation.rb:15 + def validate_step_symbol!(name); end +end + +# = Active Job \Core +# +# Provides general behavior that will be included into every Active Job +# object that inherits from ActiveJob::Base. +# +# pkg:gem/activejob#lib/active_job/core.rb:15 +module ActiveJob::Core + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveJob::Core::ClassMethods + + # Creates a new job instance. Takes the arguments that will be + # passed to the perform method. + # + # pkg:gem/activejob#lib/active_job/core.rb:103 + def initialize(*arguments, **); end + + # Job arguments + # + # pkg:gem/activejob#lib/active_job/core.rb:19 + def arguments; end + + # Job arguments + # + # pkg:gem/activejob#lib/active_job/core.rb:19 + def arguments=(_arg0); end + + # Attaches the stored job data to the current instance. Receives a hash + # returned from +serialize+ + # + # ==== Examples + # + # class DeliverWebhookJob < ActiveJob::Base + # attr_writer :attempt_number + # + # def attempt_number + # @attempt_number ||= 0 + # end + # + # def serialize + # super.merge('attempt_number' => attempt_number + 1) + # end + # + # def deserialize(job_data) + # super + # self.attempt_number = job_data['attempt_number'] + # end + # + # rescue_from(Timeout::Error) do |exception| + # raise exception if attempt_number > 5 + # retry_job(wait: 10) + # end + # end + # + # pkg:gem/activejob#lib/active_job/core.rb:160 + def deserialize(job_data); end + + # Track any exceptions raised by the backend so callers can inspect the errors. + # + # pkg:gem/activejob#lib/active_job/core.rb:63 + def enqueue_error; end + + # Track any exceptions raised by the backend so callers can inspect the errors. + # + # pkg:gem/activejob#lib/active_job/core.rb:63 + def enqueue_error=(_arg0); end + + # Track when a job was enqueued + # + # pkg:gem/activejob#lib/active_job/core.rb:53 + def enqueued_at; end + + # Track when a job was enqueued + # + # pkg:gem/activejob#lib/active_job/core.rb:53 + def enqueued_at=(_arg0); end + + # Hash that contains the number of times this job handled errors for each specific retry_on declaration. + # Keys are the string representation of the exceptions listed in the retry_on declaration, + # while its associated value holds the number of executions where the corresponding retry_on + # declaration handled one of its listed exceptions. + # + # pkg:gem/activejob#lib/active_job/core.rb:44 + def exception_executions; end + + # Hash that contains the number of times this job handled errors for each specific retry_on declaration. + # Keys are the string representation of the exceptions listed in the retry_on declaration, + # while its associated value holds the number of executions where the corresponding retry_on + # declaration handled one of its listed exceptions. + # + # pkg:gem/activejob#lib/active_job/core.rb:44 + def exception_executions=(_arg0); end + + # Number of times this job has been executed (which increments on every retry, like after an exception). + # + # pkg:gem/activejob#lib/active_job/core.rb:38 + def executions; end + + # Number of times this job has been executed (which increments on every retry, like after an exception). + # + # pkg:gem/activejob#lib/active_job/core.rb:38 + def executions=(_arg0); end + + # Job Identifier + # + # pkg:gem/activejob#lib/active_job/core.rb:26 + def job_id; end + + # Job Identifier + # + # pkg:gem/activejob#lib/active_job/core.rb:26 + def job_id=(_arg0); end + + # I18n.locale to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:47 + def locale; end + + # I18n.locale to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:47 + def locale=(_arg0); end + + # Priority that the job will have (lower is more priority). + # + # pkg:gem/activejob#lib/active_job/core.rb:32 + def priority=(_arg0); end + + # ID optionally provided by adapter + # + # pkg:gem/activejob#lib/active_job/core.rb:35 + def provider_job_id; end + + # ID optionally provided by adapter + # + # pkg:gem/activejob#lib/active_job/core.rb:35 + def provider_job_id=(_arg0); end + + # Queue in which the job will reside. + # + # pkg:gem/activejob#lib/active_job/core.rb:29 + def queue_name=(_arg0); end + + # Time when the job should be performed + # + # pkg:gem/activejob#lib/active_job/core.rb:23 + def scheduled_at; end + + # Time when the job should be performed + # + # pkg:gem/activejob#lib/active_job/core.rb:23 + def scheduled_at=(_arg0); end + + # Returns a hash with the job data that can safely be passed to the + # queuing adapter. + # + # pkg:gem/activejob#lib/active_job/core.rb:117 + def serialize; end + + # pkg:gem/activejob#lib/active_job/core.rb:20 + def serialized_arguments=(_arg0); end + + # Configures the job with the given options. + # + # pkg:gem/activejob#lib/active_job/core.rb:175 + def set(options = T.unsafe(nil)); end + + # Track whether the adapter received the job successfully. + # + # pkg:gem/activejob#lib/active_job/core.rb:56 + def successfully_enqueued=(_arg0); end + + # pkg:gem/activejob#lib/active_job/core.rb:58 + def successfully_enqueued?; end + + # Timezone to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:50 + def timezone; end + + # Timezone to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:50 + def timezone=(_arg0); end + + private + + # pkg:gem/activejob#lib/active_job/core.rb:208 + def arguments_serialized?; end + + # pkg:gem/activejob#lib/active_job/core.rb:204 + def deserialize_arguments(serialized_args); end + + # pkg:gem/activejob#lib/active_job/core.rb:193 + def deserialize_arguments_if_needed; end + + # pkg:gem/activejob#lib/active_job/core.rb:212 + def deserialize_time(time); end + + # pkg:gem/activejob#lib/active_job/core.rb:200 + def serialize_arguments(arguments); end + + # pkg:gem/activejob#lib/active_job/core.rb:185 + def serialize_arguments_if_needed(arguments); end +end + +# These methods will be included into any Active Job object, adding +# helpers for de/serialization and creation of job instances. +# +# pkg:gem/activejob#lib/active_job/core.rb:67 +module ActiveJob::Core::ClassMethods + # Creates a new job instance from a hash created with +serialize+ + # + # pkg:gem/activejob#lib/active_job/core.rb:69 + def deserialize(job_data); end + + # Creates a job preconfigured with the given options. You can call + # perform_later with the job arguments to enqueue the job with the + # preconfigured options + # + # ==== Options + # * :wait - Enqueues the job with the specified delay + # * :wait_until - Enqueues the job at the time specified + # * :queue - Enqueues the job on the specified queue + # * :priority - Enqueues the job with the specified priority + # + # ==== Examples + # + # VideoJob.set(queue: :some_queue).perform_later(Video.last) + # VideoJob.set(wait: 5.minutes).perform_later(Video.last) + # VideoJob.set(wait_until: Time.now.tomorrow).perform_later(Video.last) + # VideoJob.set(queue: :some_queue, wait: 5.minutes).perform_later(Video.last) + # VideoJob.set(queue: :some_queue, wait_until: Time.now.tomorrow).perform_later(Video.last) + # VideoJob.set(queue: :some_queue, wait: 5.minutes, priority: 10).perform_later(Video.last) + # + # pkg:gem/activejob#lib/active_job/core.rb:96 + def set(options = T.unsafe(nil)); end +end + +# Raised when an exception is raised during job arguments deserialization. +# +# Wraps the original exception raised as +cause+. +# +# pkg:gem/activejob#lib/active_job/arguments.rb:10 +class ActiveJob::DeserializationError < ::StandardError + # pkg:gem/activejob#lib/active_job/arguments.rb:11 + def initialize; end +end + +# pkg:gem/activejob#lib/active_job/enqueue_after_transaction_commit.rb:4 +module ActiveJob::EnqueueAfterTransactionCommit + private + + # pkg:gem/activejob#lib/active_job/enqueue_after_transaction_commit.rb:25 + def raw_enqueue; end + + class << self + # pkg:gem/activejob#lib/active_job/enqueue_after_transaction_commit.rb:6 + def included(base); end + end +end + +# pkg:gem/activejob#lib/active_job/enqueue_after_transaction_commit.rb:11 +module ActiveJob::EnqueueAfterTransactionCommit::ActiveJobMethods + # Ensures perform_all_later respects each job's enqueue_after_transaction_commit configuration. + # Jobs with enqueue_after_transaction_commit set to true are deferred and enqueued only after the transaction commits; + # other jobs are enqueued immediately. This ensures enqueuing timing matches the per-job setting. + # + # pkg:gem/activejob#lib/active_job/enqueue_after_transaction_commit.rb:15 + def perform_all_later(*jobs); end +end + +# Can be raised by adapters if they wish to communicate to the caller a reason +# why the adapter was unexpectedly unable to enqueue a job. +# +# pkg:gem/activejob#lib/active_job/enqueuing.rb:8 +class ActiveJob::EnqueueError < ::StandardError; end + +# pkg:gem/activejob#lib/active_job/enqueuing.rb:10 +module ActiveJob::Enqueuing + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::Enqueuing::ClassMethods + + # Enqueues the job to be performed by the queue adapter. + # + # ==== Options + # * :wait - Enqueues the job with the specified delay + # * :wait_until - Enqueues the job at the time specified + # * :queue - Enqueues the job on the specified queue + # * :priority - Enqueues the job with the specified priority + # + # ==== Examples + # + # my_job_instance.enqueue + # my_job_instance.enqueue wait: 5.minutes + # my_job_instance.enqueue queue: :important + # my_job_instance.enqueue wait_until: Date.tomorrow.midnight + # my_job_instance.enqueue priority: 10 + # + # pkg:gem/activejob#lib/active_job/enqueuing.rb:82 + def enqueue(options = T.unsafe(nil)); end + + private + + # pkg:gem/activejob#lib/active_job/enqueuing.rb:103 + def _raw_enqueue; end + + # pkg:gem/activejob#lib/active_job/enqueuing.rb:97 + def raw_enqueue; end + + module GeneratedClassMethods + def enqueue_after_transaction_commit; end + def enqueue_after_transaction_commit=(value); end + end + + module GeneratedInstanceMethods; end +end + +# Includes the +perform_later+ method for job initialization. +# +# pkg:gem/activejob#lib/active_job/enqueuing.rb:27 +module ActiveJob::Enqueuing::ClassMethods + # Push a job onto the queue. By default the arguments must be either String, + # Integer, Float, NilClass, TrueClass, FalseClass, BigDecimal, Symbol, Date, + # Time, DateTime, ActiveSupport::TimeWithZone, ActiveSupport::Duration, + # Hash, ActiveSupport::HashWithIndifferentAccess, Array, Range, or + # GlobalID::Identification instances, although this can be extended by adding + # custom serializers. + # + # Returns an instance of the job class queued with arguments available in + # Job#arguments or +false+ if the enqueue did not succeed. + # + # After the attempted enqueue, the job will be yielded to an optional block. + # + # If Active Job is used conjointly with Active Record, and #perform_later is called + # inside an Active Record transaction, then the enqueue is implicitly deferred to after + # the transaction is committed, or dropped if it's rolled back. In such case #perform_later + # will return the job instance like if it was successfully enqueued, but will still return + # +false+ if a callback prevented the job from being enqueued. + # + # This behavior can be changed on a per job basis: + # + # class NotificationJob < ApplicationJob + # self.enqueue_after_transaction_commit = false + # end + # + # pkg:gem/activejob#lib/active_job/enqueuing.rb:51 + def perform_later(*, **, &); end + + private + + # pkg:gem/activejob#lib/active_job/enqueuing.rb:61 + def job_or_instantiate(*args, **, &); end +end + +# Provides behavior for retrying and discarding jobs on exceptions. +# +# pkg:gem/activejob#lib/active_job/exceptions.rb:7 +module ActiveJob::Exceptions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::Exceptions::ClassMethods + + # Reschedules the job to be re-executed. This is useful in combination with + # {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]. + # When you rescue an exception from your job you can ask Active Job to retry + # performing your job. + # + # ==== Options + # * :wait - Enqueues the job with the specified delay in seconds + # * :wait_until - Enqueues the job at the time specified + # * :queue - Enqueues the job on the specified queue + # * :priority - Enqueues the job with the specified priority + # + # ==== Examples + # + # class SiteScraperJob < ActiveJob::Base + # rescue_from(ErrorLoadingSite) do + # retry_job queue: :low_priority + # end + # + # def perform(*args) + # # raise ErrorLoadingSite if cannot scrape + # end + # end + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:158 + def retry_job(options = T.unsafe(nil)); end + + private + + # pkg:gem/activejob#lib/active_job/exceptions.rb:171 + def determine_delay(seconds_or_duration_or_algorithm:, executions:, jitter: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/exceptions.rb:192 + def determine_jitter_for_delay(delay, jitter); end + + # pkg:gem/activejob#lib/active_job/exceptions.rb:197 + def executions_for(exceptions); end + + # pkg:gem/activejob#lib/active_job/exceptions.rb:206 + def run_after_discard_procs(exception); end + + module GeneratedClassMethods + def after_discard_procs; end + def after_discard_procs=(value); end + def after_discard_procs?; end + def retry_jitter; end + def retry_jitter=(value); end + end + + module GeneratedInstanceMethods + def after_discard_procs; end + def after_discard_procs=(value); end + def after_discard_procs?; end + end +end + +# pkg:gem/activejob#lib/active_job/exceptions.rb:15 +module ActiveJob::Exceptions::ClassMethods + # A block to run when a job is about to be discarded for any reason. + # + # ==== Example + # + # class WorkJob < ActiveJob::Base + # after_discard do |job, exception| + # ExceptionNotifier.report(exception) + # end + # + # ... + # + # end + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:131 + def after_discard(&blk); end + + # Discard the job with no attempts to retry, if the exception is raised. This is useful when the subject of the job, + # like an Active Record, is no longer available, and the job is thus no longer relevant. + # + # Passing the :report option reports the error through the error reporter before discarding the job. + # + # You can also pass a block that'll be invoked. This block is yielded with the job instance as the first and the error instance as the second parameter. + # + # +retry_on+ and +discard_on+ handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if any. + # + # ==== Example + # + # class SearchIndexingJob < ActiveJob::Base + # discard_on ActiveJob::DeserializationError + # discard_on CustomAppException, report: true + # discard_on(AnotherCustomAppException) do |job, error| + # CustomErrorHandlingCode.handle(job, error) + # end + # + # def perform(record) + # # Will raise ActiveJob::DeserializationError if the record can't be deserialized + # # Might raise CustomAppException for something domain specific + # end + # end + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:109 + def discard_on(*exceptions, report: T.unsafe(nil)); end + + # Catch the exception and reschedule job for re-execution after so many seconds, for a specific number of attempts. + # If the exception keeps getting raised beyond the specified number of attempts, the exception is allowed to + # bubble up to the underlying queuing system, which may have its own retry mechanism or place it in a + # holding queue for inspection. + # + # You can also pass a block that'll be invoked if the retry attempts fail for custom logic rather than letting + # the exception bubble up. This block is yielded with the job instance as the first and the error instance as the second parameter. + # + # +retry_on+ and +discard_on+ handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if any. + # + # ==== Options + # * :wait - Re-enqueues the job with a delay specified either in seconds (default: 3 seconds), + # as a computing proc that takes the number of executions so far as an argument, or as a symbol reference of + # :polynomially_longer, which applies the wait algorithm of ((executions**4) + (Kernel.rand * (executions**4) * jitter)) + 2 + # (first wait ~3s, then ~18s, then ~83s, etc) + # * :attempts - Enqueues the job the specified number of times (default: 5 attempts) or a symbol reference of :unlimited + # to retry the job until it succeeds. The number of attempts includes the original job execution. + # * :queue - Re-enqueues the job on a different queue + # * :priority - Re-enqueues the job with a different priority + # * :jitter - A random delay of wait time used when calculating backoff. The default is 15% (0.15) which represents the upper bound of possible wait time (expressed as a percentage) + # * :report - Errors will be reported to the Rails.error reporter before being retried + # + # ==== Examples + # + # class RemoteServiceJob < ActiveJob::Base + # retry_on CustomAppException # defaults to ~3s wait, 5 attempts + # retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 } + # retry_on CustomInfrastructureException, wait: 5.minutes, attempts: :unlimited + # + # retry_on ActiveRecord::Deadlocked, wait: 5.seconds, attempts: 3 + # retry_on Net::OpenTimeout, Timeout::Error, wait: :polynomially_longer, attempts: 10 # retries at most 10 times for Net::OpenTimeout and Timeout::Error combined + # # To retry at most 10 times for each individual exception: + # # retry_on Net::OpenTimeout, wait: :polynomially_longer, attempts: 10 + # # retry_on Net::ReadTimeout, wait: 5.seconds, jitter: 0.30, attempts: 10 + # # retry_on Timeout::Error, wait: :polynomially_longer, attempts: 10 + # + # retry_on YetAnotherCustomAppException, report: true + # retry_on EvenWorseCustomAppException do |job, error| + # CustomErrorHandlingCode.handle(job, error) + # end + # + # def perform(*args) + # # Might raise CustomAppException, AnotherCustomAppException, or YetAnotherCustomAppException for something domain specific + # # Might raise ActiveRecord::Deadlocked when a local db deadlock is detected + # # Might raise Net::OpenTimeout or Timeout::Error when the remote service is down + # end + # end + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:64 + def retry_on(*exceptions, wait: T.unsafe(nil), attempts: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), jitter: T.unsafe(nil), report: T.unsafe(nil)); end +end + +# pkg:gem/activejob#lib/active_job/exceptions.rb:168 +ActiveJob::Exceptions::JITTER_DEFAULT = T.let(T.unsafe(nil), Object) + +# = Active Job \Execution +# +# Provides methods to execute jobs immediately, and wraps job execution so +# that exceptions configured with +# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from] +# are handled. +# +# pkg:gem/activejob#lib/active_job/execution.rb:12 +module ActiveJob::Execution + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Rescuable + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + mixes_in_class_methods ::ActiveJob::Execution::ClassMethods + + # pkg:gem/activejob#lib/active_job/execution.rb:60 + def perform(*); end + + # Performs the job immediately. The job is not sent to the queuing adapter + # but directly executed by blocking the execution of others until it's finished. + # +perform_now+ returns the value of your job's +perform+ method. + # + # class MyJob < ActiveJob::Base + # def perform + # "Hello World!" + # end + # end + # + # puts MyJob.new(*args).perform_now # => "Hello World!" + # + # pkg:gem/activejob#lib/active_job/execution.rb:45 + def perform_now; end + + private + + # pkg:gem/activejob#lib/active_job/execution.rb:65 + def _perform_job; end + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end + +# Includes methods for executing and performing jobs instantly. +# +# pkg:gem/activejob#lib/active_job/execution.rb:17 +module ActiveJob::Execution::ClassMethods + # pkg:gem/activejob#lib/active_job/execution.rb:26 + def execute(job_data); end + + # Performs the job immediately. + # + # MyJob.perform_now("mike") + # + # pkg:gem/activejob#lib/active_job/execution.rb:22 + def perform_now(*, **, &); end +end + +# pkg:gem/activejob#lib/active_job/execution_state.rb:4 +module ActiveJob::ExecutionState + # pkg:gem/activejob#lib/active_job/execution_state.rb:5 + def perform_now; end +end + +# pkg:gem/activejob#lib/active_job/instrumentation.rb:16 +module ActiveJob::Instrumentation + extend ::ActiveSupport::Concern + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:29 + def instrument(operation, payload = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:25 + def perform_now; end + + private + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:42 + def _perform_job; end + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:47 + def halted_callback_hook(*); end +end + +# pkg:gem/activejob#lib/active_job/log_subscriber.rb:6 +class ActiveJob::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner=(_arg0); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner?; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:131 + def discard(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:9 + def enqueue(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:49 + def enqueue_all(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:29 + def enqueue_at(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:106 + def enqueue_retry(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:141 + def interrupt(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:86 + def perform(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:76 + def perform_start(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:149 + def resume(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:121 + def retry_stopped(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:178 + def step(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:157 + def step_skipped(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:165 + def step_started(event); end + + private + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:204 + def args_info(job); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:258 + def enqueue_source_location; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:262 + def enqueued_jobs_message(adapter, enqueued_jobs); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:242 + def error(progname = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:213 + def format(arg); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:234 + def info(progname = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:250 + def log_enqueue_source; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:230 + def logger; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:200 + def queue_name(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:226 + def scheduled_at(event); end + + class << self + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner=(value); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner?; end + + private + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def __class_attr_backtrace_cleaner; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def __class_attr_backtrace_cleaner=(new_value); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:27 + def __class_attr_log_levels; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:27 + def __class_attr_log_levels=(new_value); end + end +end + +# pkg:gem/activejob#lib/active_job/logging.rb:7 +module ActiveJob::Logging + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # pkg:gem/activejob#lib/active_job/logging.rb:31 + def perform_now; end + + private + + # pkg:gem/activejob#lib/active_job/logging.rb:45 + def logger_tagged_by_active_job?; end + + # pkg:gem/activejob#lib/active_job/logging.rb:36 + def tag_logger(*tags, &block); end + + module GeneratedClassMethods + def log_arguments; end + def log_arguments=(value); end + def log_arguments?; end + end + + module GeneratedInstanceMethods; end +end + +# = Active Job Queue adapter +# +# The +ActiveJob::QueueAdapter+ module is used to load the +# correct adapter. The default queue adapter is +:async+, +# which loads the ActiveJob::QueueAdapters::AsyncAdapter. +# +# pkg:gem/activejob#lib/active_job/queue_adapter.rb:20 +module ActiveJob::QueueAdapter + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::QueueAdapter::ClassMethods + + module GeneratedClassMethods + def _queue_adapter; end + def _queue_adapter=(value); end + def _queue_adapter_name; end + def _queue_adapter_name=(value); end + end + + module GeneratedInstanceMethods; end +end + +# Includes the setter method for changing the active queue adapter. +# +# pkg:gem/activejob#lib/active_job/queue_adapter.rb:31 +module ActiveJob::QueueAdapter::ClassMethods + # Returns the backend queue provider. The default queue adapter + # is +:async+. See QueueAdapters for more information. + # + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:34 + def queue_adapter; end + + # Specify the backend queue provider. The default queue adapter + # is the +:async+ queue. See QueueAdapters for more + # information. + # + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:49 + def queue_adapter=(name_or_adapter); end + + # Returns string denoting the name of the configured queue adapter. + # By default returns "async". + # + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:41 + def queue_adapter_name; end + + private + + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:66 + def assign_adapter(adapter_name, queue_adapter); end + + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:73 + def queue_adapter?(object); end +end + +# pkg:gem/activejob#lib/active_job/queue_adapter.rb:71 +ActiveJob::QueueAdapter::ClassMethods::QUEUE_ADAPTER_METHODS = T.let(T.unsafe(nil), Array) + +# = Active Job adapters +# +# Active Job has adapters for the following queuing backends: +# +# * {Backburner}[https://github.com/nesquena/backburner] +# * {Delayed Job}[https://github.com/collectiveidea/delayed_job] +# * {Que}[https://github.com/chanks/que] +# * {queue_classic}[https://github.com/QueueClassic/queue_classic] +# * {Resque}[https://github.com/resque/resque] +# * {Sidekiq}[https://sidekiq.org] +# * {Sneakers}[https://github.com/jondot/sneakers] +# * Please Note: We are not accepting pull requests for new adapters. See the {README}[link:files/activejob/README_md.html] for more details. +# +# For testing and development Active Job has three built-in adapters: +# +# * {Active Job Async}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/AsyncAdapter.html] +# * {Active Job Inline}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/InlineAdapter.html] +# * {Active Job Test}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/TestAdapter.html] +# +# === Backends Features +# +# | | Async | Queues | Delayed | Priorities | Timeout | Retries | +# |-------------------|-------|--------|------------|------------|---------|---------| +# | Backburner | Yes | Yes | Yes | Yes | Job | Global | +# | Delayed Job | Yes | Yes | Yes | Job | Global | Global | +# | Que | Yes | Yes | Yes | Job | No | Job | +# | queue_classic | Yes | Yes | Yes* | No | No | No | +# | Resque | Yes | Yes | Yes (Gem) | Queue | Global | Yes | +# | Sidekiq | Yes | Yes | Yes | Queue | No | Job | +# | Sneakers | Yes | Yes | No | Queue | Queue | No | +# | Active Job Async | Yes | Yes | Yes | No | No | No | +# | Active Job Inline | No | Yes | N/A | N/A | N/A | N/A | +# | Active Job Test | No | Yes | N/A | N/A | N/A | N/A | +# +# ==== Async +# +# Yes: The Queue Adapter has the ability to run the job in a non-blocking manner. +# It either runs on a separate or forked process, or on a different thread. +# +# No: The job is run in the same process. +# +# ==== Queues +# +# Yes: Jobs may set which queue they are run in with queue_as or by using the set +# method. +# +# ==== Delayed +# +# Yes: The adapter will run the job in the future through perform_later. +# +# (Gem): An additional gem is required to use perform_later with this adapter. +# +# No: The adapter will run jobs at the next opportunity and cannot use perform_later. +# +# N/A: The adapter does not support queuing. +# +# NOTE: +# queue_classic supports job scheduling since version 3.1. +# For older versions you can use the queue_classic-later gem. +# +# ==== Priorities +# +# The order in which jobs are processed can be configured differently depending +# on the adapter. +# +# Job: Any class inheriting from the adapter may set the priority on the job +# object relative to other jobs. +# +# Queue: The adapter can set the priority for job queues, when setting a queue +# with Active Job this will be respected. +# +# Yes: Allows the priority to be set on the job object, at the queue level or +# as default configuration option. +# +# No: The adapter does not allow the priority of jobs to be configured. +# +# N/A: The adapter does not support queuing, and therefore sorting them. +# +# ==== Timeout +# +# When a job will stop after the allotted time. +# +# Job: The timeout can be set for each instance of the job class. +# +# Queue: The timeout is set for all jobs on the queue. +# +# Global: The adapter is configured that all jobs have a maximum run time. +# +# No: The adapter does not allow the timeout of jobs to be configured. +# +# N/A: This adapter does not run in a separate process, and therefore timeout +# is unsupported. +# +# ==== Retries +# +# Job: The number of retries can be set per instance of the job class. +# +# Yes: The Number of retries can be configured globally, for each instance or +# on the queue. This adapter may also present failed instances of the job class +# that can be restarted. +# +# Global: The adapter has a global number of retries. +# +# No: The adapter does not allow the number of retries to be configured. +# +# N/A: The adapter does not run in a separate process, and therefore doesn't +# support retries. +# +# pkg:gem/activejob#lib/active_job/queue_adapters.rb:112 +module ActiveJob::QueueAdapters + extend ::ActiveSupport::Autoload + + class << self + # Returns adapter for specified name. + # + # ActiveJob::QueueAdapters.lookup(:sidekiq) + # # => ActiveJob::QueueAdapters::SidekiqAdapter + # + # pkg:gem/activejob#lib/active_job/queue_adapters.rb:134 + def lookup(name); end + end +end + +# pkg:gem/activejob#lib/active_job/queue_adapters.rb:126 +ActiveJob::QueueAdapters::ADAPTER = T.let(T.unsafe(nil), String) + +# = Active Job Abstract Adapter +# +# Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter +# forms the abstraction layer which makes this possible. +# +# pkg:gem/activejob#lib/active_job/queue_adapters/abstract_adapter.rb:9 +class ActiveJob::QueueAdapters::AbstractAdapter + # pkg:gem/activejob#lib/active_job/queue_adapters/abstract_adapter.rb:12 + def enqueue(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/abstract_adapter.rb:16 + def enqueue_at(job, timestamp); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/abstract_adapter.rb:10 + def stopping; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/abstract_adapter.rb:10 + def stopping=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/abstract_adapter.rb:20 + def stopping?; end +end + +# = Active Job Async adapter +# +# The Async adapter runs jobs with an in-process thread pool. +# +# This is the default queue adapter. It's well-suited for dev/test since +# it doesn't need an external infrastructure, but it's a poor fit for +# production since it drops pending jobs on restart. +# +# To use this adapter, set queue adapter to +:async+: +# +# config.active_job.queue_adapter = :async +# +# To configure the adapter's thread pool, instantiate the adapter and +# pass your own config: +# +# config.active_job.queue_adapter = ActiveJob::QueueAdapters::AsyncAdapter.new \ +# min_threads: 1, +# max_threads: 2 * Concurrent.processor_count, +# idletime: 600.seconds +# +# The adapter uses a {Concurrent Ruby}[https://github.com/ruby-concurrency/concurrent-ruby] thread pool to schedule and execute +# jobs. Since jobs share a single thread pool, long-running jobs will block +# short-lived jobs. Fine for dev/test; bad for production. +# +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:33 +class ActiveJob::QueueAdapters::AsyncAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter + # See {Concurrent::ThreadPoolExecutor}[https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/ThreadPoolExecutor.html] for executor options. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:35 + def initialize(**executor_options); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:39 + def enqueue(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:43 + def enqueue_at(job, timestamp); end + + # Used for our test suite. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:55 + def immediate=(immediate); end + + # Gracefully stop processing jobs. Finishes in-progress work and handles + # any new jobs following the executor's fallback policy (`caller_runs`). + # Waits for termination by default. Pass `wait: false` to continue. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:50 + def shutdown(wait: T.unsafe(nil)); end +end + +# Note that we don't actually need to serialize the jobs since we're +# performing them in-process, but we do so anyway for parity with other +# adapters and deployment environments. Otherwise, serialization bugs +# may creep in undetected. +# +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:63 +class ActiveJob::QueueAdapters::AsyncAdapter::JobWrapper + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:64 + def initialize(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:69 + def perform; end +end + +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:74 +class ActiveJob::QueueAdapters::AsyncAdapter::Scheduler + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:86 + def initialize(**options); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:96 + def enqueue(job, queue_name:); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:100 + def enqueue_at(job, timestamp, queue_name:); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:114 + def executor; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:84 + def immediate; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:84 + def immediate=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:109 + def shutdown(wait: T.unsafe(nil)); end +end + +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:75 +ActiveJob::QueueAdapters::AsyncAdapter::Scheduler::DEFAULT_EXECUTOR_OPTIONS = T.let(T.unsafe(nil), Hash) + +# = Active Job Inline adapter +# +# When enqueuing jobs with the Inline adapter the job will be executed +# immediately. +# +# To use the Inline set the queue_adapter config to +:inline+. +# +# Rails.application.config.active_job.queue_adapter = :inline +# +# pkg:gem/activejob#lib/active_job/queue_adapters/inline_adapter.rb:13 +class ActiveJob::QueueAdapters::InlineAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter + # pkg:gem/activejob#lib/active_job/queue_adapters/inline_adapter.rb:14 + def enqueue(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/inline_adapter.rb:18 + def enqueue_at(*); end +end + +# = Test adapter for Active Job +# +# The test adapter should be used only in testing. Along with +# ActiveJob::TestCase and ActiveJob::TestHelper +# it makes a great tool to test your \Rails application. +# +# To use the test adapter set +queue_adapter+ config to +:test+. +# +# Rails.application.config.active_job.queue_adapter = :test +# +# pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:14 +class ActiveJob::QueueAdapters::TestAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def at; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def at=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:28 + def enqueue(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:33 + def enqueue_at(job, timestamp); end + + # Provides a store of all the enqueued jobs with the TestAdapter so you can check them. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:19 + def enqueued_jobs; end + + # Provides a store of all the enqueued jobs with the TestAdapter so you can check them. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:16 + def enqueued_jobs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def filter; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def filter=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_at_jobs; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_at_jobs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_jobs; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_jobs=(_arg0); end + + # Provides a store of all the performed jobs with the TestAdapter so you can check them. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:24 + def performed_jobs; end + + # Provides a store of all the performed jobs with the TestAdapter so you can check them. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:16 + def performed_jobs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def queue; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def queue=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def reject; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def reject=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def stopping; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def stopping=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:38 + def stopping?; end + + private + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:83 + def filter_as_proc(filter); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:61 + def filtered?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:75 + def filtered_job_class?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:69 + def filtered_queue?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:65 + def filtered_time?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:43 + def job_to_hash(job, extras = T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:52 + def perform_or_enqueue(perform, job, job_data); end +end + +# pkg:gem/activejob#lib/active_job/queue_name.rb:4 +module ActiveJob::QueueName + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::QueueName::ClassMethods + + # Returns the name of the queue the job will be run on. + # + # pkg:gem/activejob#lib/active_job/queue_name.rb:61 + def queue_name; end + + module GeneratedClassMethods + def queue_name; end + def queue_name=(value); end + def queue_name?; end + def queue_name_delimiter; end + def queue_name_delimiter=(value); end + def queue_name_delimiter?; end + def queue_name_prefix; end + def queue_name_prefix=(value); end + def queue_name_prefix?; end + end + + module GeneratedInstanceMethods + def queue_name_prefix; end + def queue_name_prefix=(value); end + def queue_name_prefix?; end + end +end + +# Includes the ability to override the default queue name and prefix. +# +# pkg:gem/activejob#lib/active_job/queue_name.rb:8 +module ActiveJob::QueueName::ClassMethods + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name; end + + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name=(val); end + + # Specifies the name of the queue to process the job on. + # + # class PublishToFeedJob < ActiveJob::Base + # queue_as :feeds + # + # def perform(post) + # post.to_feed! + # end + # end + # + # Can be given a block that will evaluate in the context of the job + # so that a dynamic queue name can be applied: + # + # class PublishToFeedJob < ApplicationJob + # queue_as do + # post = self.arguments.first + # + # if post.paid? + # :paid_feeds + # else + # :feeds + # end + # end + # + # def perform(post) + # post.to_feed! + # end + # end + # + # pkg:gem/activejob#lib/active_job/queue_name.rb:39 + def queue_as(part_name = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/queue_name.rb:47 + def queue_name_from_part(part_name); end + + class << self + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name; end + + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name=(val); end + end +end + +# pkg:gem/activejob#lib/active_job/queue_priority.rb:4 +module ActiveJob::QueuePriority + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::QueuePriority::ClassMethods + + # Returns the priority that the job will be created with + # + # pkg:gem/activejob#lib/active_job/queue_priority.rb:53 + def priority; end + + module GeneratedClassMethods + def priority; end + def priority=(value); end + def priority?; end + end + + module GeneratedInstanceMethods; end +end + +# Includes the ability to override the default queue priority. +# +# pkg:gem/activejob#lib/active_job/queue_priority.rb:8 +module ActiveJob::QueuePriority::ClassMethods + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority; end + + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority=(val); end + + # Specifies the priority of the queue to create the job with. + # + # class PublishToFeedJob < ActiveJob::Base + # queue_with_priority 50 + # + # def perform(post) + # post.to_feed! + # end + # end + # + # Can be given a block that will evaluate in the context of the job + # so that a dynamic priority can be applied: + # + # class PublishToFeedJob < ApplicationJob + # queue_with_priority do + # post = self.arguments.first + # + # if post.paid? + # 10 + # else + # 50 + # end + # end + # + # def perform(post) + # post.to_feed! + # end + # end + # + # pkg:gem/activejob#lib/active_job/queue_priority.rb:39 + def queue_with_priority(priority = T.unsafe(nil), &block); end + + class << self + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority; end + + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority=(val); end + end +end + +# Raised when an unsupported argument type is set as a job argument. We +# currently support String, Integer, Float, NilClass, TrueClass, FalseClass, +# BigDecimal, Symbol, Date, Time, DateTime, ActiveSupport::TimeWithZone, +# ActiveSupport::Duration, Hash, ActiveSupport::HashWithIndifferentAccess, +# Array, Range, or GlobalID::Identification instances, although this can be +# extended by adding custom serializers. +# Raised if you set the key for a Hash something else than a string or +# a symbol. Also raised when trying to serialize an object which can't be +# identified with a GlobalID - such as an unpersisted Active Record model. +# +# pkg:gem/activejob#lib/active_job/arguments.rb:26 +class ActiveJob::SerializationError < ::ArgumentError; end + +# = Active Job \Serializers +# +# The +ActiveJob::Serializers+ module is used to store a list of known serializers +# and to add new ones. It also has helpers to serialize/deserialize objects. +# +# pkg:gem/activejob#lib/active_job/serializers.rb:8 +module ActiveJob::Serializers + extend ::ActiveSupport::Autoload + + class << self + # Adds new serializers to a list of known serializers. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:60 + def add_serializers(*new_serializers); end + + # Returns deserialized object. + # Will look up through all known serializers. + # If no serializer found will raise ArgumentError. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:40 + def deserialize(argument); end + + # Returns serialized representative of the passed object. + # Will look up through all known serializers. + # Raises ActiveJob::SerializationError if it can't find a proper serializer. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:31 + def serialize(argument); end + + # Returns list of known serializers. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:51 + def serializers; end + + # pkg:gem/activejob#lib/active_job/serializers.rb:53 + def serializers=(serializers); end + + private + + # pkg:gem/activejob#lib/active_job/serializers.rb:66 + def add_new_serializers(new_serializers); end + + # pkg:gem/activejob#lib/active_job/serializers.rb:80 + def index_serializers(new_serializers); end + end +end + +# pkg:gem/activejob#lib/active_job/serializers/action_controller_parameters_serializer.rb:5 +class ActiveJob::Serializers::ActionControllerParametersSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/action_controller_parameters_serializer.rb:10 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/action_controller_parameters_serializer.rb:18 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/action_controller_parameters_serializer.rb:6 + def serialize(argument); end + + # pkg:gem/activejob#lib/active_job/serializers/action_controller_parameters_serializer.rb:14 + def serialize?(argument); end +end + +# pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:7 +class ActiveJob::Serializers::BigDecimalSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:12 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:16 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:8 + def serialize(big_decimal); end +end + +# pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:5 +class ActiveJob::Serializers::DateSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:10 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:14 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:6 + def serialize(date); end +end + +# pkg:gem/activejob#lib/active_job/serializers/date_time_serializer.rb:5 +class ActiveJob::Serializers::DateTimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/date_time_serializer.rb:6 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/date_time_serializer.rb:10 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:5 +class ActiveJob::Serializers::DurationSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:12 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:19 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:6 + def serialize(duration); end +end + +# pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:5 +class ActiveJob::Serializers::ModuleSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:11 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:15 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:6 + def serialize(constant); end +end + +# pkg:gem/activejob#lib/active_job/serializers.rb:104 +ActiveJob::Serializers::OBJECT_SERIALIZER_KEY = T.let(T.unsafe(nil), String) + +# Base class for serializing and deserializing custom objects. +# +# Example: +# +# class MoneySerializer < ActiveJob::Serializers::ObjectSerializer +# def serialize(money) +# super("amount" => money.amount, "currency" => money.currency) +# end +# +# def deserialize(hash) +# Money.new(hash["amount"], hash["currency"]) +# end +# +# def klass +# Money +# end +# end +# +# pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:24 +class ActiveJob::Serializers::ObjectSerializer + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:31 + def initialize; end + + # Deserializes an argument from a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:47 + def deserialize(hash); end + + # Serializes an argument to a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:42 + def serialize(hash); end + + # Determines if an argument should be serialized by a serializer. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:37 + def serialize?(argument); end + + class << self + # Deserializes an argument from a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:28 + def deserialize(*, **, &); end + + # Serializes an argument to a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:28 + def serialize(*, **, &); end + + # Determines if an argument should be serialized by a serializer. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:28 + def serialize?(*, **, &); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:25 + def allocate; end + + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:25 + def new(*_arg0); end + end +end + +# pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:5 +class ActiveJob::Serializers::RangeSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:14 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:18 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:6 + def serialize(range); end +end + +# pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:5 +class ActiveJob::Serializers::SymbolSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:10 + def deserialize(argument); end + + # pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:14 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:6 + def serialize(argument); end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_object_serializer.rb:5 +class ActiveJob::Serializers::TimeObjectSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/time_object_serializer.rb:8 + def serialize(time); end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_object_serializer.rb:6 +ActiveJob::Serializers::TimeObjectSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/serializers/time_serializer.rb:5 +class ActiveJob::Serializers::TimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/time_serializer.rb:6 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/time_serializer.rb:10 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:5 +class ActiveJob::Serializers::TimeWithZoneSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:15 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:19 + def klass; end + + # pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:8 + def serialize(time_with_zone); end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:6 +ActiveJob::Serializers::TimeWithZoneSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:6 +class ActiveJob::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:137 + def discard(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:7 + def enqueue(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:56 + def enqueue_all(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:31 + def enqueue_at(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:109 + def enqueue_retry(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:149 + def interrupt(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:87 + def perform(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:73 + def perform_start(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:162 + def resume(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:124 + def retry_stopped(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:197 + def step(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:173 + def step_skipped(event); end + + # pkg:gem/activejob#lib/active_job/structured_event_subscriber.rb:184 + def step_started(event); end +end + +# pkg:gem/activejob#lib/active_job/test_case.rb:6 +class ActiveJob::TestCase < ::ActiveSupport::TestCase + include ::ActiveJob::TestHelper +end + +# Provides helper methods for testing Active Job +# +# pkg:gem/activejob#lib/active_job/test_helper.rb:8 +module ActiveJob::TestHelper + include ::ActiveSupport::Testing::Assertions + + # pkg:gem/activejob#lib/active_job/test_helper.rb:56 + def after_teardown; end + + # Asserts that the number of enqueued jobs matches the given number. + # + # def test_jobs + # assert_enqueued_jobs 0 + # HelloJob.perform_later('david') + # assert_enqueued_jobs 1 + # HelloJob.perform_later('abdelkader') + # assert_enqueued_jobs 2 + # end + # + # If a block is passed, asserts that the block will cause the specified number of + # jobs to be enqueued. + # + # def test_jobs_again + # assert_enqueued_jobs 1 do + # HelloJob.perform_later('cristian') + # end + # + # assert_enqueued_jobs 2 do + # HelloJob.perform_later('aaron') + # HelloJob.perform_later('rafael') + # end + # end + # + # Asserts the number of times a specific job was enqueued by passing +:only+ option. + # + # def test_logging_job + # assert_enqueued_jobs 1, only: LoggingJob do + # LoggingJob.perform_later + # HelloJob.perform_later('jeremy') + # end + # end + # + # Asserts the number of times a job except specific class was enqueued by passing +:except+ option. + # + # def test_logging_job + # assert_enqueued_jobs 1, except: HelloJob do + # LoggingJob.perform_later + # HelloJob.perform_later('jeremy') + # end + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # a hash containing the job's class and it's argument are passed as argument. + # + # Asserts the number of times a job is enqueued to a specific queue by passing +:queue+ option. + # + # def test_logging_job + # assert_enqueued_jobs 2, queue: 'default' do + # LoggingJob.perform_later + # HelloJob.perform_later('elfassy') + # end + # end + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:122 + def assert_enqueued_jobs(number, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the job has been enqueued with the given arguments. + # + # def test_assert_enqueued_with + # MyJob.perform_later(1,2,3) + # assert_enqueued_with(job: MyJob, args: [1,2,3]) + # + # MyJob.set(wait_until: Date.tomorrow.noon, queue: "my_queue").perform_later + # assert_enqueued_with(at: Date.tomorrow.noon, queue: "my_queue") + # end + # + # For keyword arguments, specify them as a hash inside an array: + # + # def test_assert_enqueued_with_keyword_arguments + # MyJob.perform_later(arg1: 'value1', arg2: 'value2') + # assert_enqueued_with(job: MyJob, args: [{ arg1: 'value1', arg2: 'value2' }]) + # end + # + # The given arguments may also be specified as matcher procs that return a + # boolean value indicating whether a job's attribute meets certain criteria. + # + # For example, a proc can be used to match a range of times: + # + # def test_assert_enqueued_with + # at_matcher = ->(job_at) { (Date.yesterday..Date.tomorrow).cover?(job_at) } + # + # MyJob.set(wait_until: Date.today.noon).perform_later + # + # assert_enqueued_with(job: MyJob, at: at_matcher) + # end + # + # A proc can also be used to match a subset of a job's args: + # + # def test_assert_enqueued_with + # args_matcher = ->(job_args) { job_args[0].key?(:foo) } + # + # MyJob.perform_later(foo: "bar", other_arg: "No need to check in the test") + # + # assert_enqueued_with(job: MyJob, args: args_matcher) + # end + # + # If a block is passed, asserts that the block will cause the job to be + # enqueued with the given arguments. + # + # def test_assert_enqueued_with + # assert_enqueued_with(job: MyJob, args: [1,2,3]) do + # MyJob.perform_later(1,2,3) + # end + # + # assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) do + # MyJob.set(wait_until: Date.tomorrow.noon).perform_later + # end + # end + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:406 + def assert_enqueued_with(job: T.unsafe(nil), args: T.unsafe(nil), at: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), &block); end + + # Asserts that no jobs have been enqueued. + # + # def test_jobs + # assert_no_enqueued_jobs + # HelloJob.perform_later('jeremy') + # assert_enqueued_jobs 1 + # end + # + # If a block is passed, asserts that the block will not cause any job to be enqueued. + # + # def test_jobs_again + # assert_no_enqueued_jobs do + # # No job should be enqueued from this block + # end + # end + # + # Asserts that no jobs of a specific kind are enqueued by passing +:only+ option. + # + # def test_no_logging + # assert_no_enqueued_jobs only: LoggingJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # Asserts that no jobs except specific class are enqueued by passing +:except+ option. + # + # def test_no_logging + # assert_no_enqueued_jobs except: HelloJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # a hash containing the job's class and it's argument are passed as argument. + # + # Asserts that no jobs are enqueued to a specific queue by passing +:queue+ option + # + # def test_no_logging + # assert_no_enqueued_jobs queue: 'default' do + # LoggingJob.set(queue: :some_queue).perform_later + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_enqueued_jobs 0, &block + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:186 + def assert_no_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that no jobs have been performed. + # + # def test_jobs + # assert_no_performed_jobs + # + # perform_enqueued_jobs do + # HelloJob.perform_later('matthew') + # assert_performed_jobs 1 + # end + # end + # + # If a block is passed, asserts that the block will not cause any job to be performed. + # + # def test_jobs_again + # assert_no_performed_jobs do + # # No job should be performed from this block + # end + # end + # + # The block form supports filtering. If the +:only+ option is specified, + # then only the listed job(s) will not be performed. + # + # def test_no_logging + # assert_no_performed_jobs only: LoggingJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # Also if the +:except+ option is specified, + # then the job(s) except specific class will not be performed. + # + # def test_no_logging + # assert_no_performed_jobs except: HelloJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # an instance of the job will be passed as argument. + # + # If the +:queue+ option is specified, + # then only the job(s) enqueued to a specific queue will not be performed. + # + # def test_assert_no_performed_jobs_with_queue_option + # assert_no_performed_jobs queue: :some_queue do + # HelloJob.set(queue: :other_queue).perform_later("jeremy") + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_performed_jobs 0, &block + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:348 + def assert_no_performed_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the number of performed jobs matches the given number. + # If no block is passed, perform_enqueued_jobs + # must be called around or after the job call. + # + # def test_jobs + # assert_performed_jobs 0 + # + # perform_enqueued_jobs do + # HelloJob.perform_later('xavier') + # end + # assert_performed_jobs 1 + # + # HelloJob.perform_later('yves') + # + # perform_enqueued_jobs + # + # assert_performed_jobs 2 + # end + # + # If a block is passed, asserts that the block will cause the specified number of + # jobs to be performed. + # + # def test_jobs_again + # assert_performed_jobs 1 do + # HelloJob.perform_later('robin') + # end + # + # assert_performed_jobs 2 do + # HelloJob.perform_later('carlos') + # HelloJob.perform_later('sean') + # end + # end + # + # This method also supports filtering. If the +:only+ option is specified, + # then only the listed job(s) will be performed. + # + # def test_hello_job + # assert_performed_jobs 1, only: HelloJob do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later + # end + # end + # + # Also if the +:except+ option is specified, + # then the job(s) except specific class will be performed. + # + # def test_hello_job + # assert_performed_jobs 1, except: LoggingJob do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later + # end + # end + # + # An array may also be specified, to support testing multiple jobs. + # + # def test_hello_and_logging_jobs + # assert_nothing_raised do + # assert_performed_jobs 2, only: [HelloJob, LoggingJob] do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later('stewie') + # RescueJob.perform_later('david') + # end + # end + # end + # + # A proc may also be specified. When passed a Proc, the job's instance will be passed as argument. + # + # def test_hello_and_logging_jobs + # assert_nothing_raised do + # assert_performed_jobs(1, only: ->(job) { job.is_a?(HelloJob) }) do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later('stewie') + # RescueJob.perform_later('david') + # end + # end + # end + # + # If the +:queue+ option is specified, + # then only the job(s) enqueued to a specific queue will be performed. + # + # def test_assert_performed_jobs_with_queue_option + # assert_performed_jobs 1, queue: :some_queue do + # HelloJob.set(queue: :some_queue).perform_later("jeremy") + # HelloJob.set(queue: :other_queue).perform_later("bogdan") + # end + # end + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:278 + def assert_performed_jobs(number, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the job has been performed with the given arguments. + # + # def test_assert_performed_with + # MyJob.perform_later(1,2,3) + # + # perform_enqueued_jobs + # + # assert_performed_with(job: MyJob, args: [1,2,3]) + # + # MyJob.set(wait_until: Date.tomorrow.noon, queue: "my_queue").perform_later + # + # perform_enqueued_jobs + # + # assert_performed_with(at: Date.tomorrow.noon, queue: "my_queue") + # end + # + # The given arguments may also be specified as matcher procs that return a + # boolean value indicating whether a job's attribute meets certain criteria. + # + # For example, a proc can be used to match a range of times: + # + # def test_assert_performed_with + # at_matcher = ->(job_at) { (Date.yesterday..Date.tomorrow).cover?(job_at) } + # + # MyJob.set(wait_until: Date.today.noon).perform_later + # + # perform_enqueued_jobs + # + # assert_performed_with(job: MyJob, at: at_matcher) + # end + # + # A proc can also be used to match a subset of a job's args: + # + # def test_assert_performed_with + # args_matcher = ->(job_args) { job_args[0].key?(:foo) } + # + # MyJob.perform_later(foo: "bar", other_arg: "No need to check in the test") + # + # perform_enqueued_jobs + # + # assert_performed_with(job: MyJob, args: args_matcher) + # end + # + # If a block is passed, that block performs all of the jobs that were + # enqueued throughout the duration of the block and asserts that + # the job has been performed with the given arguments in the block. + # + # def test_assert_performed_with + # assert_performed_with(job: MyJob, args: [1,2,3]) do + # MyJob.perform_later(1,2,3) + # end + # + # assert_performed_with(job: MyJob, at: Date.tomorrow.noon) do + # MyJob.set(wait_until: Date.tomorrow.noon).perform_later + # end + # end + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:510 + def assert_performed_with(job: T.unsafe(nil), args: T.unsafe(nil), at: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:41 + def before_setup; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:9 + def enqueued_jobs(*, **, &); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:9 + def enqueued_jobs=(arg); end + + # Performs all enqueued jobs. If a block is given, performs all of the jobs + # that were enqueued throughout the duration of the block. If a block is + # not given, performs all of the enqueued jobs up to this point in the test. + # + # def test_perform_enqueued_jobs + # perform_enqueued_jobs do + # MyJob.perform_later(1, 2, 3) + # end + # assert_performed_jobs 1 + # end + # + # def test_perform_enqueued_jobs_without_block + # MyJob.perform_later(1, 2, 3) + # + # perform_enqueued_jobs + # + # assert_performed_jobs 1 + # end + # + # This method also supports filtering. If the +:only+ option is specified, + # then only the listed job(s) will be performed. + # + # def test_perform_enqueued_jobs_with_only + # perform_enqueued_jobs(only: MyJob) do + # MyJob.perform_later(1, 2, 3) # will be performed + # HelloJob.perform_later(1, 2, 3) # will not be performed + # end + # assert_performed_jobs 1 + # end + # + # Also if the +:except+ option is specified, + # then the job(s) except specific class will be performed. + # + # def test_perform_enqueued_jobs_with_except + # perform_enqueued_jobs(except: HelloJob) do + # MyJob.perform_later(1, 2, 3) # will be performed + # HelloJob.perform_later(1, 2, 3) # will not be performed + # end + # assert_performed_jobs 1 + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # an instance of the job will be passed as argument. + # + # If the +:queue+ option is specified, + # then only the job(s) enqueued to a specific queue will be performed. + # + # def test_perform_enqueued_jobs_with_queue + # perform_enqueued_jobs queue: :some_queue do + # MyJob.set(queue: :some_queue).perform_later(1, 2, 3) # will be performed + # HelloJob.set(queue: :other_queue).perform_later(1, 2, 3) # will not be performed + # end + # assert_performed_jobs 1 + # end + # + # If the +:at+ option is specified, then only jobs that have been enqueued + # to run at or before the given time will be performed. This includes jobs + # that have been enqueued without a time. + # + # If queue_adapter_for_test is overridden to return a different adapter, + # +perform_enqueued_jobs+ will merely execute the block. + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:620 + def perform_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:9 + def performed_jobs(*, **, &); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:9 + def performed_jobs=(arg); end + + # Accesses the queue_adapter set by ActiveJob::Base. + # + # def test_assert_job_has_custom_queue_adapter_set + # assert_instance_of CustomQueueAdapter, HelloJob.queue_adapter + # end + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:661 + def queue_adapter; end + + # Returns a queue adapter instance to use with all Active Job test helpers. + # By default, returns an instance of ActiveJob::QueueAdapters::TestAdapter. + # Override this method to specify a different adapter. The adapter must + # implement the same interface as ActiveJob::QueueAdapters::TestAdapter. + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:66 + def queue_adapter_for_test; end + + private + + # pkg:gem/activejob#lib/active_job/test_helper.rb:676 + def clear_enqueued_jobs; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:680 + def clear_performed_jobs; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:745 + def deserialize_args_for_assertion(job); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:716 + def enqueued_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:710 + def filter_as_proc(filter); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:724 + def flush_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:752 + def instantiate_job(payload, skip_deserialize_arguments: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:684 + def jobs_with(jobs, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:720 + def performed_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:732 + def prepare_args_for_assertion(args); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:759 + def queue_adapter_changed_jobs; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:666 + def require_active_job_test_adapter!(method); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:672 + def using_test_adapter?; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:766 + def validate_option(only: T.unsafe(nil), except: T.unsafe(nil)); end +end + +# pkg:gem/activejob#lib/active_job/test_helper.rb:15 +module ActiveJob::TestHelper::TestQueueAdapter + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + + module GeneratedClassMethods + def _test_adapter; end + def _test_adapter=(value); end + end + + module GeneratedInstanceMethods; end +end + +# pkg:gem/activejob#lib/active_job/test_helper.rb:22 +module ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + # pkg:gem/activejob#lib/active_job/test_helper.rb:27 + def disable_test_adapter; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:31 + def enable_test_adapter(test_adapter); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:23 + def queue_adapter; end +end + +# Raised during job payload deserialization when it references an uninitialized job class. +# +# pkg:gem/activejob#lib/active_job/core.rb:5 +class ActiveJob::UnknownJobClassError < ::NameError + # pkg:gem/activejob#lib/active_job/core.rb:6 + def initialize(job_class_name); end +end + +# pkg:gem/activejob#lib/active_job/gem_version.rb:9 +module ActiveJob::VERSION; end + +# pkg:gem/activejob#lib/active_job/gem_version.rb:10 +ActiveJob::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:11 +ActiveJob::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:13 +ActiveJob::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:15 +ActiveJob::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:12 +ActiveJob::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/activesupport@8.1.4.rbi b/sorbet/rbi/gems/activesupport@8.1.4.rbi new file mode 100644 index 0000000..c228df5 --- /dev/null +++ b/sorbet/rbi/gems/activesupport@8.1.4.rbi @@ -0,0 +1,20105 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activesupport` gem. +# Please instead update this file by running `bin/tapioca gem activesupport`. + + +# :include: ../README.rdoc +# -- +# The JSON gem adds a few modules to Ruby core classes containing :to_json definition, overwriting +# their default behavior. That said, we need to define the basic to_json method in all of them, +# otherwise they will always use to_json gem implementation, which is backwards incompatible in +# several cases (for instance, the JSON implementation for Hash does not work) with inheritance. +# +# On the other hand, we should avoid conflict with ::JSON.{generate,dump}(obj). Unfortunately, the +# JSON gem's encoder relies on its own to_json implementation to encode objects. Since it always +# passes a ::JSON::State object as the only argument to to_json, we can detect that and forward the +# calls to the original to_json method. +# +# It should be noted that when using ::JSON.{generate,dump} directly, ActiveSupport's encoder is +# bypassed completely. This means that as_json won't be invoked and the JSON gem will simply +# ignore any options it does not natively understand. This also means that ::JSON.{generate,dump} +# should give exactly the same results with or without Active Support. +# :markup: markdown +# -- +# Defines the standard inflection rules. These are the starting point for +# new projects and are not considered complete. The current set of inflection +# rules is frozen. This means, we do not change them to become more complete. +# This is a safety measure to keep existing applications from breaking. +# ++ +# +# pkg:gem/activesupport#lib/active_support/delegation.rb:3 +module ActiveSupport + extend ::ActiveSupport::LazyLoadHooks + extend ::ActiveSupport::Autoload + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters; end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases; end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases=(val); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times; end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order; end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold; end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold=(val); end + + class << self + # pkg:gem/activesupport#lib/active_support.rb:116 + def cache_format_version; end + + # pkg:gem/activesupport#lib/active_support.rb:120 + def cache_format_version=(value); end + + # pkg:gem/activesupport#lib/active_support/deprecator.rb:4 + def deprecator; end + + # pkg:gem/activesupport#lib/active_support.rb:98 + def eager_load!; end + + # pkg:gem/activesupport#lib/active_support.rb:109 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support.rb:109 + def error_reporter=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_html_entities_in_json(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_html_entities_in_json=(arg); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_js_separators_in_json(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_js_separators_in_json=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def event_reporter; end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def event_reporter=(_arg0); end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters; end + + # pkg:gem/activesupport#lib/active_support.rb:114 + def filter_parameters=(val); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # pkg:gem/activesupport#lib/active_support/gem_version.rb:5 + def gem_version; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def json_encoder(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def json_encoder=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases; end + + # pkg:gem/activesupport#lib/active_support.rb:106 + def parallelize_test_databases=(val); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times; end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order; end + + # pkg:gem/activesupport#lib/active_support.rb:104 + def test_order=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold; end + + # pkg:gem/activesupport#lib/active_support.rb:105 + def test_parallelization_threshold=(val); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def time_precision(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def time_precision=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:124 + def to_time_preserves_timezone; end + + # pkg:gem/activesupport#lib/active_support.rb:131 + def to_time_preserves_timezone=(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def use_standard_json_time_format(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def use_standard_json_time_format=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:139 + def utc_to_local_returns_utc_offset_times; end + + # pkg:gem/activesupport#lib/active_support.rb:143 + def utc_to_local_returns_utc_offset_times=(value); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # pkg:gem/activesupport#lib/active_support/version.rb:7 + def version; end + end +end + +# = Actionable Errors +# +# Actionable errors lets you define actions to resolve an error. +# +# To make an error actionable, include the +ActiveSupport::ActionableError+ +# module and invoke the +action+ class macro to define the action. An action +# needs a name and a block to execute. +# +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:11 +module ActiveSupport::ActionableError + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::ActionableError::ClassMethods + + class << self + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:20 + def actions(error); end + + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:29 + def dispatch(error, name); end + end + + module GeneratedClassMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end + + module GeneratedInstanceMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end +end + +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:35 +module ActiveSupport::ActionableError::ClassMethods + # Defines an action that can resolve the error. + # + # class PendingMigrationError < MigrationError + # include ActiveSupport::ActionableError + # + # action "Run pending migrations" do + # ActiveRecord::Tasks::DatabaseTasks.migrate + # end + # end + # + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:45 + def action(name, &block); end +end + +# pkg:gem/activesupport#lib/active_support/actionable_error.rb:14 +class ActiveSupport::ActionableError::NonActionable < ::StandardError; end + +# = \Array Inquirer +# +# Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check +# its string-like contents: +# +# variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet]) +# +# variants.phone? # => true +# variants.tablet? # => true +# variants.desktop? # => false +# +# pkg:gem/activesupport#lib/active_support/array_inquirer.rb:14 +class ActiveSupport::ArrayInquirer < ::Array + # Passes each element of +candidates+ collection to ArrayInquirer collection. + # The method returns true if any element from the ArrayInquirer collection + # is equal to the stringified or symbolized form of any element in the +candidates+ collection. + # + # If +candidates+ collection is not given, method returns true. + # + # variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet]) + # + # variants.any? # => true + # variants.any?(:phone, :tablet) # => true + # variants.any?('phone', 'desktop') # => true + # variants.any?(:desktop, :watch) # => false + # + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:27 + def any?(*candidates); end + + private + + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:42 + def method_missing(name, *, **, &); end + + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:38 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# = Active Support \Autoload +# +# Autoload and eager load conveniences for your library. +# +# This module allows you to define autoloads based on +# \Rails conventions (i.e. no need to define the path +# it is automatically guessed based on the filename) +# and also define a set of constants that needs to be +# eager loaded: +# +# module MyLib +# extend ActiveSupport::Autoload +# +# autoload :Model +# +# eager_autoload do +# autoload :Cache +# end +# end +# +# Then your library can be eager loaded by simply calling: +# +# MyLib.eager_load! +# +# pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:29 +module ActiveSupport::Autoload + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:30 + def autoload(const_name, path = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:51 + def autoload_at(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:44 + def autoload_under(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:58 + def eager_autoload; end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:65 + def eager_load!; end +end + +# = Backtrace Cleaner +# +# Backtraces often include many lines that are not relevant for the context +# under review. This makes it hard to find the signal amongst the backtrace +# noise, and adds debugging time. With a BacktraceCleaner, filters and +# silencers are used to remove the noisy lines, so that only the most relevant +# lines remain. +# +# Filters are used to modify lines of data, while silencers are used to remove +# lines entirely. The typical filter use case is to remove lengthy path +# information from the start of each line, and view file paths relevant to the +# app directory instead of the file system root. The typical silencer use case +# is to exclude the output of a noisy library from the backtrace, so that you +# can focus on the rest. +# +# bc = ActiveSupport::BacktraceCleaner.new +# root = "#{Rails.root}/" +# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix +# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems +# bc.clean(exception.backtrace) # perform the cleanup +# +# To reconfigure an existing BacktraceCleaner (like the default one in \Rails) +# and show as much data as possible, you can always call +# BacktraceCleaner#remove_silencers!, which will restore the +# backtrace to a pristine state. If you need to reconfigure an existing +# BacktraceCleaner so that it does not filter or modify the paths of any lines +# of the backtrace, you can call BacktraceCleaner#remove_filters! +# These two methods will give you a completely untouched backtrace. +# +# Inspired by the Quiet Backtrace gem by thoughtbot. +# +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:34 +class ActiveSupport::BacktraceCleaner + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:35 + def initialize; end + + # Adds a filter from the block provided. Each line in the backtrace will be + # mapped against this filter. + # + # # Will turn "/my/rails/root/app/models/person.rb" into "app/models/person.rb" + # root = "#{Rails.root}/" + # backtrace_cleaner.add_filter { |line| line.delete_prefix(root) } + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:154 + def add_filter(&block); end + + # Adds a silencer from the block provided. If the silencer returns +true+ + # for a given line, it will be excluded from the clean backtrace. + # + # # Will reject all lines that include the word "puma", like "/gems/puma/server.rb" or "/app/my_puma_server/rb" + # backtrace_cleaner.add_silencer { |line| /puma/.match?(line) } + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:163 + def add_silencer(&block); end + + # Returns the backtrace after all filters and silencers have been run + # against it. Filters run first, then silencers. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:45 + def clean(backtrace, kind = T.unsafe(nil)); end + + # Returns the frame with all filters applied. + # returns +nil+ if the frame was silenced. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:73 + def clean_frame(frame, kind = T.unsafe(nil)); end + + # Given an array of Thread::Backtrace::Location objects, returns an array + # with the clean ones: + # + # clean_locations = backtrace_cleaner.clean_locations(caller_locations) + # + # Filters and silencers receive strings as usual. However, the +path+ + # attributes of the locations in the returned array are the original, + # unfiltered ones, since locations are immutable. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:67 + def clean_locations(locations, kind = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:57 + def filter(backtrace, kind = T.unsafe(nil)); end + + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:129 + def first_clean_frame(kind = T.unsafe(nil)); end + + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:141 + def first_clean_location(kind = T.unsafe(nil)); end + + # Removes all filters, but leaves in the silencers. Useful if you suddenly + # need to see entire filepaths in the backtrace that you had already + # filtered out. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:177 + def remove_filters!; end + + # Removes all silencers, but leaves in the filters. Useful if your + # context of debugging suddenly expands as you suspect a bug in one of + # the libraries you use. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:170 + def remove_silencers!; end + + private + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:198 + def add_core_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:189 + def add_gem_filter; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:202 + def add_gem_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:206 + def add_stdlib_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:210 + def filter_backtrace(backtrace); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:184 + def initialize_copy(_other); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:226 + def noise(backtrace); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:218 + def silence(backtrace); end +end + +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:182 +ActiveSupport::BacktraceCleaner::FORMATTED_GEMS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/benchmark.rb:4 +module ActiveSupport::Benchmark + class << self + # Benchmark realtime in the specified time unit. By default, + # the returned unit is in seconds. + # + # ActiveSupport::Benchmark.realtime { sleep 0.1 } + # # => 0.10007 + # + # ActiveSupport::Benchmark.realtime(:float_millisecond) { sleep 0.1 } + # # => 100.07 + # + # `unit` can be any of the values accepted by Ruby's `Process.clock_gettime`. + # + # pkg:gem/activesupport#lib/active_support/benchmark.rb:15 + def realtime(unit = T.unsafe(nil), &block); end + end +end + +# = \Benchmarkable +# +# pkg:gem/activesupport#lib/active_support/benchmarkable.rb:7 +module ActiveSupport::Benchmarkable + # Allows you to measure the execution time of a block in a template and + # records the result to the log. Wrap this block around expensive operations + # or possible bottlenecks to get a time reading for the operation. For + # example, let's say you thought your file processing method was taking too + # long; you could wrap it in a benchmark block. + # + # <% benchmark 'Process data files' do %> + # <%= expensive_files_operation %> + # <% end %> + # + # That would add something like "Process data files (345.2ms)" to the log, + # which you can then use to compare timings when optimizing your code. + # + # You may give an optional logger level (:debug, :info, + # :warn, :error) as the :level option. The + # default logger level value is :info. + # + # <% benchmark 'Low-level files', level: :debug do %> + # <%= lowlevel_files_operation %> + # <% end %> + # + # Finally, you can pass true as the third argument to silence all log + # activity (other than the timing information) from inside the block. This + # is great for boiling down a noisy block to just a single statement that + # produces one log line: + # + # <% benchmark 'Process data files', level: :info, silence: true do %> + # <%= expensive_and_chatty_files_operation %> + # <% end %> + # + # pkg:gem/activesupport#lib/active_support/benchmarkable.rb:37 + def benchmark(message = T.unsafe(nil), options = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:7 +module ActiveSupport::BigDecimalWithDefaultFormat + # pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:8 + def to_s(format = T.unsafe(nil)); end +end + +# = Active Support Broadcast Logger +# +# The Broadcast logger is a logger used to write messages to multiple IO. It is commonly used +# in development to display messages on STDOUT and also write them to a file (development.log). +# With the Broadcast logger, you can broadcast your logs to a unlimited number of sinks. +# +# The BroadcastLogger acts as a standard logger and all methods you are used to are available. +# However, all the methods on this logger will propagate and be delegated to the other loggers +# that are part of the broadcast. +# +# Broadcasting your logs. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Add a logger to the broadcast. +# +# stdout_logger = Logger.new(STDOUT) +# broadcast = BroadcastLogger.new(stdout_logger) +# file_logger = Logger.new("development.log") +# broadcast.broadcast_to(file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Modifying the log level for all broadcasted loggers. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.level = Logger::FATAL # Modify the log level for the whole broadcast. +# +# Stop broadcasting log to a sink. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# broadcast.stop_broadcasting_to(file_logger) +# broadcast.info("Hello world!") # Writes the log *only* to STDOUT. +# +# At least one sink has to be part of the broadcast. Otherwise, your logs will not +# be written anywhere. For instance: +# +# broadcast = BroadcastLogger.new +# broadcast.info("Hello world") # The log message will appear nowhere. +# +# If you are adding a custom logger with custom methods to the broadcast, +# the `BroadcastLogger` will proxy them and return the raw value, or an array +# of raw values, depending on how many loggers in the broadcasts responded to +# the method: +# +# class MyLogger < ::Logger +# def loggable? +# true +# end +# end +# +# logger = BroadcastLogger.new +# logger.loggable? # => A NoMethodError exception is raised because no loggers in the broadcasts could respond. +# +# logger.broadcast_to(MyLogger.new(STDOUT)) +# logger.loggable? # => true +# logger.broadcast_to(MyLogger.new(STDOUT)) +# puts logger.broadcasts # => [MyLogger, MyLogger] +# logger.loggable? # [true, true] +# +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:74 +class ActiveSupport::BroadcastLogger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:81 + def initialize(*loggers); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def <<(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def add(*, **, &); end + + # Add logger(s) to the broadcast. + # + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:92 + def broadcast_to(*loggers); end + + # Returns all the logger that are part of this broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:78 + def broadcasts; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def close(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def debug(*, **, &); end + + # Sets the log level to +Logger::DEBUG+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:146 + def debug!; end + + # True if the log level allows entries with severity +Logger::DEBUG+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:141 + def debug?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def error(*, **, &); end + + # Sets the log level to +Logger::ERROR+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:179 + def error!; end + + # True if the log level allows entries with severity +Logger::ERROR+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:174 + def error?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def fatal(*, **, &); end + + # Sets the log level to +Logger::FATAL+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:190 + def fatal!; end + + # True if the log level allows entries with severity +Logger::FATAL+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:185 + def fatal?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def formatter(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def formatter=(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def info(*, **, &); end + + # Sets the log level to +Logger::INFO+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:157 + def info!; end + + # True if the log level allows entries with severity +Logger::INFO+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:152 + def info?; end + + # Returns the lowest level of all the loggers in the broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:135 + def level; end + + # Returns the lowest level of all the loggers in the broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def level=(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:113 + def local_level; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:107 + def local_level=(level); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def log(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 + def progname; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 + def progname=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def sev_threshold=(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer=(val); end + + # Remove a logger from the broadcast. When a logger is removed, messages sent to + # the broadcast will no longer be written to its sink. + # + # sink = Logger.new(STDOUT) + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # + # broadcast_logger.stop_broadcasting_to(sink) + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:103 + def stop_broadcasting_to(logger); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def unknown(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def warn(*, **, &); end + + # Sets the log level to +Logger::WARN+ for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:168 + def warn!; end + + # True if the log level allows entries with severity +Logger::WARN+ to be written + # to at least one broadcast. False otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:163 + def warn?; end + + private + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:202 + def dispatch(method, *args, **kwargs, &block); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:194 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:222 + def method_missing(name, *, **, &); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:234 + def respond_to_missing?(method, include_all); end + + class << self + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:121 +ActiveSupport::BroadcastLogger::LOGGER_METHODS = T.let(T.unsafe(nil), Array) + +# See ActiveSupport::Cache::Store for documentation. +# +# pkg:gem/activesupport#lib/active_support/cache/entry.rb:6 +module ActiveSupport::Cache + class << self + # Expands out the +key+ argument into a key that can be used for the + # cache store. Optionally accepts a namespace, and all keys will be + # scoped within that namespace. + # + # If the +key+ argument provided is an array, or responds to +to_a+, then + # each of elements in the array will be turned into parameters/keys and + # concatenated into a single key. For example: + # + # ActiveSupport::Cache.expand_cache_key([:foo, :bar]) # => "foo/bar" + # ActiveSupport::Cache.expand_cache_key([:foo, :bar], "namespace") # => "namespace/foo/bar" + # + # The +key+ argument can also respond to +cache_key+ or +to_param+. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:113 + def expand_cache_key(key, namespace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:60 + def format_version; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:60 + def format_version=(_arg0); end + + # Creates a new Store object according to the given options. + # + # If no arguments are passed to this method, then a new + # ActiveSupport::Cache::MemoryStore object will be returned. + # + # If you pass a Symbol as the first argument, then a corresponding cache + # store class under the ActiveSupport::Cache namespace will be created. + # For example: + # + # ActiveSupport::Cache.lookup_store(:memory_store) + # # => returns a new ActiveSupport::Cache::MemoryStore object + # + # ActiveSupport::Cache.lookup_store(:mem_cache_store) + # # => returns a new ActiveSupport::Cache::MemCacheStore object + # + # Any additional arguments will be passed to the corresponding cache store + # class's constructor: + # + # ActiveSupport::Cache.lookup_store(:file_store, '/tmp/cache') + # # => same as: ActiveSupport::Cache::FileStore.new('/tmp/cache') + # + # If the first argument is not a Symbol, then it will simply be returned: + # + # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new) + # # => returns MyOwnCacheStore.new + # + # pkg:gem/activesupport#lib/active_support/cache.rb:87 + def lookup_store(store = T.unsafe(nil), *parameters); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:125 + def retrieve_cache_key(key); end + + # Obtains the specified cache store class, given the name of the +store+. + # Raises an error when the store class cannot be found. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:137 + def retrieve_store_class(store); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:7 +class ActiveSupport::Cache::Coder + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:8 + def initialize(serializer, compressor, legacy_serializer: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:14 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:20 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:48 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:136 + def dump_version(version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:144 + def load_version(dumped_version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:121 + def signature?(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:129 + def try_compress(string, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:125 + def type_for_string(value); end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:76 +ActiveSupport::Cache::Coder::COMPRESSED_FLAG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:98 +class ActiveSupport::Cache::Coder::LazyEntry < ::ActiveSupport::Cache::Entry + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:99 + def initialize(serializer, compressor, payload, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:114 + def mismatched?(version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:106 + def value; end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:84 +ActiveSupport::Cache::Coder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:68 +ActiveSupport::Cache::Coder::OBJECT_DUMP_TYPE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:80 +ActiveSupport::Cache::Coder::PACKED_EXPIRES_AT_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:78 +ActiveSupport::Cache::Coder::PACKED_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:79 +ActiveSupport::Cache::Coder::PACKED_TYPE_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:82 +ActiveSupport::Cache::Coder::PACKED_VERSION_INDEX = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:81 +ActiveSupport::Cache::Coder::PACKED_VERSION_LENGTH_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:66 +ActiveSupport::Cache::Coder::SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:96 +ActiveSupport::Cache::Coder::STRING_DESERIALIZERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:70 +ActiveSupport::Cache::Coder::STRING_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:86 +class ActiveSupport::Cache::Coder::StringDeserializer + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:87 + def initialize(encoding); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:91 + def load(payload); end +end + +# pkg:gem/activesupport#lib/active_support/cache.rb:47 +ActiveSupport::Cache::DEFAULT_COMPRESS_LIMIT = T.let(T.unsafe(nil), Integer) + +# Raised by coders when the cache entry can't be deserialized. +# This error is treated as a cache miss. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:51 +class ActiveSupport::Cache::DeserializationError < ::StandardError; end + +# This class is used to represent cache entries. Cache entries have a value, an optional +# expiration time, and an optional version. The expiration time is used to support the :race_condition_ttl option +# on the cache. The version is used to support the :version option on the cache for rejecting +# mismatches. +# +# Since cache entries in most instances will be serialized, the internals of this class are highly optimized +# using short instance variable names that are lazily defined. +# +# pkg:gem/activesupport#lib/active_support/cache/entry.rb:14 +class ActiveSupport::Cache::Entry + # Creates a new cache entry for the specified value. Options supported are + # +:compressed+, +:version+, +:expires_at+ and +:expires_in+. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:25 + def initialize(value, compressed: T.unsafe(nil), version: T.unsafe(nil), expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), **); end + + # Returns the size of the cached value. This could be less than + # value.bytesize if the data is compressed. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:61 + def bytesize; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:76 + def compressed(compress_threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:72 + def compressed?; end + + # Duplicates the value in a class. This is used by cache implementations that don't natively + # serialize entries to protect against accidental cache modifications. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:106 + def dup_value!; end + + # Checks if the entry is expired. The +expires_in+ parameter can override + # the value set when the entry was created. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:43 + def expired?; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:47 + def expires_at; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:51 + def expires_at=(value); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:100 + def local?; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:37 + def mismatched?(version); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:116 + def pack; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:33 + def value; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:21 + def version; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:127 + def marshal_load(payload); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:123 + def uncompress(value); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:16 + def unpack(members); end + end +end + +# = \File \Cache \Store +# +# A cache store implementation which stores everything on the filesystem. +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:13 +class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:21 + def initialize(cache_path, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:14 + def cache_path; end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:41 + def cleanup(options = T.unsafe(nil)); end + + # Deletes all items from the cache. In this case it deletes all the entries in the specified + # file store directory except for .keep or .gitkeep. Be careful which directory is specified in your + # config file when using +FileStore+ because everything in that directory will be deleted. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:34 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value. Returns the updated value. + # + # If the key is unset, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:81 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:90 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value. Returns the updated value. + # + # If the key is unset, it starts from +0+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:61 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:102 + def inspect; end + + private + + # Delete empty directories in the cache. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:196 + def delete_empty_directories(dir); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:132 + def delete_entry(key, **options); end + + # Make sure a file path's directories exist. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:205 + def ensure_cache_path(path); end + + # Translate a file path into a key. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:190 + def file_path_key(path); end + + # Lock a file for a block so only one process can modify it at a time. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:149 + def lock_file(file_name, &block); end + + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:223 + def modify_value(name, amount, options); end + + # Translate a key into a file path. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:163 + def normalize_key(key, options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:107 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:114 + def read_serialized_entry(key, **); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:209 + def search_dir(dir, &callback); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:121 + def write_entry(key, entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:125 + def write_serialized_entry(key, payload, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:27 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:16 +ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:17 +ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:18 +ActiveSupport::Cache::FileStore::FILEPATH_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max is 1024, plus some room +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:19 +ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) + +# = Memory \Cache \Store +# +# A cache store implementation which stores everything into memory in the +# same process. If you're running multiple Ruby on \Rails server processes +# (which is the case if you're using Phusion Passenger or puma clustered mode), +# then this means that \Rails server process instances won't be able +# to share cache data with each other and this may not be the most +# appropriate cache in that scenario. +# +# This cache has a bounded size specified by the +:size+ options to the +# initializer (default is 32Mb). When the cache exceeds the allotted size, +# a cleanup will occur which tries to prune the cache down to three quarters +# of the maximum size by removing the least recently used entries. +# +# Unlike other Cache store implementations, +MemoryStore+ does not compress +# values by default. +MemoryStore+ does not benefit from compression as much +# as other Store implementations, as it does not send data over a network. +# However, when compression is enabled, it still pays the full cost of +# compression in terms of cpu use. +# +# +MemoryStore+ is thread-safe. +# +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:28 +class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:75 + def initialize(options = T.unsafe(nil)); end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:103 + def cleanup(options = T.unsafe(nil)); end + + # Delete all data stored in a given cache store. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:95 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value. Returns the updated value. + # + # If the key is unset or has expired, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:168 + def decrement(name, amount = T.unsafe(nil), **options); end + + # Deletes cache entries if the cache key matches a given pattern. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:175 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value. Returns the updated value. + # + # If the key is unset, it will be set to +amount+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:151 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:187 + def inspect; end + + # To ensure entries fit within the specified memory prune the cache by removing the least + # recently accessed entries. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:116 + def prune(target_size, max_time = T.unsafe(nil)); end + + # Returns true if the cache is currently being pruned. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:135 + def pruning?; end + + # Synchronize calls to the cache. This should be called wherever the underlying cache implementation + # is not thread safe. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:193 + def synchronize(&block); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:200 + def cached_size(key, payload); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:233 + def delete_entry(key, **); end + + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:243 + def modify_value(name, amount, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:204 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:216 + def write_entry(key, entry, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:90 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:31 +module ActiveSupport::Cache::MemoryStore::DupCoder + extend ::ActiveSupport::Cache::MemoryStore::DupCoder + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:34 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:42 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:47 + def load(entry); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:58 + def dump_value(value); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:66 + def load_value(string); end +end + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:56 +ActiveSupport::Cache::MemoryStore::DupCoder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:198 +ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Integer) + +# = Null \Cache \Store +# +# A cache store implementation which doesn't actually store anything. Useful in +# development and test environments where you don't want caching turned on but +# need to go through the caching interface. +# +# This cache does implement the local cache strategy, so values will actually +# be cached inside blocks that utilize this strategy. See +# ActiveSupport::Cache::Strategy::LocalCache for more details. +# +# pkg:gem/activesupport#lib/active_support/cache/null_store.rb:14 +class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:25 + def cleanup(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:22 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:31 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:34 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:28 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:37 + def inspect; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:57 + def delete_entry(key, **); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:42 + def read_entry(key, **s); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:46 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:49 + def write_entry(key, entry, **); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:53 + def write_serialized_entry(key, payload, **); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:18 + def supports_cache_versioning?; end + end +end + +# Mapping of canonical option names to aliases that a store will recognize. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:43 +ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:8 +module ActiveSupport::Cache::SerializerWithFallback + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:17 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:39 + def marshal_load(payload); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:9 + def [](format); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:66 +module ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:88 + def _load(marked); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:73 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:77 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:94 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:71 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_COMPRESSED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:70 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_UNCOMPRESSED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:99 +module ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:109 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:105 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:113 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:103 +ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:118 +module ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:126 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:122 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:130 + def dumped?(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:135 + def available?; end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:45 +module ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:57 + def _load(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:49 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:53 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:61 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:144 +ActiveSupport::Cache::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# = Active Support \Cache \Store +# +# An abstract cache store class. There are multiple cache store +# implementations, each having its own additional features. See the classes +# under the ActiveSupport::Cache module, e.g. +# ActiveSupport::Cache::MemCacheStore. MemCacheStore is currently the most +# popular cache store for large production websites. +# +# Some implementations may not support all methods beyond the basic cache +# methods of #fetch, #write, #read, #exist?, and #delete. +# +# +ActiveSupport::Cache::Store+ can store any Ruby object that is supported +# by its +coder+'s +dump+ and +load+ methods. +# +# cache = ActiveSupport::Cache::MemoryStore.new +# +# cache.read('city') # => nil +# cache.write('city', "Duckburgh") # => true +# cache.read('city') # => "Duckburgh" +# +# cache.write('not serializable', Proc.new {}) # => TypeError +# +# Keys are always translated into Strings and are case sensitive. When an +# object is specified as a key and has a +cache_key+ method defined, this +# method will be called to define the key. Otherwise, the +to_param+ +# method will be called. Hashes and Arrays can also be used as keys. The +# elements will be delimited by slashes, and the elements within a Hash +# will be sorted by key so they are consistent. +# +# cache.read('city') == cache.read(:city) # => true +# +# Nil values can be cached. +# +# If your cache is on a shared infrastructure, you can define a namespace +# for your cache entries. If a namespace is defined, it will be prefixed on +# to every key. The namespace can be either a static value or a Proc. If it +# is a Proc, it will be invoked when each key is evaluated so that you can +# use application logic to invalidate keys. +# +# cache.namespace = -> { @last_mod_time } # Set the namespace to a variable +# @last_mod_time = Time.now # Invalidate the entire cache by changing namespace +# +# pkg:gem/activesupport#lib/active_support/cache.rb:190 +class ActiveSupport::Cache::Store + # Creates a new cache. + # + # ==== Options + # + # [+:namespace+] + # Sets the namespace for the cache. This option is especially useful if + # your application shares a cache with other applications. + # + # [+:serializer+] + # The serializer for cached values. Must respond to +dump+ and +load+. + # + # The default serializer depends on the cache format version (set via + # +config.active_support.cache_format_version+ when using Rails). The + # default serializer for each format version includes a fallback + # mechanism to deserialize values from any format version. This behavior + # makes it easy to migrate between format versions without invalidating + # the entire cache. + # + # You can also specify serializer: :message_pack to use a + # preconfigured serializer based on ActiveSupport::MessagePack. The + # +:message_pack+ serializer includes the same deserialization fallback + # mechanism, allowing easy migration from (or to) the default + # serializer. The +:message_pack+ serializer may improve performance, + # but it requires the +msgpack+ gem. + # + # [+:compressor+] + # The compressor for serialized cache values. Must respond to +deflate+ + # and +inflate+. + # + # The default compressor is +Zlib+. To define a new custom compressor + # that also decompresses old cache entries, you can check compressed + # values for Zlib's "\x78" signature: + # + # module MyCompressor + # def self.deflate(dumped) + # # compression logic... (make sure result does not start with "\x78"!) + # end + # + # def self.inflate(compressed) + # if compressed.start_with?("\x78") + # Zlib.inflate(compressed) + # else + # # decompression logic... + # end + # end + # end + # + # ActiveSupport::Cache.lookup_store(:redis_cache_store, compressor: MyCompressor) + # + # [+:coder+] + # The coder for serializing and (optionally) compressing cache entries. + # Must respond to +dump+ and +load+. + # + # The default coder composes the serializer and compressor, and includes + # some performance optimizations. If you only need to override the + # serializer or compressor, you should specify the +:serializer+ or + # +:compressor+ options instead. + # + # If the store can handle cache entries directly, you may also specify + # coder: nil to omit the serializer, compressor, and coder. For + # example, if you are using ActiveSupport::Cache::MemoryStore and can + # guarantee that cache values will not be mutated, you can specify + # coder: nil to avoid the overhead of safeguarding against + # mutation. + # + # The +:coder+ option is mutually exclusive with the +:serializer+ and + # +:compressor+ options. Specifying them together will raise an + # +ArgumentError+. + # + # Any other specified options are treated as default options for the + # relevant cache operations, such as #read, #write, and #fetch. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:300 + def initialize(options = T.unsafe(nil)); end + + # Cleans up the cache by removing expired entries. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:785 + def cleanup(options = T.unsafe(nil)); end + + # Clears the entire cache. Be careful with this method since it could + # affect other processes if shared cache is being used. + # + # The options hash is passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:795 + def clear(options = T.unsafe(nil)); end + + # Decrements an integer value in the cache. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:750 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # Deletes an entry in the cache. Returns +true+ if an entry is deleted + # and +false+ otherwise. + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:686 + def delete(name, options = T.unsafe(nil)); end + + # Deletes all entries with keys matching the pattern. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:732 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Deletes multiple entries in the cache. Returns the number of deleted + # entries. + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:699 + def delete_multi(names, options = T.unsafe(nil)); end + + # Returns +true+ if the cache contains an entry for the given key. + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:713 + def exist?(name, options = T.unsafe(nil)); end + + # Fetches data from the cache, using the given key. If there is data in + # the cache with the given key, then that data is returned. + # + # If there is no such data in the cache (a cache miss), then +nil+ will be + # returned. However, if a block has been passed, that block will be passed + # the key and executed in the event of a cache miss. The return value of the + # block will be written to the cache under the given cache key, and that + # return value will be returned. + # + # cache.write('today', 'Monday') + # cache.fetch('today') # => "Monday" + # + # cache.fetch('city') # => nil + # cache.fetch('city') do + # 'Duckburgh' + # end + # cache.fetch('city') # => "Duckburgh" + # + # ==== Options + # + # Internally, +fetch+ calls +read_entry+, and calls +write_entry+ on a + # cache miss. Thus, +fetch+ supports the same options as #read and #write. + # Additionally, +fetch+ supports the following options: + # + # * force: true - Forces a cache "miss," meaning we treat the + # cache value as missing even if it's present. Passing a block is + # required when +force+ is true so this always results in a cache write. + # + # cache.write('today', 'Monday') + # cache.fetch('today', force: true) { 'Tuesday' } # => 'Tuesday' + # cache.fetch('today', force: true) # => ArgumentError + # + # The +:force+ option is useful when you're calling some other method to + # ask whether you should force a cache write. Otherwise, it's clearer to + # just call +write+. + # + # * skip_nil: true - Prevents caching a nil result: + # + # cache.fetch('foo') { nil } + # cache.fetch('bar', skip_nil: true) { nil } + # cache.exist?('foo') # => true + # cache.exist?('bar') # => false + # + # * +:race_condition_ttl+ - Specifies the number of seconds during which + # an expired value can be reused while a new value is being generated. + # This can be used to prevent race conditions when cache entries expire, + # by preventing multiple processes from simultaneously regenerating the + # same entry (also known as the dog pile effect). + # + # When a process encounters a cache entry that has expired less than + # +:race_condition_ttl+ seconds ago, it will bump the expiration time by + # +:race_condition_ttl+ seconds before generating a new value. During + # this extended time window, while the process generates a new value, + # other processes will continue to use the old value. After the first + # process writes the new value, other processes will then use it. + # + # If the first process errors out while generating a new value, another + # process can try to generate a new value after the extended time window + # has elapsed. + # + # # Set all values to expire after one second. + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1) + # + # cache.write("foo", "original value") + # val_1 = nil + # val_2 = nil + # p cache.read("foo") # => "original value" + # + # sleep 1 # wait until the cache expires + # + # t1 = Thread.new do + # # fetch does the following: + # # 1. gets an recent expired entry + # # 2. extends the expiry by 2 seconds (race_condition_ttl) + # # 3. regenerates the new value + # val_1 = cache.fetch("foo", race_condition_ttl: 2) do + # sleep 1 + # "new value 1" + # end + # end + # + # # Wait until t1 extends the expiry of the entry + # # but before generating the new value + # sleep 0.1 + # + # val_2 = cache.fetch("foo", race_condition_ttl: 2) do + # # This block won't be executed because t1 extended the expiry + # "new value 2" + # end + # + # t1.join + # + # p val_1 # => "new value 1" + # p val_2 # => "original value" + # p cache.fetch("foo") # => "new value 1" + # + # # The entry requires 3 seconds to expire (expires_in + race_condition_ttl) + # # We have waited 2 seconds already (sleep(1) + t1.join) thus we need to wait 1 + # # more second to see the entry expire. + # sleep 1 + # + # p cache.fetch("foo") # => nil + # + # ==== Dynamic Options + # + # In some cases it may be necessary to dynamically compute options based + # on the cached value. To support this, an ActiveSupport::Cache::WriteOptions + # instance is passed as the second argument to the block. For example: + # + # cache.fetch("authentication-token:#{user.id}") do |key, options| + # token = authenticate_to_service + # options.expires_at = token.expires_at + # token + # end + # + # pkg:gem/activesupport#lib/active_support/cache.rb:452 + def fetch(name, options = T.unsafe(nil), &block); end + + # Fetches data from the cache, using the given keys. If there is data in + # the cache with the given keys, then that data is returned. Otherwise, + # the supplied block is called for each key for which there was no data, + # and the result will be written to the cache and returned. + # Therefore, you need to pass a block that returns the data to be written + # to the cache. If you do not want to write the cache when the cache is + # not found, use #read_multi. + # + # Returns a hash with the data for each of the names. For example: + # + # cache.write("bim", "bam") + # cache.fetch_multi("bim", "unknown_key") do |key| + # "Fallback value for key: #{key}" + # end + # # => { "bim" => "bam", + # # "unknown_key" => "Fallback value for key: unknown_key" } + # + # You may also specify additional options via the +options+ argument. See #fetch for details. + # Other options are passed to the underlying cache implementation. For example: + # + # cache.fetch_multi("fizz", expires_in: 5.seconds) do |key| + # "buzz" + # end + # # => {"fizz"=>"buzz"} + # cache.read("fizz") + # # => "buzz" + # sleep(6) + # cache.read("fizz") + # # => nil + # + # pkg:gem/activesupport#lib/active_support/cache.rb:603 + def fetch_multi(*names); end + + # Increments an integer value in the cache. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:741 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger=(val); end + + # Silences the logger within a block. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:330 + def mute; end + + # Get the current namespace + # + # pkg:gem/activesupport#lib/active_support/cache.rb:800 + def namespace; end + + # Set the current namespace. Note, this will be ignored if custom + # options are passed to cache wills with a namespace key. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:806 + def namespace=(namespace); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:723 + def new_entry(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:200 + def options; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time=(val); end + + # Reads data from the cache, using the given key. If there is data in + # the cache with the given key, then that data is returned. Otherwise, + # +nil+ is returned. + # + # Note, if data was written with the :expires_in or + # :version options, both of these conditions are applied before + # the data is returned. + # + # ==== Options + # + # * +:namespace+ - Replace the store namespace for this call. + # * +:version+ - Specifies a version for the cache entry. If the cached + # version does not match the requested version, the read will be treated + # as a cache miss. This feature is used to support recyclable cache keys. + # + # Other options will be handled by the specific cache store implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:506 + def read(name, options = T.unsafe(nil)); end + + # Reads a counter that was set by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:762 + def read_counter(name, **options); end + + # Reads multiple values at once from the cache. Options can be passed + # in the last argument. + # + # Some cache implementation may optimize this method. + # + # Returns a hash mapping the names provided to the values found. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:544 + def read_multi(*names); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:200 + def silence; end + + # Silences the logger. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:324 + def silence!; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:201 + def silence?; end + + # Writes the value to the cache with the key. The value must be supported + # by the +coder+'s +dump+ and +load+ methods. + # + # Returns +true+ if the write succeeded, +nil+ if there was an error talking + # to the cache backend, or +false+ if the write failed for another reason. + # + # By default, cache entries larger than 1kB are compressed. Compression + # allows more data to be stored in the same memory footprint, leading to + # fewer cache evictions and higher hit rates. + # + # ==== Options + # + # * compress: false - Disables compression of the cache entry. + # + # * +:compress_threshold+ - The compression threshold, specified in bytes. + # \Cache entries larger than this threshold will be compressed. Defaults + # to +1.kilobyte+. + # + # * +:expires_in+ - Sets a relative expiration time for the cache entry, + # specified in seconds. +:expire_in+ and +:expired_in+ are aliases for + # +:expires_in+. + # + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 5.minutes) + # cache.write(key, value, expires_in: 1.minute) # Set a lower value for one entry + # + # * +:expires_at+ - Sets an absolute expiration time for the cache entry. + # + # cache = ActiveSupport::Cache::MemoryStore.new + # cache.write(key, value, expires_at: Time.now.at_end_of_hour) + # + # * +:version+ - Specifies a version for the cache entry. When reading + # from the cache, if the cached version does not match the requested + # version, the read will be treated as a cache miss. This feature is + # used to support recyclable cache keys. + # + # * +:unless_exist+ - Prevents overwriting an existing cache entry. + # + # Other options will be handled by the specific cache store implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:672 + def write(name, value, options = T.unsafe(nil)); end + + # Writes a counter that can then be modified by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:775 + def write_counter(name, value, **options); end + + # Cache Storage API to write multiple values at once. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:559 + def write_multi(hash, options = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:1074 + def _instrument(operation, multi: T.unsafe(nil), options: T.unsafe(nil), **payload, &block); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:811 + def default_serializer; end + + # Deletes an entry from the cache implementation. Subclasses must + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:897 + def delete_entry(key, **options); end + + # Deletes multiples entries in the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:903 + def delete_multi_entries(entries, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:862 + def deserialize_entry(payload, **); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:984 + def expand_and_namespace_key(key, options = T.unsafe(nil)); end + + # Expands key to be a consistent string value. Invokes +cache_key+ if + # object responds to +cache_key+. Otherwise, +to_param+ method will be + # called. If the key is a Hash, then keys will be sorted alphabetically. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1037 + def expanded_key(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1058 + def expanded_version(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1111 + def get_entry_value(entry, name, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1095 + def handle_expired_entry(entry, key, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:937 + def handle_invalid_expires_in(message); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1066 + def instrument(operation, key, options = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1070 + def instrument_multi(operation, keys, options = T.unsafe(nil), &block); end + + # Adds the namespace defined in the options to a pattern designed to + # match keys. Implementations that support delete_matched should call + # this method to translate a pattern that matches names into one that + # matches namespaced keys. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:826 + def key_matcher(pattern, options); end + + # Merges the default options with ones specific to a method call. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:908 + def merged_options(call_options); end + + # Prefix the key with a namespace string: + # + # namespace_key 'foo', namespace: 'cache' + # # => 'cache:foo' + # + # With a namespace block: + # + # namespace_key 'foo', namespace: -> { 'cache' } + # # => 'cache:foo' + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1012 + def namespace_key(key, call_options = T.unsafe(nil)); end + + # Expands, namespaces and truncates the cache key. + # Raises an exception when the key is +nil+ or an empty string. + # May be overridden by cache stores to do additional normalization. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:979 + def normalize_key(key, options = T.unsafe(nil)); end + + # Normalize aliased options to their canonical form + # + # pkg:gem/activesupport#lib/active_support/cache.rb:948 + def normalize_options(options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1054 + def normalize_version(key, options = T.unsafe(nil)); end + + # Reads an entry from the cache implementation. Subclasses must implement + # this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:843 + def read_entry(key, **options); end + + # Reads multiple entries from the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:870 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1116 + def save_block_result_to_cache(name, key, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:853 + def serialize_entry(entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:991 + def truncate_key(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:959 + def validate_options(options); end + + # Writes an entry to the cache implementation. Subclasses must implement + # this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:849 + def write_entry(key, entry, **options); end + + # Writes multiple entries to the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:889 + def write_multi_entries(hash, **options); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:197 + def logger=(val); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def raise_on_invalid_cache_expiration_time=(val); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:205 + def retrieve_pool_options(options); end + end +end + +# Default +ConnectionPool+ options +# +# pkg:gem/activesupport#lib/active_support/cache.rb:192 +ActiveSupport::Cache::Store::DEFAULT_POOL_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Keys are truncated with the Active Support digest if they exceed the limit. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:195 +ActiveSupport::Cache::Store::MAX_KEY_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache.rb:53 +module ActiveSupport::Cache::Strategy; end + +# = Local \Cache \Strategy +# +# Caches that implement LocalCache will be backed by an in-memory cache for the +# duration of a block. Repeated calls to the cache for the same key will hit the +# in-memory cache for faster access. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:13 +module ActiveSupport::Cache::Strategy::LocalCache + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:98 + def cleanup(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:92 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:117 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:104 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:124 + def fetch_multi(*names, &block); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:110 + def increment(name, amount = T.unsafe(nil), **options); end + + # The current local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:82 + def local_cache; end + + # Middleware class can be inserted as a Rack handler to be local cache for the + # duration of request. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:88 + def middleware; end + + # Set a new local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:72 + def new_local_cache; end + + # Unset the current local cache. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:77 + def unset_local_cache; end + + # Use a local cache for the duration of block. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:67 + def with_local_cache(&block); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:230 + def bypass_local_cache(&block); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:211 + def delete_entry(key, **); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:226 + def local_cache_key; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:173 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:159 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:234 + def use_temporary_local_cache(temporary_cache); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:216 + def write_cache_value(name, value, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:202 + def write_serialized_entry(key, payload, **); end +end + +# Class for storing and registering the local caches. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:17 +module ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + extend ::ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:20 + def cache_for(local_cache_key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:25 + def set_cache_for(local_cache_key, value); end +end + +# = Local \Cache \Store +# +# Simple memory backed cache. This cache is not thread safe and is intended only +# for serving as a temporary memory cache for a single thread. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:35 +class ActiveSupport::Cache::Strategy::LocalCache::LocalStore + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:36 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:40 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:57 + def delete_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:61 + def fetch_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:44 + def read_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:48 + def read_multi_entries(keys); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:52 + def write_entry(key, entry); end +end + +# -- +# This class wraps up local storage for middlewares. Only the middleware method should +# construct them. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:13 +class ActiveSupport::Cache::Strategy::LocalCache::Middleware + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:17 + def initialize(name, cache); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:15 + def cache; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:15 + def cache=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:28 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:14 + def name; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:23 + def new(app); end +end + +# These options mean something to all cache implementations. Individual cache +# implementations may support additional options. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:26 +ActiveSupport::Cache::UNIVERSAL_OPTIONS = T.let(T.unsafe(nil), Array) + +# Enables the dynamic configuration of Cache entry options while ensuring +# that conflicting options are not both set. When a block is given to +# ActiveSupport::Cache::Store#fetch, the second argument will be an +# instance of +WriteOptions+. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:1132 +class ActiveSupport::Cache::WriteOptions + # pkg:gem/activesupport#lib/active_support/cache.rb:1133 + def initialize(options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1157 + def expires_at; end + + # Sets the Cache entry's +expires_at+ value. If an +expires_in+ option was + # previously set, this will unset it since +expires_at+ and +expires_in+ + # cannot both be set. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1164 + def expires_at=(expires_at); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1145 + def expires_in; end + + # Sets the Cache entry's +expires_in+ value. If an +expires_at+ option was + # previously set, this will unset it since +expires_in+ and +expires_at+ + # cannot both be set. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1152 + def expires_in=(expires_in); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1137 + def version; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1141 + def version=(version); end +end + +# = Caching Key Generator +# +# CachingKeyGenerator is a wrapper around KeyGenerator which allows users to avoid +# re-executing the key generation process when it's called using the same +salt+ and +# +key_size+. +# +# pkg:gem/activesupport#lib/active_support/key_generator.rb:55 +class ActiveSupport::CachingKeyGenerator + # pkg:gem/activesupport#lib/active_support/key_generator.rb:56 + def initialize(key_generator); end + + # Returns a derived key suitable for use. + # + # pkg:gem/activesupport#lib/active_support/key_generator.rb:62 + def generate_key(*args); end +end + +# = Active Support \Callbacks +# +# \Callbacks are code hooks that are run at key points in an object's life cycle. +# The typical use case is to have a base class define a set of callbacks +# relevant to the other functionality it supplies, so that subclasses can +# install callbacks that enhance or modify the base functionality without +# needing to override or redefine methods of the base class. +# +# Mixing in this module allows you to define the events in the object's +# life cycle that will support callbacks (via ClassMethods#define_callbacks), +# set the instance methods, procs, or callback objects to be called (via +# ClassMethods#set_callback), and run the installed callbacks at the +# appropriate times (via +run_callbacks+). +# +# By default callbacks are halted by throwing +:abort+. +# See ClassMethods#define_callbacks for details. +# +# Three kinds of callbacks are supported: before callbacks, run before a +# certain event; after callbacks, run after the event; and around callbacks, +# blocks that surround the event, triggering it when they yield. Callback code +# can be contained in instance methods, procs or lambdas, or callback objects +# that respond to certain predetermined methods. See ClassMethods#set_callback +# for details. +# +# class Record +# include ActiveSupport::Callbacks +# define_callbacks :save +# +# def save +# run_callbacks :save do +# puts "- save" +# end +# end +# end +# +# class PersonRecord < Record +# set_callback :save, :before, :saving_message +# def saving_message +# puts "saving..." +# end +# +# set_callback :save, :after do |object| +# puts "saved" +# end +# end +# +# person = PersonRecord.new +# person.save +# +# Output: +# saving... +# - save +# saved +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:65 +module ActiveSupport::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + # Runs the callbacks for the given event. + # + # Calls the before and around callbacks in the order they were set, yields + # the block (if given one), and then runs the after callbacks in reverse + # order. + # + # If the callback chain was halted, returns +false+. Otherwise returns the + # result of the block, +nil+ if no callbacks have been set, or +true+ + # if callbacks have been set but no block is given. + # + # run_callbacks :save do + # save + # end + # + # -- + # + # As this method is used in many places, and often wraps large portions of + # user code, it has an additional design goal of minimizing its impact on + # the visible call stack. An exception from inside a :before or :after + # callback can be as noisy as it likes -- but when control has passed + # smoothly through and into the supplied block, we want as little evidence + # as possible that we were here. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:97 + def run_callbacks(kind, type = T.unsafe(nil)); end + + private + + # A hook invoked every time a before callback is halted. + # This can be overridden in ActiveSupport::Callbacks implementors in order + # to provide better debugging/logging. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:150 + def halted_callback_hook(filter, name); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:73 +ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES = T.let(T.unsafe(nil), Array) + +# A future invocation of user-supplied code (either as a callback, +# or a condition filter). +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:337 +module ActiveSupport::Callbacks::CallTemplate + class << self + # Filters support: + # + # Symbols:: A method to call. + # Procs:: A proc to call with the object. + # Objects:: An object with a before_foo method on it to call. + # + # All of these objects are converted into a CallTemplate and handled + # the same after this point. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:495 + def build(filter, callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:396 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:397 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:401 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:411 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:405 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:418 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:419 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:423 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:433 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:427 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:440 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:441 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:445 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:457 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:450 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:338 +class ActiveSupport::Callbacks::CallTemplate::MethodCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:339 + def initialize(method); end + + # Return the parts needed to make this call, with the given + # input values. + # + # Returns an array of the form: + # + # [target, block, method, *arguments] + # + # This array can be used as such: + # + # target.send(method, *arguments, &block) + # + # The actual invocation is left up to the caller to minimize + # call stack pollution. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:356 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:366 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:360 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:373 +class ActiveSupport::Callbacks::CallTemplate::ObjectCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:374 + def initialize(target, method); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:379 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:389 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:383 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:465 +class ActiveSupport::Callbacks::CallTemplate::ProcCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:466 + def initialize(target); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:470 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:480 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:474 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:231 +class ActiveSupport::Callbacks::Callback + # pkg:gem/activesupport#lib/active_support/callbacks.rb:246 + def initialize(name, filter, kind, options, chain_config); end + + # Wraps code with filter + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:300 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:244 + def chain_config; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:282 + def compiled; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:304 + def current_scopes; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:273 + def duplicates?(other); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:244 + def filter; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def kind; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def kind=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:269 + def matches?(_kind, _filter); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:257 + def merge_conditional_options(chain, if_option:, unless_option:); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:243 + def name=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:312 + def check_conditionals(conditionals); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:327 + def conditions_lambdas; end + + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:232 + def build(chain, filter, kind, options); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:309 +ActiveSupport::Callbacks::Callback::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:568 +class ActiveSupport::Callbacks::CallbackChain + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:573 + def initialize(name, config); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:633 + def append(*callbacks); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:601 + def clear; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:615 + def compile(type); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:571 + def config; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:595 + def delete(o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:585 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:587 + def empty?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:586 + def index(o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:589 + def insert(index, o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:571 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:637 + def prepend(*callbacks); end + + protected + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:642 + def chain; end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:645 + def append_one(callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:608 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:652 + def prepend_one(callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:659 + def remove_duplicates(callback); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:675 +ActiveSupport::Callbacks::CallbackChain::DEFAULT_TERMINATOR = T.let(T.unsafe(nil), ActiveSupport::Callbacks::CallbackChain::DefaultTerminator) + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:665 +class ActiveSupport::Callbacks::CallbackChain::DefaultTerminator + # pkg:gem/activesupport#lib/active_support/callbacks.rb:666 + def call(target, result_lambda); end +end + +# Execute before and after filters in a sequence instead of +# chaining them with nested lambda calls, see: +# https://github.com/rails/rails/issues/18011 +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:519 +class ActiveSupport::Callbacks::CallbackSequence + # pkg:gem/activesupport#lib/active_support/callbacks.rb:520 + def initialize(nested = T.unsafe(nil), call_template = T.unsafe(nil), user_conditions = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:535 + def after(after); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:541 + def around(call_template, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:529 + def before(before); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:555 + def expand_call_template(arg, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:551 + def final?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:563 + def invoke_after(arg); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:559 + def invoke_before(arg); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:549 + def nested; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:545 + def skip?(arg); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:678 +module ActiveSupport::Callbacks::ClassMethods + # This is used internally to append, prepend and skip callbacks to the + # CallbackChain. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:688 + def __update_callbacks(name); end + + # Define sets of events in the object life cycle that support callbacks. + # + # define_callbacks :validate + # define_callbacks :initialize, :save, :destroy + # + # ===== Options + # + # * :terminator - Determines when a before filter will halt the + # callback chain, preventing following before and around callbacks from + # being called and the event from being triggered. + # This should be a lambda to be executed. + # The current object and the result lambda of the callback will be provided + # to the terminator lambda. + # + # define_callbacks :validate, terminator: ->(target, result_lambda) { result_lambda.call == false } + # + # In this example, if any before validate callbacks returns +false+, + # any successive before and around callback is not executed. + # + # The default terminator halts the chain when a callback throws +:abort+. + # + # * :skip_after_callbacks_if_terminated - Determines if after + # callbacks should be terminated by the :terminator option. By + # default after callbacks are executed no matter if callback chain was + # terminated or not. This option has no effect if :terminator + # option is set to +nil+. + # + # * :scope - Indicates which methods should be executed when an + # object is used as a callback. + # + # class Audit + # def before(caller) + # puts 'Audit: before is called' + # end + # + # def before_save(caller) + # puts 'Audit: before_save is called' + # end + # end + # + # class Account + # include ActiveSupport::Callbacks + # + # define_callbacks :save + # set_callback :save, :before, Audit.new + # + # def save + # run_callbacks :save do + # puts 'save in main' + # end + # end + # end + # + # In the above case whenever you save an account the method + # Audit#before will be called. On the other hand + # + # define_callbacks :save, scope: [:kind, :name] + # + # would trigger Audit#before_save instead. That's constructed + # by calling #{kind}_#{name} on the given instance. In this + # case "kind" is "before" and "name" is "save". In this context +:kind+ + # and +:name+ have special meanings: +:kind+ refers to the kind of + # callback (before/after/around) and +:name+ refers to the method on + # which callbacks are being defined. + # + # A declaration like + # + # define_callbacks :save, scope: [:name] + # + # would call Audit#save. + # + # ===== Notes + # + # +names+ passed to +define_callbacks+ must not end with + # !, ? or =. + # + # Calling +define_callbacks+ multiple times with the same +names+ will + # overwrite previous callbacks registered with #set_callback. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:903 + def define_callbacks(*names); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:679 + def normalize_callback_params(filters, block); end + + # Remove all set callbacks for the given event. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:813 + def reset_callbacks(name); end + + # Install a callback for the given event. + # + # set_callback :save, :before, :before_method + # set_callback :save, :after, :after_method, if: :condition + # set_callback :save, :around, ->(r, block) { stuff; result = block.call; stuff } + # + # The second argument indicates whether the callback is to be run +:before+, + # +:after+, or +:around+ the event. If omitted, +:before+ is assumed. This + # means the first example above can also be written as: + # + # set_callback :save, :before_method + # + # The callback can be specified as a symbol naming an instance method; as a + # proc, lambda, or block; or as an object that responds to a certain method + # determined by the :scope argument to #define_callbacks. + # + # If a proc, lambda, or block is given, its body is evaluated in the context + # of the current object. It can also optionally accept the current object as + # an argument. + # + # Before and around callbacks are called in the order that they are set; + # after callbacks are called in the reverse order. + # + # Around callbacks can access the return value from the event, if it + # wasn't halted, from the +yield+ call. + # + # ===== Options + # + # * :if - A symbol or an array of symbols, each naming an instance + # method or a proc; the callback will be called only when they all return + # a true value. + # + # If a proc is given, its body is evaluated in the context of the + # current object. It can also optionally accept the current object as + # an argument. + # * :unless - A symbol or an array of symbols, each naming an + # instance method or a proc; the callback will be called only when they + # all return a false value. + # + # If a proc is given, its body is evaluated in the context of the + # current object. It can also optionally accept the current object as + # an argument. + # * :prepend - If +true+, the callback will be prepended to the + # existing chain rather than appended. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:739 + def set_callback(name, *filter_list, &block); end + + # Skip a previously set callback. Like #set_callback, :if or + # :unless options may be passed in order to control when the + # callback is skipped. + # + # Note: this example uses +PersonRecord+ and +#saving_message+, which you + # can see defined here[rdoc-ref:ActiveSupport::Callbacks] + # + # class Writer < PersonRecord + # attr_accessor :age + # skip_callback :save, :before, :saving_message, if: -> { age > 18 } + # end + # + # When if option returns true, callback is skipped. + # + # writer = Writer.new + # writer.age = 20 + # writer.save + # + # Output: + # - save + # saved + # + # When if option returns false, callback is NOT skipped. + # + # young_writer = Writer.new + # young_writer.age = 17 + # young_writer.save + # + # Output: + # saving... + # - save + # saved + # + # An ArgumentError will be raised if the callback has not + # already been set (unless the :raise option is set to false). + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:788 + def skip_callback(name, *filter_list, &block); end + + protected + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:939 + def get_callbacks(name); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:943 + def set_callbacks(name, callbacks); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:153 +module ActiveSupport::Callbacks::Conditionals; end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:154 +class ActiveSupport::Callbacks::Conditionals::Value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:155 + def initialize(&block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:158 + def call(target, value); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:162 +module ActiveSupport::Callbacks::Filters; end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:194 +class ActiveSupport::Callbacks::Filters::After + # pkg:gem/activesupport#lib/active_support/callbacks.rb:196 + def initialize(user_callback, user_conditions, chain_config); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:214 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:202 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def halting; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def user_callback; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def user_conditions; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:219 +class ActiveSupport::Callbacks::Filters::Around + # pkg:gem/activesupport#lib/active_support/callbacks.rb:220 + def initialize(user_callback, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:225 + def apply(callback_sequence); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:165 +class ActiveSupport::Callbacks::Filters::Before + # pkg:gem/activesupport#lib/active_support/callbacks.rb:166 + def initialize(user_callback, user_conditions, chain_config, filter, name); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:189 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:173 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def filter; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def halted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def user_callback; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:171 + def user_conditions; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:163 +class ActiveSupport::Callbacks::Filters::Environment < ::Struct + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def halted; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def halted=(_); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def target; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def target=(_); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def value; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def value=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def members; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/class_attribute.rb:4 +module ActiveSupport::ClassAttribute + class << self + # pkg:gem/activesupport#lib/active_support/class_attribute.rb:6 + def redefine(owner, name, namespaced_name, value); end + + # pkg:gem/activesupport#lib/active_support/class_attribute.rb:26 + def redefine_method(owner, name, private: T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:4 +class ActiveSupport::CodeGenerator + # pkg:gem/activesupport#lib/active_support/code_generator.rb:53 + def initialize(owner, path, line); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:61 + def class_eval; end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:65 + def define_cached_method(canonical_name, namespace:, as: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:69 + def execute; end + + class << self + # pkg:gem/activesupport#lib/active_support/code_generator.rb:41 + def batch(owner, path, line); end + end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:5 +class ActiveSupport::CodeGenerator::MethodSet + # pkg:gem/activesupport#lib/active_support/code_generator.rb:8 + def initialize(namespace); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:28 + def apply(owner, path, line); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:15 + def define_cached_method(canonical_name, as: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:6 +ActiveSupport::CodeGenerator::MethodSet::METHOD_CACHES = T.let(T.unsafe(nil), Hash) + +# = Active Support \Concern +# +# A typical module looks like this: +# +# module M +# def self.included(base) +# base.extend ClassMethods +# base.class_eval do +# scope :disabled, -> { where(disabled: true) } +# end +# end +# +# module ClassMethods +# ... +# end +# end +# +# By using +ActiveSupport::Concern+ the above module could instead be +# written as: +# +# require "active_support/concern" +# +# module M +# extend ActiveSupport::Concern +# +# included do +# scope :disabled, -> { where(disabled: true) } +# end +# +# class_methods do +# ... +# end +# end +# +# Moreover, it gracefully handles module dependencies. Given a +Foo+ module +# and a +Bar+ module which depends on the former, we would typically write the +# following: +# +# module Foo +# def self.included(base) +# base.class_eval do +# def self.method_injected_by_foo +# ... +# end +# end +# end +# end +# +# module Bar +# def self.included(base) +# base.method_injected_by_foo +# end +# end +# +# class Host +# include Foo # We need to include this dependency for Bar +# include Bar # Bar is the module that Host really needs +# end +# +# But why should +Host+ care about +Bar+'s dependencies, namely +Foo+? We +# could try to hide these from +Host+ directly including +Foo+ in +Bar+: +# +# module Bar +# include Foo +# def self.included(base) +# base.method_injected_by_foo +# end +# end +# +# class Host +# include Bar +# end +# +# Unfortunately this won't work, since when +Foo+ is included, its base +# is the +Bar+ module, not the +Host+ class. With +ActiveSupport::Concern+, +# module dependencies are properly resolved: +# +# require "active_support/concern" +# +# module Foo +# extend ActiveSupport::Concern +# included do +# def self.method_injected_by_foo +# ... +# end +# end +# end +# +# module Bar +# extend ActiveSupport::Concern +# include Foo +# +# included do +# self.method_injected_by_foo +# end +# end +# +# class Host +# include Bar # It works, now Bar takes care of its dependencies +# end +# +# === Prepending concerns +# +# Just like include, concerns also support prepend with a corresponding +# prepended do callback. module ClassMethods or class_methods do are +# prepended as well. +# +# prepend is also used for any dependencies. +# +# pkg:gem/activesupport#lib/active_support/concern.rb:112 +module ActiveSupport::Concern + # pkg:gem/activesupport#lib/active_support/concern.rb:129 + def append_features(base); end + + # Define class methods from given block. + # You can define private class methods as well. + # + # module Example + # extend ActiveSupport::Concern + # + # class_methods do + # def foo; puts 'foo'; end + # + # private + # def bar; puts 'bar'; end + # end + # end + # + # class Buzz + # include Example + # end + # + # Buzz.foo # => "foo" + # Buzz.bar # => private method 'bar' called for Buzz:Class(NoMethodError) + # + # pkg:gem/activesupport#lib/active_support/concern.rb:209 + def class_methods(&class_methods_module_definition); end + + # Evaluate given block in context of base class, + # so that you can write class macros here. + # When you define more than one +included+ block, it raises an exception. + # + # pkg:gem/activesupport#lib/active_support/concern.rb:158 + def included(base = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/concern.rb:142 + def prepend_features(base); end + + # Evaluate given block in context of base class, + # so that you can write class macros here. + # When you define more than one +prepended+ block, it raises an exception. + # + # pkg:gem/activesupport#lib/active_support/concern.rb:175 + def prepended(base = T.unsafe(nil), &block); end + + class << self + # pkg:gem/activesupport#lib/active_support/concern.rb:125 + def extended(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/concern.rb:113 +class ActiveSupport::Concern::MultipleIncludedBlocks < ::StandardError + # pkg:gem/activesupport#lib/active_support/concern.rb:114 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/concern.rb:119 +class ActiveSupport::Concern::MultiplePrependBlocks < ::StandardError + # pkg:gem/activesupport#lib/active_support/concern.rb:120 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:6 +module ActiveSupport::Concurrency; end + +# A share/exclusive lock, otherwise known as a read/write lock. +# +# https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock +# +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:10 +class ActiveSupport::Concurrency::ShareLock + include ::MonitorMixin + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:49 + def initialize; end + + # Execute the supplied block while holding the Exclusive lock. If + # +no_wait+ is set and the lock is not immediately available, + # returns +nil+ without yielding. Otherwise, returns the result of + # the block. + # + # See +start_exclusive+ for other options. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:147 + def exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), after_compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # We track Thread objects, instead of just using counters, because + # we need exclusive locks to be reentrant, and we need to be able + # to upgrade share locks to exclusive. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:17 + def raw_state; end + + # Execute the supplied block while holding the Share lock. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:158 + def sharing; end + + # Returns false if +no_wait+ is set and the lock is not + # immediately available. Otherwise, returns true after the lock + # has been acquired. + # + # +purpose+ and +compatible+ work together; while this thread is + # waiting for the exclusive lock, it will yield its share (if any) + # to any other attempt whose +purpose+ appears in this attempt's + # +compatible+ list. This allows a "loose" upgrade, which, being + # less strict, prevents some classes of deadlocks. + # + # For many resources, loose upgrades are sufficient: if a thread + # is awaiting a lock, it is not running any other code. With + # +purpose+ matching, it is possible to yield only to other + # threads whose activity will not interfere. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:75 + def start_exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:113 + def start_sharing; end + + # Relinquish the exclusive lock. Must only be called by the thread + # that called start_exclusive (and currently holds the lock). + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:95 + def stop_exclusive(compatible: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:130 + def stop_sharing; end + + # Temporarily give up all held Share locks while executing the + # supplied block, allowing any +compatible+ exclusive lock request + # to proceed. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:170 + def yield_shares(purpose: T.unsafe(nil), compatible: T.unsafe(nil), block_share: T.unsafe(nil)); end + + private + + # Must be called within synchronize + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:203 + def busy_for_exclusive?(purpose); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:208 + def busy_for_sharing?(purpose); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:213 + def eligible_waiters?(compatible); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:217 + def wait_for(method, &block); end +end + +# = Active Support \Configurable +# +# Configurable provides a config method to store and retrieve +# configuration options as an OrderedOptions. +# +# pkg:gem/activesupport#lib/active_support/configurable.rb:17 +module ActiveSupport::Configurable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveSupport::Configurable::ClassMethods + + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # user = User.new + # + # user.config.allowed_access = true + # user.config.level = 1 + # + # user.config.allowed_access # => true + # user.config.level # => 1 + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:189 + def config; end +end + +# pkg:gem/activesupport#lib/active_support/configurable.rb:35 +module ActiveSupport::Configurable::ClassMethods + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.config.allowed_access = true + # User.config.level = 1 + # + # User.config.allowed_access # => true + # User.config.level # => 1 + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:49 + def config; end + + # Configure values from within the passed block. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.config.allowed_access # => nil + # + # User.configure do |config| + # config.allowed_access = true + # end + # + # User.config.allowed_access # => true + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:73 + def configure; end + + private + + # Allows you to add shortcut so that you don't have to refer to attribute + # through config. Also look at the example for config to contrast. + # + # Defines both class and instance config accessors. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access + # end + # + # User.allowed_access # => nil + # User.allowed_access = false + # User.allowed_access # => false + # + # user = User.new + # user.allowed_access # => false + # user.allowed_access = true + # user.allowed_access # => true + # + # User.allowed_access # => false + # + # The attribute name must be a valid method name in Ruby. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :"1_Badname" + # end + # # => NameError: invalid config attribute name + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, instance_reader: false, instance_writer: false + # end + # + # User.allowed_access = false + # User.allowed_access # => false + # + # User.new.allowed_access = true # => NoMethodError + # User.new.allowed_access # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, instance_accessor: false + # end + # + # User.allowed_access = false + # User.allowed_access # => false + # + # User.new.allowed_access = true # => NoMethodError + # User.new.allowed_access # => NoMethodError + # + # Also you can pass default or a block to set up the attribute with a default value. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, default: false + # config_accessor :hair_colors do + # [:brown, :black, :blonde, :red] + # end + # end + # + # User.allowed_access # => false + # User.hair_colors # => [:brown, :black, :blonde, :red] + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:145 + def config_accessor(*names, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/configurable.rb:166 + def inherited(subclass); end +end + +# pkg:gem/activesupport#lib/active_support/configurable.rb:20 +class ActiveSupport::Configurable::Configuration < ::ActiveSupport::InheritableOptions + # pkg:gem/activesupport#lib/active_support/configurable.rb:21 + def compile_methods!; end + + class << self + # Compiles reader methods so we don't have to go through method_missing. + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:26 + def compile_methods!(keys); end + end +end + +# Reads a YAML configuration file, evaluating any ERB, then +# parsing the resulting YAML. +# +# Warns in case of YAML confusing characters, like invisible +# non-breaking spaces. +# +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:9 +class ActiveSupport::ConfigurationFile + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:12 + def initialize(content_path); end + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:21 + def parse(context: T.unsafe(nil), **options); end + + private + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:44 + def read(content_path); end + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:54 + def render(context); end + + class << self + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:17 + def parse(content_path, **options); end + end +end + +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:10 +class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end + +# Provides a DSL for declaring a continuous integration workflow that can be run either locally or in the cloud. +# Each step is timed, reports success/error, and is aggregated into a collective report that reports total runtime, +# as well as whether the entire run was successful or not. +# +# Example: +# +# ActiveSupport::ContinuousIntegration.run do +# step "Setup", "bin/setup --skip-server" +# step "Style: Ruby", "bin/rubocop" +# step "Security: Gem audit", "bin/bundler-audit" +# step "Tests: Rails", "bin/rails test test:system" +# +# if success? +# step "Signoff: Ready for merge and deploy", "gh signoff" +# else +# failure "Skipping signoff; CI failed.", "Fix the issues and try again." +# end +# end +# +# Starting with Rails 8.1, a default `bin/ci` and `config/ci.rb` file are created to provide out-of-the-box CI. +# +# pkg:gem/activesupport#lib/active_support/continuous_integration.rb:24 +class ActiveSupport::ContinuousIntegration + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:64 + def initialize; end + + # Echo text to the terminal in the color corresponding to the type of the text. + # + # Examples: + # + # echo "This is going to be green!", type: :success + # echo "This is going to be red!", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:111 + def echo(text, type:); end + + # Display an error heading with the title and optional subtitle to reflect that the run failed. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:86 + def failure(title, subtitle = T.unsafe(nil)); end + + # Display a colorized heading followed by an optional subtitle. + # + # Examples: + # + # heading "Smoke Testing", "End-to-end tests verifying key functionality", padding: false + # heading "Skipping video encoding tests", "Install FFmpeg to run these tests", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:98 + def heading(heading, subtitle = T.unsafe(nil), type: T.unsafe(nil), padding: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:116 + def report(title, &block); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:33 + def results; end + + # Declare a step with a title and a command. The command can either be given as a single string or as multiple + # strings that will be passed to `system` as individual arguments (and therefore correctly escaped for paths etc). + # + # Examples: + # + # step "Setup", "bin/setup" + # step "Single test", "bin/rails", "test", "--name", "test_that_is_one" + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:75 + def step(title, *command); end + + # Returns true if all steps were successful. + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:81 + def success?; end + + private + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:141 + def colorize(text, type); end + + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:134 + def timing; end + + class << self + # Perform a CI run. Execute each step, show their results and runtime, and exit with a non-zero status if there are any failures. + # + # Pass an optional title, subtitle, and a block that declares the steps to be executed. + # + # Sets the CI environment variable to "true" to allow for conditional behavior in the app, like enabling eager loading and disabling logging. + # + # Example: + # + # ActiveSupport::ContinuousIntegration.run do + # step "Setup", "bin/setup --skip-server" + # step "Style: Ruby", "bin/rubocop" + # step "Security: Gem audit", "bin/bundler-audit" + # step "Tests: Rails", "bin/rails test test:system" + # + # if success? + # step "Signoff: Ready for merge and deploy", "gh signoff" + # else + # failure "Skipping signoff; CI failed.", "Fix the issues and try again." + # end + # end + # + # pkg:gem/activesupport#lib/active_support/continuous_integration.rb:55 + def run(title = T.unsafe(nil), subtitle = T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/continuous_integration.rb:25 +ActiveSupport::ContinuousIntegration::COLORS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:6 +module ActiveSupport::CoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:7 +module ActiveSupport::CoreExt::ERBUtil + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:28 + def h(s); end + + # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. + # This method is not for public consumption! Seriously! + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:18 + def unwrapped_html_escape(s); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:31 +module ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::CoreExt::ERBUtil + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def h(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def unwrapped_html_escape(s); end +end + +# = Current Attributes +# +# Abstract super class that provides a thread-isolated attributes singleton, which resets automatically +# before and after each request. This allows you to keep all the per-request attributes easily +# available to the whole system. +# +# The following full app-like example demonstrates how to use a Current class to +# facilitate easy access to the global, per-request attributes without passing them deeply +# around everywhere: +# +# # app/models/current.rb +# class Current < ActiveSupport::CurrentAttributes +# attribute :account, :user +# attribute :request_id, :user_agent, :ip_address +# +# resets { Time.zone = nil } +# +# def user=(user) +# super +# self.account = user.account +# Time.zone = user.time_zone +# end +# end +# +# # app/controllers/concerns/authentication.rb +# module Authentication +# extend ActiveSupport::Concern +# +# included do +# before_action :authenticate +# end +# +# private +# def authenticate +# if authenticated_user = User.find_by(id: cookies.encrypted[:user_id]) +# Current.user = authenticated_user +# else +# redirect_to new_session_url +# end +# end +# end +# +# # app/controllers/concerns/set_current_request_details.rb +# module SetCurrentRequestDetails +# extend ActiveSupport::Concern +# +# included do +# before_action do +# Current.request_id = request.uuid +# Current.user_agent = request.user_agent +# Current.ip_address = request.ip +# end +# end +# end +# +# class ApplicationController < ActionController::Base +# include Authentication +# include SetCurrentRequestDetails +# end +# +# class MessagesController < ApplicationController +# def create +# Current.account.messages.create(message_params) +# end +# end +# +# class Message < ApplicationRecord +# belongs_to :creator, default: -> { Current.user } +# after_create { |message| Event.create(record: message) } +# end +# +# class Event < ApplicationRecord +# before_create do +# self.request_id = Current.request_id +# self.user_agent = Current.user_agent +# self.ip_address = Current.ip_address +# end +# end +# +# A word of caution: It's easy to overdo a global singleton like Current and tangle your model as a result. +# Current should only be used for a few, top-level globals, like account, user, and request details. +# The attributes stuck in Current should be used by more or less all actions on all requests. If you start +# sticking controller-specific attributes in there, you're going to create a mess. +# +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 +class ActiveSupport::CurrentAttributes + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _run_reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _run_reset_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def attributes; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def attributes=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def defaults; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def defaults?; end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def reset; end + + # Expose one or more attributes within a block. Old values are returned after the block concludes. + # Example demonstrating the common use of needing to set Current attributes outside the request-cycle: + # + # class Chat::PublicationJob < ApplicationJob + # def perform(attributes, room_number, creator) + # Current.set(person: creator) do + # Chat::Publisher.publish(attributes: attributes, room_number: room_number) + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def set(attributes, &block); end + + private + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:186 + def resolve_defaults; end + + class << self + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 + def _reset_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:153 + def after_reset(*methods, &block); end + + # Declares one or more attributes that will be given both class and instance accessor methods. + # + # ==== Options + # + # * :default - The default value for the attributes. If the value + # is a proc or lambda, it will be called whenever an instance is + # constructed. Otherwise, the value will be duplicated with +#dup+. + # Default values are re-assigned when the attributes are reset. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:115 + def attribute(*names, default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 + def attributes(&); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 + def attributes=(arg); end + + # Calls this callback before #reset is called on the instance. Used for resetting external collaborators that depend on current values. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:145 + def before_reset(*methods, &block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:157 + def clear_all; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def defaults; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def defaults=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def defaults?; end + + # Returns singleton instance for this class in this thread. If none exists, one is created. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:103 + def instance; end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:155 + def reset(*, **, &); end + + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:150 + def resets(*methods, &block); end + + # Expose one or more attributes within a block. Old values are returned after the block concludes. + # Example demonstrating the common use of needing to set Current attributes outside the request-cycle: + # + # class Chat::PublicationJob < ApplicationJob + # def perform(attributes, room_number, creator) + # Current.set(person: creator) do + # Chat::Publisher.publish(attributes: attributes, room_number: room_number) + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:155 + def set(*, **, &); end + + private + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:94 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def __class_attr_defaults; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:201 + def __class_attr_defaults=(new_value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:169 + def current_instances; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:173 + def current_instances_key; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:165 + def generated_attribute_methods; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:185 + def method_added(name); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:177 + def method_missing(name, *, **, &); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:181 + def respond_to_missing?(name, _); end + end +end + +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:97 +ActiveSupport::CurrentAttributes::INVALID_ATTRIBUTE_NAMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:99 +ActiveSupport::CurrentAttributes::NOT_SET = T.let(T.unsafe(nil), Object) + +# Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class +# to provide a merge!(other, &block) method. +# +# pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:6 +module ActiveSupport::DeepMergeable + # Returns a new instance with the values from +other+ merged recursively. + # + # class Hash + # include ActiveSupport::DeepMergeable + # end + # + # hash_1 = { a: true, b: { c: [1, 2, 3] } } + # hash_2 = { a: false, b: { x: [3, 4, 5] } } + # + # hash_1.deep_merge(hash_2) + # # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } } + # + # A block can be provided to merge non-DeepMergeable values: + # + # hash_1 = { a: 100, b: 200, c: { c1: 100 } } + # hash_2 = { b: 250, c: { c1: 200 } } + # + # hash_1.deep_merge(hash_2) do |key, this_val, other_val| + # this_val + other_val + # end + # # => { a: 100, b: 450, c: { c1: 300 } } + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:29 + def deep_merge(other, &block); end + + # Same as #deep_merge, but modifies +self+. + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:34 + def deep_merge!(other, &block); end + + # Returns true if +other+ can be deep merged into +self+. Classes may + # override this method to restrict or expand the domain of deep mergeable + # values. Defaults to checking that +other+ is of type +self.class+. + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:49 + def deep_merge?(other); end +end + +# pkg:gem/activesupport#lib/active_support/delegation.rb:14 +module ActiveSupport::Delegation + class << self + # pkg:gem/activesupport#lib/active_support/delegation.rb:21 + def generate(owner, methods, location: T.unsafe(nil), to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), nilable: T.unsafe(nil), private: T.unsafe(nil), as: T.unsafe(nil), signature: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/delegation.rb:150 + def generate_method_missing(owner, target, allow_nil: T.unsafe(nil)); end + end +end + +# pkg:gem/activesupport#lib/active_support/delegation.rb:18 +ActiveSupport::Delegation::RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) + +# pkg:gem/activesupport#lib/active_support/delegation.rb:15 +ActiveSupport::Delegation::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ +# option is not used. +# +# pkg:gem/activesupport#lib/active_support/delegation.rb:6 +class ActiveSupport::DelegationError < ::NoMethodError + class << self + # pkg:gem/activesupport#lib/active_support/delegation.rb:8 + def nil_target(method_name, target); end + end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:6 +module ActiveSupport::Dependencies + class << self + # pkg:gem/activesupport#lib/active_support/dependencies.rb:66 + def _autoloaded_tracked_classes; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:66 + def _autoloaded_tracked_classes=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:60 + def _eager_load_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:60 + def _eager_load_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:53 + def autoload_once_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:53 + def autoload_once_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:47 + def autoload_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:47 + def autoload_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:73 + def autoloader; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:73 + def autoloader=(_arg0); end + + # Private method that reloads constants autoloaded by the main autoloader. + # + # Rails.application.reloader.reload! is the public interface for application + # reload. That involves more things, like deleting unloaded classes from the + # internal state of the descendants tracker, or reloading routes. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:80 + def clear; end + + # Private method that helps configuring the autoloaders. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:98 + def eager_load?(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:9 + def interlock; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:9 + def interlock=(_arg0); end + + # Execute the supplied block while holding an exclusive lock, + # preventing any other thread from being inside a #run_interlock + # block at the same time. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:23 + def load_interlock(&block); end + + # Execute the supplied block without interference from any + # concurrent loads. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:16 + def run_interlock(&block); end + + # Private method used by require_dependency. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:88 + def search_for_file(relpath); end + + # Execute the supplied block while holding an exclusive lock, + # preventing any other thread from being inside a #run_interlock + # block at the same time. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:35 + def unload_interlock(&block); end + end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:7 +class ActiveSupport::Dependencies::Interlock + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:37 + def done_running; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:29 + def done_unloading; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:12 + def loading(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:45 + def permit_concurrent_loads(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:50 + def raw_state(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:41 + def running(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:33 + def start_running; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:25 + def start_unloading; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:21 + def unloading(&block); end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/require_dependency.rb:3 +module ActiveSupport::Dependencies::RequireDependency + # Warning: This method is obsolete. The semantics of the autoloader + # match Ruby's and you do not need to be defensive with load order anymore. + # Just refer to classes and modules normally. + # + # Engines that do not control the mode in which their parent application runs + # should call +require_dependency+ where needed in case the runtime mode is + # +:classic+. + # + # pkg:gem/activesupport#lib/active_support/dependencies/require_dependency.rb:11 + def require_dependency(filename); end +end + +# = Active Support \Deprecation +# +# \Deprecation specifies the API used by \Rails to deprecate methods, instance variables, objects, and constants. It's +# also available for gems or applications. +# +# For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for +# users to be able to configure it). +# +# module MyLibrary +# def self.deprecator +# @deprecator ||= ActiveSupport::Deprecation.new("2.0", "MyLibrary") +# end +# end +# +# For a Railtie or Engine, you may also want to add it to the application's deprecators, so that the application's +# configuration can be applied to it. +# +# module MyLibrary +# class Railtie < Rails::Railtie +# initializer "my_library.deprecator" do |app| +# app.deprecators[:my_library] = MyLibrary.deprecator +# end +# end +# end +# +# With the above initializer, configuration settings like the following will affect +MyLibrary.deprecator+: +# +# # in config/environments/test.rb +# config.active_support.deprecation = :raise +# +# pkg:gem/activesupport#lib/active_support/deprecation.rb:33 +class ActiveSupport::Deprecation + include ::ActiveSupport::Deprecation::Behavior + include ::ActiveSupport::Deprecation::Reporting + include ::ActiveSupport::Deprecation::Disallowed + include ::ActiveSupport::Deprecation::MethodWrapper + + # It accepts two parameters on initialization. The first is a version of library + # and the second is a library name. + # + # ActiveSupport::Deprecation.new('2.0', 'MyLibrary') + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:71 + def initialize(deprecation_horizon = T.unsafe(nil), gem_name = T.unsafe(nil)); end + + # The version number in which the deprecated behavior will be removed, by default. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:65 + def deprecation_horizon; end + + # The version number in which the deprecated behavior will be removed, by default. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:65 + def deprecation_horizon=(_arg0); end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation.rb:60 + def _instance; end + end +end + +# Behavior module allows to determine how to display deprecation messages. +# You can create a custom behavior or set any from the +DEFAULT_BEHAVIORS+ +# constant. Available behaviors are: +# +# [+:raise+] Raise ActiveSupport::DeprecationException. +# [+:stderr+] Log all deprecation warnings to $stderr. +# [+:log+] Log all deprecation warnings to +Rails.logger+. +# [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. +# [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. +# [+:silence+] Do nothing. On \Rails, set config.active_support.report_deprecations = false to disable all behaviors. +# +# Setting behaviors only affects deprecations that happen after boot time. +# For more information you can read the documentation of the #behavior= method. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:69 +module ActiveSupport::Deprecation::Behavior + # Returns the current behavior or if one isn't set, defaults to +:stderr+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:74 + def behavior; end + + # Sets the behavior to the specified value. Can be a single value, array, + # or an object that responds to +call+. + # + # Available behaviors: + # + # [+:raise+] Raise ActiveSupport::DeprecationException. + # [+:stderr+] Log all deprecation warnings to $stderr. + # [+:log+] Log all deprecation warnings to +Rails.logger+. + # [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. + # [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. + # [+:silence+] Do nothing. + # + # Setting behaviors only affects deprecations that happen after boot time. + # Deprecation warnings raised by gems are not affected by this setting + # because they happen before \Rails boots up. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.behavior = :stderr + # deprecator.behavior = [:stderr, :log] + # deprecator.behavior = MyCustomHandler + # deprecator.behavior = ->(message, callstack, deprecation_horizon, gem_name) { + # # custom stuff + # } + # + # If you are using \Rails, you can set + # config.active_support.report_deprecations = false to disable + # all deprecation behaviors. This is similar to the +:silence+ option but + # more performant. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:111 + def behavior=(behavior); end + + # Whether to print a backtrace along with the warning. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 + def debug; end + + # Whether to print a backtrace along with the warning. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 + def debug=(_arg0); end + + # Returns the current behavior for disallowed deprecations or if one isn't set, defaults to +:raise+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:79 + def disallowed_behavior; end + + # Sets the behavior for disallowed deprecations (those configured by + # ActiveSupport::Deprecation#disallowed_warnings=) to the specified + # value. As with #behavior=, this can be a single value, array, or an + # object that responds to +call+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:119 + def disallowed_behavior=(behavior); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:124 + def arity_coerce(behavior); end + + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:143 + def arity_of_callable(callable); end +end + +# Default warning behaviors per Rails.env. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:13 +ActiveSupport::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:5 +module ActiveSupport::Deprecation::DeprecatedConstantAccessor + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:6 + def included(base); end + end +end + +# DeprecatedConstantProxy transforms a constant into a deprecated one. It takes the full names of an old +# (deprecated) constant and of a new constant (both in string form) and a deprecator. The deprecated constant now +# returns the value of the new one. +# +# PLANETS = %w(mercury venus earth mars jupiter saturn uranus neptune pluto) +# +# # (In a later update, the original implementation of `PLANETS` has been removed.) +# +# PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) +# PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("PLANETS", "PLANETS_POST_2006", ActiveSupport::Deprecation.new) +# +# PLANETS.map { |planet| planet.capitalize } +# # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead. +# (Backtrace information…) +# ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:120 +class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:128 + def initialize(old_const, new_const, deprecator, message: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:158 + def append_features(base); end + + # Returns the class of the new constant. + # + # PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) + # PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006') + # PLANETS.class # => Array + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:154 + def class; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:168 + def extended(base); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def hash(*, **, &); end + + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:141 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def instance_methods(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def name(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:163 + def prepend_features(base); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def respond_to?(*, **, &); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:178 + def const_missing(name); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:183 + def method_missing(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:174 + def target; end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:121 + def new(*args, **options, &block); end + end +end + +# DeprecatedInstanceVariableProxy transforms an instance variable into a deprecated one. It takes an instance of a +# class, a method on that class, an instance variable, and a deprecator as the last argument. +# +# Trying to use the deprecated instance variable will result in a deprecation warning, pointing to the method as a +# replacement. +# +# class Example +# def initialize +# @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, ActiveSupport::Deprecation.new) +# @_request = :special_request +# end +# +# def request +# @_request +# end +# +# def old_request +# @request +# end +# end +# +# example = Example.new +# # => # +# +# example.old_request.to_s +# # => DEPRECATION WARNING: @request is deprecated! Call request.to_s instead of +# @request.to_s +# (Backtrace information…) +# "special_request" +# +# example.request.to_s +# # => "special_request" +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:87 +class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:88 + def initialize(instance, method, var = T.unsafe(nil), deprecator:); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:96 + def target; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:100 + def warn(callstack, called, args); end +end + +# DeprecatedObjectProxy transforms an object into a deprecated one. It takes an object, a deprecation message, and +# a deprecator. +# +# deprecated_object = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(Object.new, "This object is now deprecated", ActiveSupport::Deprecation.new) +# # => # +# +# deprecated_object.to_s +# DEPRECATION WARNING: This object is now deprecated. +# (Backtrace) +# # => "#" +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:38 +class ActiveSupport::Deprecation::DeprecatedObjectProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:39 + def initialize(object, message, deprecator); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:46 + def target; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:50 + def warn(callstack, called, args); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:5 +class ActiveSupport::Deprecation::DeprecationProxy + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:17 + def inspect; end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:22 + def method_missing(called, *args, &block); end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:6 + def new(*args, **kwargs, &block); end + end +end + +# A managed collection of deprecators. Configuration methods, such as +# #behavior=, affect all deprecators in the collection. Additionally, the +# #silence method silences all deprecators in the collection for the +# duration of a given block. +# +# pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:9 +class ActiveSupport::Deprecation::Deprecators + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:10 + def initialize; end + + # Returns a deprecator added to this collection via #[]=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:16 + def [](name); end + + # Adds a given +deprecator+ to this collection. The deprecator will be + # immediately configured with any options previously set on this + # collection. + # + # deprecators = ActiveSupport::Deprecation::Deprecators.new + # deprecators.debug = true + # + # foo_deprecator = ActiveSupport::Deprecation.new("2.0", "Foo") + # foo_deprecator.debug # => false + # + # deprecators[:foo] = foo_deprecator + # deprecators[:foo].debug # => true + # foo_deprecator.debug # => true + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:34 + def []=(name, deprecator); end + + # Sets the deprecation warning behavior for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#behavior=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:60 + def behavior=(behavior); end + + # Sets the debug flag for all deprecators in this collection. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:52 + def debug=(debug); end + + # Sets the disallowed deprecation warning behavior for all deprecators in + # this collection. + # + # See ActiveSupport::Deprecation#disallowed_behavior=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:68 + def disallowed_behavior=(disallowed_behavior); end + + # Sets the disallowed deprecation warnings for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#disallowed_warnings=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:76 + def disallowed_warnings=(disallowed_warnings); end + + # Iterates over all deprecators in this collection. If no block is given, + # returns an +Enumerator+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:41 + def each(&block); end + + # Silences all deprecators in this collection for the duration of the + # given block. + # + # See ActiveSupport::Deprecation#silence. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:84 + def silence(&block); end + + # Sets the silenced flag for all deprecators in this collection. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:47 + def silenced=(silenced); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:97 + def apply_options(deprecator); end + + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:92 + def set_option(name, value); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:5 +module ActiveSupport::Deprecation::Disallowed + # Sets the criteria used to identify deprecation messages which should be + # disallowed. Can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings.) These are compared against + # the text of the generated deprecation warning. + # + # Additionally the scalar symbol +:all+ may be used to treat all + # deprecations as disallowed. + # + # Deprecations matching a substring or regular expression will be handled + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:21 + def disallowed_warnings; end + + # Sets the criteria used to identify deprecation messages which should be + # disallowed. Can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings.) These are compared against + # the text of the generated deprecation warning. + # + # Additionally the scalar symbol +:all+ may be used to treat all + # deprecations as disallowed. + # + # Deprecations matching a substring or regular expression will be handled + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:17 + def disallowed_warnings=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:26 + def deprecation_disallowed?(message); end + + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:39 + def explicitly_allowed?(message); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation.rb:57 +ActiveSupport::Deprecation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:8 +module ActiveSupport::Deprecation::MethodWrapper + # Declare that a method has been deprecated. + # + # class Fred + # def aaa; end + # def bbb; end + # def ccc; end + # def ddd; end + # def eee; end + # end + # + # deprecator = ActiveSupport::Deprecation.new('next-release', 'MyGem') + # + # deprecator.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead') + # # => Fred + # + # Fred.new.aaa + # # DEPRECATION WARNING: aaa is deprecated and will be removed from MyGem next-release. (called from irb_binding at (irb):10) + # # => nil + # + # Fred.new.bbb + # # DEPRECATION WARNING: bbb is deprecated and will be removed from MyGem next-release (use zzz instead). (called from irb_binding at (irb):11) + # # => nil + # + # Fred.new.ccc + # # DEPRECATION WARNING: ccc is deprecated and will be removed from MyGem next-release (use Bar#ccc instead). (called from irb_binding at (irb):12) + # # => nil + # + # pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:35 + def deprecate_methods(target_module, *method_names); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:7 +module ActiveSupport::Deprecation::Reporting + # Allow previously disallowed deprecation warnings within the block. + # allowed_warnings can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings). These are compared against + # the text of deprecation warning messages generated within the block. + # Matching warnings will be exempt from the rules set by + # ActiveSupport::Deprecation#disallowed_warnings. + # + # The optional if: argument accepts a truthy/falsy value or an object that + # responds to .call. If truthy, then matching warnings will be allowed. + # If falsey then the method yields to the block without allowing the warning. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.disallowed_behavior = :raise + # deprecator.disallowed_warnings = [ + # "something broke" + # ] + # + # deprecator.warn('something broke!') + # # => ActiveSupport::DeprecationException + # + # deprecator.allow ['something broke'] do + # deprecator.warn('something broke!') + # end + # # => nil + # + # deprecator.allow ['something broke'], if: Rails.env.production? do + # deprecator.warn('something broke!') + # end + # # => ActiveSupport::DeprecationException for dev/test, nil for production + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:89 + def allow(allowed_warnings = T.unsafe(nil), if: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:48 + def begin_silence; end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:99 + def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:52 + def end_silence; end + + # Name of gem where method is deprecated + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 + def gem_name; end + + # Name of gem where method is deprecated + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 + def gem_name=(_arg0); end + + # Silence deprecation warnings within the block. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.warn('something broke!') + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # deprecator.silence do + # deprecator.warn('something broke!') + # end + # # => nil + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:41 + def silence(&block); end + + # Whether to print a message (silent mode) + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:56 + def silenced; end + + # Whether to print a message (silent mode) + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:9 + def silenced=(_arg0); end + + # Outputs a deprecation warning to the output configured by + # ActiveSupport::Deprecation#behavior. + # + # ActiveSupport::Deprecation.new.warn('something broke!') + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:18 + def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end + + private + + # Outputs a deprecation warning message + # + # deprecated_method_warning(:method_name) + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon}" + # deprecated_method_warning(:method_name, :another_method) + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (use another_method instead)" + # deprecated_method_warning(:method_name, "Optional message") + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (Optional message)" + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:115 + def deprecated_method_warning(method_name, message = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:129 + def deprecation_caller_message(callstack); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:124 + def deprecation_message(callstack, message = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:140 + def extract_callstack(callstack); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:157 + def ignored_callstack?(path); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:154 +ActiveSupport::Deprecation::Reporting::LIB_DIR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:152 +ActiveSupport::Deprecation::Reporting::RAILS_GEM_ROOT = T.let(T.unsafe(nil), String) + +# Raised when ActiveSupport::Deprecation::Behavior#behavior is set with :raise. +# You would set :raise, as a behavior to raise errors and proactively report exceptions from deprecations. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:8 +class ActiveSupport::DeprecationException < ::StandardError; end + +# = Active Support Descendants Tracker +# +# This module provides an internal implementation to track descendants +# which is faster than iterating through +ObjectSpace+. +# +# However Ruby 3.1 provide a fast native +Class#subclasses+ method, +# so if you know your code won't be executed on older rubies, including +# +ActiveSupport::DescendantsTracker+ does not provide any benefit. +# +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:14 +module ActiveSupport::DescendantsTracker + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:107 + def descendants; end + + class << self + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:78 + def clear(classes); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:102 + def descendants(klass); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:69 + def disable_clear!; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:89 + def reject!(classes); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:98 + def subclasses(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:58 +module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:63 + def descendants; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 + def subclasses; end +end + +# On MRI `ObjectSpace::WeakMap` keys are weak references. +# So we can simply use WeakMap as a `Set`. +# On TruffleRuby `ObjectSpace::WeakMap` keys are strong references. +# So we use `object_id` as a key and the actual object as a value. +# +# JRuby for now doesn't have Class#descendant, but when it will, it will likely +# have the same WeakMap semantic than Truffle so we future proof this as much as possible. +# +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:20 +class ActiveSupport::DescendantsTracker::WeakSet < ::ObjectSpace::WeakMap + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:23 + def <<(object); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:21 + def to_a; end +end + +# pkg:gem/activesupport#lib/active_support/digest.rb:6 +class ActiveSupport::Digest + class << self + # pkg:gem/activesupport#lib/active_support/digest.rb:8 + def hash_digest_class; end + + # pkg:gem/activesupport#lib/active_support/digest.rb:12 + def hash_digest_class=(klass); end + + # pkg:gem/activesupport#lib/active_support/digest.rb:17 + def hexdigest(arg); end + end +end + +# = Active Support \Duration +# +# Provides accurate date and time measurements using Date#advance and +# Time#advance, respectively. It mainly supports the methods on Numeric. +# +# 1.month.ago # equivalent to Time.now.advance(months: -1) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:14 +class ActiveSupport::Duration + # pkg:gem/activesupport#lib/active_support/duration.rb:226 + def initialize(value, parts, variable = T.unsafe(nil)); end + + # Returns the modulo of this Duration by another Duration or Numeric. + # Numeric values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:312 + def %(other); end + + # Multiplies this Duration by a Numeric and returns a new Duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:287 + def *(other); end + + # Adds another Duration or a Numeric to this Duration. Numeric values + # are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:268 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:326 + def +@; end + + # Subtracts another Duration or a Numeric from this Duration. Numeric + # values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:282 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:322 + def -@; end + + # Divides this Duration by a Numeric and returns a new Duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:298 + def /(other); end + + # Compares one Duration with another or a Numeric to this Duration. + # Numeric values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:258 + def <=>(other); end + + # Returns +true+ if +other+ is also a Duration instance with the + # same +value+, or if other == value. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:341 + def ==(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:481 + def _parts; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def abs(&); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:440 + def after(time = T.unsafe(nil)); end + + # Calculates a new Time or Date that is as far in the past + # as this Duration represents. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:444 + def ago(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:459 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:448 + def before(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:245 + def coerce(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:467 + def encode_with(coder); end + + # Returns +true+ if +other+ is also a Duration instance, which has the + # same parts as this one. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:426 + def eql?(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:439 + def from_now(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:430 + def hash; end + + # Returns the amount of days a duration covers as a float + # + # 12.hours.in_days # => 0.5 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:399 + def in_days; end + + # Returns the amount of hours a duration covers as a float + # + # 1.day.in_hours # => 24.0 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:392 + def in_hours; end + + # Returns the amount of minutes a duration covers as a float + # + # 1.day.in_minutes # => 1440.0 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:385 + def in_minutes; end + + # Returns the amount of months a duration covers as a float + # + # 9.weeks.in_months # => 2.07 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:413 + def in_months; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:380 + def in_seconds; end + + # Returns the amount of weeks a duration covers as a float + # + # 2.months.in_weeks # => 8.696 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:406 + def in_weeks; end + + # Returns the amount of years a duration covers as a float + # + # 30.days.in_years # => 0.082 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:420 + def in_years; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:463 + def init_with(coder); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:450 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:335 + def instance_of?(klass); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:330 + def is_a?(klass); end + + # Build ISO 8601 Duration string for this duration. + # The +precision+ parameter can be used to limit seconds' precision of duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:473 + def iso8601(precision: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:333 + def kind_of?(klass); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def negative?(&); end + + # Returns a copy of the parts hash that defines the duration. + # + # 5.minutes.parts # => {:minutes=>5} + # 3.years.parts # => {:years=>3} + # + # pkg:gem/activesupport#lib/active_support/duration.rb:241 + def parts; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def positive?(&); end + + # Calculates a new Time or Date that is as far in the future + # as this Duration represents. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:436 + def since(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def to_f(&); end + + # Returns the number of seconds that this Duration represents. + # + # 1.minute.to_i # => 60 + # 1.hour.to_i # => 3600 + # 1.day.to_i # => 86400 + # + # Note that this conversion makes some assumptions about the + # duration of some periods, e.g. months are always 1/12 of year + # and years are 365.2425 days: + # + # # equivalent to (1.year / 12).to_i + # 1.month.to_i # => 2629746 + # + # # equivalent to 365.2425.days.to_i + # 1.year.to_i # => 31556952 + # + # In such cases, Ruby's core + # Date[https://docs.ruby-lang.org/en/master/Date.html] and + # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision + # date and time arithmetic. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:377 + def to_i; end + + # Returns the amount of seconds a duration covers as a string. + # For more information check to_i method. + # + # 1.day.to_s # => "86400" + # + # pkg:gem/activesupport#lib/active_support/duration.rb:353 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:447 + def until(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:133 + def value; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:477 + def variable?; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + def zero?(&); end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:516 + def method_missing(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:520 + def raise_type_error(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:512 + def respond_to_missing?(method, _); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:486 + def sum(sign, time = T.unsafe(nil)); end + + class << self + # pkg:gem/activesupport#lib/active_support/duration.rb:149 + def ===(other); end + + # Creates a new Duration from a seconds value that is converted + # to the individual parts: + # + # ActiveSupport::Duration.build(31556952).parts # => {:years=>1} + # ActiveSupport::Duration.build(2716146).parts # => {:months=>1, :days=>1} + # + # pkg:gem/activesupport#lib/active_support/duration.rb:189 + def build(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:167 + def days(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:163 + def hours(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:159 + def minutes(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:175 + def months(value); end + + # Creates a new Duration from string formatted according to ISO 8601 Duration. + # + # See {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601#Durations] for more information. + # This method allows negative parts to be present in pattern. + # If invalid string is provided, it will raise +ActiveSupport::Duration::ISO8601Parser::ParsingError+. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:144 + def parse(iso8601duration); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:155 + def seconds(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:171 + def weeks(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:179 + def years(value); end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:217 + def calculate_total_seconds(parts); end + end +end + +# Parses a string formatted according to ISO 8601 Duration into the hash. +# +# See {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601#Durations] for more information. +# +# This parser allows negative parts to be present in pattern. +# +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:12 +class ActiveSupport::Duration::ISO8601Parser + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:34 + def initialize(string); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def mode; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def mode=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:41 + def parse!; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 + def parts; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 + def scanner; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def sign; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def sign=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:83 + def finished?; end + + # Parses number which can be a float with either comma or period. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:88 + def number; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:96 + def raise_parsing_error(reason = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:92 + def scan(pattern); end + + # Checks for various semantic errors as stated in ISO 8601 standard. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:101 + def validate!; end +end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:17 +ActiveSupport::Duration::ISO8601Parser::COMMA = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:22 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:28 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:20 +ActiveSupport::Duration::ISO8601Parser::DATE_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:25 +ActiveSupport::Duration::ISO8601Parser::DATE_TO_PART = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:16 +ActiveSupport::Duration::ISO8601Parser::PERIOD = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:15 +ActiveSupport::Duration::ISO8601Parser::PERIOD_OR_COMMA = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:13 +class ActiveSupport::Duration::ISO8601Parser::ParsingError < ::ArgumentError; end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:19 +ActiveSupport::Duration::ISO8601Parser::SIGN_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:23 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:29 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:21 +ActiveSupport::Duration::ISO8601Parser::TIME_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:26 +ActiveSupport::Duration::ISO8601Parser::TIME_TO_PART = T.let(T.unsafe(nil), Hash) + +# Serializes duration to string according to ISO 8601 Duration format. +# +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:6 +class ActiveSupport::Duration::ISO8601Serializer + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:9 + def initialize(duration, precision: T.unsafe(nil)); end + + # Builds and returns output string. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:15 + def serialize; end + + private + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:55 + def format_seconds(seconds); end + + # Return pair of duration's parts and whole duration sign. + # Parts are summarized (as they can become repetitive due to addition, etc). + # Zero parts are removed as not significant. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:38 + def normalize; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:51 + def week_mixed_with_date?(parts); end +end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:7 +ActiveSupport::Duration::ISO8601Serializer::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration.rb:130 +ActiveSupport::Duration::PARTS = T.let(T.unsafe(nil), Array) + +# length of a gregorian year (365.2425 days) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:120 +ActiveSupport::Duration::PARTS_IN_SECONDS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/duration.rb:115 +ActiveSupport::Duration::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:114 +ActiveSupport::Duration::SECONDS_PER_HOUR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:113 +ActiveSupport::Duration::SECONDS_PER_MINUTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:117 +ActiveSupport::Duration::SECONDS_PER_MONTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:116 +ActiveSupport::Duration::SECONDS_PER_WEEK = T.let(T.unsafe(nil), Integer) + +# 1/12 of a gregorian year +# +# pkg:gem/activesupport#lib/active_support/duration.rb:118 +ActiveSupport::Duration::SECONDS_PER_YEAR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:15 +class ActiveSupport::Duration::Scalar < ::Numeric + # pkg:gem/activesupport#lib/active_support/duration.rb:19 + def initialize(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:85 + def %(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:66 + def *(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:41 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:53 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:27 + def -@; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:77 + def /(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:31 + def <=>(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:23 + def coerce(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_f(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_i(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_s(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:16 + def value; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:93 + def variable?; end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:98 + def calculate(op, other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:108 + def raise_type_error(other); end +end + +# pkg:gem/activesupport#lib/active_support/duration.rb:131 +ActiveSupport::Duration::VARIABLE_PARTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/editor.rb:6 +class ActiveSupport::Editor + # pkg:gem/activesupport#lib/active_support/editor.rb:48 + def initialize(url_pattern); end + + # pkg:gem/activesupport#lib/active_support/editor.rb:52 + def url_for(path, line); end + + class << self + # Returns the current editor pattern if it is known. + # First check for the `RAILS_EDITOR` environment variable, and if it's + # missing, check for the `EDITOR` environment variable. + # + # pkg:gem/activesupport#lib/active_support/editor.rb:28 + def current; end + + # pkg:gem/activesupport#lib/active_support/editor.rb:39 + def find(name); end + + # Registers a URL pattern for opening file in a given editor. + # This allows Rails to generate clickable links to control known editors. + # + # Example: + # + # ActiveSupport::Editor.register("myeditor", "myeditor://%s:%d") + # + # pkg:gem/activesupport#lib/active_support/editor.rb:17 + def register(name, url_pattern, aliases: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/editor.rb:43 + def reset; end + end +end + +# = Encrypted Configuration +# +# Provides convenience methods on top of EncryptedFile to access values stored +# as encrypted YAML. +# +# Values can be accessed via +Hash+ methods, such as +fetch+ and +dig+, or via +# dynamic accessor methods, similar to OrderedOptions. +# +# my_config = ActiveSupport::EncryptedConfiguration.new(...) +# my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" +# +# my_config[:some_secret] +# # => 123 +# my_config.some_secret +# # => 123 +# my_config.dig(:some_namespace, :another_secret) +# # => 456 +# my_config.some_namespace.another_secret +# # => 456 +# my_config.fetch(:foo) +# # => KeyError +# my_config.foo! +# # => KeyError +# +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:35 +class ActiveSupport::EncryptedConfiguration < ::ActiveSupport::EncryptedFile + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:54 + def initialize(config_path:, key_path:, env_key:, raise_if_missing_key:); end + + # Returns the decrypted content as a Hash with symbolized keys. + # + # my_config = ActiveSupport::EncryptedConfiguration.new(...) + # my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" + # + # my_config.config + # # => { some_secret: 123, some_namespace: { another_secret: 789 } } + # + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:85 + def config; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:89 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:52 + def method_missing(method, *, **, &); end + + # Reads the file and returns the decrypted content. See EncryptedFile#read. + # + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:62 + def read; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:69 + def validate!; end + + private + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:94 + def deep_symbolize_keys(hash); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:102 + def deep_transform(hash); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:116 + def deserialize(content); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:112 + def options; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:52 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:36 +class ActiveSupport::EncryptedConfiguration::InvalidContentError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:37 + def initialize(content_path); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:41 + def message; end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:46 +class ActiveSupport::EncryptedConfiguration::InvalidKeyError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:47 + def initialize(content_path, key); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:8 +class ActiveSupport::EncryptedFile + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:42 + def initialize(content_path:, key_path:, env_key:, raise_if_missing_key:); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:83 + def change(&block); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def content_path; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def env_key; end + + # Returns the encryption key, first trying the environment variable + # specified by +env_key+, then trying the key file specified by +key_path+. + # If +raise_if_missing_key+ is true, raises MissingKeyError if the + # environment variable is not set and the key file does not exist. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:52 + def key; end + + # Returns truthy if #key is truthy. Returns falsy otherwise. Unlike #key, + # does not raise MissingKeyError when +raise_if_missing_key+ is true. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:58 + def key?; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def key_path; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def raise_if_missing_key; end + + # Reads the file and returns the decrypted content. + # + # Raises: + # - MissingKeyError if the key is missing and +raise_if_missing_key+ is true. + # - MissingContentError if the encrypted file does not exist or otherwise + # if the key is missing. + # - ActiveSupport::MessageEncryptor::InvalidMessage if the content cannot be + # decrypted or verified. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:70 + def read; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:78 + def write(contents); end + + private + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:129 + def check_key_length; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:108 + def decrypt(contents); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:103 + def encrypt(contents); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:112 + def encryptor; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:125 + def handle_missing_key; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:117 + def read_env_key; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:121 + def read_key_file; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:89 + def writing(contents); end + + class << self + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:35 + def expected_key_length; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:31 + def generate_key; end + end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:29 +ActiveSupport::EncryptedFile::CIPHER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:23 +class ActiveSupport::EncryptedFile::InvalidKeyLengthError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:24 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:9 +class ActiveSupport::EncryptedFile::MissingContentError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:10 + def initialize(content_path); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:15 +class ActiveSupport::EncryptedFile::MissingKeyError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:16 + def initialize(key_path:, env_key:); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:4 +module ActiveSupport::EnumerableCoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:5 +module ActiveSupport::EnumerableCoreExt::Constants + private + + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:7 + def const_missing(name); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:25 +ActiveSupport::EnumerableCoreExt::SoleItemExpectedError = Enumerable::SoleItemExpectedError + +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:7 +class ActiveSupport::EnvironmentInquirer < ::ActiveSupport::StringInquirer + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:15 + def initialize(env); end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def development?; end + + # Returns true if we're in the development or test environment. + # + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:36 + def local?; end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def production?; end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def test?; end +end + +# Optimization for the three default environments, so this inquirer doesn't need to rely on +# the slower delegation through method_missing that StringInquirer would normally entail. +# +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:10 +ActiveSupport::EnvironmentInquirer::DEFAULT_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# Environments that'll respond true for #local? +# +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:13 +ActiveSupport::EnvironmentInquirer::LOCAL_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# = Active Support \Error Reporter +# +# +ActiveSupport::ErrorReporter+ is a common interface for error reporting services. +# +# To rescue and report any unhandled error, you can use the #handle method: +# +# Rails.error.handle do +# do_something! +# end +# +# If an error is raised, it will be reported and swallowed. +# +# Alternatively, if you want to report the error but not swallow it, you can use #record: +# +# Rails.error.record do +# do_something! +# end +# +# Both methods can be restricted to handle only a specific error class: +# +# maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } +# +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:26 +class ActiveSupport::ErrorReporter + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:35 + def initialize(*subscribers, logger: T.unsafe(nil)); end + + # Add a middleware to modify the error context before it is sent to subscribers. + # + # Middleware is added to a stack of callables run on an error's execution context + # before passing to subscribers. Allows creation of entries in error context that + # are shared by all subscribers. + # + # A context middleware receives the same parameters as #report. + # It must return a hash - the middleware stack returns the hash after it has + # run through all middlewares. A middleware can mutate or replace the hash. + # + # Rails.error.add_middleware(-> (error, context) { context.merge({ foo: :bar }) }) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:218 + def add_middleware(middleware); end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def debug_mode; end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def debug_mode=(_arg0); end + + # Prevent a subscriber from being notified of errors for the + # duration of the block. You may pass in the subscriber itself, or its class. + # + # This can be helpful for error reporting service integrations, when they wish + # to handle any errors higher in the stack. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:186 + def disable(subscriber); end + + # Evaluates the given block, reporting and swallowing any unhandled error. + # If no error is raised, returns the return value of the block. Otherwise, + # returns the result of +fallback.call+, or +nil+ if +fallback+ is not + # specified. + # + # # Will report a TypeError to all subscribers and return nil. + # Rails.error.handle do + # 1 + '1' + # end + # + # Can be restricted to handle only specific error classes: + # + # maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:warning+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.handle(context: { section: "admin" }) do + # # ... + # end + # + # * +:fallback+ - A callable that provides +handle+'s return value when an + # unhandled error is raised. For example: + # + # user = Rails.error.handle(fallback: -> { User.anonymous }) do + # User.find_by(params) + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:79 + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def logger; end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:31 + def logger=(_arg0); end + + # Evaluates the given block, reporting and re-raising any unhandled error. + # If no error is raised, returns the return value of the block. + # + # # Will report a TypeError to all subscribers and re-raise it. + # Rails.error.record do + # 1 + '1' + # end + # + # Can be restricted to handle only specific error classes: + # + # tags = Rails.error.record(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:error+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.record(context: { section: "admin" }) do + # # ... + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:115 + def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Report an error directly to subscribers. You can use this method when the + # block-based #handle and #record methods are not suitable. + # + # Rails.error.report(error) + # + # The +error+ argument must be an instance of Exception. + # + # Rails.error.report(Exception.new("Something went wrong")) + # + # Otherwise you can use #unexpected to report an error which does accept a + # string argument. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:233 + def report(error, handled: T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Update the execution context that is accessible to error subscribers. Any + # context passed to #handle, #record, or #report will be merged with the + # context set here. + # + # Rails.error.set_context(section: "checkout", user_id: @user.id) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:202 + def set_context(*, **, &); end + + # Register a new error subscriber. The subscriber must respond to + # + # report(Exception, handled: Boolean, severity: (:error OR :warning OR :info), context: Hash, source: String) + # + # The +report+ method should never raise an error. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:162 + def subscribe(subscriber); end + + # Either report the given error when in production, or raise it when in development or test. + # + # When called in production, after the error is reported, this method will return + # nil and execution will continue. + # + # When called in development, the original error is wrapped in a different error class to ensure + # it's not being rescued higher in the stack and will be surfaced to the developer. + # + # This method is intended for reporting violated assertions about preconditions, or similar + # cases that can and should be gracefully handled in production, but that aren't supposed to happen. + # + # The error can be either an exception instance or a String. + # + # example: + # + # def edit + # if published? + # Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible") + # return false + # end + # # ... + # end + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:146 + def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Unregister an error subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyErrorSubscriber.new + # Rails.error.subscribe(subscriber) + # + # Rails.error.unsubscribe(subscriber) + # # or + # Rails.error.unsubscribe(MyErrorSubscriber) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:177 + def unsubscribe(subscriber); end + + private + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:278 + def ensure_backtrace(error); end +end + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:29 +ActiveSupport::ErrorReporter::DEFAULT_RESCUE = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:28 +ActiveSupport::ErrorReporter::DEFAULT_SOURCE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:298 +class ActiveSupport::ErrorReporter::ErrorContextMiddlewareStack + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:299 + def initialize; end + + # Run all middlewares in the stack + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:313 + def execute(error, handled:, severity:, context:, source:); end + + # Add a middleware to the error context stack. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:304 + def use(middleware); end +end + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:27 +ActiveSupport::ErrorReporter::SEVERITIES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:33 +class ActiveSupport::ErrorReporter::UnexpectedError < ::Exception; end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:49 +class ActiveSupport::EventContext + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:65 + def clear; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:54 + def context; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:58 + def set_context(context_hash); end + end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:50 +ActiveSupport::EventContext::EMPTY_CONTEXT = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:51 +ActiveSupport::EventContext::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support \Event Reporter +# +# +ActiveSupport::EventReporter+ provides an interface for reporting structured events to subscribers. +# +# To report an event, you can use the +notify+ method: +# +# Rails.event.notify("user_created", { id: 123 }) +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# The +notify+ API can receive either an event name and a payload hash, or an event object. Names are coerced to strings. +# +# === Event Objects +# +# If an event object is passed to the +notify+ API, it will be passed through to subscribers as-is, and the name of the +# object's class will be used as the event name. +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# Rails.event.notify(UserCreatedEvent.new(id: 123, name: "John Doe")) +# # Emits event: +# # { +# # name: "UserCreatedEvent", +# # payload: #, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# An event is any Ruby object representing a schematized event. While payload hashes allow arbitrary, +# implicitly-structured data, event objects are intended to enforce a particular schema. +# +# Subscribers are responsible for serializing event objects. +# +# === Subscribers +# +# Subscribers must implement the +emit+ method, which will be called with the event hash. +# +# The event hash has the following keys: +# +# name: String (The name of the event) +# payload: Hash, Object (The payload of the event, or the event object itself) +# tags: Hash (The tags of the event) +# context: Hash (The context of the event) +# timestamp: Integer (The timestamp of the event, in nanoseconds) +# source_location: Hash (The source location of the event, containing the filepath, lineno, and label) +# +# Subscribers are responsible for encoding events to their desired format before emitting them to their +# target destination, such as a streaming platform, a log device, or an alerting service. +# +# class JSONEventSubscriber +# def emit(event) +# json_data = JSON.generate(event) +# LogExporter.export(json_data) +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload].map { |key, value| "#{key}=#{value}" }.join(" ") +# source_location = event[:source_location] +# log = "[#{event[:name]}] #{payload} at #{source_location[:filepath]}:#{source_location[:lineno]}" +# Rails.logger.info(log) +# end +# end +# +# Note that event objects are passed through to subscribers as-is, and may need to be serialized before being encoded: +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload] +# json_data = JSON.generate(payload.serialize) +# LogExporter.export(json_data) +# end +# end +# +# ==== Filtered Subscriptions +# +# Subscribers can be configured with an optional filter proc to only receive a subset of events: +# +# # Only receive events with names starting with "user." +# Rails.event.subscribe(user_subscriber) { |event| event[:name].start_with?("user.") } +# +# # Only receive events with specific payload types +# Rails.event.subscribe(audit_subscriber) { |event| event[:payload].is_a?(AuditEvent) } +# +# === Debug Events +# +# You can use the +debug+ method to report an event that will only be reported if the +# event reporter is in debug mode: +# +# Rails.event.debug("my_debug_event", { foo: "bar" }) +# +# === Tags +# +# To add additional context to an event, separate from the event payload, you can add +# tags via the +tagged+ method: +# +# Rails.event.tagged("graphql") do +# Rails.event.notify("user_created", { id: 123 }) +# end +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: { graphql: true }, +# # context: {}, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# === Context Store +# +# You may want to attach metadata to every event emitted by the reporter. While tags +# provide domain-specific context for a series of events, context is scoped to the job / request +# and should be used for metadata associated with the execution context. +# Context can be set via the +set_context+ method: +# +# Rails.event.set_context(request_id: "abcd123", user_agent: "TestAgent") +# Rails.event.notify("user_created", { id: 123 }) +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: {}, +# # context: { request_id: "abcd123", user_agent: "TestAgent" }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# Context is reset automatically before and after each request. +# +# A custom context store can be configured via +config.active_support.event_reporter_context_store+. +# +# # config/application.rb +# config.active_support.event_reporter_context_store = CustomContextStore +# +# class CustomContextStore +# class << self +# def context +# # Return the context. +# end +# +# def set_context(context_hash) +# # Append context_hash to the existing context store. +# end +# +# def clear +# # Delete the stored context. +# end +# end +# end +# +# The Event Reporter standardizes on symbol keys for all payload data, tags, and context store entries. +# String keys are automatically converted to symbols for consistency. +# +# Rails.event.notify("user.created", { "id" => 123 }) +# # Emits event: +# # { +# # name: "user.created", +# # payload: { id: 123 }, +# # } +# +# === Security +# +# When reporting events, Hash-based payloads are automatically filtered to remove sensitive data based on {Rails.application.filter_parameters}[https://guides.rubyonrails.org/configuring.html#config-filter-parameters]. +# +# If an {event object}[rdoc-ref:EventReporter@Event+Objects] is given instead, subscribers will need to filter sensitive data themselves, e.g. with ActiveSupport::ParameterFilter. +# +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:271 +class ActiveSupport::EventReporter + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:286 + def initialize(*subscribers, raise_on_error: T.unsafe(nil)); end + + # Clears all context data. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:525 + def clear_context; end + + # Returns the current context data. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:530 + def context; end + + # Report an event only when in debug mode. For example: + # + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:435 + def debug(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:276 + def debug_mode=(_arg0); end + + # Check if debug mode is currently enabled. Debug mode is enabled on the reporter + # via +with_debug+, and in local environments. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:420 + def debug_mode?; end + + # Reports an event to all registered subscribers. An event name and payload can be provided: + # + # Rails.event.notify("user.created", { id: 123 }) + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Alternatively, an event object can be provided: + # + # Rails.event.notify(UserCreatedEvent.new(id: 123)) + # # Emits event: + # # { + # # name: "UserCreatedEvent", + # # payload: #, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:363 + def notify(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Sets whether to raise an error if a subscriber raises an error during + # event emission, or when unexpected arguments are passed to +notify+. + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:274 + def raise_on_error=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:534 + def reload_payload_filter; end + + # Sets context data that will be included with all events emitted by the reporter. + # Context data should be scoped to the job or request, and is reset automatically + # before and after each request and job. + # + # Rails.event.set_context(user_agent: "TestAgent") + # Rails.event.set_context(job_id: "abc123") + # Rails.event.tagged("graphql") do + # Rails.event.notify("user_created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user_created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: { user_agent: "TestAgent", job_id: "abc123" }, + # # timestamp: 1738964843208679035 + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:520 + def set_context(context); end + + # Registers a new event subscriber. The subscriber must respond to + # + # emit(event: Hash) + # + # The event hash will have the following keys: + # + # name: String (The name of the event) + # payload: Hash, Object (The payload of the event, or the event object itself) + # tags: Hash (The tags of the event) + # context: Hash (The context of the event) + # timestamp: Integer (The timestamp of the event, in nanoseconds) + # source_location: Hash (The source location of the event, containing the filepath, lineno, and label) + # + # An optional filter proc can be provided to only receive a subset of events: + # + # Rails.event.subscribe(subscriber) { |event| event[:name].start_with?("user.") } + # Rails.event.subscribe(subscriber) { |event| event[:payload].is_a?(UserEvent) } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:311 + def subscribe(subscriber, &filter); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:278 + def subscribers; end + + # Add tags to events to supply additional context. Tags operate in a stack-oriented manner, + # so all events emitted within the block inherit the same set of tags. For example: + # + # Rails.event.tagged("graphql") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Tags can be provided as arguments or as keyword arguments, and can be nested: + # + # Rails.event.tagged("graphql") do + # # Other code here... + # Rails.event.tagged(section: "admin") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { section: "admin", graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # The +tagged+ API can also receive a tag object: + # + # graphql_tag = GraphqlTag.new(operation_name: "user_created", operation_type: "mutation") + # Rails.event.tagged(graphql_tag) do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { "GraphqlTag": # }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:497 + def tagged(*args, **kwargs, &block); end + + # Unregister an event subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyEventSubscriber.new + # Rails.event.subscribe(subscriber) + # + # Rails.event.unsubscribe(subscriber) + # # or + # Rails.event.unsubscribe(MyEventSubscriber) + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:326 + def unsubscribe(subscriber); end + + # Temporarily enables debug mode for the duration of the block. + # Calls to +debug+ will only be reported if debug mode is enabled. + # + # Rails.event.with_debug do + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # end + # + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:410 + def with_debug; end + + private + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:544 + def context_store; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:579 + def handle_unexpected_args(name_or_object, payload, kwargs); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:548 + def payload_filter; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:540 + def raise_on_error?; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:555 + def resolve_name(name_or_object); end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:564 + def resolve_payload(name_or_object, payload, **kwargs); end + + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:281 + def context_store; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:281 + def context_store=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:4 +module ActiveSupport::ExecutionContext + class << self + # pkg:gem/activesupport#lib/active_support/execution_context.rb:76 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:47 + def after_change(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:103 + def clear; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:111 + def current_attributes_instances; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:107 + def flush; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:45 + def nestable; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:45 + def nestable=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:94 + def pop; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:85 + def push; end + + # Updates the execution context. If a block is given, it resets the provided keys to their + # previous value once the block exits. + # + # pkg:gem/activesupport#lib/active_support/execution_context.rb:53 + def set(**options); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:81 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:116 + def record; end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:5 +class ActiveSupport::ExecutionContext::Record + # pkg:gem/activesupport#lib/active_support/execution_context.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:6 + def current_attributes_instances; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:27 + def flush; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:21 + def pop; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:14 + def push; end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:6 + def store; end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:7 +class ActiveSupport::ExecutionWrapper + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_complete_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_run_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:141 + def complete; end + + # Complete this in-flight execution. This method *must* be called + # exactly once on the result of any call to +run!+. + # + # Where possible, prefer +wrap+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:135 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:127 + def run; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:122 + def run!; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:146 + def hook_state; end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _complete_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:14 + def _run_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:118 + def active?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:114 + def active_key; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:110 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:100 + def perform; end + + # Register an object to be invoked during both the +run+ and + # +complete+ steps. + # + # +hook.complete+ will be passed the value returned from +hook.run+, + # and will only be invoked if +run+ has previously been called. + # (Mostly, this means it won't be invoked if an exception occurs in + # a preceding +to_run+ block; all ordinary +to_complete+ blocks are + # invoked in that situation.) + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:50 + def register_hook(hook, outer: T.unsafe(nil)); end + + # Run this execution. + # + # Returns an instance, whose +complete!+ method *must* be invoked + # after the work has been performed. + # + # Where possible, prefer +wrap+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:66 + def run!(reset: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:21 + def to_complete(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:17 + def to_run(*args, &block); end + + # Perform the work in the supplied block as an execution. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:86 + def wrap(source: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 + def __class_attr___callbacks=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 +class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:39 + def after(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def before(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def hook; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def hook=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:32 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:10 +ActiveSupport::ExecutionWrapper::Null = T.let(T.unsafe(nil), Object) + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 +class ActiveSupport::ExecutionWrapper::RunHook < ::Struct + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def before(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def hook; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def hook=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:25 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/executor.rb:6 +class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end + +# = \File Update Checker +# +# FileUpdateChecker specifies the API used by \Rails to watch files +# and control reloading. The API depends on four methods: +# +# * +initialize+ which expects two parameters and one block as +# described below. +# +# * +updated?+ which returns a boolean if there were updates in +# the filesystem or not. +# +# * +execute+ which executes the given block on initialization +# and updates the latest watched files and timestamp. +# +# * +execute_if_updated+ which just executes the block if it was updated. +# +# After initialization, a call to +execute_if_updated+ must execute +# the block only if there was really a change in the filesystem. +# +# This class is used by \Rails to reload the I18n framework whenever +# they are changed upon a new request. +# +# i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do +# I18n.reload! +# end +# +# ActiveSupport::Reloader.to_prepare do +# i18n_reloader.execute_if_updated +# end +# +# pkg:gem/activesupport#lib/active_support/file_update_checker.rb:35 +class ActiveSupport::FileUpdateChecker + # It accepts two parameters on initialization. The first is an array + # of files and the second is an optional hash of directories. The hash must + # have directories as keys and the value is an array of extensions to be + # watched under that directory. + # + # This method must also receive a block that will be called once a path + # changes. The array of files and list of directories cannot be changed + # after FileUpdateChecker has been initialized. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:44 + def initialize(files, dirs = T.unsafe(nil), &block); end + + # Executes the given block and updates the latest watched files and + # timestamp. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:85 + def execute; end + + # Execute the block given if updated. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:95 + def execute_if_updated; end + + # Check if any of the entries were updated. If so, the watched and/or + # updated_at values are cached until the block is executed via +execute+ + # or +execute_if_updated+. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:66 + def updated?; end + + private + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:160 + def compile_ext(array); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:147 + def compile_glob(hash); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:156 + def escape(key); end + + # This method returns the maximum mtime of the files in +paths+, or +nil+ + # if the array is empty. + # + # Files with a mtime in the future are ignored. Such abnormal situation + # can happen for example if the user changes the clock by hand. It is + # healthy to consider this edge case because with mtimes in the future + # reloading is not triggered. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:125 + def max_mtime(paths); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:114 + def updated_at(paths); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:106 + def watched; end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:4 +module ActiveSupport::ForkTracker + class << self + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:31 + def after_fork(&block); end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:19 + def after_fork_callback; end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:27 + def hook!; end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:36 + def unregister(callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:5 +module ActiveSupport::ForkTracker::CoreExt + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 + def _fork; end +end + +# = Active Support \Gzip +# +# A convenient wrapper for the zlib standard library that allows +# compression/decompression of strings with gzip. +# +# gzip = ActiveSupport::Gzip.compress('compress me!') +# # => "\x1F\x8B\b\x00o\x8D\xCDO\x00\x03K\xCE\xCF-(J-.V\xC8MU\x04\x00R>n\x83\f\x00\x00\x00" +# +# ActiveSupport::Gzip.decompress(gzip) +# # => "compress me!" +# +# pkg:gem/activesupport#lib/active_support/gzip.rb:17 +module ActiveSupport::Gzip + class << self + # Compresses a string using gzip. + # + # pkg:gem/activesupport#lib/active_support/gzip.rb:32 + def compress(source, level = T.unsafe(nil), strategy = T.unsafe(nil)); end + + # Decompresses a gzipped string. + # + # pkg:gem/activesupport#lib/active_support/gzip.rb:27 + def decompress(source); end + end +end + +# pkg:gem/activesupport#lib/active_support/gzip.rb:18 +class ActiveSupport::Gzip::Stream < ::StringIO + # pkg:gem/activesupport#lib/active_support/gzip.rb:19 + def initialize(*); end + + # pkg:gem/activesupport#lib/active_support/gzip.rb:23 + def close; end +end + +# = \Hash With Indifferent Access +# +# Implements a hash where keys :foo and "foo" are considered +# to be the same. +# +# rgb = ActiveSupport::HashWithIndifferentAccess.new +# +# rgb[:black] = '#000000' +# rgb[:black] # => '#000000' +# rgb['black'] # => '#000000' +# +# rgb['white'] = '#FFFFFF' +# rgb[:white] # => '#FFFFFF' +# rgb['white'] # => '#FFFFFF' +# +# Internally symbols are mapped to strings when used as keys in the entire +# writing interface (calling []=, merge, etc). This +# mapping belongs to the public interface. For example, given: +# +# hash = ActiveSupport::HashWithIndifferentAccess.new(a: 1) +# +# You are guaranteed that the key is returned as a string: +# +# hash.keys # => ["a"] +# +# Technically other types of keys are accepted: +# +# hash = ActiveSupport::HashWithIndifferentAccess.new(a: 1) +# hash[0] = 0 +# hash # => {"a"=>1, 0=>0} +# +# but this class is intended for use cases where strings or symbols are the +# expected keys and it is convenient to understand both as the same. For +# example the +params+ hash in Ruby on \Rails. +# +# Note that core extensions define Hash#with_indifferent_access: +# +# rgb = { black: '#000000', white: '#FFFFFF' }.with_indifferent_access +# +# which may be handy. +# +# To access this class outside of \Rails, require the core extension with: +# +# require "active_support/core_ext/hash/indifferent_access" +# +# which will, in turn, require this file. +# +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:55 +class ActiveSupport::HashWithIndifferentAccess < ::Hash + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:70 + def initialize(constructor = T.unsafe(nil)); end + + # Same as Hash#[] where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters['foo'] # => 1 + # counters[:foo] # => 1 + # counters[:zoo] # => nil + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:184 + def [](key); end + + # Assigns a new value to the hash: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:key] = 'value' + # + # This value can be later fetched using either +:key+ or 'key'. + # + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:101 + def []=(key, value); end + + # Same as Hash#assoc where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters.assoc('foo') # => ["foo", 1] + # counters.assoc(:foo) # => ["foo", 1] + # counters.assoc(:zoo) # => nil + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:197 + def assoc(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:391 + def compact; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:334 + def deep_symbolize_keys; end + + # Same as Hash#default where the key passed as argument can be + # either a string or a symbol: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new(1) + # hash.default # => 1 + # + # hash = ActiveSupport::HashWithIndifferentAccess.new { |hash, key| key } + # hash.default # => nil + # hash.default('foo') # => 'foo' + # hash.default(:foo) # => 'foo' + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:239 + def default(key = T.unsafe(nil)); end + + # Removes the specified key from the hash. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:317 + def delete(key); end + + # Same as Hash#dig where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = { bar: 1 } + # + # counters.dig('foo', 'bar') # => 1 + # counters.dig(:foo, :bar) # => 1 + # counters.dig(:zoo) # => nil + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:224 + def dig(*args); end + + # Returns a shallow copy of the hash. + # + # hash = ActiveSupport::HashWithIndifferentAccess.new({ a: { b: 'b' } }) + # dup = hash.dup + # dup[:a][:c] = 'c' + # + # hash[:a][:c] # => "c" + # dup[:a][:c] # => "c" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:280 + def dup; end + + # Returns a hash with indifferent access that includes everything except given keys. + # hash = { a: "x", b: "y", c: 10 }.with_indifferent_access + # hash.except(:a, "b") # => {c: 10}.with_indifferent_access + # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:325 + def except(*keys); end + + # Returns +true+ so that Array#extract_options! finds members of + # this class. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:58 + def extractable_options?; end + + # Same as Hash#fetch where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters.fetch('foo') # => 1 + # counters.fetch(:bar, 0) # => 0 + # counters.fetch(:bar) { |key| 0 } # => 0 + # counters.fetch(:zoo) # => KeyError: key not found: "zoo" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:211 + def fetch(key, *extras); end + + # Returns an array of the values at the specified indices, but also + # raises an exception when one of the keys can't be found. + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:a] = 'x' + # hash[:b] = 'y' + # hash.fetch_values('a', 'b') # => ["x", "y"] + # hash.fetch_values('a', 'c') { |key| 'z' } # => ["x", "z"] + # hash.fetch_values('a', 'c') # => KeyError: key not found: "c" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:267 + def fetch_values(*indices, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:341 + def filter(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:172 + def has_key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:171 + def include?(key); end + + # Checks the hash for a key matching the argument passed in: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:167 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:173 + def member?(key); end + + # This method has the same semantics of +update+, except it does not + # modify the receiver but rather returns a new hash with indifferent + # access with the result of the merge. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:287 + def merge(*hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:159 + def merge!(*other_hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:66 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:90 + def regular_update(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:89 + def regular_writer(_arg0, _arg1); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:343 + def reject(*args, &block); end + + # Replaces the contents of this hash with other_hash. + # + # h = { "a" => 100, "b" => 200 } + # h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:312 + def replace(other_hash); end + + # Like +merge+ but the other way around: Merges the receiver into the + # argument and returns a new hash with indifferent access as result: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['a'] = nil + # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:297 + def reverse_merge(other_hash); end + + # Same semantics as +reverse_merge+ but modifies the receiver in-place. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:303 + def reverse_merge!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:337 + def select(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:381 + def slice(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:386 + def slice!(*keys); end + + # Assigns a new value to the hash: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:key] = 'value' + # + # This value can be later fetched using either +:key+ or 'key'. + # + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. unless `convert_value: false` + # is set. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:115 + def store(key, value, convert_value: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:332 + def symbolize_keys; end + + # Convert to a regular hash with string keys. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:396 + def to_hash; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:333 + def to_options; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:335 + def to_options!; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:402 + def to_proc; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:355 + def transform_keys(hash = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:367 + def transform_keys!(hash = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:348 + def transform_values(&block); end + + # Updates the receiver in-place, merging in the hashes passed as arguments: + # + # hash_1 = ActiveSupport::HashWithIndifferentAccess.new + # hash_1[:key] = 'value' + # + # hash_2 = ActiveSupport::HashWithIndifferentAccess.new + # hash_2[:key] = 'New Value!' + # + # hash_1.update(hash_2) # => {"key"=>"New Value!"} + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } + # + # The arguments can be either an + # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. + # In either case the merge respects the semantics of indifferent access. + # + # If the argument is a regular hash with keys +:key+ and "key" only one + # of the values end up in the receiver, but which one is unspecified. + # + # When given a block, the value for duplicated keys will be determined + # by the result of invoking the block with the duplicated key, the value + # in the receiver, and the value in +other_hash+. The rules for duplicated + # keys follow the semantics of indifferent access: + # + # hash_1[:key] = 10 + # hash_2['key'] = 12 + # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:148 + def update(*other_hashes, &block); end + + # Returns an array of the values at the specified indices: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:a] = 'x' + # hash[:b] = 'y' + # hash.values_at('a', 'b') # => ["x", "y"] + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:253 + def values_at(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:300 + def with_defaults(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:306 + def with_defaults!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:62 + def with_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:328 + def without(*keys); end + + private + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:407 + def cast(other); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:411 + def convert_key(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:415 + def convert_value(value, conversion: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:428 + def convert_value_to_hash(value); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:439 + def copy_defaults(target); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:448 + def update_with_single_argument(other_hash, block); end + + class << self + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:85 + def [](*args); end + end +end + +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:353 +ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Object) + +# pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:4 +module ActiveSupport::HtmlSafeTranslation + extend ::ActiveSupport::HtmlSafeTranslation + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:30 + def html_safe_translation_key?(key); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:7 + def translate(key, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:35 + def html_escape_translation_options(options); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:48 + def html_safe_translation(translation); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:43 + def i18n_option?(name); end +end + +# = Active Support \Inflector +# +# The Inflector transforms words from singular to plural, class names to table +# names, modularized class names to ones without, and class names to foreign +# keys. The default inflections for pluralization, singularization, and +# uncountable words are kept in inflections.rb. +# +# The \Rails core team has stated patches for the inflections library will not +# be accepted in order to avoid breaking legacy applications which may be +# relying on errant inflections. If you discover an incorrect inflection and +# require it for your application or wish to define rules for languages other +# than English, please correct or add them yourself (explained below). +# +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:8 +module ActiveSupport::Inflector + extend ::ActiveSupport::Inflector + + # Converts strings to UpperCamelCase. + # If the +uppercase_first_letter+ parameter is set to false, then produces + # lowerCamelCase. + # + # Also converts '/' to '::' which is useful for converting + # paths to namespaces. + # + # camelize('active_model') # => "ActiveModel" + # camelize('active_model', false) # => "activeModel" + # camelize('active_model/errors') # => "ActiveModel::Errors" + # camelize('active_model/errors', false) # => "activeModel::Errors" + # + # As a rule of thumb you can think of +camelize+ as the inverse of + # #underscore, though there are cases where that does not hold: + # + # camelize(underscore('SSLError')) # => "SslError" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:70 + def camelize(term, uppercase_first_letter = T.unsafe(nil)); end + + # Creates a class name from a plural table name like \Rails does for table + # names to models. Note that this returns a string and not a Class. (To + # convert to an actual class follow +classify+ with #constantize.) + # + # classify('ham_and_eggs') # => "HamAndEgg" + # classify('posts') # => "Post" + # + # Singular names are not handled correctly: + # + # classify('calculus') # => "Calculu" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:218 + def classify(table_name); end + + # Tries to find a constant with the name specified in the argument string. + # + # constantize('Module') # => Module + # constantize('Foo::Bar') # => Foo::Bar + # + # The name is assumed to be the one of a top-level constant, no matter + # whether it starts with "::" or not. No lexical context is taken into + # account: + # + # C = 'outside' + # module M + # C = 'inside' + # C # => 'inside' + # constantize('C') # => 'outside', same as ::C + # end + # + # NameError is raised when the name is not in CamelCase or the constant is + # unknown. + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:289 + def constantize(camel_cased_word); end + + # Replaces underscores with dashes in the string. + # + # dasherize('puni_puni') # => "puni-puni" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:226 + def dasherize(underscored_word); end + + # Removes the rightmost segment from the constant expression in the string. + # + # deconstantize('Net::HTTP') # => "Net" + # deconstantize('::Net::HTTP') # => "::Net" + # deconstantize('String') # => "" + # deconstantize('::String') # => "" + # deconstantize('') # => "" + # + # See also #demodulize. + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:256 + def deconstantize(path); end + + # Removes the module part from the expression in the string. + # + # demodulize('ActiveSupport::Inflector::Inflections') # => "Inflections" + # demodulize('Inflections') # => "Inflections" + # demodulize('::Inflections') # => "Inflections" + # demodulize('') # => "" + # + # See also #deconstantize. + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:238 + def demodulize(path); end + + # Converts the first character in the string to lowercase. + # + # downcase_first('If they enjoyed The Matrix') # => "if they enjoyed The Matrix" + # downcase_first('I') # => "i" + # downcase_first('') # => "" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:175 + def downcase_first(string); end + + # Creates a foreign key name from a class name. + # +separate_class_name_and_id_with_underscore+ sets whether + # the method should put '_' between the name and 'id'. + # + # foreign_key('Message') # => "message_id" + # foreign_key('Message', false) # => "messageid" + # foreign_key('Admin::Post') # => "post_id" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:267 + def foreign_key(class_name, separate_class_name_and_id_with_underscore = T.unsafe(nil)); end + + # Tweaks an attribute name for display to end users. + # + # Specifically, performs these transformations: + # + # * Applies human inflection rules to the argument. + # * Deletes leading underscores, if any. + # * Removes an "_id" suffix if present. + # * Replaces underscores with spaces, if any. + # * Downcases all words except acronyms. + # * Capitalizes the first word. + # The capitalization of the first word can be turned off by setting the + # +:capitalize+ option to false (default is true). + # + # The trailing '_id' can be kept by setting the + # optional parameter +keep_id_suffix+ to true (default is false). + # + # humanize('employee_salary') # => "Employee salary" + # humanize('author_id') # => "Author" + # humanize('author_id', capitalize: false) # => "author" + # humanize('_id') # => "Id" + # humanize('author_id', keep_id_suffix: true) # => "Author id" + # + # If "SSL" was defined to be an acronym: + # + # humanize('ssl_error') # => "SSL error" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:135 + def humanize(lower_case_and_underscored_word, capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end + + # Yields a singleton instance of Inflector::Inflections so you can specify + # additional inflector rules. If passed an optional locale, rules for other + # languages can be specified. If not specified, defaults to :en. + # Only rules for English are provided. + # + # ActiveSupport::Inflector.inflections(:en) do |inflect| + # inflect.uncountable 'rails' + # end + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:283 + def inflections(locale = T.unsafe(nil)); end + + # Returns the suffix that should be added to a number to denote the position + # in an ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # ordinal(1) # => "st" + # ordinal(2) # => "nd" + # ordinal(1002) # => "nd" + # ordinal(1003) # => "rd" + # ordinal(-11) # => "th" + # ordinal(-1021) # => "st" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:334 + def ordinal(number); end + + # Turns a number into an ordinal string used to denote the position in an + # ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # ordinalize(1) # => "1st" + # ordinalize(2) # => "2nd" + # ordinalize(1002) # => "1002nd" + # ordinalize(1003) # => "1003rd" + # ordinalize(-11) # => "-11th" + # ordinalize(-1021) # => "-1021st" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:347 + def ordinalize(number); end + + # Replaces special characters in a string so that it may be used as part of + # a 'pretty' URL. + # + # parameterize("Donald E. Knuth") # => "donald-e-knuth" + # parameterize("^très|Jolie-- ") # => "tres-jolie" + # + # To use a custom separator, override the +separator+ argument. + # + # parameterize("Donald E. Knuth", separator: '_') # => "donald_e_knuth" + # parameterize("^très|Jolie__ ", separator: '_') # => "tres_jolie" + # + # To remove the unwanted characters instead of replacing them, pass an + # empty separator. +nil+ is treated the same way. + # + # parameterize("Donald E. Knuth", separator: '') # => "donaldeknuth" + # + # To preserve the case of the characters in a string, use the +preserve_case+ argument. + # + # parameterize("Donald E. Knuth", preserve_case: true) # => "Donald-E-Knuth" + # parameterize("^très|Jolie-- ", preserve_case: true) # => "tres-Jolie" + # + # It preserves dashes and underscores unless they are used as separators: + # + # parameterize("^très|Jolie__ ") # => "tres-jolie__" + # parameterize("^très|Jolie-- ", separator: "_") # => "tres_jolie--" + # parameterize("^très_Jolie-- ", separator: ".") # => "tres_jolie--" + # + # If the optional parameter +locale+ is specified, + # the word will be parameterized as a word of that language. + # By default, this parameter is set to nil and it will use + # the configured I18n.locale. + # + # pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:131 + def parameterize(string, separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # If passed an optional +locale+ parameter, the word will be + # pluralized using rules defined for that language. By default, + # this parameter is set to :en. + # + # pluralize('post') # => "posts" + # pluralize('octopus') # => "octopi" + # pluralize('sheep') # => "sheep" + # pluralize('words') # => "words" + # pluralize('CamelOctopus') # => "CamelOctopi" + # pluralize('ley', :es) # => "leyes" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:33 + def pluralize(word, locale = T.unsafe(nil)); end + + # Tries to find a constant with the name specified in the argument string. + # + # safe_constantize('Module') # => Module + # safe_constantize('Foo::Bar') # => Foo::Bar + # + # The name is assumed to be the one of a top-level constant, no matter + # whether it starts with "::" or not. No lexical context is taken into + # account: + # + # C = 'outside' + # module M + # C = 'inside' + # C # => 'inside' + # safe_constantize('C') # => 'outside', same as ::C + # end + # + # +nil+ is returned when the name is not in CamelCase or the constant (or + # part of it) is unknown. + # + # safe_constantize('blargle') # => nil + # safe_constantize('UnknownModule') # => nil + # safe_constantize('UnknownModule::Foo::Bar') # => nil + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:315 + def safe_constantize(camel_cased_word); end + + # The reverse of #pluralize, returns the singular form of a word in a + # string. + # + # If passed an optional +locale+ parameter, the word will be + # singularized using rules defined for that language. By default, + # this parameter is set to :en. + # + # singularize('posts') # => "post" + # singularize('octopi') # => "octopus" + # singularize('sheep') # => "sheep" + # singularize('word') # => "word" + # singularize('CamelOctopi') # => "CamelOctopus" + # singularize('leyes', :es) # => "ley" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:50 + def singularize(word, locale = T.unsafe(nil)); end + + # Creates the name of a table like \Rails does for models to table names. + # This method uses the #pluralize method on the last word in the string. + # + # tableize('RawScaledScorer') # => "raw_scaled_scorers" + # tableize('ham_and_egg') # => "ham_and_eggs" + # tableize('fancyCategory') # => "fancy_categories" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:204 + def tableize(class_name); end + + # Capitalizes all the words and replaces some characters in the string to + # create a nicer looking title. +titleize+ is meant for creating pretty + # output. It is not used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # titleize('man from the boondocks') # => "Man From The Boondocks" + # titleize('x-men: the last stand') # => "X Men: The Last Stand" + # titleize('TheManWithoutAPast') # => "The Man Without A Past" + # titleize('raiders_of_the_lost_ark') # => "Raiders Of The Lost Ark" + # titleize('string_ending_with_id', keep_id_suffix: true) # => "String Ending With Id" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:192 + def titleize(word, keep_id_suffix: T.unsafe(nil)); end + + # Replaces non-ASCII characters with an ASCII approximation, or if none + # exists, a replacement character which defaults to "?". + # + # transliterate('Ærøskøbing') + # # => "AEroskobing" + # + # Default approximations are provided for Western/Latin characters, + # e.g, "ø", "ñ", "é", "ß", etc. + # + # This method is I18n aware, so you can set up custom approximations for a + # locale. This can be useful, for example, to transliterate German's "ü" + # and "ö" to "ue" and "oe", or to add support for transliterating Russian + # to ASCII. + # + # In order to make your custom transliterations available, you must set + # them as the i18n.transliterate.rule i18n key: + # + # # Store the transliterations in locales/de.yml + # i18n: + # transliterate: + # rule: + # ü: "ue" + # ö: "oe" + # + # # Or set them using Ruby + # I18n.backend.store_translations(:de, i18n: { + # transliterate: { + # rule: { + # 'ü' => 'ue', + # 'ö' => 'oe' + # } + # } + # }) + # + # The value for i18n.transliterate.rule can be a simple Hash that + # maps characters to ASCII approximations as shown above, or, for more + # complex requirements, a Proc: + # + # I18n.backend.store_translations(:de, i18n: { + # transliterate: { + # rule: ->(string) { MyTransliterator.transliterate(string) } + # } + # }) + # + # Now you can have different transliterations for each locale: + # + # transliterate('Jürgen', locale: :en) + # # => "Jurgen" + # + # transliterate('Jürgen', locale: :de) + # # => "Juergen" + # + # Transliteration is restricted to UTF-8, US-ASCII, and GB18030 strings. + # Other encodings will raise an ArgumentError. + # + # pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:64 + def transliterate(string, replacement = T.unsafe(nil), locale: T.unsafe(nil)); end + + # Makes an underscored, lowercase form from the expression in the string. + # + # Changes '::' to '/' to convert namespaces to paths. + # + # underscore('ActiveModel') # => "active_model" + # underscore('ActiveModel::Errors') # => "active_model/errors" + # + # As a rule of thumb you can think of +underscore+ as the inverse of + # #camelize, though there are cases where that does not hold: + # + # camelize(underscore('SSLError')) # => "SslError" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:99 + def underscore(camel_cased_word); end + + # Converts the first character in the string to uppercase. + # + # upcase_first('what a Lovely Day') # => "What a Lovely Day" + # upcase_first('w') # => "W" + # upcase_first('') # => "" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:166 + def upcase_first(string); end + + private + + # Applies inflection rules for +singularize+ and +pluralize+. + # + # If passed an optional +locale+ parameter, the uncountables will be + # found for that locale. + # + # apply_inflections('post', inflections.plurals, :en) # => "posts" + # apply_inflections('posts', inflections.singulars, :en) # => "post" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:376 + def apply_inflections(word, rules, locale = T.unsafe(nil)); end + + # Mounts a regular expression, returned as a string to ease interpolation, + # that will match part by part the given constant. + # + # const_regexp("Foo::Bar::Baz") # => "Foo(::Bar(::Baz)?)?" + # const_regexp("::") # => "::" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:357 + def const_regexp(camel_cased_word); end +end + +# pkg:gem/activesupport#lib/active_support/inflector/transliterate.rb:8 +ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(nil), Array) + +# = Active Support \Inflections +# +# A singleton instance of this class is yielded by Inflector.inflections, +# which can then be used to specify additional inflection rules. If passed +# an optional locale, rules for other languages can be specified. The +# default locale is :en. Only rules for English are provided. +# +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1\2en' +# inflect.singular /^(ox)en/i, '\1' +# +# inflect.irregular 'cactus', 'cacti' +# +# inflect.uncountable 'equipment' +# end +# +# New rules are added at the top. So in the example above, the irregular +# rule for cactus will now be the first of the pluralization and +# singularization rules that is runs. This guarantees that your rules run +# before any of the rules that may already have been loaded. +# +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:31 +class ActiveSupport::Inflector::Inflections + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:97 + def initialize; end + + # Specifies a new acronym. An acronym must be specified as it will appear + # in a camelized string. An underscore string that contains the acronym + # will retain the acronym when passed to +camelize+, +humanize+, or + # +titleize+. A camelized string that contains the acronym will maintain + # the acronym when titleized or humanized, and will convert the acronym + # into a non-delimited single lowercase word when passed to +underscore+. + # + # acronym 'HTML' + # titleize 'html' # => 'HTML' + # camelize 'html' # => 'HTML' + # underscore 'MyHTML' # => 'my_html' + # + # The acronym, however, must occur as a delimited unit and not be part of + # another word for conversions to recognize it: + # + # acronym 'HTTP' + # camelize 'my_http_delimited' # => 'MyHTTPDelimited' + # camelize 'https' # => 'Https', not 'HTTPs' + # underscore 'HTTPS' # => 'http_s', not 'https' + # + # acronym 'HTTPS' + # camelize 'https' # => 'HTTPS' + # underscore 'HTTPS' # => 'https' + # + # Note: Acronyms that are passed to +pluralize+ will no longer be + # recognized, since the acronym will not occur as a delimited unit in the + # pluralized result. To work around this, you must specify the pluralized + # form as an acronym as well: + # + # acronym 'API' + # camelize(pluralize('api')) # => 'Apis' + # + # acronym 'APIs' + # camelize(pluralize('api')) # => 'APIs' + # + # +acronym+ may be used to specify any word that contains an acronym or + # otherwise needs to maintain a non-standard capitalization. The only + # restriction is that the word must begin with a capital letter. + # + # acronym 'RESTful' + # underscore 'RESTful' # => 'restful' + # underscore 'RESTfulController' # => 'restful_controller' + # titleize 'RESTfulController' # => 'RESTful Controller' + # camelize 'restful' # => 'RESTful' + # camelize 'restful_controller' # => 'RESTfulController' + # + # acronym 'McDonald' + # underscore 'McDonald' # => 'mcdonald' + # camelize 'mcdonald' # => 'McDonald' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:159 + def acronym(word); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def acronyms; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:95 + def acronyms_camelize_regex; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:95 + def acronyms_underscore_regex; end + + # Clears the loaded inflections within a given scope (default is + # :all). Give the scope as a symbol of the inflection type, the + # options are: :plurals, :singulars, :uncountables, + # :humans, :acronyms. + # + # clear :all + # clear :plurals + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:248 + def clear(scope = T.unsafe(nil)); end + + # Specifies a humanized form of a string by a regular expression rule or + # by a string mapping. When using a regular expression based replacement, + # the normal humanize formatting is called after the replacement. When a + # string is used, the human form should be specified as desired (example: + # 'The name', not 'the_name'). + # + # human /_cnt$/i, '\1_count' + # human 'legacy_col_person_name', 'Name' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:237 + def human(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def humans; end + + # Specifies a new irregular that applies to both pluralization and + # singularization at the same time. This can only be used for strings, not + # regular expressions. You simply pass the irregular in singular and + # plural form. + # + # irregular 'cactus', 'cacti' + # irregular 'person', 'people' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:191 + def irregular(singular, plural); end + + # Specifies a new pluralization rule and its replacement. The rule can + # either be a string or a regular expression. The replacement should + # always be a string that may include references to the matched data from + # the rule. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:168 + def plural(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def plurals; end + + # Specifies a new singularization rule and its replacement. The rule can + # either be a string or a regular expression. The replacement should + # always be a string that may include references to the matched data from + # the rule. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:178 + def singular(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def singulars; end + + # Specifies words that are uncountable and should not be inflected. + # + # uncountable 'money' + # uncountable 'money', 'information' + # uncountable %w( money information rice ) + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:225 + def uncountable(*words); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:93 + def uncountables; end + + private + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:267 + def define_acronym_regex_patterns; end + + # Private, for the test suite. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:103 + def initialize_dup(orig); end + + class << self + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:77 + def instance(locale = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:83 + def instance_or_fallback(locale); end + end +end + +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:35 +class ActiveSupport::Inflector::Inflections::Uncountables + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:40 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:50 + def <<(word); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def ==(arg); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:61 + def add(words); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:45 + def delete(entry); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def each(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def empty?(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:57 + def flatten; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def pop(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_a(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_ary(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_s(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:68 + def uncountable?(str); end +end + +# = Inheritable Options +# +# +InheritableOptions+ provides a constructor to build an OrderedOptions +# hash inherited from another hash. +# +# Use this if you already have some hash and you want to create a new one based on it. +# +# h = ActiveSupport::InheritableOptions.new({ girl: 'Mary', boy: 'John' }) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# If the existing hash has string keys, call Hash#symbolize_keys on it. +# +# h = ActiveSupport::InheritableOptions.new({ 'girl' => 'Mary', 'boy' => 'John' }.symbolize_keys) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:89 +class ActiveSupport::InheritableOptions < ::ActiveSupport::OrderedOptions + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:90 + def initialize(parent = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:107 + def ==(other); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:142 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:134 + def inheritable_copy; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:111 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:126 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:130 + def overridden?(key); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:119 + def pretty_print(pp); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:138 + def to_a; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:103 + def to_h; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:115 + def to_s; end + + private + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:123 + def own_key?(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:4 +module ActiveSupport::IsolatedExecutionState + class << self + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:31 + def [](key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:37 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:50 + def clear; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:54 + def context; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:46 + def delete(key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:11 + def isolation_level; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:13 + def isolation_level=(level); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:42 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:11 + def scope; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:58 + def share_with(other, except: T.unsafe(nil), &block); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:11 +module ActiveSupport::JSON + class << self + # Parses a JSON string (JavaScript Object Notation) into a Ruby object. + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") + # # => {"team" => "rails", "players" => "36"} + # ActiveSupport::JSON.decode("2.39") + # # => 2.39 + # + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:24 + def decode(json, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:56 + def dump(value, options = T.unsafe(nil)); end + + # Dumps objects in JSON (JavaScript Object Notation). + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) + # # => "{\"team\":\"rails\",\"players\":\"36\"}" + # + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # + # ActiveSupport::JSON.encode({ key: "\u2028" }) + # # => "{\"key\":\"\\u2028\"}" + # + # By default, it also generates JSON that is safe to include in HTML, as + # it escapes <, >, and &: + # + # ActiveSupport::JSON.encode({ key: "<>&" }) + # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" + # + # This behavior can be changed with the +escape_html_entities+ option, or the + # global escape_html_entities_in_json configuration option. + # + # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) + # # => "{\"key\":\"<>&\"}" + # + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: + # + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:47 + def encode(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:37 + def load(json, options = T.unsafe(nil)); end + + # Returns the class of the error that will be raised when there is an + # error in decoding JSON. Using this method means you won't directly + # depend on the ActiveSupport's JSON implementation, in case it changes + # in the future. + # + # begin + # obj = ActiveSupport::JSON.decode(some_string) + # rescue ActiveSupport::JSON.parse_error + # Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}") + # end + # + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:49 + def parse_error; end + + private + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:54 + def convert_dates_from(data); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:14 +ActiveSupport::JSON::DATETIME_REGEX = T.let(T.unsafe(nil), Regexp) + +# matches YAML-formatted dates +# +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:13 +ActiveSupport::JSON::DATE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:59 +module ActiveSupport::JSON::Encoding + class << self + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:251 + def encode_without_escape(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:247 + def encode_without_options(value); end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:224 + def escape_html_entities_in_json; end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:224 + def escape_html_entities_in_json=(_arg0); end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:231 + def escape_js_separators_in_json; end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:231 + def escape_js_separators_in_json=(_arg0); end + + # Sets the encoder used by \Rails to encode Ruby objects into JSON strings + # in +Object#to_json+ and +ActiveSupport::JSON.encode+. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:239 + def json_encoder; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:241 + def json_encoder=(encoder); end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:235 + def time_precision; end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:235 + def time_precision=(_arg0); end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:220 + def use_standard_json_time_format; end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:220 + def use_standard_json_time_format=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:63 +ActiveSupport::JSON::Encoding::ESCAPED_CHARS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:72 +ActiveSupport::JSON::Encoding::FULL_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:71 +ActiveSupport::JSON::Encoding::HTML_ENTITIES_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:150 +class ActiveSupport::JSON::Encoding::JSONGemCoderEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:183 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:195 + def encode(value); end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:152 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::CODER = T.let(T.unsafe(nil), JSON::Coder) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:151 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::JSON_NATIVE_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:75 +class ActiveSupport::JSON::Encoding::JSONGemEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:78 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:83 + def encode(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:76 + def options; end + + private + + # Convert an object into a "JSON-ready" representation composed of + # primitives like Hash, Array, String, Symbol, Numeric, + # and +true+/+false+/+nil+. + # Recursively calls #as_json to the object to recursively build a + # fully JSON-ready object. + # + # This allows developers to implement #as_json without having to + # worry about what base types of objects they are allowed to return + # or having to remember to call #as_json recursively. + # + # Note: the +options+ hash passed to +object.to_json+ is only passed + # to +object.as_json+, not any of this method's recursive +#as_json+ + # calls. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:118 + def jsonify(value); end + + # Encode a "jsonified" Ruby data structure using the JSON gem + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:143 + def stringify(jsonified); end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:73 +ActiveSupport::JSON::Encoding::JS_SEPARATORS_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:60 +ActiveSupport::JSON::Encoding::U2028 = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:61 +ActiveSupport::JSON::Encoding::U2029 = T.let(T.unsafe(nil), String) + +# = Key Generator +# +# KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. +# It can be used to derive a number of keys for various purposes from a given secret. +# This lets \Rails applications have a single secure secret, but avoid reusing that +# key in multiple incompatible contexts. +# +# pkg:gem/activesupport#lib/active_support/key_generator.rb:13 +class ActiveSupport::KeyGenerator + # pkg:gem/activesupport#lib/active_support/key_generator.rb:28 + def initialize(secret, options = T.unsafe(nil)); end + + # Returns a derived key suitable for use. The default +key_size+ is chosen + # to be compatible with the default settings of ActiveSupport::MessageVerifier. + # i.e. OpenSSL::Digest::SHA1#block_length + # + # pkg:gem/activesupport#lib/active_support/key_generator.rb:41 + def generate_key(salt, key_size = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/key_generator.rb:45 + def inspect; end + + class << self + # pkg:gem/activesupport#lib/active_support/key_generator.rb:23 + def hash_digest_class; end + + # pkg:gem/activesupport#lib/active_support/key_generator.rb:15 + def hash_digest_class=(klass); end + end +end + +# = Lazy Load Hooks +# +# LazyLoadHooks allows \Rails to lazily load a lot of components and thus +# making the app boot faster. Because of this feature now there is no need to +# require +ActiveRecord::Base+ at boot time purely to apply +# configuration. Instead a hook is registered that applies configuration once +# +ActiveRecord::Base+ is loaded. Here +ActiveRecord::Base+ is +# used as example but this feature can be applied elsewhere too. +# +# Here is an example where on_load method is called to register a hook. +# +# initializer 'active_record.initialize_timezone' do +# ActiveSupport.on_load(:active_record) do +# self.time_zone_aware_attributes = true +# self.default_timezone = :utc +# end +# end +# +# When the entirety of +ActiveRecord::Base+ has been +# evaluated then run_load_hooks is invoked. The very last line of +# +ActiveRecord::Base+ is: +# +# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) +# +# run_load_hooks will then execute all the hooks that were registered +# with the on_load method. In the case of the above example, it will +# execute the block of code that is in the +initializer+. +# +# Registering a hook that has already run results in that hook executing +# immediately. This allows hooks to be nested for code that relies on +# multiple lazily loaded components: +# +# initializer "action_text.renderer" do +# ActiveSupport.on_load(:action_controller_base) do +# ActiveSupport.on_load(:action_text_content) do +# self.default_renderer = Class.new(ActionController::Base).renderer +# end +# end +# end +# +# pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:43 +module ActiveSupport::LazyLoadHooks + # Declares a block that will be executed when a \Rails component is fully + # loaded. If the component has already loaded, the block is executed + # immediately. + # + # ==== Options + # + # * :yield - Yields the object that run_load_hooks to +block+. + # * :run_once - Given +block+ will run only once. + # + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:60 + def on_load(name, options = T.unsafe(nil), &block); end + + # Executes all blocks registered to +name+ via on_load, using +base+ as the + # evaluation context. + # + # ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) + # + # In the case of the above example, it will execute all hooks registered + # for +:active_record+ within the class +ActiveRecord::Base+. + # + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:75 + def run_load_hooks(name, base = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:91 + def execute_hook(name, base, options, block); end + + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:83 + def with_execution_control(name, block, once); end + + class << self + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:44 + def extended(base); end + end +end + +# = Active Support Log \Subscriber +# +# +ActiveSupport::LogSubscriber+ is an object set to consume +# ActiveSupport::Notifications with the sole purpose of logging them. +# The log subscriber dispatches notifications to a registered object based +# on its given namespace. +# +# An example would be Active Record log subscriber responsible for logging +# queries: +# +# module ActiveRecord +# class LogSubscriber < ActiveSupport::LogSubscriber +# attach_to :active_record +# +# def sql(event) +# info "#{event.payload[:name]} (#{event.duration}) #{event.payload[:sql]}" +# end +# end +# end +# +# ActiveRecord::LogSubscriber.logger must be set as well, but it is assigned +# automatically in a \Rails environment. +# +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. +# +# Being an ActiveSupport::Notifications consumer, +# +ActiveSupport::LogSubscriber+ exposes a simple interface to check if +# instrumented code raises an exception. It is common to log a different +# message in case of an error, and this can be achieved by extending +# the previous example: +# +# module ActiveRecord +# class LogSubscriber < ActiveSupport::LogSubscriber +# def sql(event) +# exception = event.payload[:exception] +# +# if exception +# exception_object = event.payload[:exception_object] +# +# error "[ERROR] #{event.payload[:name]}: #{exception.join(', ')} " \ +# "(#{exception_object.backtrace.first})" +# else +# # standard logger code +# end +# end +# end +# end +# +# +ActiveSupport::LogSubscriber+ also has some helpers to deal with +# logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure +# that all logs are flushed, and it is called in Rails::Rack::Logger after a +# request finishes. +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:64 +class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:133 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:146 + def call(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging=(val); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def debug(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def error(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:152 + def event_levels=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def fatal(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def info(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:138 + def logger; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:142 + def silenced?(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def unknown(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:156 + def warn(progname = T.unsafe(nil), &block); end + + private + + # Set color by using a symbol or one of the defined constants. Set modes + # by specifying bold, italic, or underline options. Inspired by Highline, + # this method will automatically clear formatting at the end of the returned String. + # + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def color(text, color, mode_options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:180 + def log_exception(name, e); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:174 + def mode_from(options); end + + class << self + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:99 + def attach_to(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 + def colorize_logging=(val); end + + # Flush all log_subscribers' logger. + # + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:112 + def flush_all!; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def log_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def log_levels=(value); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def log_levels?; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:107 + def log_subscribers; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:93 + def logger; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:105 + def logger=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def __class_attr_log_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 + def __class_attr_log_levels=(new_value); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:117 + def fetch_public_methods(subscriber, inherit_all); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:121 + def set_event_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:127 + def subscribe_log_level(method, level); end + end +end + +# ANSI sequence colors +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:74 +ActiveSupport::LogSubscriber::BLACK = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:78 +ActiveSupport::LogSubscriber::BLUE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:80 +ActiveSupport::LogSubscriber::CYAN = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:76 +ActiveSupport::LogSubscriber::GREEN = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 +ActiveSupport::LogSubscriber::LEVEL_CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:79 +ActiveSupport::LogSubscriber::MAGENTA = T.let(T.unsafe(nil), String) + +# ANSI sequence modes +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:66 +ActiveSupport::LogSubscriber::MODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:75 +ActiveSupport::LogSubscriber::RED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:81 +ActiveSupport::LogSubscriber::WHITE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:77 +ActiveSupport::LogSubscriber::YELLOW = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/logger.rb:8 +class ActiveSupport::Logger < ::Logger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # pkg:gem/activesupport#lib/active_support/logger.rb:33 + def initialize(*args, **kwargs); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer=(val); end + + class << self + # Returns true if the logger destination matches one of the sources + # + # logger = Logger.new(STDOUT) + # ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT) + # # => true + # + # logger = Logger.new('/var/log/rails.log') + # ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log') + # # => true + # + # pkg:gem/activesupport#lib/active_support/logger.rb:20 + def logger_outputs_to?(logger, *sources); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:47 + def normalize_sources(sources); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer=(val); end + end +end + +# Simple formatter which only displays the message. +# +# pkg:gem/activesupport#lib/active_support/logger.rb:39 +class ActiveSupport::Logger::SimpleFormatter < ::Logger::Formatter + # This method is invoked when a log event occurs + # + # pkg:gem/activesupport#lib/active_support/logger.rb:41 + def call(severity, timestamp, progname, msg); end +end + +# pkg:gem/activesupport#lib/active_support/logger_silence.rb:8 +module ActiveSupport::LoggerSilence + extend ::ActiveSupport::Concern + include ::ActiveSupport::LoggerThreadSafeLevel + + # Silences the logger for the duration of the block. + # + # pkg:gem/activesupport#lib/active_support/logger_silence.rb:17 + def silence(severity = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:7 +module ActiveSupport::LoggerThreadSafeLevel + extend ::ActiveSupport::Concern + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:10 + def initialize(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:35 + def level; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:15 + def local_level; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:19 + def local_level=(level); end + + # Change the thread-local level for the duration of the given block. + # + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:40 + def log_at(level); end + + private + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:48 + def local_level_key; end +end + +# = Active Support Message Encryptor +# +# MessageEncryptor is a simple way to encrypt values which get stored +# somewhere you don't trust. +# +# The cipher text and initialization vector are base64 encoded and returned +# to you. +# +# This can be used in situations similar to the MessageVerifier, but +# where you don't want users to be able to determine the value of the payload. +# +# len = ActiveSupport::MessageEncryptor.key_len +# salt = SecureRandom.random_bytes(len) +# key = ActiveSupport::KeyGenerator.new('password').generate_key(salt, len) # => "\x89\xE0\x156\xAC..." +# crypt = ActiveSupport::MessageEncryptor.new(key) # => # +# encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..." +# crypt.decrypt_and_verify(encrypted_data) # => "my secret data" +# +# The +decrypt_and_verify+ method will raise an +# +ActiveSupport::MessageEncryptor::InvalidMessage+ exception if the data +# provided cannot be decrypted or verified. +# +# crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage +# +# === Confining messages to a specific purpose +# +# By default any message can be used throughout your app. But they can also be +# confined to a specific +:purpose+. +# +# token = crypt.encrypt_and_sign("this is the chair", purpose: :login) +# +# Then that same purpose must be passed when verifying to get the data back out: +# +# crypt.decrypt_and_verify(token, purpose: :login) # => "this is the chair" +# crypt.decrypt_and_verify(token, purpose: :shipping) # => nil +# crypt.decrypt_and_verify(token) # => nil +# +# Likewise, if a message has no purpose it won't be returned when verifying with +# a specific purpose. +# +# token = crypt.encrypt_and_sign("the conversation is lively") +# crypt.decrypt_and_verify(token, purpose: :scare_tactics) # => nil +# crypt.decrypt_and_verify(token) # => "the conversation is lively" +# +# === Making messages expire +# +# By default messages last forever and verifying one year from now will still +# return the original value. But messages can be set to expire at a given +# time with +:expires_in+ or +:expires_at+. +# +# crypt.encrypt_and_sign(parcel, expires_in: 1.month) +# crypt.encrypt_and_sign(doowad, expires_at: Time.now.end_of_year) +# +# Then the messages can be verified and returned up to the expire time. +# Thereafter, verifying returns +nil+. +# +# === Rotating keys +# +# MessageEncryptor also supports rotating out old configurations by falling +# back to a stack of encryptors. Call +rotate+ to build and add an encryptor +# so +decrypt_and_verify+ will also try the fallback. +# +# By default any rotated encryptors use the values of the primary +# encryptor unless specified otherwise. +# +# You'd give your encryptor the new defaults: +# +# crypt = ActiveSupport::MessageEncryptor.new(@secret, cipher: "aes-256-gcm") +# +# Then gradually rotate the old values out by adding them as fallbacks. Any message +# generated with the old values will then work until the rotation is removed. +# +# crypt.rotate old_secret # Fallback to an old secret instead of @secret. +# crypt.rotate cipher: "aes-256-cbc" # Fallback to an old cipher instead of aes-256-gcm. +# +# Though if both the secret and the cipher was changed at the same time, +# the above should be combined into: +# +# crypt.rotate old_secret, cipher: "aes-256-cbc" +# +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:90 +class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Rotator + + # Initialize a new MessageEncryptor. +secret+ must be at least as long as + # the cipher key size. For the default 'aes-256-gcm' cipher, this is 256 + # bits. If you are using a user-entered secret, you can generate a suitable + # key by using ActiveSupport::KeyGenerator or a similar key + # derivation function. + # + # The first additional parameter is used as the signature key for + # MessageVerifier. This allows you to specify keys to encrypt and sign + # data. Ignored when using an AEAD cipher like 'aes-256-gcm'. + # + # ActiveSupport::MessageEncryptor.new('secret', 'signature_secret') + # + # ==== Options + # + # [+:cipher+] + # Cipher to use. Can be any cipher returned by +OpenSSL::Cipher.ciphers+. + # Default is 'aes-256-gcm'. + # + # [+:digest+] + # Digest used for signing. Ignored when using an AEAD cipher like + # 'aes-256-gcm'. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageEncryptor generates RFC 4648 compliant strings + # which are not URL-safe. In other words, they can contain "+" and "/". + # If you want to generate URL-safe strings (in compliance with "Base 64 + # Encoding with URL and Filename Safe Alphabet" in RFC 4648), you can + # pass +true+. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:183 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:256 + def create_message(value, **options); end + + # Decrypt and verify a message. We need to verify the message in order to + # avoid padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +decrypt_and_verify+ will return +nil+. + # + # message = encryptor.encrypt_and_sign("hello", purpose: "greeting") + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => "hello" + # encryptor.decrypt_and_verify(message) # => nil + # + # message = encryptor.encrypt_and_sign("bye") + # encryptor.decrypt_and_verify(message) # => "bye" + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => nil + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:241 + def decrypt_and_verify(message, **options); end + + # Encrypt and sign a message. We need to sign the message in order to avoid + # padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_at: Time.now.tomorrow) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_in: 24.hours) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #decrypt_and_verify.) + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:220 + def encrypt_and_sign(value, **options); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:264 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:260 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + private + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:371 + def aead_mode; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:372 + def aead_mode?; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:295 + def decrypt(encrypted_message); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:277 + def encrypt(data); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:340 + def extract_part(encrypted_message, rindex, length); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:350 + def extract_parts(encrypted_message); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:336 + def join_parts(parts); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:320 + def length_after_encode(length_before_encode); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:332 + def length_of_encoded_auth_tag; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:328 + def length_of_encoded_iv; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:367 + def new_cipher; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:269 + def sign(data); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:273 + def verify(data); end + + class << self + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:96 + def default_cipher; end + + # Given a cipher, returns the key length of the cipher to help generate the key of desired size + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:252 + def key_len(cipher = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 + def use_authenticated_message_encryption; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 + def use_authenticated_message_encryption=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:118 +ActiveSupport::MessageEncryptor::AUTH_TAG_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:115 +class ActiveSupport::MessageEncryptor::InvalidMessage < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:105 +module ActiveSupport::MessageEncryptor::NullSerializer + class << self + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:110 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:106 + def load(value); end + end +end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:116 +ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:119 +ActiveSupport::MessageEncryptor::SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/message_encryptors.rb:6 +class ActiveSupport::MessageEncryptors < ::ActiveSupport::Messages::RotationCoordinator + private + + # pkg:gem/activesupport#lib/active_support/message_encryptors.rb:187 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# = Active Support Message Verifier +# +# +MessageVerifier+ makes it easy to generate and verify messages which are +# signed to prevent tampering. +# +# In a \Rails application, you can use +Rails.application.message_verifier+ +# to manage unique instances of verifiers for each use case. +# {Learn more}[link:classes/Rails/Application.html#method-i-message_verifier]. +# +# This is useful for cases like remember-me tokens and auto-unsubscribe links +# where the session store isn't suitable or available. +# +# First, generate a signed message: +# cookies[:remember_me] = Rails.application.message_verifier(:remember_me).generate([@user.id, 2.weeks.from_now]) +# +# Later verify that message: +# +# id, time = Rails.application.message_verifier(:remember_me).verify(cookies[:remember_me]) +# if time.future? +# self.current_user = User.find(id) +# end +# +# === Signing is not encryption +# +# The signed messages are not encrypted. The payload is merely encoded (Base64 by default) and can be decoded by +# anyone. The signature is just assuring that the message wasn't tampered with. For example: +# +# message = Rails.application.message_verifier('my_purpose').generate('never put secrets here') +# # => "BAhJIhtuZXZlciBwdXQgc2VjcmV0cyBoZXJlBjoGRVQ=--a0c1c0827919da5e949e989c971249355735e140" +# Base64.decode64(message.split("--").first) # no key needed +# # => 'never put secrets here' +# +# If you also need to encrypt the contents, you must use ActiveSupport::MessageEncryptor instead. +# +# === Confine messages to a specific purpose +# +# It's not recommended to use the same verifier for different purposes in your application. +# Doing so could allow a malicious actor to re-use a signed message to perform an unauthorized +# action. +# You can reduce this risk by confining signed messages to a specific +:purpose+. +# +# token = @verifier.generate("signed message", purpose: :login) +# +# Then that same purpose must be passed when verifying to get the data back out: +# +# @verifier.verified(token, purpose: :login) # => "signed message" +# @verifier.verified(token, purpose: :shipping) # => nil +# @verifier.verified(token) # => nil +# +# @verifier.verify(token, purpose: :login) # => "signed message" +# @verifier.verify(token, purpose: :shipping) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# +# Likewise, if a message has no purpose it won't be returned when verifying with +# a specific purpose. +# +# token = @verifier.generate("signed message") +# @verifier.verified(token, purpose: :redirect) # => nil +# @verifier.verified(token) # => "signed message" +# +# @verifier.verify(token, purpose: :redirect) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => "signed message" +# +# === Expiring messages +# +# By default messages last forever and verifying one year from now will still +# return the original value. But messages can be set to expire at a given +# time with +:expires_in+ or +:expires_at+. +# +# @verifier.generate("signed message", expires_in: 1.month) +# @verifier.generate("signed message", expires_at: Time.now.end_of_year) +# +# Messages can then be verified and returned until expiry. +# Thereafter, the +verified+ method returns +nil+ while +verify+ raises +# +ActiveSupport::MessageVerifier::InvalidSignature+. +# +# === Rotating keys +# +# MessageVerifier also supports rotating out old configurations by falling +# back to a stack of verifiers. Call +rotate+ to build and add a verifier so +# either +verified+ or +verify+ will also try verifying with the fallback. +# +# By default any rotated verifiers use the values of the primary +# verifier unless specified otherwise. +# +# You'd give your verifier the new defaults: +# +# verifier = ActiveSupport::MessageVerifier.new(@secret, digest: "SHA512", serializer: JSON) +# +# Then gradually rotate the old values out by adding them as fallbacks. Any message +# generated with the old values will then work until the rotation is removed. +# +# verifier.rotate(old_secret) # Fallback to an old secret instead of @secret. +# verifier.rotate(digest: "SHA256") # Fallback to an old digest instead of SHA512. +# verifier.rotate(serializer: Marshal) # Fallback to an old serializer instead of JSON. +# +# Though the above would most likely be combined into one rotation: +# +# verifier.rotate(old_secret, digest: "SHA256", serializer: Marshal) +# +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:110 +class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Rotator + + # Initialize a new MessageVerifier with a secret for the signature. + # + # ==== Options + # + # [+:digest+] + # Digest used for signing. The default is "SHA1". See + # +OpenSSL::Digest+ for alternatives. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageVerifier generates RFC 4648 compliant strings which are + # not URL-safe. In other words, they can contain "+" and "/". If you want to + # generate URL-safe strings (in compliance with "Base 64 Encoding with URL + # and Filename Safe Alphabet" in RFC 4648), you can pass +true+. + # Note that MessageVerifier will always accept both URL-safe and URL-unsafe + # encoded messages, to allow a smooth transition between the two settings. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:167 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:310 + def create_message(value, **options); end + + # Generates a signed message for the provided value. + # + # The message is signed with the +MessageVerifier+'s secret. + # Returns Base64-encoded message joined with the generated signature. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # verifier.generate("signed message") # => "BAhJIhNzaWduZWQgbWVzc2FnZQY6BkVU--f67d5f27c3ee0b8483cebf2103757455e947493b" + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = verifier.generate("hello", expires_at: Time.now.tomorrow) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = verifier.generate("hello", expires_in: 24.hours) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #verified and #verify.) + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:306 + def generate(value, **options); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:318 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:314 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # Checks if a signed message could have been generated by signing an object + # with the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") + # verifier.valid_message?(signed_message) # => true + # + # tampered_message = signed_message.chop # editing the message invalidates the signature + # verifier.valid_message?(tampered_message) # => false + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:183 + def valid_message?(message); end + + # Decodes the signed message using the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # + # signed_message = verifier.generate("signed message") + # verifier.verified(signed_message) # => "signed message" + # + # Returns +nil+ if the message was not signed with the same secret. + # + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") + # other_verifier.verified(signed_message) # => nil + # + # Returns +nil+ if the message is not Base64-encoded. + # + # invalid_message = "f--46a0120593880c733a53b6dad75b42ddc1c8996d" + # verifier.verified(invalid_message) # => nil + # + # Raises any error raised while decoding the signed message. + # + # incompatible_message = "test--dad7b06c94abba8d46a15fafaef56c327665d5ff" + # verifier.verified(incompatible_message) # => TypeError: incompatible marshal file format + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verified+ will return +nil+. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verified(message, purpose: "greeting") # => "hello" + # verifier.verified(message, purpose: "chatting") # => nil + # verifier.verified(message) # => nil + # + # message = verifier.generate("bye") + # verifier.verified(message) # => "bye" + # verifier.verified(message, purpose: "greeting") # => nil + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:224 + def verified(message, **options); end + + # Decodes the signed message using the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") + # + # verifier.verify(signed_message) # => "signed message" + # + # Raises +InvalidSignature+ if the message was not signed with the same + # secret or was not Base64-encoded. + # + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") + # other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verify+ will raise ActiveSupport::MessageVerifier::InvalidSignature. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verify(message, purpose: "greeting") # => "hello" + # verifier.verify(message, purpose: "chatting") # => raises InvalidSignature + # verifier.verify(message) # => raises InvalidSignature + # + # message = verifier.generate("bye") + # verifier.verify(message) # => "bye" + # verifier.verify(message, purpose: "greeting") # => raises InvalidSignature + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:262 + def verify(message, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:323 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:356 + def digest_length_in_hex; end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:373 + def digest_matches_data?(digest, data); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:335 + def extract_encoded(signed); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:352 + def generate_digest(data); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:364 + def separator_at?(signed_message, index); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:368 + def separator_index_for(signed_message); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:330 + def sign_encoded(encoded); end +end + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:113 +class ActiveSupport::MessageVerifier::InvalidSignature < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:115 +ActiveSupport::MessageVerifier::SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:116 +ActiveSupport::MessageVerifier::SEPARATOR_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/message_verifiers.rb:6 +class ActiveSupport::MessageVerifiers < ::ActiveSupport::Messages::RotationCoordinator + private + + # pkg:gem/activesupport#lib/active_support/message_verifiers.rb:185 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:6 +module ActiveSupport::Messages; end + +# pkg:gem/activesupport#lib/active_support/messages/codec.rb:9 +class ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Metadata + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:15 + def initialize(**options); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:45 + def catch_and_ignore(throwable, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:52 + def catch_and_raise(throwable, as: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:29 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:39 + def deserialize(serialized); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:25 + def encode(data, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:35 + def serialize(data); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:23 + def serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:60 + def use_message_serializer_for_metadata?; end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def default_serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def default_serializer=(value); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def __class_attr_default_serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def __class_attr_default_serializer=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:9 +module ActiveSupport::Messages::Metadata + private + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:128 + def deserialize_from_json(serialized); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:141 + def deserialize_from_json_safe_string(string); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:43 + def deserialize_with_metadata(message, **expected_metadata); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:96 + def dual_serialized_metadata_envelope_json?(string); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:78 + def extract_from_metadata_envelope(envelope, purpose: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:92 + def metadata_envelope?(object); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:114 + def parse_expiry(expires_at); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:100 + def pick_expiry(expires_at, expires_in); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:124 + def serialize_to_json(data); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:137 + def serialize_to_json_safe_string(data); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:30 + def serialize_with_metadata(data, **metadata); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:60 + def use_message_serializer_for_metadata?; end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:64 + def wrap_in_metadata_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:71 + def wrap_in_metadata_legacy_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 + def use_message_serializer_for_metadata; end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 + def use_message_serializer_for_metadata=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:12 +ActiveSupport::Messages::Metadata::ENVELOPE_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:19 +ActiveSupport::Messages::Metadata::TIMESTAMP_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:5 +class ActiveSupport::Messages::RotationConfiguration + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:6 + def encrypted; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:12 + def rotate(kind, *args, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:6 + def signed; end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:7 +class ActiveSupport::Messages::RotationCoordinator + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:10 + def initialize(&secret_generator); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:18 + def [](salt); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:22 + def []=(salt, codec); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:48 + def clear_rotations; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:54 + def on_rotation(&callback); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:35 + def prepend(**options, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:26 + def rotate(**options, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:44 + def rotate_defaults; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 + def transitional; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 + def transitional=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:97 + def build(salt, secret_generator:, secret_generator_options:, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:85 + def build_with_rotations(salt); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:60 + def changing_configuration!; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:71 + def normalize_options(options); end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotator.rb:5 +module ActiveSupport::Messages::Rotator + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:6 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:23 + def fall_back_to(fallback); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:18 + def on_rotation(&on_rotation); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:28 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:14 + def rotate(*args, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:54 + def build_rotation(*args, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:58 + def catch_rotation_error(&block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:48 + def initialize_dup(*); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:8 +module ActiveSupport::Messages::SerializerWithFallback + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:17 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:33 + def detect_format(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:44 + def fallback?(format); end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:9 + def [](format); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:48 +module ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:50 + def fallback?(format); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:78 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:90 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:86 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:96 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:82 + def format; end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:101 + def detect_format(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:94 +ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback::JSON_START_WITH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:107 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:55 +module ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:67 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:63 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:73 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:59 + def format; end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:71 +ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:113 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:125 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:121 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:129 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:117 + def format; end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:134 + def available?; end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:143 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:149 +ActiveSupport::Messages::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/multibyte.rb:4 +module ActiveSupport::Multibyte + class << self + # Returns the current proxy class. + # + # pkg:gem/activesupport#lib/active_support/multibyte.rb:23 + def proxy_class; end + + # The proxy class returned when calling mb_chars. You can use this accessor + # to configure your own proxy class so you can support other encodings. See + # the ActiveSupport::Multibyte::Chars implementation for an example how to + # do this. + # + # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 + # + # pkg:gem/activesupport#lib/active_support/multibyte.rb:14 + def proxy_class=(klass); end + end +end + +# = Active Support \Multibyte \Chars +# +# Chars enables you to work transparently with UTF-8 encoding in the Ruby +# String class without having extensive knowledge about the encoding. A +# Chars object accepts a string upon initialization and proxies String +# methods in an encoding safe manner. All the normal String methods are also +# implemented on the proxy. +# +# String methods are proxied through the Chars object, and can be accessed +# through the +mb_chars+ method. Methods which would normally return a +# String object now return a Chars object so methods can be chained. +# +# 'The Perfect String '.mb_chars.downcase.strip +# # => # +# +# Chars objects are perfectly interchangeable with String objects as long as +# no explicit class checks are made. If certain methods do explicitly check +# the class, call +to_s+ before you pass chars objects to them. +# +# bad.explicit_checking_method 'T'.mb_chars.downcase.to_s +# +# The default Chars implementation assumes that the encoding of the string +# is UTF-8, if you want to handle different encodings you can write your own +# multibyte string handler and configure it through +# ActiveSupport::Multibyte.proxy_class. +# +# class CharsForUTF32 +# def size +# @wrapped_string.size / 4 +# end +# +# def self.accepts?(string) +# string.length % 4 == 0 +# end +# end +# +# ActiveSupport::Multibyte.proxy_class = CharsForUTF32 +# +# pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:47 +class ActiveSupport::Multibyte::Chars + include ::Comparable + + # Creates a new Chars instance by wrapping _string_. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:56 + def initialize(string, deprecation: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def <=>(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def =~(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def acts_like_string?(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:171 + def as_json(options = T.unsafe(nil)); end + + # Performs composition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.compose.to_s.length # => 1 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:150 + def compose; end + + # Performs canonical decomposition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.decompose.to_s.length # => 2 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:142 + def decompose; end + + # Returns the number of grapheme clusters in the string. + # + # 'क्षि'.mb_chars.length # => 4 + # 'क्षि'.mb_chars.grapheme_length # => 2 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:158 + def grapheme_length; end + + # Limits the byte size of the string to a number of bytes without breaking + # characters. Usable when the storage for a string is limited for some + # reason. + # + # 'こんにちは'.mb_chars.limit(7).to_s # => "こん" + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:125 + def limit(limit); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def match?(*, **, &); end + + # Forward all undefined methods to the wrapped string. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:72 + def method_missing(method, *, **, &); end + + # Reverses all characters in the string. + # + # 'Café'.mb_chars.reverse.to_s # => 'éfaC' + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:116 + def reverse; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:176 + def reverse!(*args); end + + # Works like String#slice!, but returns an instance of + # Chars, or +nil+ if the string was not modified. The string will not be + # modified if the range given is out of bounds + # + # string = 'Welcome' + # string.mb_chars.slice!(3) # => # + # string # => 'Welome' + # string.mb_chars.slice!(0..3) # => # + # string # => 'me' + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:106 + def slice!(*args); end + + # Works just like String#split, with the exception that the items + # in the resulting list are Chars instances instead of String. This makes + # chaining methods easier. + # + # 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"] + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:93 + def split(*args); end + + # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent + # resulting in a valid UTF-8 string. + # + # Passing +true+ will forcibly tidy all bytes, assuming that the string's + # encoding is entirely CP1252 or ISO-8859-1. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:167 + def tidy_bytes(force = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:176 + def tidy_bytes!(*args); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:136 + def titlecase; end + + # Capitalizes the first letter of every word, when possible. + # + # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" + # "日本語".mb_chars.titleize.to_s # => "日本語" + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:133 + def titleize; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:50 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:51 + def to_str; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:49 + def wrapped_string; end + + private + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:183 + def chars(string); end + + # Returns +true+ if _obj_ responds to the given method. Private methods + # are included in the search only if the optional second parameter + # evaluates to +true+. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:84 + def respond_to_missing?(method, include_private); end +end + +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:5 +module ActiveSupport::Multibyte::Unicode + extend ::ActiveSupport::Multibyte::Unicode + + # Compose decomposed characters to the composed form. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:21 + def compose(codepoints); end + + # Decompose composed characters to the decomposed form. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:12 + def decompose(type, codepoints); end + + # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent + # resulting in a valid UTF-8 string. + # + # Passing +true+ will forcibly tidy all bytes, assuming that the string's + # encoding is entirely CP1252 or ISO-8859-1. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:30 + def tidy_bytes(string, force = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:37 + def recode_windows1252_chars(string); end +end + +# The Unicode version that is supported by the implementation +# +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:9 +ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String) + +# = \Notifications +# +# +ActiveSupport::Notifications+ provides an instrumentation API for +# Ruby. +# +# == Instrumenters +# +# To instrument an event you just need to do: +# +# ActiveSupport::Notifications.instrument('render', extra: :information) do +# render plain: 'Foo' +# end +# +# That first executes the block and then notifies all subscribers once done. +# +# In the example above +render+ is the name of the event, and the rest is called +# the _payload_. The payload is a mechanism that allows instrumenters to pass +# extra information to subscribers. Payloads consist of a hash whose contents +# are arbitrary and generally depend on the event. +# +# == Subscribers +# +# You can consume those events and the information they provide by registering +# a subscriber. +# +# ActiveSupport::Notifications.subscribe('render') do |event| +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# end +# +# +Event+ objects record CPU time and allocations. If you don't need this +# it's also possible to pass a block that accepts five arguments: +# +# ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| +# name # => String, name of the event (such as 'render' from above) +# start # => Time, when the instrumented block started execution +# finish # => Time, when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# Here, the +start+ and +finish+ values represent wall-clock time. If you are +# concerned about accuracy, you can register a monotonic subscriber. +# +# ActiveSupport::Notifications.monotonic_subscribe('render') do |name, start, finish, id, payload| +# name # => String, name of the event (such as 'render' from above) +# start # => Float, monotonic time when the instrumented block started execution +# finish # => Float, monotonic time when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# For instance, let's store all "render" events in an array: +# +# events = [] +# +# ActiveSupport::Notifications.subscribe('render') do |event| +# events << event +# end +# +# That code returns right away, you are just subscribing to "render" events. +# The block is saved and will be called whenever someone instruments "render": +# +# ActiveSupport::Notifications.instrument('render', extra: :information) do +# render plain: 'Foo' +# end +# +# event = events.first +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# +# If an exception happens during that particular instrumentation the payload will +# have a key :exception with an array of two elements as value: a string with +# the name of the exception class, and the exception message. +# The :exception_object key of the payload will have the exception +# itself as the value: +# +# event.payload[:exception] # => ["ArgumentError", "Invalid value"] +# event.payload[:exception_object] # => # +# +# As the earlier example depicts, the class ActiveSupport::Notifications::Event +# is able to take the arguments as they come and provide an object-oriented +# interface to that data. +# +# It is also possible to pass an object which responds to call method +# as the second parameter to the subscribe method instead of a block: +# +# module ActionController +# class PageRequest +# def call(name, started, finished, unique_id, payload) +# Rails.logger.debug ['notification:', name, started, finished, unique_id, payload].join(' ') +# end +# end +# end +# +# ActiveSupport::Notifications.subscribe('process_action.action_controller', ActionController::PageRequest.new) +# +# resulting in the following output within the logs including a hash with the payload: +# +# notification: process_action.action_controller 2012-04-13 01:08:35 +0300 2012-04-13 01:08:35 +0300 af358ed7fab884532ec7 { +# controller: "Devise::SessionsController", +# action: "new", +# params: {"action"=>"new", "controller"=>"devise/sessions"}, +# format: :html, +# method: "GET", +# path: "/login/sign_in", +# status: 200, +# view_runtime: 279.3080806732178, +# db_runtime: 40.053 +# } +# +# You can also subscribe to all events whose name matches a certain regexp: +# +# ActiveSupport::Notifications.subscribe(/render/) do |*args| +# ... +# end +# +# and even pass no argument to subscribe, in which case you are subscribing +# to all events. +# +# == Temporary Subscriptions +# +# Sometimes you do not want to subscribe to an event for the entire life of +# the application. There are two ways to unsubscribe. +# +# WARNING: The instrumentation framework is designed for long-running subscribers, +# use this feature sparingly because it wipes some internal caches and that has +# a negative impact on performance. +# +# === Subscribe While a Block Runs +# +# You can subscribe to some event temporarily while some block runs. For +# example, in +# +# callback = lambda {|event| ... } +# ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do +# ... +# end +# +# the callback will be called for all "sql.active_record" events instrumented +# during the execution of the block. The callback is unsubscribed automatically +# after that. +# +# To record +started+ and +finished+ values with monotonic time, +# specify the optional :monotonic option to the +# subscribed method. The :monotonic option is set +# to +false+ by default. +# +# callback = lambda {|name, started, finished, unique_id, payload| ... } +# ActiveSupport::Notifications.subscribed(callback, "sql.active_record", monotonic: true) do +# ... +# end +# +# === Manual Unsubscription +# +# The +subscribe+ method returns a subscriber object: +# +# subscriber = ActiveSupport::Notifications.subscribe("render") do |event| +# ... +# end +# +# To prevent that block from being called anymore, just unsubscribe passing +# that reference: +# +# ActiveSupport::Notifications.unsubscribe(subscriber) +# +# You can also unsubscribe by passing the name of the subscriber object. Note +# that this will unsubscribe all subscriptions with the given name: +# +# ActiveSupport::Notifications.unsubscribe("render") +# +# Subscribers using a regexp or other pattern-matching object will remain subscribed +# to all events that match their original pattern, unless those events match a string +# passed to +unsubscribe+: +# +# subscriber = ActiveSupport::Notifications.subscribe(/render/) { } +# ActiveSupport::Notifications.unsubscribe('render_template.action_view') +# subscriber.subscribed_to?('render_template.action_view') # => false +# subscriber.subscribed_to?('render_partial.action_view') # => true +# +# == Default Queue +# +# Notifications ships with a queue implementation that consumes and publishes events +# to all log subscribers. You can use any queue implementation you want. +# +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:7 +module ActiveSupport::Notifications + class << self + # pkg:gem/activesupport#lib/active_support/notifications.rb:208 + def instrument(name, payload = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:269 + def instrumenter; end + + # Performs the same functionality as #subscribe, but the +start+ and + # +finish+ block arguments are in monotonic time instead of wall-clock + # time. Monotonic time will not jump forward or backward (due to NTP or + # Daylights Savings). Use +monotonic_subscribe+ when accuracy of time + # duration is important. For example, computing elapsed time between + # two events. + # + # pkg:gem/activesupport#lib/active_support/notifications.rb:254 + def monotonic_subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:198 + def notifier; end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:198 + def notifier=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:200 + def publish(name, *args); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:204 + def publish_event(event); end + + # Subscribe to a given event name with the passed +block+. + # + # You can subscribe to events by passing a String to match exact event + # names, or by passing a Regexp to match all events that match a pattern. + # + # If the block passed to the method only takes one argument, + # it will yield an +Event+ object to the block: + # + # ActiveSupport::Notifications.subscribe(/render/) do |event| + # @event = event + # end + # + # Otherwise the +block+ will receive five arguments with information + # about the event: + # + # ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| + # name # => String, name of the event (such as 'render' from above) + # start # => Time, when the instrumented block started execution + # finish # => Time, when the instrumented block ended execution + # id # => String, unique ID for the instrumenter that fired the event + # payload # => Hash, the payload + # end + # + # Raises an error if invalid event name type is passed: + # + # ActiveSupport::Notifications.subscribe(:render) {|event| ...} + # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) + # + # pkg:gem/activesupport#lib/active_support/notifications.rb:244 + def subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:258 + def subscribed(callback, pattern = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:265 + def unsubscribe(subscriber_or_name); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications.rb:274 + def registry; end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:106 +class ActiveSupport::Notifications::Event + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:110 + def initialize(name, start, ending, transaction_id, payload); end + + # Returns the number of allocations made between the call to #start! and + # the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:176 + def allocations; end + + # Returns the CPU time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:163 + def cpu_time; end + + # Returns the difference in milliseconds between when the execution of the + # event started and when it ended. + # + # ActiveSupport::Notifications.subscribe('wait') do |event| + # @event = event + # end + # + # ActiveSupport::Notifications.instrument('wait') do + # sleep 1 + # end + # + # @event.duration # => 1000.138 + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:198 + def duration; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:128 + def end; end + + # Record information at the time this event finishes + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:154 + def finish!; end + + # Returns the time spent in GC (in milliseconds) between the call to #start! + # and the call to #finish! + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:182 + def gc_time; end + + # Returns the idle time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:169 + def idle_time; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def name; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 + def payload; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 + def payload=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:132 + def record; end + + # Record information at the time this event starts + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:146 + def start!; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:124 + def time; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def transaction_id; end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:203 + def now; end + + # Likely on JRuby, TruffleRuby + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:230 + def now_allocations; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:210 + def now_cpu; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:220 + def now_gc; end +end + +# This is a default queue implementation that ships with Notifications. +# It just pushes events to all registered log subscribers. +# +# This class is thread safe. All methods are reentrant. +# +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:55 +class ActiveSupport::Notifications::Fanout + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:56 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:319 + def all_listeners_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:286 + def build_handle(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:106 + def clear_cache(key = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:305 + def finish(name, id, payload, listeners = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:190 + def group_listeners(listeners); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:196 + def groups_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:64 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:328 + def listeners_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:332 + def listening?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:311 + def publish(name, *, **, &); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:315 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:298 + def start(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:69 + def subscribe(pattern = T.unsafe(nil), callable = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:86 + def unsubscribe(subscriber_or_name); end + + # This is a sync queue, so there is no waiting. + # + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:337 + def wait; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:116 +class ActiveSupport::Notifications::Fanout::BaseGroup + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:119 + def initialize(listeners, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:123 + def each(&block); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:128 +class ActiveSupport::Notifications::Fanout::BaseTimeGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:133 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:129 + def start(name, id, payload); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:169 +class ActiveSupport::Notifications::Fanout::EventObjectGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:175 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:170 + def start(name, id, payload); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:185 + def build_event(name, id, payload); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:155 +class ActiveSupport::Notifications::Fanout::EventedGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:162 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:156 + def start(name, id, payload); end +end + +# A +Handle+ is used to record the start and finish time of event. +# +# Both #start and #finish must each be called exactly once. +# +# Where possible, it's best to use the block form: ActiveSupport::Notifications.instrument. +# +Handle+ is a low-level API intended for cases where the block form can't be used. +# +# handle = ActiveSupport::Notifications.instrumenter.build_handle("my.event", {}) +# begin +# handle.start +# # work to be instrumented +# ensure +# handle.finish +# end +# +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:230 +class ActiveSupport::Notifications::Fanout::Handle + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:233 + def initialize(notifier, name, id, groups, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:250 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:254 + def finish_with_values(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:241 + def start; end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:264 + def ensure_state!(expected); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:141 +class ActiveSupport::Notifications::Fanout::MonotonicTimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:143 + def now; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:271 +module ActiveSupport::Notifications::Fanout::NullHandle + extend ::ActiveSupport::Notifications::Fanout::NullHandle + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:277 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:280 + def finish_with_values(_name, _id, _payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:274 + def start; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:340 +module ActiveSupport::Notifications::Fanout::Subscribers + class << self + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:341 + def new(pattern, listener, monotonic); end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:455 +class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:456 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:460 + def publish_event(event); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:397 +class ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:400 + def initialize(pattern, delegate); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 + def delegate; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:408 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 + def pattern; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:412 + def publish(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:418 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:398 + def silenceable; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:426 + def silenced?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:430 + def subscribed_to?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:434 + def unsubscribe!(name); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:360 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:373 + def initialize(pattern); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:382 + def ===(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:361 + def exclusions; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:361 + def pattern; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:378 + def unsubscribe!(name); end + + class << self + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:363 + def wrap(pattern); end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:386 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher::AllMessages + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:387 + def ===(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:391 + def unsubscribe!(*); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:449 +class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Timed + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:450 + def group_class; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:439 +class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:440 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:444 + def publish(*, **, &); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:148 +class ActiveSupport::Notifications::Fanout::TimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:150 + def now; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:18 +module ActiveSupport::Notifications::FanoutIteration + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:20 + def iterate_guarding_exceptions(collection, &block); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:8 +class ActiveSupport::Notifications::InstrumentationSubscriberError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:11 + def initialize(exceptions); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:9 + def exceptions; end +end + +# Instrumenters are stored in a thread local. +# +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:9 +class ActiveSupport::Notifications::Instrumenter + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:12 + def initialize(notifier); end + + # Returns a "handle" for an event with the given +name+ and +payload+. + # + # #start and #finish must each be called exactly once on the returned object. + # + # Where possible, it's best to use #instrument, which will record the + # start and finish of the event and correctly handle any exceptions. + # +build_handle+ is a low-level API intended for cases where using + # +instrument+ isn't possible. + # + # See ActiveSupport::Notifications::Fanout::Handle. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:78 + def build_handle(name, payload); end + + # Send a finish notification with +name+ and +payload+. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:92 + def finish(name, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:96 + def finish_with_state(listeners_state, name, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:10 + def id; end + + # Given a block, instrument it by measuring the time taken to execute + # and publish it. Without a block, simply send a message via the + # notifier. Notice that events get sent even if an error occurs in the + # passed-in block. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:54 + def instrument(name, payload = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:82 + def new_event(name, payload = T.unsafe(nil)); end + + # Send a start notification with +name+ and +payload+. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:87 + def start(name, payload); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:101 + def unique_id; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:21 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:34 + def initialize(notifier, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:45 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:41 + def start; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:22 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle::Wrapper + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:23 + def initialize(notifier); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:27 + def build_handle(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def finish(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def start(*, **, &); end +end + +# = Number Helper +# +# Provides methods for formatting numbers into currencies, percentages, +# phone numbers, and more. +# +# Example usage in a class: +# class Topic +# include ActiveSupport::NumberHelper +# +# def price +# number_to_currency(@price) +# end +# end +# +# Example usage in a module: +# require "active_support/number_helper" +# +# module NumberFormatting +# def format_price(price) +# ActiveSupport::NumberHelper.number_to_currency(price) +# end +# end +# +# pkg:gem/activesupport#lib/active_support/number_helper.rb:26 +module ActiveSupport::NumberHelper + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::NumberHelper + + # Formats a +number+ into a currency string. + # + # number_to_currency(1234567890.50) # => "$1,234,567,890.50" + # number_to_currency(1234567890.506) # => "$1,234,567,890.51" + # number_to_currency("12x34") # => "$12x34" + # + # number_to_currency(1234567890.50, unit: "£", separator: ",", delimiter: "") + # # => "£1234567890,50" + # + # The currency unit and number formatting of the current locale will be used + # unless otherwise specified via options. No currency conversion is + # performed. If the user is given a way to change their locale, they will + # also be able to change the relative value of the currency displayed with + # this helper. If your application will ever support multiple locales, you + # may want to specify a constant +:locale+ option or consider using a + # library capable of currency conversion. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_currency(1234567890.506, locale: :fr) + # # => "1 234 567 890,51 €" + # + # [+:precision+] + # The level of precision. Defaults to 2. + # + # number_to_currency(1234567890.123, precision: 3) # => "$1,234,567,890.123" + # number_to_currency(0.456789, precision: 0) # => "$0" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_currency(1234567890.01, precision: 0, round_mode: :up) + # # => "$1,234,567,891" + # + # [+:unit+] + # The denomination of the currency. Defaults to "$". + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:format+] + # The format for non-negative numbers. %u represents the currency, + # and %n represents the number. Defaults to "%u%n". + # + # number_to_currency(1234567890.50, format: "%n %u") + # # => "1,234,567,890.50 $" + # + # [+:negative_format+] + # The format for negative numbers. %u and %n behave the + # same as in +:format+, but %n represents the absolute value of + # the number. Defaults to the value of +:format+ prepended with -. + # + # number_to_currency(-1234567890.50, negative_format: "(%u%n)") + # # => "($1,234,567,890.50)" + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_currency(1234567890.50, strip_insignificant_zeros: true) + # # => "$1,234,567,890.5" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:161 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Formats +number+ by grouping thousands with a delimiter. + # + # number_to_delimited(12345678) # => "12,345,678" + # number_to_delimited("123456") # => "123,456" + # number_to_delimited(12345678.9876) # => "12,345,678.9876" + # number_to_delimited("12x34") # => "12x34" + # + # number_to_delimited(12345678.9876, delimiter: ".", separator: ",") + # # => "12.345.678,9876" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_delimited(12345678.05, locale: :fr) + # # => "12 345 678,05" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # number_to_delimited(12345678, delimiter: ".") + # # => "12.345.678" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_delimited(12345678.05, separator: " ") + # # => "12,345,678 05" + # + # [+:delimiter_pattern+] + # A regexp to determine the placement of delimiters. Helpful when using + # currency formats like INR. + # + # number_to_delimited("123456.78", delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) + # # => "1,23,456.78" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:264 + def number_to_delimited(number, options = T.unsafe(nil)); end + + # Formats +number+ into a more human-friendly representation. Useful for + # numbers that can become very large and too hard to read. + # + # number_to_human(123) # => "123" + # number_to_human(1234) # => "1.23 Thousand" + # number_to_human(12345) # => "12.3 Thousand" + # number_to_human(1234567) # => "1.23 Million" + # number_to_human(1234567890) # => "1.23 Billion" + # number_to_human(1234567890123) # => "1.23 Trillion" + # number_to_human(1234567890123456) # => "1.23 Quadrillion" + # number_to_human(1234567890123456789) # => "1230 Quadrillion" + # + # See #number_to_human_size if you want to pretty-print a file size. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human(123456, precision: 2) # => "120 Thousand" + # number_to_human(123456, precision: 4) # => "123.5 Thousand" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human(123456, precision: 2, round_mode: :up) + # # => "130 Thousand" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human(123456, precision: 4, separator: ",") + # # => "123,5 Thousand" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # number_to_human(1000000) # => "1 Million" + # number_to_human(1000000, strip_insignificant_zeros: false) # => "1.00 Million" + # number_to_human(10.01) # => "10" + # number_to_human(10.01, strip_insignificant_zeros: false) # => "10.0" + # + # [+:format+] + # The format of the output. %n represents the number, and + # %u represents the quantifier (e.g., "Thousand"). Defaults to + # "%n %u". + # + # [+:units+] + # A Hash of custom unit quantifier names. + # + # number_to_human(1, units: { unit: "m", thousand: "km" }) # => "1 m" + # number_to_human(100, units: { unit: "m", thousand: "km" }) # => "100 m" + # number_to_human(1000, units: { unit: "m", thousand: "km" }) # => "1 km" + # number_to_human(100000, units: { unit: "m", thousand: "km" }) # => "100 km" + # number_to_human(10000000, units: { unit: "m", thousand: "km" }) # => "10000 km" + # + # The following keys are supported for integer units: +:unit+, +:ten+, + # +:hundred+, +:thousand+, +:million+, +:billion+, +:trillion+, + # +:quadrillion+. Additionally, the following keys are supported for + # fractional units: +:deci+, +:centi+, +:mili+, +:micro+, +:nano+, + # +:pico+, +:femto+. + # + # The Hash can also be defined as a scope in an I18n locale. For example: + # + # en: + # distance: + # centi: + # one: "centimeter" + # other: "centimeters" + # unit: + # one: "meter" + # other: "meters" + # thousand: + # one: "kilometer" + # other: "kilometers" + # + # Then it can be specified by name: + # + # number_to_human(1, units: :distance) # => "1 meter" + # number_to_human(100, units: :distance) # => "100 meters" + # number_to_human(1000, units: :distance) # => "1 kilometer" + # number_to_human(100000, units: :distance) # => "100 kilometers" + # number_to_human(10000000, units: :distance) # => "10000 kilometers" + # number_to_human(0.1, units: :distance) # => "10 centimeters" + # number_to_human(0.01, units: :distance) # => "1 centimeter" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:475 + def number_to_human(number, options = T.unsafe(nil)); end + + # Formats +number+ as bytes into a more human-friendly representation. + # Useful for reporting file sizes to users. + # + # number_to_human_size(123) # => "123 Bytes" + # number_to_human_size(1234) # => "1.21 KB" + # number_to_human_size(12345) # => "12.1 KB" + # number_to_human_size(1234567) # => "1.18 MB" + # number_to_human_size(1234567890) # => "1.15 GB" + # number_to_human_size(1234567890123) # => "1.12 TB" + # number_to_human_size(1234567890123456) # => "1.1 PB" + # number_to_human_size(1234567890123456789) # => "1.07 EB" + # + # See #number_to_human if you want to pretty-print a generic number. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human_size(123456, precision: 2) # => "120 KB" + # number_to_human_size(1234567, precision: 2) # => "1.2 MB" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human_size(123456, precision: 2, round_mode: :up) + # # => "130 KB" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human_size(1234567, separator: ",") + # # => "1,18 MB" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:373 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Formats +number+ as a percentage string. + # + # number_to_percentage(100) # => "100.000%" + # number_to_percentage("99") # => "99.000%" + # number_to_percentage("99x") # => "99x%" + # + # number_to_percentage(12345.6789, delimiter: ".", separator: ",", precision: 2) + # # => "12.345,68%" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_percentage(1000, locale: :fr) + # # => "1000,000%" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 2. + # + # number_to_percentage(12.3456789, precision: 4) # => "12.3457%" + # number_to_percentage(99.999, precision: 0) # => "100%" + # number_to_percentage(99.999, precision: nil) # => "99.999%" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_percentage(12.3456789, precision: 4, round_mode: :down) + # # => "12.3456%" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. + # + # number_to_percentage(12345.6789) # => "12345.679%" + # number_to_percentage(12345.6789, significant: true) # => "12300%" + # number_to_percentage(12345.6789, precision: 2) # => "12345.68%" + # number_to_percentage(12345.6789, precision: 2, significant: true) # => "12000%" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # [+:format+] + # The format of the output. %n represents the number. Defaults to + # "%n%". + # + # number_to_percentage(100, format: "%n %") + # # => "100.000 %" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:223 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Formats +number+ into a phone number. + # + # number_to_phone(5551234) # => "555-1234" + # number_to_phone("5551234") # => "555-1234" + # number_to_phone(1235551234) # => "123-555-1234" + # number_to_phone("12x34") # => "12x34" + # + # number_to_phone(1235551234, delimiter: ".", country_code: 1, extension: 1343) + # # => "+1.123.555.1234 x 1343" + # + # ==== Options + # + # [+:area_code+] + # Whether to use parentheses for the area code. Defaults to false. + # + # number_to_phone(1235551234, area_code: true) + # # => "(123) 555-1234" + # + # [+:delimiter+] + # The digit group delimiter to use. Defaults to "-". + # + # number_to_phone(1235551234, delimiter: " ") + # # => "123 555 1234" + # + # [+:country_code+] + # A country code to prepend. + # + # number_to_phone(1235551234, country_code: 1) + # # => "+1-123-555-1234" + # + # [+:extension+] + # An extension to append. + # + # number_to_phone(1235551234, extension: 555) + # # => "123-555-1234 x 555" + # + # [+:pattern+] + # A regexp that specifies how the digits should be grouped. The first + # three captures from the regexp are treated as digit groups. + # + # number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) + # # => "133-1234-5678" + # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) + # # => "(755) 6123-4567" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:88 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Formats +number+ to a specific level of precision. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 0) # => "12345" + # number_to_rounded(12345, precision: 5) # => "12345.00000" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_rounded(111.234, locale: :fr) + # # => "111,234" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 3. + # + # number_to_rounded(12345.6789, precision: nil) + # # => "12345.6789" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_rounded(12.34, precision: 0, round_mode: :up) + # # => "13" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, significant: true) # => "12300" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 2, significant: true) # => "12000" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_rounded(12.34, strip_insignificant_zeros: false) # => "12.340" + # number_to_rounded(12.34, strip_insignificant_zeros: true) # => "12.34" + # number_to_rounded(12.3456, strip_insignificant_zeros: true) # => "12.346" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:320 + def number_to_rounded(number, options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:12 +class ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:127 + def initialize(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:133 + def execute; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 + def number; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 + def opts; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float?; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:152 + def default_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:177 + def default_value(key); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:148 + def format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:158 + def i18n_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:144 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:173 + def translate_in_locale(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:169 + def translate_number_value_with_default(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:181 + def valid_bigdecimal; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:123 + def convert(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace=(value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float=(value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float?; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:21 +ActiveSupport::NumberHelper::NumberConverter::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToCurrencyConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:10 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:38 + def i18n_opts; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:29 + def options; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 + def __class_attr_namespace=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToDelimitedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:10 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:39 + def delimiter_pattern; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:15 + def parts; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToHumanConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:15 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:50 + def calculate_exponent(units); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:38 + def determine_unit(units, exponent); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:34 + def format; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:55 + def unit_exponents(units); end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:8 +ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:10 +ActiveSupport::NumberHelper::NumberToHumanConverter::INVERTED_DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToHumanSizeConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:13 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:55 + def base; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:31 + def conversion_format; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:44 + def exponent; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:51 + def smaller_than_base?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:39 + def storage_unit_key; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:35 + def unit; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:8 +ActiveSupport::NumberHelper::NumberToHumanSizeConverter::STORAGE_UNITS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToPercentageConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:10 + def convert; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 + def __class_attr_namespace=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:8 +class ActiveSupport::NumberHelper::NumberToPhoneConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:9 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:16 + def convert_to_phone_number(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:24 + def convert_with_area_code(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:31 + def convert_without_area_code(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:43 + def country_code(code); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:39 + def delimiter; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:47 + def phone_ext(ext); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:51 + def regexp_pattern(default_pattern); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToRoundedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:11 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:49 + def format_number(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:45 + def strip_insignificant_zeros; end + + class << self + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 + def __class_attr_namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 + def __class_attr_namespace=(new_value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 + def __class_attr_validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 + def __class_attr_validate_float=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:5 +class ActiveSupport::NumberHelper::RoundingHelper + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:8 + def initialize(options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:20 + def digit_count(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:6 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:12 + def round(number); end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:37 + def absolute_precision(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:26 + def convert_to_decimal(number); end +end + +# pkg:gem/activesupport#lib/active_support/option_merger.rb:6 +class ActiveSupport::OptionMerger + # pkg:gem/activesupport#lib/active_support/option_merger.rb:11 + def initialize(context, options); end + + private + + # pkg:gem/activesupport#lib/active_support/option_merger.rb:16 + def method_missing(method, *arguments, &block); end + + # pkg:gem/activesupport#lib/active_support/option_merger.rb:34 + def respond_to_missing?(*, **, &); end +end + +# DEPRECATED: +ActiveSupport::OrderedHash+ implements a hash that preserves +# insertion order. +# +# oh = ActiveSupport::OrderedHash.new +# oh[:a] = 1 +# oh[:b] = 2 +# oh.keys # => [:a, :b], this order is guaranteed +# +# Also, maps the +omap+ feature for YAML files +# (See https://yaml.org/type/omap.html) to support ordered items +# when loading from YAML. +# +# +ActiveSupport::OrderedHash+ is namespaced to prevent conflicts +# with other implementations. +# +# pkg:gem/activesupport#lib/active_support/ordered_hash.rb:24 +class ActiveSupport::OrderedHash < ::Hash + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:29 + def encode_with(coder); end + + # Returns true to make sure that this hash is extractable via Array#extract_options! + # + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:46 + def extractable_options?; end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:41 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:37 + def reject(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:33 + def select(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:25 + def to_yaml_type; end +end + +# = Ordered Options +# +# +OrderedOptions+ inherits from +Hash+ and provides dynamic accessor methods. +# +# With a +Hash+, key-value pairs are typically managed like this: +# +# h = {} +# h[:boy] = 'John' +# h[:girl] = 'Mary' +# h[:boy] # => 'John' +# h[:girl] # => 'Mary' +# h[:dog] # => nil +# +# Using +OrderedOptions+, the above code can be written as: +# +# h = ActiveSupport::OrderedOptions.new +# h.boy = 'John' +# h.girl = 'Mary' +# h.boy # => 'John' +# h.girl # => 'Mary' +# h.dog # => nil +# +# To raise an exception when the value is blank, append a +# bang to the key name, like: +# +# h.dog! # => raises KeyError: :dog is blank +# +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:33 +class ActiveSupport::OrderedOptions < ::Hash + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:41 + def [](key); end + + # make it protected + # + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:37 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:45 + def dig(key, *identifiers); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:64 + def extractable_options?; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:68 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:49 + def method_missing(method, *args); end + + protected + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:34 + def _get(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:60 + def respond_to_missing?(name, include_private); end +end + +# = Active Support Parameter Filter +# +# +ParameterFilter+ replaces values in a Hash-like object if their +# keys match one of the specified filters. +# +# Matching based on nested keys is possible by using dot notation, e.g. +# "credit_card.number". +# +# If a proc is given as a filter, each key and value of the Hash-like +# and of any nested Hashes will be passed to it. The value or key can +# then be mutated as desired using methods such as String#replace. +# +# # Replaces values with "[FILTERED]" for keys that match /password/i. +# ActiveSupport::ParameterFilter.new([:password]) +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# ActiveSupport::ParameterFilter.new([:foo, "bar"]) +# +# # Replaces values for the exact key "pin" and for keys that begin with +# # "pin_". Does not match keys that otherwise include "pin" as a +# # substring, such as "shipping_id". +# ActiveSupport::ParameterFilter.new([/\Apin\z/, /\Apin_/]) +# +# # Replaces the value for :code in `{ credit_card: { code: "xxxx" } }`. +# # Does not change `{ file: { code: "xxxx" } }`. +# ActiveSupport::ParameterFilter.new(["credit_card.code"]) +# +# # Reverses values for keys that match /secret/i. +# ActiveSupport::ParameterFilter.new([-> (k, v) do +# v.reverse! if /secret/i.match?(k) +# end]) +# +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:39 +class ActiveSupport::ParameterFilter + # Create instance with given filters. Supported type of filters are +String+, +Regexp+, and +Proc+. + # Other types of filters are treated as +String+ using +to_s+. + # For +Proc+ filters, key, value, and optional original hash is passed to block arguments. + # + # ==== Options + # + # * :mask - A replaced object when filtered. Defaults to "[FILTERED]". + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:77 + def initialize(filters = T.unsafe(nil), mask: T.unsafe(nil)); end + + # Mask value of +params+ if key matches one of filters. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:83 + def filter(params); end + + # Returns filtered value for given key. For +Proc+ filters, third block argument is not populated. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:88 + def filter_param(key, value); end + + private + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:125 + def call(params, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:93 + def compile_filters!(filters); end + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:135 + def value_for_key(key, value, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + class << self + # Precompiles an array of filters that otherwise would be passed directly to + # #initialize. Depending on the quantity and types of filters, + # precompilation can improve filtering performance, especially in the case + # where the ParameterFilter instance itself cannot be retained (but the + # precompiled filters can be retained). + # + # filters = [/foo/, :bar, "nested.baz", /nested\.qux/] + # + # precompiled = ActiveSupport::ParameterFilter.precompile_filters(filters) + # # => [/(?-mix:foo)|(?i:bar)/, /(?i:nested\.baz)|(?-mix:nested\.qux)/] + # + # ActiveSupport::ParameterFilter.new(precompiled) + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:55 + def precompile_filters(filters); end + end +end + +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:40 +ActiveSupport::ParameterFilter::FILTERED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/railtie.rb:7 +class ActiveSupport::Railtie < ::Rails::Railtie; end + +# = Active Support \Reloader +# +# This class defines several callbacks: +# +# to_prepare -- Run once at application startup, and also from +# +to_run+. +# +# to_run -- Run before a work run that is reloading. If +# +reload_classes_only_on_change+ is true (the default), the class +# unload will have already occurred. +# +# to_complete -- Run after a work run that has reloaded. If +# +reload_classes_only_on_change+ is false, the class unload will +# have occurred after the work run, but before this callback. +# +# before_class_unload -- Run immediately before the classes are +# unloaded. +# +# after_class_unload -- Run immediately after the classes are +# unloaded. +# +# pkg:gem/activesupport#lib/active_support/reloader.rb:28 +class ActiveSupport::Reloader < ::ActiveSupport::ExecutionWrapper + # pkg:gem/activesupport#lib/active_support/reloader.rb:99 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:48 + def _run_run_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:126 + def class_unload!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:131 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor?; end + + # Release the unload lock if it has been previously obtained + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:114 + def release_unload_lock!; end + + # Acquire the ActiveSupport::Dependencies::Interlock unload lock, + # ensuring it will be released automatically + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:106 + def require_unload_lock!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:121 + def run!; end + + class << self + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks=(value); end + + # Registers a callback that will run immediately after the classes are unloaded. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:44 + def after_class_unload(*args, &block); end + + # Registers a callback that will run immediately before the classes are unloaded. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:39 + def before_class_unload(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:87 + def check!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:95 + def prepare!; end + + # Initiate a manual reload + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:51 + def reload!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:91 + def reloaded!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:62 + def run!(reset: T.unsafe(nil)); end + + # Registers a callback that will run once at application startup and every time the code is reloaded. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:34 + def to_prepare(*args, &block); end + + # Run the supplied block as a work unit, reloading code as needed + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:71 + def wrap(**kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def __class_attr_check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def __class_attr_check=(new_value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def __class_attr_executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def __class_attr_executor=(new_value); end + end +end + +# = Active Support \Rescuable +# +# Rescuable module adds support for easier exception handling. +# +# pkg:gem/activesupport#lib/active_support/rescuable.rb:11 +module ActiveSupport::Rescuable + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + + # Internal handler lookup. Delegates to class method. Some libraries call + # this directly, so keeping it around for compatibility. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:172 + def handler_for_rescue(exception); end + + # Delegates to the class method, but uses the instance as the subject for + # rescue_from handlers (method calls, +instance_exec+ blocks). + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:166 + def rescue_with_handler(exception); end + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end + +# pkg:gem/activesupport#lib/active_support/rescuable.rb:18 +module ActiveSupport::Rescuable::ClassMethods + # pkg:gem/activesupport#lib/active_support/rescuable.rb:105 + def handler_for_rescue(exception, object: T.unsafe(nil)); end + + # Registers exception classes with a handler to be called by rescue_with_handler. + # + # rescue_from receives a series of exception classes or class + # names, and an exception handler specified by a trailing :with + # option containing the name of a method or a Proc object. Alternatively, a block + # can be given as the handler. + # + # Handlers that take one argument will be called with the exception, so + # that the exception can be inspected when dealing with it. + # + # Handlers are inherited. They are searched from right to left, from + # bottom to top, and up the hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if + # any. + # + # class ApplicationController < ActionController::Base + # rescue_from User::NotAuthorized, with: :deny_access + # rescue_from ActiveRecord::RecordInvalid, with: :show_record_errors + # + # rescue_from "MyApp::BaseError" do |exception| + # redirect_to root_url, alert: exception.message + # end + # + # private + # def deny_access + # head :forbidden + # end + # + # def show_record_errors(exception) + # redirect_back_or_to root_url, alert: exception.record.errors.full_messages.to_sentence + # end + # end + # + # Exceptions raised inside exception handlers are not propagated up. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:53 + def rescue_from(*klasses, with: T.unsafe(nil), &block); end + + # Matches an exception to a handler based on the exception class. + # + # If no handler matches the exception, check for a handler matching the + # (optional) +exception.cause+. If no handler matches the exception or its + # cause, this returns +nil+, so you can deal with unhandled exceptions. + # Be sure to re-raise unhandled exceptions if this is what you expect. + # + # begin + # # ... + # rescue => exception + # rescue_with_handler(exception) || raise + # end + # + # Returns the exception if it was handled and +nil+ if it was not. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:90 + def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/rescuable.rb:139 + def constantize_rescue_handler_class(class_or_name); end + + # pkg:gem/activesupport#lib/active_support/rescuable.rb:124 + def find_rescue_handler(exception); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:19 +class ActiveSupport::SafeBuffer < ::String + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:70 + def initialize(_str = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:124 + def %(args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:115 + def *(_); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:111 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:85 + def <<(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:38 + def [](*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:103 + def []=(arg1, arg2, arg3 = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:147 + def as_json(*); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:87 + def bytesplice(*args, value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def capitalize(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def capitalize!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chomp(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chomp!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chop(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def chop!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:59 + def chr; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:79 + def concat(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_prefix(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_prefix!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_suffix(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def delete_suffix!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def downcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def downcase!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:155 + def encode_with(coder); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def gsub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def gsub!(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:139 + def html_safe?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:91 + def insert(index, value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def lstrip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def lstrip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def next(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def next!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:95 + def prepend(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:99 + def replace(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def reverse(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def reverse!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def rstrip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def rstrip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:65 + def safe_concat(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def scrub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def scrub!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:49 + def slice(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:51 + def slice!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def squeeze(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def squeeze!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def strip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def strip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def sub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:175 + def sub!(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def succ(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def succ!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def swapcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def swapcase!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:151 + def to_param; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:143 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr_s(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def tr_s!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def unicode_normalize(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def unicode_normalize!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def upcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:161 + def upcase!(*args); end + + protected + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:202 + def mark_unsafe!; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:207 + def explicit_html_escape_interpolated_argument(arg); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:211 + def implicit_html_escape_interpolated_argument(arg); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:74 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:28 + def original_concat(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:219 + def set_block_back_references(block, match_data); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:225 + def string_into_safe_buffer(new_string, is_html_safe); end +end + +# Raised when ActiveSupport::SafeBuffer#safe_concat is called on unsafe buffers. +# +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:32 +class ActiveSupport::SafeBuffer::SafeConcatError < ::StandardError + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:33 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:20 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:26 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(nil), Array) + +# = Secure Compare Rotator +# +# The ActiveSupport::SecureCompareRotator is a wrapper around ActiveSupport::SecurityUtils.secure_compare +# and allows you to rotate a previously defined value to a new one. +# +# It can be used as follow: +# +# rotator = ActiveSupport::SecureCompareRotator.new('new_production_value') +# rotator.rotate('previous_production_value') +# rotator.secure_compare!('previous_production_value') +# +# One real use case example would be to rotate a basic auth credentials: +# +# class MyController < ApplicationController +# def authenticate_request +# rotator = ActiveSupport::SecureCompareRotator.new('new_password') +# rotator.rotate('old_password') +# +# authenticate_or_request_with_http_basic do |username, password| +# rotator.secure_compare!(password) +# rescue ActiveSupport::SecureCompareRotator::InvalidMatch +# false +# end +# end +# end +# +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:32 +class ActiveSupport::SecureCompareRotator + include ::ActiveSupport::SecurityUtils + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:37 + def initialize(value, on_rotation: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:43 + def rotate(previous_value); end + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:47 + def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:35 +class ActiveSupport::SecureCompareRotator::InvalidMatch < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/security_utils.rb:4 +module ActiveSupport::SecurityUtils + private + + # Constant time string comparison, for fixed length strings. + # + # The values compared should be of fixed length, such as strings + # that have already been processed by HMAC. Raises in case of length mismatch. + # + # pkg:gem/activesupport#lib/active_support/security_utils.rb:10 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # pkg:gem/activesupport#lib/active_support/security_utils.rb:32 + def secure_compare(a, b); end + + class << self + # pkg:gem/activesupport#lib/active_support/security_utils.rb:24 + def fixed_length_secure_compare(a, b); end + + # pkg:gem/activesupport#lib/active_support/security_utils.rb:35 + def secure_compare(a, b); end + end +end + +# = \String Inquirer +# +# Wrapping a string in this class gives you a prettier way to test +# for equality. The value returned by Rails.env is wrapped +# in a StringInquirer object, so instead of calling this: +# +# Rails.env == 'production' +# +# you can call this: +# +# Rails.env.production? +# +# == Instantiating a new \StringInquirer +# +# vehicle = ActiveSupport::StringInquirer.new('car') +# vehicle.car? # => true +# vehicle.bike? # => false +# +# pkg:gem/activesupport#lib/active_support/string_inquirer.rb:21 +class ActiveSupport::StringInquirer < ::String + private + + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:27 + def method_missing(method_name, *, **, &); end + + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:23 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# = Active Support Structured Event \Subscriber +# +# +ActiveSupport::StructuredEventSubscriber+ consumes ActiveSupport::Notifications +# in order to emit structured events via +Rails.event+. +# +# An example would be the Action Controller structured event subscriber, responsible for +# emitting request processing events: +# +# module ActionController +# class StructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber +# attach_to :action_controller +# +# def start_processing(event) +# emit_event("controller.request_started", +# controller: event.payload[:controller], +# action: event.payload[:action], +# format: event.payload[:format] +# ) +# end +# end +# end +# +# After configured, whenever a "start_processing.action_controller" notification is published, +# it will properly dispatch the event (+ActiveSupport::Notifications::Event+) to the +start_processing+ method. +# The subscriber can then emit a structured event via the +emit_event+ method. +# +# pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:31 +class ActiveSupport::StructuredEventSubscriber < ::ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:56 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:88 + def call(event); end + + # Like +emit_event+, but only emits when the event reporter is in debug mode + # + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:82 + def emit_debug_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Emit a structured event via Rails.event.notify. + # + # ==== Arguments + # + # * +name+ - The event name as a string or symbol + # * +payload+ - The event payload as a hash or object + # * +caller_depth+ - Stack depth for source location (default: 1) + # * +kwargs+ - Additional payload data merged with the payload hash + # + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:75 + def emit_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:61 + def silenced?(event); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:65 + def silenced_events=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:95 + def handle_event_error(name, error); end + + class << self + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:37 + def attach_to(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods=(value); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def debug_methods?; end + + private + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def __class_attr_debug_methods; end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:32 + def __class_attr_debug_methods=(new_value); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:50 + def debug_only(method); end + + # pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:44 + def set_silenced_events; end + end +end + +# pkg:gem/activesupport#lib/active_support/structured_event_subscriber.rb:34 +ActiveSupport::StructuredEventSubscriber::DEBUG_CHECK = T.let(T.unsafe(nil), Proc) + +# = Active Support \Subscriber +# +# +ActiveSupport::Subscriber+ is an object set to consume +# ActiveSupport::Notifications. The subscriber dispatches notifications to +# a registered object based on its given namespace. +# +# An example would be an Active Record subscriber responsible for collecting +# statistics about queries: +# +# module ActiveRecord +# class StatsSubscriber < ActiveSupport::Subscriber +# attach_to :active_record +# +# def sql(event) +# Statsd.timing("sql.#{event.payload[:name]}", event.duration) +# end +# end +# end +# +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. +# +# We can detach a subscriber as well: +# +# ActiveRecord::StatsSubscriber.detach_from(:active_record) +# +# pkg:gem/activesupport#lib/active_support/subscriber.rb:32 +class ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 + def call(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:70 + def patterns; end + + class << self + # Attach the subscriber to a namespace. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:35 + def attach_to(namespace, subscriber = T.unsafe(nil), notifier = T.unsafe(nil), inherit_all: T.unsafe(nil)); end + + # Detach the subscriber from a namespace. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:50 + def detach_from(namespace, notifier = T.unsafe(nil)); end + + # Adds event subscribers for all new methods added to the class. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:69 + def method_added(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:79 + def subscribers; end + + private + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:86 + def add_event_subscriber(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:124 + def fetch_public_methods(subscriber, inherit_all); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:108 + def find_attached_subscriber; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:112 + def invalid_event?(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 + def notifier; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:120 + def pattern_subscribed?(pattern); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:116 + def prepare_pattern(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:97 + def remove_event_subscriber(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:84 + def subscriber; end + end +end + +# This is a class for wrapping syntax errors. The purpose of this class +# is to enhance the backtraces on SyntaxError exceptions to include the +# source location of the syntax error. That way we can display the error +# source on error pages in development. +# +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:10 +class ActiveSupport::SyntaxErrorProxy + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:11 + def backtrace; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:41 + def backtrace_locations; end + + private + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:54 + def parse_message_for_trace; end +end + +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:15 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocation < ::Struct + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:25 + def absolute_path; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:22 + def base_label; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:19 + def label; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:16 + def spot(_); end +end + +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:30 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocationProxy + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:31 + def initialize(loc, ex); end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:36 + def spot(_); end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:6 +class ActiveSupport::TagStack + class << self + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:11 + def tags; end + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:15 + def with_tags(*args, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/event_reporter.rb:30 + def resolve_tags(args, kwargs); end + end +end + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:7 +ActiveSupport::TagStack::EMPTY_TAGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/event_reporter.rb:8 +ActiveSupport::TagStack::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support Tagged Logging +# +# Wraps any standard Logger object to provide tagging capabilities. +# +# May be called with a block: +# +# logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) +# logger.tagged('BCX') { logger.info 'Stuff' } # Logs "[BCX] Stuff" +# logger.tagged('BCX', "Jason") { |tagged_logger| tagged_logger.info 'Stuff' } # Logs "[BCX] [Jason] Stuff" +# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff" +# +# If called without a block, a new logger will be returned with applied tags: +# +# logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) +# logger.tagged("BCX").info "Stuff" # Logs "[BCX] Stuff" +# logger.tagged("BCX", "Jason").info "Stuff" # Logs "[BCX] [Jason] Stuff" +# logger.tagged("BCX").tagged("Jason").info "Stuff" # Logs "[BCX] [Jason] Stuff" +# +# This is used by the default Rails.logger as configured by Railties to make +# it easy to stamp log lines with subdomains, request ids, and anything else +# to aid debugging of multi-user production applications. +# +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:29 +module ActiveSupport::TaggedLogging + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def clear_tags!(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:152 + def flush; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def pop_tags(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def push_tags(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:141 + def tagged(*tags); end + + class << self + # Returns an `ActiveSupport::Logger` that has already been wrapped with tagged logging concern. + # + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:117 + def logger(*args, **kwargs); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:121 + def new(logger); end + end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:30 +module ActiveSupport::TaggedLogging::Formatter + # This method is invoked when a log event occurs. + # + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:32 + def call(severity, timestamp, progname, msg); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:51 + def clear_tags!; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:61 + def current_tags; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:47 + def pop_tags(count = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:43 + def push_tags(*tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:55 + def tag_stack; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:36 + def tagged(*tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:65 + def tags_text; end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:108 +module ActiveSupport::TaggedLogging::LocalTagStorage + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 + def tag_stack; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 + def tag_stack=(_arg0); end + + class << self + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:111 + def extended(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:70 +class ActiveSupport::TaggedLogging::TagStack + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:73 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:91 + def clear; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:96 + def format_message(message); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:86 + def pop_tags(count); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:78 + def push_tags(tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:71 + def tags; end +end + +# pkg:gem/activesupport#lib/active_support/test_case.rb:23 +class ActiveSupport::TestCase < ::Minitest::Test + include ::ActiveSupport::Testing::SetupAndTeardown + include ::ActiveSupport::Testing::TestsWithoutAssertions + include ::ActiveSupport::Testing::TaggedLogging + include ::ActiveSupport::Callbacks + include ::ActiveSupport::Testing::Assertions + include ::ActiveSupport::Testing::ErrorReporterAssertions + include ::ActiveSupport::Testing::EventReporterAssertions + include ::ActiveSupport::Testing::NotificationAssertions + include ::ActiveSupport::Testing::Deprecation + include ::ActiveSupport::Testing::ConstantStubbing + include ::ActiveSupport::Testing::TimeHelpers + include ::ActiveSupport::Testing::FileFixtures + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveSupport::Testing::SetupAndTeardown::ClassMethods + extend ::ActiveSupport::Testing::Declarative + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_setup_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _run_teardown_callbacks!(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:302 + def assert_no_match(matcher, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:225 + def assert_not_empty(obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:236 + def assert_not_equal(exp, act, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:247 + def assert_not_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:258 + def assert_not_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:269 + def assert_not_includes(obj, sub, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:280 + def assert_not_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:291 + def assert_not_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:313 + def assert_not_nil(obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:324 + def assert_not_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:335 + def assert_not_predicate(o1, op, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:346 + def assert_not_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:357 + def assert_not_same(exp, act, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path?; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:361 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:196 + def method_name; end + + # Returns the current parallel worker ID if tests are running in parallel + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:199 + def parallel_worker_id; end + + class << self + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _setup_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def _teardown_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def file_fixture_path?; end + + # Returns the current parallel worker ID if tests are running in parallel, + # nil otherwise. + # + # ActiveSupport::TestCase.parallel_worker_id # => 2 + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:34 + def parallel_worker_id; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:38 + def parallel_worker_id=(value); end + + # Parallelizes the test suite. + # + # Takes a +workers+ argument that controls how many times the process + # is forked. For each process a new database will be created suffixed + # with the worker number. + # + # test-database_0 + # test-database_1 + # + # If ENV["PARALLEL_WORKERS"] is set the workers argument will be ignored + # and the environment variable will be used instead. This is useful for CI + # environments, or other environments where you may need more workers than + # you do for local testing. + # + # If the number of workers is set to +1+ or fewer, the tests will not be + # parallelized. + # + # If +workers+ is set to +:number_of_processors+, the number of workers will be + # set to the actual core count on the machine you are on. + # + # The default parallelization method is to fork processes. If you'd like to + # use threads instead you can pass with: :threads to the +parallelize+ + # method. Note the threaded parallelization does not create multiple + # databases and will not work with system tests. + # + # parallelize(workers: :number_of_processors, with: :threads) + # + # The threaded parallelization uses minitest's parallel executor directly. + # The processes parallelization uses a Ruby DRb server. + # + # Because parallelization presents an overhead, it is only enabled when the + # number of tests to run is above the +threshold+ param. The default value is + # 50, and it's configurable via +config.active_support.test_parallelization_threshold+. + # + # If you want to skip Rails default creation of one database per process in favor of + # writing your own implementation, you can set +parallelize_databases+, or configure it + # via +config.active_support.parallelize_test_databases+. + # + # parallelize(workers: :number_of_processors, parallelize_databases: false) + # + # Note that your test suite may deadlock if you attempt to use only one database + # with multiple processes. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:113 + def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil), parallelize_databases: T.unsafe(nil)); end + + # Before fork hook for parallel testing. This can be used to run anything + # before the processes are forked. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_before_fork do + # # run this before fork + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:138 + def parallelize_before_fork(&block); end + + # Setup hook for parallel testing. This can be used if you have multiple + # databases or any behavior that needs to be run after the process is forked + # but before the tests run. + # + # Note: this feature is not available with the threaded parallelization. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_setup do + # # create databases + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:155 + def parallelize_setup(&block); end + + # Clean up hook for parallel testing. This can be used to drop databases + # if your app uses multiple write/read databases or other clean up before + # the tests finish. This runs before the forked process is closed. + # + # Note: this feature is not available with the threaded parallelization. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_teardown do + # # drop databases + # end + # end + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:172 + def parallelize_teardown(&block); end + + # MT6 API change + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:66 + def run_order; end + + # Returns the order in which test cases are run. + # + # ActiveSupport::TestCase.test_order # => :random + # + # Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+. + # Defaults to +:random+. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:61 + def test_order; end + + # Sets the order in which test cases are run. + # + # ActiveSupport::TestCase.test_order = :random # => :random + # + # Valid values are: + # * +:random+ (to run tests in random order) + # * +:parallel+ (to run tests in parallel) + # * +:sorted+ (to run tests alphabetically by method name) + # * +:alpha+ (equivalent to +:sorted+) + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:51 + def test_order=(new_order); end + + private + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __class_attr___callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:204 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def __class_attr_file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:213 + def __class_attr_file_fixture_path=(new_value); end + end +end + +# pkg:gem/activesupport#lib/active_support/test_case.rb:24 +ActiveSupport::TestCase::Assertion = Minitest::Assertion + +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:4 +module ActiveSupport::Testing; end + +# pkg:gem/activesupport#lib/active_support/testing/assertions.rb:7 +module ActiveSupport::Testing::Assertions + # Assertion that the result of evaluating an expression is changed before + # and after invoking the passed in block. + # + # assert_changes 'Status.all_good?' do + # post :create, params: { status: { ok: false } } + # end + # + # You can pass the block as a string to be evaluated in the context of + # the block. A lambda can be passed for the block as well. + # + # assert_changes -> { Status.all_good? } do + # post :create, params: { status: { ok: false } } + # end + # + # The assertion is useful to test side effects. The passed block can be + # anything that can be converted to string with #to_s. + # + # assert_changes :@object do + # @object = 42 + # end + # + # The keyword arguments +:from+ and +:to+ can be given to specify the + # expected initial value and the expected value after the block was + # executed. The comparison is done using case equality (===), which means + # you can specify patterns or classes: + # + # # Exact value match + # assert_changes :@object, from: nil, to: :foo do + # @object = :foo + # end + # + # # Case equality + # assert_changes -> { user.token }, to: /\w{32}/ do + # user.generate_token + # end + # + # # Type check + # assert_changes -> { current_error }, from: nil, to: RuntimeError do + # raise "Oops" + # end + # + # An error message can be specified. + # + # assert_changes -> { Status.all_good? }, 'Expected the status to be bad' do + # post :create, params: { status: { incident: true } } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:212 + def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end + + # Test numeric difference between the return value of an expression as a + # result of what is evaluated in the yielded block. + # + # assert_difference 'Article.count' do + # post :create, params: { article: {...} } + # end + # + # An arbitrary expression is passed in and evaluated. + # + # assert_difference 'Article.last.comments(:reload).size' do + # post :create, params: { comment: {...} } + # end + # + # An arbitrary positive or negative difference can be specified. + # The default is +1+. + # + # assert_difference 'Article.count', -1 do + # post :delete, params: { id: ... } + # end + # + # An array of expressions can be passed in and evaluated. + # + # assert_difference [ 'Article.count', 'Post.count' ], 2 do + # post :create, params: { article: {...} } + # end + # + # A hash of expressions/numeric differences can be passed in and evaluated. + # + # assert_difference({ 'Article.count' => 1, 'Notification.count' => 2 }) do + # post :create, params: { article: {...} } + # end + # + # A lambda, a list of lambdas or a hash of lambdas/numeric differences can be passed in and evaluated: + # + # assert_difference ->{ Article.count }, 2 do + # post :create, params: { article: {...} } + # end + # + # assert_difference [->{ Article.count }, ->{ Post.count }], 2 do + # post :create, params: { article: {...} } + # end + # + # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # post :create, params: { article: {...} } + # end + # + # An error message can be specified. + # + # assert_difference 'Article.count', -1, 'An Article should be destroyed' do + # post :delete, params: { id: ... } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:105 + def assert_difference(expression, *args, &block); end + + # Assertion that the result of evaluating an expression is not changed before + # and after invoking the passed in block. + # + # assert_no_changes 'Status.all_good?' do + # post :create, params: { status: { ok: true } } + # end + # + # Provide the optional keyword argument +:from+ to specify the expected + # initial value. The comparison is done using case equality (===), which means + # you can specify patterns or classes: + # + # # Exact value match + # assert_no_changes -> { Status.all_good? }, from: true do + # post :create, params: { status: { ok: true } } + # end + # + # # Case equality + # assert_no_changes -> { user.token }, from: /\w{32}/ do + # user.touch + # end + # + # # Type check + # assert_no_changes -> { current_error }, from: RuntimeError do + # retry_operation + # end + # + # An error message can be specified. + # + # assert_no_changes -> { Status.all_good? }, 'Expected the status to be good' do + # post :create, params: { status: { ok: false } } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:281 + def assert_no_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), &block); end + + # Assertion that the numeric result of evaluating an expression is not + # changed before and after invoking the passed in block. + # + # assert_no_difference 'Article.count' do + # post :create, params: { article: invalid_attributes } + # end + # + # A lambda can be passed in and evaluated. + # + # assert_no_difference -> { Article.count } do + # post :create, params: { article: invalid_attributes } + # end + # + # An error message can be specified. + # + # assert_no_difference 'Article.count', 'An Article should not be created' do + # post :create, params: { article: invalid_attributes } + # end + # + # An array of expressions can also be passed in and evaluated. + # + # assert_no_difference [ 'Article.count', -> { Post.count } ] do + # post :create, params: { article: invalid_attributes } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:162 + def assert_no_difference(expression, message = T.unsafe(nil), &block); end + + # Asserts that an expression is not truthy. Passes if +object+ is +nil+ or + # +false+. "Truthy" means "considered true in a conditional" like if + # foo. + # + # assert_not nil # => true + # assert_not false # => true + # assert_not 'foo' # => Expected "foo" to be nil or false + # + # An error message can be specified. + # + # assert_not foo, 'foo should be false' + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:21 + def assert_not(object, message = T.unsafe(nil)); end + + # Assertion that the block should not raise an exception. + # + # Passes if evaluated code in the yielded block raises no exception. + # + # assert_nothing_raised do + # perform_service(param: 'no_exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:48 + def assert_nothing_raised; end + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:39 + def assert_raise(*exp, match: T.unsafe(nil), &block); end + + # Asserts that a block raises one of +exp+. This is an enhancement of the + # standard Minitest assertion method with the ability to test error + # messages. + # + # assert_raises(ArgumentError, match: /incorrect param/i) do + # perform_service(param: 'exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:34 + def assert_raises(*exp, match: T.unsafe(nil), &block); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:316 + def _assert_nothing_raised_or_warn(assertion, &block); end + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:331 + def _callable_to_source_string(callable); end +end + +# pkg:gem/activesupport#lib/active_support/testing/assertions.rb:8 +ActiveSupport::Testing::Assertions::UNTRACKED = T.let(T.unsafe(nil), Object) + +# Resolves a constant from a minitest spec name. +# +# Given the following spec-style test: +# +# describe WidgetsController, :index do +# describe "authenticated user" do +# describe "returns widgets" do +# it "has a controller that exists" do +# assert_kind_of WidgetsController, @controller +# end +# end +# end +# end +# +# The test will have the following name: +# +# "WidgetsController::index::authenticated user::returns widgets" +# +# The constant WidgetsController can be resolved from the name. +# The following code will resolve the constant: +# +# controller = determine_constant_from_test_name(name) do |constant| +# Class === constant && constant < ::ActionController::Metal +# end +# +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:32 +module ActiveSupport::Testing::ConstantLookup + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods +end + +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:35 +module ActiveSupport::Testing::ConstantLookup::ClassMethods + # pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:36 + def determine_constant_from_test_name(test_name); end +end + +# pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:5 +module ActiveSupport::Testing::ConstantStubbing + # Changes the value of a constant for the duration of a block. Example: + # + # # World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 + # stub_const(World::List::Import, :LARGE_IMPORT_THRESHOLD, 1) do + # assert_equal 1, World::List::Import::LARGE_IMPORT_THRESHOLD + # end + # + # assert_equal 5000, World::List::Import::LARGE_IMPORT_THRESHOLD + # + # Using this method rather than forcing World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 prevents + # warnings from being thrown, and ensures that the old value is returned after the test has completed. + # + # If the constant doesn't already exists, but you need it set for the duration of the block + # you can do so by passing `exists: false`. + # + # stub_const(object, :SOME_CONST, 1, exists: false) do + # assert_equal 1, SOME_CONST + # end + # + # Note: Stubbing a const will stub it across all threads. So if you have concurrent threads + # (like separate test suites running in parallel) that all depend on the same constant, it's possible + # divergent stubbing will trample on each other. + # + # pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:28 + def stub_const(mod, constant, new_value, exists: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/testing/declarative.rb:5 +module ActiveSupport::Testing::Declarative + # Helper to define a test method using a String. Under the hood, it replaces + # spaces with underscores and defines the test method. + # + # test "verify something" do + # ... + # end + # + # pkg:gem/activesupport#lib/active_support/testing/declarative.rb:13 + def test(name, &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:7 +module ActiveSupport::Testing::Deprecation + # :call-seq: + # assert_deprecated(deprecator, &block) + # assert_deprecated(match, deprecator, &block) + # + # Asserts that a matching deprecation warning was emitted by the given deprecator during the execution of the yielded block. + # + # assert_deprecated(/foo/, CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # The +match+ object may be a +Regexp+, or +String+ appearing in the message. + # + # assert_deprecated('foo', CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # If the +match+ is omitted (or explicitly +nil+), any deprecation warning will match. + # + # assert_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:30 + def assert_deprecated(match = T.unsafe(nil), deprecator = T.unsafe(nil), &block); end + + # Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block. + # + # assert_not_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "message" # fails assertion + # end + # + # assert_not_deprecated(ActiveSupport::Deprecation.new) do + # CustomDeprecator.warn "message" # passes assertion, different deprecator + # end + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:55 + def assert_not_deprecated(deprecator, &block); end + + # Returns the return value of the block and an array of all the deprecation warnings emitted by the given + # +deprecator+ during the execution of the yielded block. + # + # collect_deprecations(CustomDeprecator) do + # CustomDeprecator.warn "message" + # ActiveSupport::Deprecation.new.warn "other message" + # :result + # end # => [:result, ["message"]] + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:69 + def collect_deprecations(deprecator); end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:5 +module ActiveSupport::Testing::ErrorReporterAssertions + # Assertion that the block should cause at least one exception to be reported + # to +Rails.error+. + # + # Passes if the evaluated code in the yielded block reports a matching exception. + # + # assert_error_reported(IOError) do + # Rails.error.report(IOError.new("Oops")) + # end + # + # To test further details about the reported exception, you can use the return + # value. + # + # report = assert_error_reported(IOError) do + # # ... + # end + # assert_equal "Oops", report.error.message + # assert_equal "admin", report.context[:section] + # assert_equal :warning, report.severity + # assert_predicate report, :handled? + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:88 + def assert_error_reported(error_class = T.unsafe(nil), &block); end + + # Assertion that the block should not cause an exception to be reported + # to +Rails.error+. + # + # Passes if evaluated code in the yielded block reports no exception. + # + # assert_no_error_reported do + # perform_service(param: 'no_exception') + # end + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:62 + def assert_no_error_reported(&block); end + + # Captures reported errors from within the block that match the given + # error class. + # + # reports = capture_error_reports(IOError) do + # Rails.error.report(IOError.new("Oops")) + # Rails.error.report(IOError.new("Oh no")) + # Rails.error.report(StandardError.new) + # end + # + # assert_equal 2, reports.size + # assert_equal "Oops", reports.first.error.message + # assert_equal "Oh no", reports.last.error.message + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:118 + def capture_error_reports(error_class = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:6 +module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:16 + def record; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:29 + def report(error, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:38 + def subscribe; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 +class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:12 + def handled?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def new(*_arg0); end + end +end + +# Provides test helpers for asserting on ActiveSupport::EventReporter events. +# +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:6 +module ActiveSupport::Testing::EventReporterAssertions + # Asserts that the block causes an event with the given name to be reported + # to +Rails.event+. + # + # Passes if the evaluated code in the yielded block reports a matching event. + # + # assert_event_reported("user.created") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # To test further details about the reported event, you can specify payload and tag matchers. + # + # assert_event_reported("user.created", + # payload: { id: 123, name: "John Doe" }, + # tags: { request_id: /[0-9]+/ } + # ) do + # Rails.event.tagged(request_id: "123") do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # end + # + # The matchers support partial matching - only the specified keys need to match. + # + # assert_event_reported("user.created", payload: { id: 123 }) do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:142 + def assert_event_reported(name, payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Asserts that the provided events were reported, regardless of order. + # + # assert_events_reported([ + # { name: "user.created", payload: { id: 123 } }, + # { name: "email.sent", payload: { to: "user@example.com" } } + # ]) do + # create_user_and_send_welcome_email + # end + # + # Supports the same payload and tag matching as +assert_event_reported+. + # + # assert_events_reported([ + # { + # name: "process.started", + # payload: { id: 123 }, + # tags: { request_id: /[0-9]+/ } + # }, + # { name: "process.completed" } + # ]) do + # Rails.event.tagged(request_id: "456") do + # start_and_complete_process(123) + # end + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:184 + def assert_events_reported(expected_events, &block); end + + # Asserts that the block does not cause an event to be reported to +Rails.event+. + # + # If no name is provided, passes if evaluated code in the yielded block reports no events. + # + # assert_no_event_reported do + # service_that_does_not_report_events.perform + # end + # + # If a name is provided, passes if evaluated code in the yielded block reports no events + # with that name. + # + # assert_no_event_reported("user.created") do + # service_that_does_not_report_events.perform + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:101 + def assert_no_event_reported(name = T.unsafe(nil), payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Allows debug events to be reported to +Rails.event+ for the duration of a given block. + # + # with_debug_event_reporting do + # service_that_reports_debug_events.perform + # end + # + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:222 + def with_debug_event_reporting(&block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:7 +module ActiveSupport::Testing::EventReporterAssertions::EventCollector + class << self + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:46 + def emit(event); end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:53 + def record; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:81 + def event_recorders; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:66 + def subscribe; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:11 +class ActiveSupport::Testing::EventReporterAssertions::EventCollector::Event + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:14 + def initialize(event_data); end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:12 + def event_data; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:18 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:22 + def matches?(name, payload, tags); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/event_reporter_assertions.rb:34 + def matches_hash?(expected_hash, event_key); end +end + +# Adds simple access to sample files called file fixtures. +# File fixtures are normal files stored in +# ActiveSupport::TestCase.file_fixture_path. +# +# File fixtures are represented as +Pathname+ objects. +# This makes it easy to extract specific information: +# +# file_fixture("example.txt").read # get the file's content +# file_fixture("example.mp3").size # get the file size +# +# pkg:gem/activesupport#lib/active_support/testing/file_fixtures.rb:16 +module ActiveSupport::Testing::FileFixtures + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # Returns a +Pathname+ to the fixture file named +fixture_name+. + # + # Raises +ArgumentError+ if +fixture_name+ can't be found. + # + # pkg:gem/activesupport#lib/active_support/testing/file_fixtures.rb:26 + def file_fixture(fixture_name); end + + module GeneratedClassMethods + def file_fixture_path; end + def file_fixture_path=(value); end + def file_fixture_path?; end + end + + module GeneratedInstanceMethods + def file_fixture_path; end + def file_fixture_path?; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:7 +module ActiveSupport::Testing::Isolation + include ::ActiveSupport::Testing::Isolation::Forking + + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:20 + def run; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:16 + def forking_env?; end + + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:10 + def included(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:35 +module ActiveSupport::Testing::Isolation::Forking + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:36 + def run_in_isolation(&blk); end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:73 +module ActiveSupport::Testing::Isolation::Subprocess + # Complicated H4X to get this working in Windows / JRuby with + # no forking. + # + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:78 + def run_in_isolation(&blk); end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:74 +ActiveSupport::Testing::Isolation::Subprocess::ORIG_ARGV = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:8 +class ActiveSupport::Testing::Isolation::SubprocessCrashed < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:5 +module ActiveSupport::Testing::NotificationAssertions + # Assert no notifications were emitted for a given +pattern+. + # + # You can assert no notifications were emitted by passing a pattern, which accepts + # either a string or regexp, and a block. While the block is executed, if no + # matching notifications are emitted, the assertion will pass. + # + # assert_no_notifications("post.submitted") do + # post.destroy # => emits non-matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:66 + def assert_no_notifications(pattern = T.unsafe(nil), &block); end + + # Assert a notification was emitted with a given +pattern+ and optional +payload+. + # + # You can assert that a notification was emitted by passing a pattern, which accepts + # either a string or regexp, an optional payload, and a block. While the block + # is executed, if a matching notification is emitted, the assertion will pass + # and the notification will be returned. + # + # Note that the payload is matched as a subset, meaning that the notification must + # contain at least the specified keys and values, but may contain additional ones. + # + # assert_notification("post.submitted", title: "Cool Post") do + # post.submit(title: "Cool Post", body: "Cool Body") # => emits matching notification + # end + # + # Using the returned notification, you can make more customized assertions. + # + # notification = assert_notification("post.submitted", title: "Cool Post") do + # ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: Body.new("Cool Body")) + # end + # + # assert_instance_of(Body, notification.payload[:body]) + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:28 + def assert_notification(pattern, payload = T.unsafe(nil), &block); end + + # Assert the number of notifications emitted with a given +pattern+. + # + # You can assert the number of notifications emitted by passing a pattern, which accepts + # either a string or regexp, a count, and a block. While the block is executed, + # the number of matching notifications emitted will be counted. After the block's + # execution completes, the assertion will pass if the count matches. + # + # assert_notifications_count("post.submitted", 1) do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:51 + def assert_notifications_count(pattern, count, &block); end + + # Capture emitted notifications, optionally filtered by a +pattern+. + # + # You can capture emitted notifications, optionally filtered by a pattern, + # which accepts either a string or regexp, and a block. + # + # notifications = capture_notifications("post.submitted") do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # pkg:gem/activesupport#lib/active_support/testing/notification_assertions.rb:85 + def capture_notifications(pattern = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:8 +class ActiveSupport::Testing::Parallelization + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:36 + def initialize(worker_count); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:54 + def <<(work); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 + def after_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:43 + def before_fork; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def before_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:34 + def run_cleanup_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:62 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:58 + def size; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:47 + def start; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:22 + def after_fork_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 + def after_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:14 + def before_fork_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def before_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:30 + def run_cleanup_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:34 + def run_cleanup_hooks; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 +class ActiveSupport::Testing::Parallelization::PrerecordResultClass < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def name; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def name=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:11 +class ActiveSupport::Testing::Parallelization::Server + include ::DRb::DRbUndumped + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:14 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:32 + def <<(o); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:64 + def active_workers?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:68 + def interrupt; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:37 + def pop; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:21 + def record(reporter, result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:54 + def remove_dead_workers(dead_pids); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:72 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:44 + def start_worker(worker_id, worker_pid); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:49 + def stop_worker(worker_id, worker_pid); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:6 +class ActiveSupport::Testing::Parallelization::Worker + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:7 + def initialize(number, url); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:84 + def after_fork; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:42 + def perform_job(job); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:92 + def run_cleanup; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:60 + def safe_record(reporter, result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:14 + def start; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:36 + def work_from_queue; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:99 + def add_setup_exception(result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:103 + def set_process_title(status); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:5 +class ActiveSupport::Testing::ParallelizeExecutor + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:8 + def initialize(size:, with:, threshold: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:22 + def <<(work); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def parallelize_with; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:26 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def size; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:15 + def start; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def threshold; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:35 + def build_parallel_executor; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:72 + def execution_info; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:60 + def many_workers?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:31 + def parallel_executor; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:47 + def parallelize; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:52 + def parallelized?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:56 + def should_parallelize?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:68 + def show_execution_info; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:64 + def tests_count; end +end + +# Adds support for +setup+ and +teardown+ callbacks. +# These callbacks serve as a replacement to overwriting the +# #setup and #teardown methods of your TestCase. +# +# class ExampleTest < ActiveSupport::TestCase +# setup do +# # ... +# end +# +# teardown do +# # ... +# end +# end +# +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:20 +module ActiveSupport::Testing::SetupAndTeardown + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:44 + def after_teardown; end + + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:39 + def before_setup; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:21 + def prepended(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:27 +module ActiveSupport::Testing::SetupAndTeardown::ClassMethods + # Add a callback, which runs before TestCase#setup. + # + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:29 + def setup(*args, &block); end + + # Add a callback, which runs after TestCase#teardown. + # + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:34 + def teardown(*args, &block); end +end + +# Manages stubs for TimeHelpers +# +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:9 +class ActiveSupport::Testing::SimpleStubs + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:12 + def initialize; end + + # Stubs object.method_name with the given block + # If the method is already stubbed, remove that stub + # so that removing this stub will restore the original implementation. + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # target = Time.zone.local(2004, 11, 24, 1, 4, 44) + # simple_stubs.stub_object(Time, :now) { at(target.to_i) } + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:23 + def stub_object(object, method_name, &block); end + + # Returns true if any stubs are set, false if there are none + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:53 + def stubbed?; end + + # Returns the Stub for object#method_name + # (nil if it is not stubbed) + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:48 + def stubbing(object, method_name); end + + # Remove all object-method stubs held by this instance + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:37 + def unstub_all!; end + + private + + # Restores the original object.method described by the Stub + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:59 + def unstub_object(stub); end +end + +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 +class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def method_name; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def method_name=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def object; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def object=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def original_method; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def original_method=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def new(*_arg0); end + end +end + +# Logs a "PostsControllerTest: test name" heading before each test to +# make test.log easier to search and follow along with. +# +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:7 +module ActiveSupport::Testing::TaggedLogging + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:10 + def before_setup; end + + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:8 + def tagged_logger=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:22 + def tagged_logger; end +end + +# Warns when a test case does not perform any assertions. +# +# This is helpful in detecting broken tests that do not perform intended assertions. +# +# pkg:gem/activesupport#lib/active_support/testing/tests_without_assertions.rb:8 +module ActiveSupport::Testing::TestsWithoutAssertions + # pkg:gem/activesupport#lib/active_support/testing/tests_without_assertions.rb:9 + def after_teardown; end +end + +# Contains helpers that help you test passage of time. +# +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:68 +module ActiveSupport::Testing::TimeHelpers + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:69 + def after_teardown; end + + # Calls +travel_to+ with +date_or_time+, which defaults to +Time.now+. + # Forwards optional with_usec argument. + # + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time + # sleep(1) + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time Time.current + 1.day + # sleep(1) + # Time.current # => Mon, 10 Jul 2017 15:34:49 EST -05:00 + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time do + # sleep(1) + # User.create.created_at # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # end + # Time.current # => Sun, 09 Jul 2017 15:34:50 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:261 + def freeze_time(date_or_time = T.unsafe(nil), with_usec: T.unsafe(nil), &block); end + + # Changes current time to the time in the future or in the past by a given time difference by + # stubbing +Time.now+, +Date.today+, and +DateTime.now+. The stubs are automatically removed + # at the end of the test. + # + # Note that the usec for the resulting time will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel 1.day + # Time.current # => Sun, 10 Nov 2013 15:34:49 EST -05:00 + # Date.current # => Sun, 10 Nov 2013 + # DateTime.current # => Sun, 10 Nov 2013 15:34:49 -0500 + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel 1.day do + # User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00 + # end + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:97 + def travel(duration, with_usec: T.unsafe(nil), &block); end + + # Returns the current time back to its original state, by removing the stubs added by + # +travel+, +travel_to+, and +freeze_time+. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # This method also accepts a block, which brings the stubs back at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back do + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # end + # + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:231 + def travel_back; end + + # Changes current time to the given time by stubbing +Time.now+, +Time.new+, + # +Date.today+, and +DateTime.now+ to return the time or date passed into this method. + # The stubs are automatically removed at the end of the test. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # Date.current # => Wed, 24 Nov 2004 + # DateTime.current # => Wed, 24 Nov 2004 01:04:44 -0500 + # + # Dates are taken as their timestamp at the beginning of the day in the + # application time zone. Time.current returns said timestamp, + # and Time.now its equivalent in the system time zone. Similarly, + # Date.current returns a date equal to the argument, and + # Date.today the date according to Time.now, which may + # be different. (Note that you rarely want to deal with Time.now, + # or Date.today, in order to honor the application time zone + # please always use Time.current and Date.current.) + # + # Note that the usec for the time passed will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) do + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # end + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:133 + def travel_to(date_or_time, with_usec: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:239 + def unfreeze_time; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:270 + def in_block; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:270 + def in_block=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:266 + def simple_stubs; end +end + +# = Active Support \Time With Zone +# +# A Time-like class that can represent a time in any time zone. Necessary +# because standard Ruby Time instances are limited to UTC and the +# system's ENV['TZ'] zone. +# +# You shouldn't ever need to create a TimeWithZone instance directly via +new+. +# Instead use methods +local+, +parse+, +at+, and +now+ on TimeZone instances, +# and +in_time_zone+ on Time and DateTime instances. +# +# Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' +# Time.zone.local(2007, 2, 10, 15, 30, 45) # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.parse('2007-02-10 15:30:45') # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.at(1171139445) # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.now # => Sun, 18 May 2008 13:07:55.754107581 EDT -04:00 +# Time.utc(2007, 2, 10, 20, 30, 45).in_time_zone # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# +# See Time and TimeZone for further documentation of these methods. +# +# TimeWithZone instances implement the same API as Ruby Time instances, so +# that Time and TimeWithZone instances are interchangeable. +# +# t = Time.zone.now # => Sun, 18 May 2008 13:27:25.031505668 EDT -04:00 +# t.hour # => 13 +# t.dst? # => true +# t.utc_offset # => -14400 +# t.zone # => "EDT" +# t.to_fs(:rfc822) # => "Sun, 18 May 2008 13:27:25 -0400" +# t + 1.day # => Mon, 19 May 2008 13:27:25.031505668 EDT -04:00 +# t.beginning_of_year # => Tue, 01 Jan 2008 00:00:00.000000000 EST -05:00 +# t > Time.utc(1999) # => true +# t.is_a?(Time) # => true +# t.is_a?(ActiveSupport::TimeWithZone) # => true +# +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:44 +class ActiveSupport::TimeWithZone + include ::DateAndTime::Compatibility + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:51 + def initialize(utc_time, time_zone, local_time = T.unsafe(nil), period = T.unsafe(nil)); end + + # Adds an interval of time to the current object's time and returns that + # value as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 + # + # If we're adding a Duration of variable length (i.e., years, months, days), + # move forward from #time, otherwise move forward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time + 24.hours will advance exactly 24 hours, while a + # time + 1.day will advance 23-25 hours, depending on the day. + # + # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:314 + def +(other); end + + # Subtracts an interval of time and returns a new TimeWithZone object unless + # the other value +acts_like?+ time. In which case, it will subtract the + # other time and return the difference in seconds as a Float. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now - 1000 # => Mon, 03 Nov 2014 00:09:48.725182881 EST -05:00 + # + # If subtracting a Duration of variable length (i.e., years, months, days), + # move backward from #time, otherwise move backward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time - 24.hours will go subtract exactly 24 hours, while a + # time - 1.day will subtract 23-25 hours, depending on the day. + # + # now - 24.hours # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now - 1.day # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 + # + # If both the TimeWithZone object and the other value act like Time, a Float + # will be returned. + # + # Time.zone.now - 1.day.ago # => 86399.999967 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:349 + def -(other); end + + # Use the time in UTC for comparisons. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:247 + def <=>(other); end + + # So that +self+ acts_like?(:time). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:506 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days + # according to the proleptic Gregorian calendar. The result is returned as a + # new TimeWithZone object. + # + # The +options+ parameter takes a hash with any of these keys: + # :years, :months, :weeks, :days, + # :hours, :minutes, :seconds. + # + # If advancing by a value of variable length (i.e., years, weeks, months, + # days), move forward from #time, otherwise move forward from #utc, for + # accuracy when moving across DST boundaries. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.558049687 EDT -04:00 + # now.advance(seconds: 1) # => Sun, 02 Nov 2014 01:26:29.558049687 EDT -04:00 + # now.advance(minutes: 1) # => Sun, 02 Nov 2014 01:27:28.558049687 EDT -04:00 + # now.advance(hours: 1) # => Sun, 02 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(days: 1) # => Mon, 03 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(weeks: 1) # => Sun, 09 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28.558049687 EST -05:00 + # now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28.558049687 EST -05:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:438 + def advance(options); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:251 + def after?(_arg0); end + + # Subtracts an interval of time from the current object's time and returns + # the result as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now.ago(1000) # => Mon, 03 Nov 2014 00:09:48.725182881 EST -05:00 + # + # If we're subtracting a Duration of variable length (i.e., years, months, + # days), move backward from #time, otherwise move backward from #utc, for + # accuracy when moving across DST boundaries. + # + # For instance, time.ago(24.hours) will move back exactly 24 hours, + # while time.ago(1.day) will move back 23-25 hours, depending on + # the day. + # + # now.ago(24.hours) # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now.ago(1.day) # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:377 + def ago(other); end + + # Coerces time to a string for JSON encoding. The default format is ISO 8601. + # You can get %Y/%m/%d %H:%M:%S +offset style by setting + # ActiveSupport::JSON::Encoding.use_standard_json_time_format + # to +false+. + # + # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json + # # => "2005-02-01T05:15:10.000-10:00" + # + # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = false + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json + # # => "2005/02/01 05:15:10 -1000" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:182 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:250 + def before?(_arg0); end + + # Returns true if the current object's time is within the specified + # +min+ and +max+ time. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:255 + def between?(min, max); end + + # An instance of ActiveSupport::TimeWithZone is never blank + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:517 + def blank?; end + + # Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have + # been changed according to the +options+ parameter. The time options (:hour, + # :min, :sec, :usec, :nsec) reset cascadingly, + # so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the + # hour and minute is passed, then sec, usec, and nsec is set to 0. The +options+ + # parameter takes a hash with any of these keys: :year, :month, + # :day, :hour, :min, :sec, :usec, + # :nsec, :offset, :zone. Pass either :usec + # or :nsec, not both. Similarly, pass either :zone or + # :offset, not both. + # + # t = Time.zone.now # => Fri, 14 Apr 2017 11:45:15.116992711 EST -05:00 + # t.change(year: 2020) # => Tue, 14 Apr 2020 11:45:15.116992711 EST -05:00 + # t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00.000000000 EST -05:00 + # t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00.000000000 EST -05:00 + # t.change(offset: "-10:00") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 + # t.change(zone: "Hawaii") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:398 + def change(options); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:72 + def comparable_time; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def day; end + + # Returns true if the current time is within Daylight Savings \Time for the + # specified time zone. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.parse("2012-5-30").dst? # => true + # Time.zone.parse("2012-11-30").dst? # => false + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:100 + def dst?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:194 + def encode_with(coder); end + + # Returns +true+ if +other+ is equal to current object. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:290 + def eql?(other); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.formatted_offset(true) # => "-05:00" + # Time.zone.now.formatted_offset(false) # => "-0500" + # Time.zone = 'UTC' # => "UTC" + # Time.zone.now.formatted_offset(true, "0") # => "0" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:131 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:525 + def freeze; end + + # Returns true if the current object's time is in the future. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:285 + def future?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:73 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:92 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:74 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:114 + def gmt?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:120 + def gmt_offset; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:75 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:121 + def gmtoff; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:294 + def hash; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def hour; end + + # Returns a string of the object's date and time in the format used by + # HTTP requests. + # + # Time.zone.now.httpdate # => "Tue, 01 Jan 2013 04:39:43 GMT" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:202 + def httpdate; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:324 + def in(other); end + + # Returns the simultaneous time in Time.zone, or the specified zone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:83 + def in_time_zone(new_zone = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:190 + def init_with(coder); end + + # Returns a string of the object's date, time, zone, and offset from UTC. + # + # Time.zone.now.inspect # => "2024-11-13 07:00:10.528054960 UTC +00:00" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:146 + def inspect; end + + # Say we're a Time to thwart type checking. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:511 + def is_a?(klass); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:103 + def isdst; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:167 + def iso8601(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:514 + def kind_of?(klass); end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:89 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:531 + def marshal_dump; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:535 + def marshal_load(variables); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def mday; end + + # Send the missing method to +time+ instance, and wrap result in a new + # TimeWithZone with the existing +time_zone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:555 + def method_missing(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def min; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def mon; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def month; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:275 + def next_day?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def nsec; end + + # Returns true if the current object's time is in the past. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:260 + def past?; end + + # Returns the underlying +TZInfo::TimezonePeriod+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:78 + def period; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:521 + def present?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:282 + def prev_day?; end + + # respond_to_missing? is not called in some cases, such as when type conversion is + # performed with Kernel#String + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:541 + def respond_to?(sym, include_priv = T.unsafe(nil)); end + + # Returns a string of the object's date and time in the RFC 2822 standard + # format. + # + # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:210 + def rfc2822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:168 + def rfc3339(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:213 + def rfc822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:323 + def since(other); end + + # Replaces %Z directive with +zone before passing to Time#strftime, + # so that zone information is correct. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:241 + def strftime(format); end + + # Returns a Time instance that represents the time in +time_zone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:64 + def time; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:49 + def time_zone; end + + # Returns Array of parts of Time in sequence of + # [seconds, minutes, hours, day, month, year, weekday, yearday, dst?, zone]. + # + # now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27.485278555 UTC +00:00 + # now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"] + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:461 + def to_a; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def to_date; end + + # Returns an instance of DateTime with the timezone's UTC offset + # + # Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000 + # Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:494 + def to_datetime; end + + # Returns the object's date and time as a floating-point number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_f # => 1417709320.285418 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:469 + def to_f; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:237 + def to_formatted_s(format = T.unsafe(nil)); end + + # Returns a string of the object's date and time. + # + # This method is aliased to to_formatted_s. + # + # Accepts an optional format: + # * :default - default value, mimics Ruby Time#to_s format. + # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). + # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:228 + def to_fs(format = T.unsafe(nil)); end + + # Returns the object's date and time as an integer number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_i # => 1417709320 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:477 + def to_i; end + + # Returns the object's date and time as a rational number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_r # => (708854548642709/500000) + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:486 + def to_r; end + + # Returns a string of the object's date and time. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:216 + def to_s; end + + # Returns an instance of +Time+, either with the same timezone as +self+, + # with the same UTC offset as +self+ or in the local system timezone + # depending on the setting of +ActiveSupport.to_time_preserves_timezone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:501 + def to_time; end + + # Returns true if the current object's time falls within + # the current day. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:266 + def today?; end + + # Returns true if the current object's time falls within + # the next day (tomorrow). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:272 + def tomorrow?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:480 + def tv_sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:69 + def utc; end + + # Returns true if the current time zone is set to UTC. + # + # Time.zone = 'UTC' # => 'UTC' + # Time.zone.now.utc? # => true + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.now.utc? # => false + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:111 + def utc?; end + + # Returns the offset from current time to UTC time in seconds. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:117 + def utc_offset; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def wday; end + + # Returns a string of the object's date and time in the ISO 8601 standard + # format. + # + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:154 + def xmlschema(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def yday; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:449 + def year; end + + # Returns true if the current object's time falls within + # the previous day (yesterday). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:279 + def yesterday?; end + + # Returns the time zone abbreviation. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.zone # => "EST" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:139 + def zone; end + + private + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:593 + def duration_of_variable_length?(obj); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:574 + def get_period_and_ensure_valid_local_time(period); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:564 + def incorporate_utc_offset(time, offset); end + + # Ensure proxy class responds to all methods that underlying time instance + # responds to. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:549 + def respond_to_missing?(sym, include_priv); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:587 + def transfer_time_values_to_utc_constructor(time); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:597 + def wrap_with_time_zone(time); end +end + +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:45 +ActiveSupport::TimeWithZone::PRECISIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:562 +ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# = Active Support \Time Zone +# +# The TimeZone class serves as a wrapper around +TZInfo::Timezone+ instances. +# It allows us to do the following: +# +# * Limit the set of zones provided by TZInfo to a meaningful subset of 134 +# zones. +# * Retrieve and display zones with a friendlier name +# (e.g., "Eastern \Time (US & Canada)" instead of "America/New_York"). +# * Lazily load +TZInfo::Timezone+ instances only when they're needed. +# * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +# +parse+, +at+, and +now+ methods. +# +# If you set config.time_zone in the \Rails Application, you can +# access this TimeZone object via Time.zone: +# +# # application.rb: +# class Application < Rails::Application +# config.time_zone = 'Eastern Time (US & Canada)' +# end +# +# Time.zone # => # +# Time.zone.name # => "Eastern Time (US & Canada)" +# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00 +# +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:31 +class ActiveSupport::TimeZone + include ::Comparable + + # :stopdoc: + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:310 + def initialize(name, utc_offset = T.unsafe(nil), tzinfo = T.unsafe(nil)); end + + # Compare this time zone to the parameter. The two are compared first on + # their offsets, and then by name. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:340 + def <=>(zone); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:349 + def =~(re); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:574 + def abbr(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from number of seconds since the Unix epoch. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.utc(2000).to_f # => 946684800.0 + # Time.zone.at(946684800.0) # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # A second argument can be supplied to specify sub-second precision. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.at(946684800, 123456.789).nsec # => 123456789 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:386 + def at(*args); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:578 + def dst?(time); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:586 + def encode_with(coder); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # zone = ActiveSupport::TimeZone['Central Time (US & Canada)'] + # zone.formatted_offset # => "-06:00" + # zone.formatted_offset(false) # => "-0600" + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:334 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:582 + def init_with(coder); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from an ISO 8601 string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.iso8601('1999-12-31T14:00:00') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If the time components are missing then they will be set to zero. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.iso8601('1999-12-31') # => Fri, 31 Dec 1999 00:00:00 HST -10:00 + # + # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+ + # which usually returns +nil+ when given an invalid date string. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:403 + def iso8601(str); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from given values. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.local(2007, 2, 1, 15, 30, 45) # => Thu, 01 Feb 2007 15:30:45 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:370 + def local(*args); end + + # Adjust the given time to the simultaneous time in UTC. Returns a + # Time.utc() instance. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:558 + def local_to_utc(time, dst = T.unsafe(nil)); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:355 + def match?(re); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:297 + def name; end + + # Returns an ActiveSupport::TimeWithZone instance representing the current + # time in the time zone represented by +self+. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:523 + def now; end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from parsed string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.parse('1999-12-31 14:00:00') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If upper components are missing from the string, they are supplied from + # TimeZone#now: + # + # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 + # + # However, if the date component is not provided, but any other upper + # components are supplied, then the day of the month defaults to 1: + # + # Time.zone.parse('Mar 2000') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 + # + # If the string is invalid then an +ArgumentError+ could be raised. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:460 + def parse(str, now = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:566 + def period_for_local(time, dst = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:562 + def period_for_utc(time); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:570 + def periods_for_local(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from an RFC 3339 string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.rfc3339('2000-01-01T00:00:00Z') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If the time or zone components are missing then an +ArgumentError+ will + # be raised. This is much stricter than either +parse+ or +iso8601+ which + # allow for missing components. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.rfc3339('1999-12-31') # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:476 + def rfc3339(str); end + + # Returns a standard time zone name defined by IANA + # https://www.iana.org/time-zones + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:319 + def standard_name; end + + # Parses +str+ according to +format+ and returns an ActiveSupport::TimeWithZone. + # + # Assumes that +str+ is a time in the time zone +self+, + # unless +format+ includes an explicit time zone. + # (This is the same behavior as +parse+.) + # In either case, the returned TimeWithZone has the timezone of +self+. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.strptime('1999-12-31 14:00:00', '%Y-%m-%d %H:%M:%S') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If upper components are missing from the string, they are supplied from + # TimeZone#now: + # + # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Time.zone.strptime('22:30:00', '%H:%M:%S') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 + # + # However, if the date component is not provided, but any other upper + # components are supplied, then the day of the month defaults to 1: + # + # Time.zone.strptime('Mar 2000', '%b %Y') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:514 + def strptime(str, format, now = T.unsafe(nil)); end + + # Returns a textual representation of this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:361 + def to_s; end + + # Returns the current date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:528 + def today; end + + # Returns the next date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:533 + def tomorrow; end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:298 + def tzinfo; end + + # Returns the offset of this time zone from UTC in seconds. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:324 + def utc_offset; end + + # Adjust the given time to the simultaneous time in the time zone + # represented by +self+. Returns a local time with the appropriate offset + # -- if you want an ActiveSupport::TimeWithZone instance, use + # Time#in_time_zone() instead. + # + # As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset. + # See the +utc_to_local_returns_utc_offset_times+ config for more info. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:549 + def utc_to_local(time); end + + # Returns the previous date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:538 + def yesterday; end + + private + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:592 + def parts_to_time(parts, now); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:617 + def time_now; end + + class << self + # Locate a specific time zone object. If the argument is a string, it + # is interpreted to mean the name of the timezone to locate. If it is a + # numeric value it is either the hour offset, or the second offset, of the + # timezone to find. (The first one with that offset will be returned.) + # Returns +nil+ if no such time zone is known to the system. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:233 + def [](arg); end + + # Returns an array of all TimeZone objects. There are multiple + # TimeZone objects per time zone, in many cases, to make it easier + # for users to find their own time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:224 + def all; end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:266 + def clear; end + + # A convenience method for returning a collection of TimeZone objects + # for time zones in the country specified by its ISO 3166-1 Alpha2 code. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:261 + def country_zones(country_code); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:212 + def create(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:208 + def find_tzinfo(name); end + + # Returns a TimeZone instance with the given name, or +nil+ if no + # such TimeZone instance exists. (This exists to support the use of + # this class with the +composed_of+ macro.) + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:217 + def new(name); end + + # Assumes self represents an offset from UTC in seconds (as returned from + # Time#utc_offset) and turns this into an +HH:MM formatted string. + # + # ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00" + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:200 + def seconds_to_utc_offset(seconds, colon = T.unsafe(nil)); end + + # A convenience method for returning a collection of TimeZone objects + # for time zones in the USA. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:255 + def us_zones; end + + private + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:274 + def load_country_zones(code); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:288 + def zones_map; end + end +end + +# Keys are \Rails TimeZone names, values are TZInfo identifiers. +# +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:33 +ActiveSupport::TimeZone::MAPPING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:189 +ActiveSupport::TimeZone::UTC_OFFSET_WITHOUT_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:188 +ActiveSupport::TimeZone::UTC_OFFSET_WITH_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:35 +module ActiveSupport::ToJsonWithActiveSupportEncoder + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:36 + def to_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:6 +module ActiveSupport::Tryable + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:7 + def try(*args, **, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:20 + def try!(*args, **, &block); end +end + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:9 +module ActiveSupport::VERSION; end + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:10 +ActiveSupport::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:11 +ActiveSupport::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:13 +ActiveSupport::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:15 +ActiveSupport::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:12 +ActiveSupport::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:140 +class ActiveSupport::XMLConverter + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:151 + def initialize(xml, disallowed_types = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:156 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:222 + def become_array?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:218 + def become_content?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:226 + def become_empty_string?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:232 + def become_hash?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:172 + def deep_to_h(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:241 + def garbage?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:161 + def normalize_keys(params); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:236 + def nothing?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:257 + def process_array(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:248 + def process_content(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:185 + def process_hash(value); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:149 +ActiveSupport::XMLConverter::DISALLOWED_TYPES = T.let(T.unsafe(nil), Array) + +# Raised if the XML contains attributes with type="yaml" or +# type="symbol". Read Hash#from_xml for more details. +# +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:143 +class ActiveSupport::XMLConverter::DisallowedType < ::StandardError + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:144 + def initialize(type); end +end + +# = \XmlMini +# +# To use the much faster libxml parser: +# gem "libxml-ruby" +# XmlMini.backend = 'LibXML' +# +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:17 +module ActiveSupport::XmlMini + extend ::ActiveSupport::XmlMini + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:102 + def backend; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:106 + def backend=(name); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 + def depth; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 + def depth=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:100 + def parse(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:153 + def rename_key(key, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:120 + def to_tag(key, value, options); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:112 + def with_backend(name); end + + private + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:164 + def _dasherize(key); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:170 + def _parse_binary(bin, entity); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:181 + def _parse_file(file, entity); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:189 + def _parse_hex_binary(bin); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:201 + def cast_backend_name_to_module(name); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:193 + def current_thread_backend; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:197 + def current_thread_backend=(name); end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:34 +ActiveSupport::XmlMini::DEFAULT_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:56 +ActiveSupport::XmlMini::FORMATTING = T.let(T.unsafe(nil), Hash) + +# This module decorates files deserialized using Hash.from_xml with +# the original_filename and content_type methods. +# +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:22 +module ActiveSupport::XmlMini::FileLike + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:29 + def content_type; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 + def content_type=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:25 + def original_filename; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 + def original_filename=(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:66 +ActiveSupport::XmlMini::PARSING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:39 +ActiveSupport::XmlMini::TYPE_NAMES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:8 +module ActiveSupport::XmlMini_REXML + extend ::ActiveSupport::XmlMini_REXML + + # Parse an XML Document string or IO into a simple hash. + # + # Same as XmlSimple::xml_in but doesn't shoot itself in the foot, + # and uses the defaults from Active Support. + # + # data:: + # XML Document string or IO to parse + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:20 + def parse(data); end + + private + + # Actually converts an XML document element into a data structure. + # + # element:: + # The document element to be collapsed. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:63 + def collapse(element, depth); end + + # Determines if a document element has text content + # + # element:: + # XML element to be checked. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:133 + def empty_content?(element); end + + # Converts the attributes array of an XML element into a hash. + # Returns an empty Hash if node has no attributes. + # + # element:: + # XML element to extract attributes from. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:123 + def get_attributes(element); end + + # Adds a new key/value pair to an existing Hash. If the key to be added + # already exists and the existing value associated with key is not + # an Array, it will be wrapped in an Array. Then the new value is + # appended to that Array. + # + # hash:: + # Hash to add key/value pair to. + # key:: + # Key to be added. + # value:: + # Value to be associated with key. + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:103 + def merge!(hash, key, value); end + + # Convert an XML element and merge into the hash + # + # hash:: + # Hash to merge the converted element into. + # element:: + # XML element to merge into hash + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:54 + def merge_element!(hash, element, depth); end + + # Merge all the texts of an element into the hash + # + # hash:: + # Hash to add the converted element to. + # element:: + # XML element whose texts are to me merged into the hash + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:81 + def merge_texts!(hash, element); end + + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:41 + def require_rexml; end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:11 +ActiveSupport::XmlMini_REXML::CONTENT_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/array/extract.rb:3 +class Array + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:164 + def as_json(options = T.unsafe(nil)); end + + # An array is blank if it's empty: + # + # [].blank? # => true + # [1,2,3].blank? # => false + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:102 + def blank?; end + + # Removes all blank elements from the +Array+ in place and returns self. + # Uses Object#blank? for determining if an item is blank. + # + # a = [1, "", nil, 2, " ", [], {}, false, true] + # a.compact_blank! + # # => [1, 2, true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:275 + def compact_blank!; end + + # Returns a deep copy of array. + # + # array = [1, [2, 3]] + # dup = array.deep_dup + # dup[1][2] = 4 + # + # array[1][2] # => nil + # dup[1][2] # => 4 + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:29 + def deep_dup; end + + # Returns a copy of the Array excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding("Aaron", "Todd") # => ["David", "Rafael"] + # [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ] + # + # Note: This is an optimization of Enumerable#excluding that uses Array#- + # instead of Array#reject for performance reasons. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:47 + def excluding(*elements); end + + # Removes and returns the elements for which the block returns a true value. + # If no block is given, an Enumerator is returned instead. + # + # numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + # odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] + # numbers # => [0, 2, 4, 6, 8] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract.rb:10 + def extract!; end + + # Extracts options from a set of arguments. Removes and returns the last + # element in the array if it's a hash, otherwise returns a blank hash. + # + # def options(*args) + # args.extract_options! + # end + # + # options(1, 2) # => {} + # options(1, 2, a: :b) # => {:a=>:b} + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:24 + def extract_options!; end + + # Equal to self[4]. + # + # %w( a b c d e ).fifth # => "e" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:76 + def fifth; end + + # Equal to self[41]. Also known as accessing "the reddit". + # + # (1..42).to_a.forty_two # => 42 + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:83 + def forty_two; end + + # Equal to self[3]. + # + # %w( a b c d e ).fourth # => "d" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:69 + def fourth; end + + # Returns the tail of the array from +position+. + # + # %w( a b c d ).from(0) # => ["a", "b", "c", "d"] + # %w( a b c d ).from(2) # => ["c", "d"] + # %w( a b c d ).from(10) # => [] + # %w().from(0) # => [] + # %w( a b c d ).from(-2) # => ["c", "d"] + # %w( a b c ).from(-10) # => [] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:12 + def from(position); end + + # Returns a new array that includes the passed elements. + # + # [ 1, 2, 3 ].including(4, 5) # => [ 1, 2, 3, 4, 5 ] + # [ [ 0, 1 ] ].including([ [ 1, 0 ] ]) # => [ [ 0, 1 ], [ 1, 0 ] ] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:36 + def including(*elements); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:104 + def present?; end + + # Equal to self[1]. + # + # %w( a b c d e ).second # => "b" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:55 + def second; end + + # Equal to self[-2]. + # + # %w( a b c d e ).second_to_last # => "d" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:97 + def second_to_last; end + + # Equal to self[2]. + # + # %w( a b c d e ).third # => "c" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:62 + def third; end + + # Equal to self[-3]. + # + # %w( a b c d e ).third_to_last # => "c" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:90 + def third_to_last; end + + # Returns the beginning of the array up to +position+. + # + # %w( a b c d ).to(0) # => ["a"] + # %w( a b c d ).to(2) # => ["a", "b", "c"] + # %w( a b c d ).to(10) # => ["a", "b", "c", "d"] + # %w().to(0) # => [] + # %w( a b c d ).to(-2) # => ["a", "b", "c"] + # %w( a b c ).to(-10) # => [] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:24 + def to(position); end + + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:106 + def to_formatted_s(format = T.unsafe(nil)); end + + # Extends Array#to_s to convert a collection of elements into a + # comma separated id list if :db argument is given as the format. + # + # This method is aliased to to_formatted_s. + # + # Blog.all.to_fs(:db) # => "1,2,3" + # Blog.none.to_fs(:db) # => "null" + # [1,2].to_fs # => "[1, 2]" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:94 + def to_fs(format = T.unsafe(nil)); end + + # Calls to_param on all its elements and joins the result with + # slashes. This is used by url_for in Action Pack. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:48 + def to_param; end + + # Converts an array into a string suitable for use as a URL query string, + # using the given +key+ as the param name. + # + # ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding" + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:56 + def to_query(key); end + + # Converts the array to a comma-separated sentence where the last element is + # joined by the connector word. + # + # You can pass the following options to change the default behavior. If you + # pass an option key that doesn't exist in the list below, it will raise an + # ArgumentError. + # + # ==== Options + # + # * :words_connector - The sign or word used to join all but the last + # element in arrays with three or more elements (default: ", "). + # * :last_word_connector - The sign or word used to join the last element + # in arrays with three or more elements (default: ", and "). + # * :two_words_connector - The sign or word used to join the elements + # in arrays with two elements (default: " and "). + # * :locale - If +i18n+ is available, you can set a locale and use + # the connector options defined on the 'support.array' namespace in the + # corresponding dictionary file. + # + # ==== Examples + # + # [].to_sentence # => "" + # ['one'].to_sentence # => "one" + # ['one', 'two'].to_sentence # => "one and two" + # ['one', 'two', 'three'].to_sentence # => "one, two, and three" + # + # ['one', 'two'].to_sentence(passing: 'invalid option') + # # => ArgumentError: Unknown key: :passing. Valid keys are: :words_connector, :two_words_connector, :last_word_connector, :locale + # + # ['one', 'two'].to_sentence(two_words_connector: '-') + # # => "one-two" + # + # ['one', 'two', 'three'].to_sentence(words_connector: ' or ', last_word_connector: ' or at least ') + # # => "one or two or at least three" + # + # Using :locale option: + # + # # Given this locale dictionary: + # # + # # es: + # # support: + # # array: + # # words_connector: " o " + # # two_words_connector: " y " + # # last_word_connector: " o al menos " + # + # ['uno', 'dos'].to_sentence(locale: :es) + # # => "uno y dos" + # + # ['uno', 'dos', 'tres'].to_sentence(locale: :es) + # # => "uno o dos o al menos tres" + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:60 + def to_sentence(options = T.unsafe(nil)); end + + # Returns a string that represents the array in XML by invoking +to_xml+ + # on each element. Active Record collections delegate their representation + # in XML to this method. + # + # All elements are expected to respond to +to_xml+, if any of them does + # not then an exception is raised. + # + # The root node reflects the class name of the first element in plural + # if all elements belong to the same type and that's not Hash: + # + # customer.projects.to_xml + # + # + # + # + # 20000.0 + # 1567 + # 2008-04-09 + # ... + # + # + # 57230.0 + # 1567 + # 2008-04-15 + # ... + # + # + # + # Otherwise the root element is "objects": + # + # [{ foo: 1, bar: 2}, { baz: 3}].to_xml + # + # + # + # + # 2 + # 1 + # + # + # 3 + # + # + # + # If the collection is empty the root element is "nil-classes" by default: + # + # [].to_xml + # + # + # + # + # To ensure a meaningful root element use the :root option: + # + # customer_with_no_projects.projects.to_xml(root: 'projects') + # + # + # + # + # By default name of the node for the children of root is root.singularize. + # You can change it with the :children option. + # + # The +options+ hash is passed downwards: + # + # Message.all.to_xml(skip_types: true) + # + # + # + # + # 2008-03-07T09:58:18+01:00 + # 1 + # 1 + # 2008-03-07T09:58:18+01:00 + # 1 + # + # + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:183 + def to_xml(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:50 + def without(*elements); end + + class << self + # Wraps its argument in an array unless it is already an array (or array-like). + # + # Specifically: + # + # * If the argument is +nil+ an empty array is returned. + # * Otherwise, if the argument responds to +to_ary+ it is invoked, and its result returned. + # * Otherwise, returns an array with the argument as its single element. + # + # Array.wrap(nil) # => [] + # Array.wrap([1, 2, 3]) # => [1, 2, 3] + # Array.wrap(0) # => [0] + # + # This method is similar in purpose to Kernel#Array, but there are some differences: + # + # * If the argument responds to +to_ary+ the method is invoked. Kernel#Array + # moves on to try +to_a+ if the returned value is +nil+, but Array.wrap returns + # an array with the argument as its single element right away. + # * If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, Kernel#Array + # raises an exception, while Array.wrap does not, it just returns the value. + # * It does not call +to_a+ on the argument, if the argument does not respond to +to_ary+ + # it returns an array with the argument as its single element. + # + # The last point is easily explained with some enumerables: + # + # Array(foo: :bar) # => [[:foo, :bar]] + # Array.wrap(foo: :bar) # => [{:foo=>:bar}] + # + # There's also a related idiom that uses the splat operator: + # + # [*object] + # + # which returns [] for +nil+, but calls to Array(object) otherwise. + # + # The differences with Kernel#Array explained above + # apply to the rest of objects. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/wrap.rb:39 + def wrap(object); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:124 +class BigDecimal < ::Numeric + include ::ActiveSupport::BigDecimalWithDefaultFormat + + # A BigDecimal would be naturally represented as a JSON number. Most libraries, + # however, parse non-integer JSON numbers directly as floats. Clients using + # those libraries would get in general a wrong number and no way to recover + # other than manually inspecting the string with the JSON code itself. + # + # That's why a JSON string is returned. The JSON literal is not numeric, but + # if the other end knows by contract that the data is supposed to be a + # BigDecimal, it still has the chance to post-process the string and get the + # real value. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:134 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:6 +class Class < ::Module + include ::ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + + # Declare a class-level attribute whose value is inheritable by subclasses. + # Subclasses can change their own value and it will not impact parent class. + # + # ==== Options + # + # * :instance_reader - Sets the instance reader method (defaults to true). + # * :instance_writer - Sets the instance writer method (defaults to true). + # * :instance_accessor - Sets both instance methods (defaults to true). + # * :instance_predicate - Sets a predicate method (defaults to true). + # * :default - Sets a default value for the attribute (defaults to nil). + # + # ==== Examples + # + # class Base + # class_attribute :setting + # end + # + # class Subclass < Base + # end + # + # Base.setting = true + # Subclass.setting # => true + # Subclass.setting = false + # Subclass.setting # => false + # Base.setting # => true + # + # In the above case as long as Subclass does not assign a value to setting + # by performing Subclass.setting = _something_, Subclass.setting + # would read value assigned to parent class. Once Subclass assigns a value then + # the value assigned by Subclass would be returned. + # + # This matches normal Ruby method inheritance: think of writing an attribute + # on a subclass as overriding the reader method. However, you need to be aware + # when using +class_attribute+ with mutable structures as +Array+ or +Hash+. + # In such cases, you don't want to do changes in place. Instead use setters: + # + # Base.setting = [] + # Base.setting # => [] + # Subclass.setting # => [] + # + # # Appending in child changes both parent and child because it is the same object: + # Subclass.setting << :foo + # Base.setting # => [:foo] + # Subclass.setting # => [:foo] + # + # # Use setters to not propagate changes: + # Base.setting = [] + # Subclass.setting += [:foo] + # Base.setting # => [] + # Subclass.setting # => [:foo] + # + # For convenience, an instance predicate method is defined as well. + # To skip it, pass instance_predicate: false. + # + # Subclass.setting? # => false + # + # Instances may overwrite the class value in the same way: + # + # Base.setting = true + # object = Base.new + # object.setting # => true + # object.setting = false + # object.setting # => false + # Base.setting # => true + # + # To opt out of the instance reader method, pass instance_reader: false. + # + # object.setting # => NoMethodError + # object.setting? # => NoMethodError + # + # To opt out of the instance writer method, pass instance_writer: false. + # + # object.setting = false # => NoMethodError + # + # To opt out of both instance methods, pass instance_accessor: false. + # + # To set a default value for the attribute, pass default:, like so: + # + # class_attribute :settings, default: {} + # + # pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:86 + def class_attribute(*attrs, instance_accessor: T.unsafe(nil), instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_predicate: T.unsafe(nil), default: T.unsafe(nil)); end + + # Returns an array with all classes that are < than its receiver. + # + # class C; end + # C.descendants # => [] + # + # class B < C; end + # C.descendants # => [B] + # + # class A < B; end + # C.descendants # => [B, A] + # + # class D < C; end + # C.descendants # => [B, A, D] + # + # pkg:gem/activesupport#lib/active_support/core_ext/class/subclasses.rb:19 + def descendants; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 + def subclasses; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:68 +class Data + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:69 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date/zones.rb:6 +class Date + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:98 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:108 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:160 + def <=>(other); end + + # Duck-types as a Date-like class. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/acts_like.rb:7 + def acts_like_date?; end + + # Provides precise Date calculations for years, months, and days. The +options+ parameter takes a hash with + # any of these keys: :years, :months, :weeks, :days. + # + # The increments are applied in order of time units from largest to smallest. + # In other words, the date is incremented first by +:years+, then by + # +:months+, then by +:weeks+, then by +:days+. This order can affect the + # result around the end of a month. For example, incrementing first by months + # then by days: + # + # Date.new(2004, 9, 30).advance(months: 1, days: 1) + # # => Sun, 31 Oct 2004 + # + # Whereas incrementing first by days then by months yields a different result: + # + # Date.new(2004, 9, 30).advance(days: 1).advance(months: 1) + # # => Mon, 01 Nov 2004 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:127 + def advance(options); end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then subtracts the specified number of seconds. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:55 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:211 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:72 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:88 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:80 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:82 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:71 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:81 + def at_noon; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:67 + def beginning_of_day; end + + # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter. + # The +options+ parameter is a hash with a combination of these keys: :year, :month, :day. + # + # Date.new(2007, 5, 12).change(day: 1) # => Date.new(2007, 5, 1) + # Date.new(2007, 5, 12).change(year: 2005, month: 1) # => Date.new(2005, 1, 12) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:143 + def change(options); end + + # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:152 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:159 + def compare_without_coercion(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:66 + def default_inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:85 + def end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:64 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:67 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:78 + def midday; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:75 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:70 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:100 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:107 + def minus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:79 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:90 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:97 + def plus_without_duration(_arg0); end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:63 + def readable_inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then adds the specified number of seconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:61 + def since(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:60 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert to a formatted string. See DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_fs(:db) # => "2007-11-10" + # date.to_formatted_s(:db) # => "2007-11-10" + # + # date.to_fs(:short) # => "10 Nov" + # date.to_fs(:number) # => "20071110" + # date.to_fs(:long) # => "November 10, 2007" + # date.to_fs(:long_ordinal) # => "November 10th, 2007" + # date.to_fs(:rfc822) # => "10 Nov 2007" + # date.to_fs(:rfc2822) # => "10 Nov 2007" + # date.to_fs(:iso8601) # => "2007-11-10" + # + # == Adding your own date formats to to_fs + # You can add your own formats to the Date::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a date argument as the value. + # + # # config/initializers/date_formats.rb + # Date::DATE_FORMATS[:month_and_year] = '%B %Y' + # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:49 + def to_fs(format = T.unsafe(nil)); end + + # Converts a Date instance to a Time, where the time is set to the beginning of the day. + # The timezone can be either +:local+ or +:utc+ (default +:local+). + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_time # => 2007-11-10 00:00:00 0800 + # date.to_time(:local) # => 2007-11-10 00:00:00 0800 + # + # date.to_time(:utc) # => 2007-11-10 00:00:00 UTC + # + # NOTE: The +:local+ timezone is Ruby's *process* timezone, i.e. ENV['TZ']. + # If the application's timezone is needed, then use +in_time_zone+ instead. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:69 + def to_time(form = T.unsafe(nil)); end + + # Returns a string which represents the time in used time zone as DateTime + # defined by XML Schema: + # + # date = Date.new(2015, 05, 23) # => Sat, 23 May 2015 + # date.xmlschema # => "2015-05-23T00:00:00+04:00" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:88 + def xmlschema; end + + class << self + # Returns the week start (e.g. +:monday+) for the current request, if this has been set (via Date.beginning_of_week=). + # If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. + # If no +config.beginning_of_week+ was specified, returns +:monday+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:19 + def beginning_of_week; end + + # Sets Date.beginning_of_week to a week start (e.g. +:monday+) for current request/thread. + # + # This method accepts any of the following day symbols: + # +:monday+, +:tuesday+, +:wednesday+, +:thursday+, +:friday+, +:saturday+, +:sunday+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:27 + def beginning_of_week=(week_start); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 + def beginning_of_week_default; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 + def beginning_of_week_default=(_arg0); end + + # Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:48 + def current; end + + # Returns week start day symbol (e.g. +:monday+), or raises an +ArgumentError+ for invalid day symbol. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:32 + def find_beginning_of_week!(week_start); end + + # Returns a new Date representing the date 1 day after today (i.e. tomorrow's date). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:43 + def tomorrow; end + + # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:38 + def yesterday; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:9 +Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:6 +module DateAndTime; end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:7 +module DateAndTime::Calculations + # Returns true if the date/time falls after date_or_time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:72 + def after?(date_or_time); end + + # Returns a Range representing the whole day of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:310 + def all_day; end + + # Returns a Range representing the whole month of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:321 + def all_month; end + + # Returns a Range representing the whole quarter of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:326 + def all_quarter; end + + # Returns a Range representing the whole week of the current date/time. + # Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:316 + def all_week(start_day = T.unsafe(nil)); end + + # Returns a Range representing the whole year of the current date/time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:331 + def all_year; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:128 + def at_beginning_of_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:143 + def at_beginning_of_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:271 + def at_beginning_of_week(start_day = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:182 + def at_beginning_of_year; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:300 + def at_end_of_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:158 + def at_end_of_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:286 + def at_end_of_week(start_day = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:307 + def at_end_of_year; end + + # Returns true if the date/time falls before date_or_time. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:67 + def before?(date_or_time); end + + # Returns a new date/time at the start of the month. + # + # today = Date.today # => Thu, 18 Jun 2015 + # today.beginning_of_month # => Mon, 01 Jun 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 + # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:125 + def beginning_of_month; end + + # Returns a new date/time at the start of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_quarter # => Wed, 01 Jul 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:139 + def beginning_of_quarter; end + + # Returns a new date/time representing the start of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # +DateTime+ objects have their time set to 0:00. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:267 + def beginning_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time at the beginning of the year. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_year # => Thu, 01 Jan 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:179 + def beginning_of_year; end + + # Returns a new date/time the specified number of days ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:77 + def days_ago(days); end + + # Returns a new date/time the specified number of days in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:82 + def days_since(days); end + + # Returns the number of days to the start of the week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:258 + def days_to_week_start(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the month. + # DateTime objects will have a time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:296 + def end_of_month; end + + # Returns a new date/time at the end of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.end_of_quarter # => Wed, 30 Sep 2015 + # + # +DateTime+ objects will have a time set to 23:59:59. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:154 + def end_of_quarter; end + + # Returns a new date/time representing the end of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:283 + def end_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the year. + # DateTime objects will have a time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:304 + def end_of_year; end + + # Returns true if the date/time is in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:52 + def future?; end + + # Short-hand for months_ago(1). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:240 + def last_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:248 + def last_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:227 + def last_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:237 + def last_weekday; end + + # Short-hand for years_ago(1). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:251 + def last_year; end + + # Returns Monday of this week assuming that week starts on Monday. + # +DateTime+ objects have their time set to 0:00. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:275 + def monday; end + + # Returns a new date/time the specified number of months ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:97 + def months_ago(months); end + + # Returns a new date/time the specified number of months in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:102 + def months_since(months); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:38 + def next_day?; end + + # Returns a new date/time representing the next occurrence of the specified day of week. + # + # today = Date.today # => Thu, 14 Dec 2017 + # today.next_occurring(:monday) # => Mon, 18 Dec 2017 + # today.next_occurring(:thursday) # => Thu, 21 Dec 2017 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:340 + def next_occurring(day_of_week); end + + # Short-hand for months_since(3). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:215 + def next_quarter; end + + # Returns a new date/time representing the given day in the next week. + # + # today = Date.today # => Thu, 07 May 2015 + # today.next_week # => Mon, 11 May 2015 + # + # The +given_day_in_next_week+ defaults to the beginning of the week + # which is determined by +Date.beginning_of_week+ or +config.beginning_of_week+ + # when set. + # + # today = Date.today # => Thu, 07 May 2015 + # today.next_week(:friday) # => Fri, 15 May 2015 + # + # +DateTime+ objects have their time set to 0:00 unless +same_time+ is true. + # + # now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000 + # now.next_week # => Mon, 11 May 2015 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:200 + def next_week(given_day_in_next_week = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the next weekday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:206 + def next_weekday; end + + # Returns true if the date/time does not fall on a Saturday or Sunday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:62 + def on_weekday?; end + + # Returns true if the date/time falls on a Saturday or Sunday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:57 + def on_weekend?; end + + # Returns true if the date/time is in the past. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:47 + def past?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:44 + def prev_day?; end + + # Returns a new date/time representing the previous occurrence of the specified day of week. + # + # today = Date.today # => Thu, 14 Dec 2017 + # today.prev_occurring(:monday) # => Mon, 11 Dec 2017 + # today.prev_occurring(:thursday) # => Thu, 07 Dec 2017 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:351 + def prev_occurring(day_of_week); end + + # Short-hand for months_ago(3). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:245 + def prev_quarter; end + + # Returns a new date/time representing the given day in the previous week. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 0:00 unless +same_time+ is true. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:223 + def prev_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the previous weekday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:230 + def prev_weekday; end + + # Returns the quarter for a date/time. + # + # Date.new(2010, 1, 31).quarter # => 1 + # Date.new(2010, 4, 12).quarter # => 2 + # Date.new(2010, 9, 15).quarter # => 3 + # Date.new(2010, 12, 25).quarter # => 4 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:166 + def quarter; end + + # Returns Sunday of this week assuming that week starts on Monday. + # +DateTime+ objects have their time set to 23:59:59. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:290 + def sunday; end + + # Returns true if the date/time is today. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:30 + def today?; end + + # Returns a new date/time representing tomorrow. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:25 + def tomorrow; end + + # Returns true if the date/time is tomorrow. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:35 + def tomorrow?; end + + # Returns a new date/time the specified number of weeks ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:87 + def weeks_ago(weeks); end + + # Returns a new date/time the specified number of weeks in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:92 + def weeks_since(weeks); end + + # Returns a new date/time the specified number of years ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:107 + def years_ago(years); end + + # Returns a new date/time the specified number of years in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:112 + def years_since(years); end + + # Returns a new date/time representing yesterday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:20 + def yesterday; end + + # Returns true if the date/time is yesterday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:41 + def yesterday?; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:370 + def copy_time_to(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:366 + def days_span(day); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:358 + def first_hour(date_or_time); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:362 + def last_hour(date_or_time); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:8 +DateAndTime::Calculations::DAYS_INTO_WEEK = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:17 +DateAndTime::Calculations::WEEKEND_DAYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:7 +module DateAndTime::Compatibility + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 + def utc_to_local_returns_utc_offset_times; end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 + def utc_to_local_returns_utc_offset_times; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:21 + def utc_to_local_returns_utc_offset_times=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:4 +module DateAndTime::Zones + # Returns the simultaneous time in Time.zone if a zone is given or + # if Time.zone_default is set. Otherwise, it returns the current time. + # + # Time.zone = 'Hawaii' # => 'Hawaii' + # Time.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00 + # + # This method is similar to Time#localtime, except that it uses Time.zone as the local zone + # instead of the operating system's time zone. + # + # You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, + # and the conversion will be based on that zone instead of Time.zone. + # + # Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 + # Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:20 + def in_time_zone(zone = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:32 + def time_with_zone(time, zone); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:5 +class DateTime < ::Date + # Layers additional behavior on DateTime#<=> so that Time and + # ActiveSupport::TimeWithZone instances can be compared with a DateTime. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:209 + def <=>(other); end + + # Uses Date to provide precise Time calculations for years, months, and days. + # The +options+ parameter takes a hash with any of these keys: :years, + # :months, :weeks, :days, :hours, + # :minutes, :seconds. + # + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:82 + def advance(options); end + + # Returns a new DateTime representing the time a number of seconds ago. + # Do not use this method in combination with x.months, use months_ago instead! + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:110 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:221 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:128 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:150 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:162 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:144 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:156 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:168 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:136 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:138 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:127 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:137 + def at_noon; end + + # Returns a new DateTime representing the start of the day (0:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:123 + def beginning_of_day; end + + # Returns a new DateTime representing the start of the hour (hh:00:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:147 + def beginning_of_hour; end + + # Returns a new DateTime representing the start of the minute (hh:mm:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:159 + def beginning_of_minute; end + + # Returns a new DateTime where one or more of the elements have been changed + # according to the +options+ parameter. The time options (:hour, + # :min, :sec) reset cascadingly, so if only the hour is + # passed, then minute and sec is set to 0. If the hour and minute is passed, + # then sec is set to 0. The +options+ parameter takes a hash with any of these + # keys: :year, :month, :day, :hour, + # :min, :sec, :offset, :start. + # + # DateTime.new(2012, 8, 29, 22, 35, 0).change(day: 1) # => DateTime.new(2012, 8, 1, 22, 35, 0) + # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => DateTime.new(1981, 8, 1, 22, 35, 0) + # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => DateTime.new(1981, 8, 29, 0, 0, 0) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:51 + def change(options); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:61 + def default_inspect; end + + # Returns a new DateTime representing the end of the day (23:59:59). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:141 + def end_of_day; end + + # Returns a new DateTime representing the end of the hour (hh:59:59). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:153 + def end_of_hour; end + + # Returns a new DateTime representing the end of the minute (hh:mm:59). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:165 + def end_of_minute; end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24)) + # datetime.formatted_offset # => "-06:00" + # datetime.formatted_offset(false) # => "-0600" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:53 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:193 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:179 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:194 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:195 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:120 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:62 + def inspect; end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:171 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:134 + def midday; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:131 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:126 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:135 + def noon; end + + # Returns the fraction of a second as nanoseconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:96 + def nsec; end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:58 + def readable_inspect; end + + # Returns the number of seconds since 00:00:00. + # + # DateTime.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0 + # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296 + # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:20 + def seconds_since_midnight; end + + # Returns the number of seconds until 23:59:59. + # + # DateTime.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 + # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 + # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:29 + def seconds_until_end_of_day; end + + # Returns a new DateTime representing the time a number of seconds since the + # instance time. Do not use this method in combination with x.months, use + # months_since instead! + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:117 + def since(seconds); end + + # Returns the fraction of a second as a +Rational+ + # + # DateTime.new(2012, 8, 29, 0, 0, 0.5).subsec # => (1/2) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:36 + def subsec; end + + # Converts +self+ to a floating-point number of seconds, including fractional microseconds, since the Unix epoch. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:81 + def to_f; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:44 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # ==== Examples + # + # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 + # + # datetime.to_fs(:db) # => "2007-12-04 00:00:00" + # datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00" + # datetime.to_fs(:number) # => "20071204000000" + # datetime.to_fs(:short) # => "04 Dec 00:00" + # datetime.to_fs(:long) # => "December 04, 2007 00:00" + # datetime.to_fs(:long_ordinal) # => "December 4th, 2007 00:00" + # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" + # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" + # + # ==== Adding your own datetime formats to +to_fs+ + # + # DateTime formats are shared with Time. You can add your own to the + # Time::DATE_FORMATS hash. Use the format name as the hash key and + # either a strftime string or Proc instance that takes a time or + # datetime argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:37 + def to_fs(format = T.unsafe(nil)); end + + # Converts +self+ to an integer number of seconds since the Unix epoch. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:86 + def to_i; end + + # Returns the fraction of a second as microseconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:91 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:185 + def utc; end + + # Returns +true+ if offset == 0. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:198 + def utc?; end + + # Returns the offset value in seconds. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:203 + def utc_offset; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:101 + def offset_in_seconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:105 + def seconds_since_unix_epoch; end + + class << self + # Returns DateTime with local offset for given year if format is local else + # offset is zero. + # + # DateTime.civil_from_format :local, 2012 + # # => Sun, 01 Jan 2012 00:00:00 +0300 + # DateTime.civil_from_format :local, 2012, 12, 17 + # # => Mon, 17 Dec 2012 00:00:00 +0000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:71 + def civil_from_format(utc_or_local, year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), min = T.unsafe(nil), sec = T.unsafe(nil)); end + + # Returns Time.zone.now.to_datetime when Time.zone or + # config.time_zone are set, otherwise returns + # Time.now.to_datetime. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:10 + def current; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:117 +class Delegator < ::BasicObject + include ::ActiveSupport::Tryable +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:39 +module ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + extend ::ActiveSupport::CoreExt::ERBUtil + + private + + # A utility method for escaping HTML without affecting existing escaped entities. + # + # html_escape_once('1 < 2 & 3') + # # => "1 < 2 & 3" + # + # html_escape_once('<< Accept & Checkout') + # # => "<< Accept & Checkout" + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:63 + def html_escape_once(s); end + + # A utility method for escaping HTML entities in JSON strings. Specifically, the + # &, > and < characters are replaced with their equivalent unicode escaped form - + # \u0026, \u003e, and \u003c. The Unicode sequences \u2028 and \u2029 are also + # escaped as they are treated as newline characters in some JavaScript engines. + # These sequences have identical meaning as the original characters inside the + # context of a JSON string, so assuming the input is a valid and well-formed + # JSON value, the output will have equivalent meaning when parsed: + # + # json = JSON.generate({ name: ""}) + # # => "{\"name\":\"\"}" + # + # json_escape(json) + # # => "{\"name\":\"\\u003C/script\\u003E\\u003Cscript\\u003Ealert('PWNED!!!')\\u003C/script\\u003E\"}" + # + # JSON.parse(json) == JSON.parse(json_escape(json)) + # # => true + # + # The intended use case for this method is to escape JSON strings before including + # them inside a script tag to avoid XSS vulnerability: + # + # + # + # It is necessary to +raw+ the result of +json_escape+, so that quotation marks + # don't get converted to " entities. +json_escape+ doesn't + # automatically flag the result as HTML safe, since the raw value is unsafe to + # use inside HTML attributes. + # + # If your JSON is being used downstream for insertion into the DOM, be aware of + # whether or not it is being inserted via html(). Most jQuery plugins do this. + # If that is the case, be sure to +html_escape+ or +sanitize+ any user-generated + # content returned by your JSON. + # + # If you need to output JSON elsewhere in your HTML, you can just do something + # like this, as any unsafe characters (including quotation marks) will be + # automatically escaped for you: + # + #
    ...
    + # + # WARNING: this helper only works with valid JSON. Using this on non-JSON values + # will open up serious XSS vulnerabilities. For example, if you replace the + # +current_user.to_json+ in the example above with user input instead, the browser + # will happily eval() that string as JavaScript. + # + # The escaping performed in this method is identical to those performed in the + # Active Support JSON encoder when +ActiveSupport.escape_html_entities_in_json+ is + # set to true. Because this transformation is idempotent, this helper can be + # applied even if +ActiveSupport.escape_html_entities_in_json+ is already true. + # + # Therefore, when you are unsure if +ActiveSupport.escape_html_entities_in_json+ + # is enabled, or if you are unsure where your JSON string originated from, it + # is recommended that you always apply this helper (other libraries, such as the + # JSON gem, do not provide this kind of protection by default; also some gems + # might override +to_json+ to bypass Active Support's encoder). + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:124 + def json_escape(s); end + + # A utility method for escaping XML names of tags and names of attributes. + # + # xml_name_escape('1 < 2 & 3') + # # => "1___2___3" + # + # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:142 + def xml_name_escape(name); end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:67 + def html_escape_once(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:134 + def json_escape(s); end + + # Tokenizes a line of ERB. This is really just for error reporting and + # nobody should use it. + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:161 + def tokenize(source); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def unwrapped_html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:157 + def xml_name_escape(name); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:40 +ERB::Util::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:41 +ERB::Util::HTML_ESCAPE_ONCE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:49 +ERB::Util::INVALID_TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:47 +ERB::Util::INVALID_TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:50 +ERB::Util::SAFE_XML_TAG_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:48 +ERB::Util::TAG_NAME_FOLLOWING_CODEPOINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:51 +ERB::Util::TAG_NAME_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) + +# Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name +# +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:44 +ERB::Util::TAG_NAME_START_CODEPOINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:145 +module Enumerable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + extend ::ActiveSupport::EnumerableCoreExt::Constants + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:146 + def as_json(options = T.unsafe(nil)); end + + # Returns a new +Array+ without the blank items. + # Uses Object#blank? for determining if an item is blank. + # + # [1, "", nil, 2, " ", [], {}, false, true].compact_blank + # # => [1, 2, true] + # + # Set.new([nil, "", 1, false]).compact_blank + # # => [1] + # + # When called on a +Hash+, returns a new +Hash+ without the blank values. + # + # { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank + # # => { b: 1, f: true } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:184 + def compact_blank; end + + # The negative of the Enumerable#include?. Returns +true+ if the + # collection does not include the object. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:118 + def exclude?(object); end + + # Returns a copy of the enumerable excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd" + # # => ["David", "Rafael"] + # + # ["David", "Rafael", "Aaron", "Todd"].excluding %w[ Aaron Todd ] + # # => ["David", "Rafael"] + # + # {foo: 1, bar: 2, baz: 3}.excluding :bar + # # => {foo: 1, baz: 3} + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:132 + def excluding(*elements); end + + # Returns a new +Array+ where the order has been set to that provided in the +series+, based on the +key+ of the + # objects in the original enumerable. + # + # [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5, 3 ]) + # # => [ Person.find(1), Person.find(5), Person.find(3) ] + # + # If the +series+ include keys that have no corresponding element in the Enumerable, these are ignored. + # If the Enumerable has additional elements that aren't named in the +series+, these are not included in the result, unless + # the +filter+ option is set to +false+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:197 + def in_order_of(key, series, filter: T.unsafe(nil)); end + + # Returns a new array that includes the passed elements. + # + # [ 1, 2, 3 ].including(4, 5) + # # => [ 1, 2, 3, 4, 5 ] + # + # ["David", "Rafael"].including %w[ Aaron Todd ] + # # => ["David", "Rafael", "Aaron", "Todd"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:112 + def including(*elements); end + + # Convert an enumerable to a hash, using the block result as the key and the + # element as the value. + # + # people.index_by(&:login) + # # => { "nextangle" => , "chade-" => , ...} + # + # people.index_by { |person| "#{person.first_name} #{person.last_name}" } + # # => { "Chade- Fowlersburg-e" => , "David Heinemeier Hansson" => , ...} + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:52 + def index_by; end + + # Convert an enumerable to a hash, using the element as the key and the block + # result as the value. + # + # post = Post.new(title: "hey there", body: "what's up?") + # + # %i( title body ).index_with { |attr_name| post.public_send(attr_name) } + # # => { title: "hey there", body: "what's up?" } + # + # If an argument is passed instead of a block, it will be used as the value + # for all elements: + # + # %i( created_at updated_at ).index_with(Time.now) + # # => { created_at: 2020-03-09 22:31:47, updated_at: 2020-03-09 22:31:47 } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:75 + def index_with(default = T.unsafe(nil)); end + + # Returns +true+ if the enumerable has more than 1 element. Functionally + # equivalent to enum.to_a.size > 1. Can be called with a block too, + # much like any?, so people.many? { |p| p.age > 26 } returns +true+ + # if more than one person is over 26. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:93 + def many?; end + + # Calculates the maximum from the extracted elements. + # + # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] + # payments.maximum(:price) # => 15 + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:40 + def maximum(key); end + + # Calculates the minimum from the extracted elements. + # + # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] + # payments.minimum(:price) # => 5 + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:32 + def minimum(key); end + + # Extract the given key from the first element in the enumerable. + # + # [{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pick(:name) + # # => "David" + # + # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pick(:id, :name) + # # => [1, "David"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:161 + def pick(*keys); end + + # Extract the given key from each element in the enumerable. + # + # [{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pluck(:name) + # # => ["David", "Rafael", "Aaron"] + # + # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name) + # # => [[1, "David"], [2, "Rafael"]] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:145 + def pluck(*keys); end + + # Returns the sole item in the enumerable. If there are no items, or more + # than one item, raises Enumerable::SoleItemExpectedError. + # + # ["x"].sole # => "x" + # Set.new.sole # => Enumerable::SoleItemExpectedError: no item found + # { a: 1, b: 2 }.sole # => Enumerable::SoleItemExpectedError: multiple items found + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:211 + def sole; end + + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:136 + def without(*elements); end +end + +# Error generated by +sole+ when called on an enumerable that doesn't have +# exactly one item. +# +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:21 +class Enumerable::SoleItemExpectedError < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:263 +class Exception + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:264 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:65 +class FalseClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:87 + def as_json(options = T.unsafe(nil)); end + + # +false+ is blank: + # + # false.blank? # => true + # + # @return [true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:71 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:75 + def present?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:40 + def to_param; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:5 +class File < ::IO + class << self + # Write to a file atomically. Useful for situations where you don't + # want other processes or threads to see half-written files. + # + # File.atomic_write('important.file') do |file| + # file.write('hello') + # end + # + # This method needs to create a temporary file. By default it will create it + # in the same directory as the destination file. If you don't like this + # behavior you can provide a different directory but it must be on the + # same physical filesystem as the file you're trying to write. + # + # File.atomic_write('/data/something.important', '/data/tmp') do |file| + # file.write('hello') + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:21 + def atomic_write(file_name, temp_dir = T.unsafe(nil)); end + + # Private utility method. + # + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:56 + def probe_stat_in(dir); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:116 +class Float < ::Numeric + # Encoding Infinity or NaN to JSON should return "null". The default returns + # "Infinity" or "NaN" which are not valid JSON. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:119 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:5 +class Hash + include ::Enumerable + include ::ActiveSupport::DeepMergeable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:175 + def as_json(options = T.unsafe(nil)); end + + # Validates all keys in a hash match *valid_keys, raising + # +ArgumentError+ on a mismatch. + # + # Note that keys are treated differently than HashWithIndifferentAccess, + # meaning that string and symbol keys will not match. + # + # { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) # => raises "ArgumentError: Unknown key: :years. Valid keys are: :name, :age" + # { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') # => raises "ArgumentError: Unknown key: :name. Valid keys are: 'name', 'age'" + # { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:48 + def assert_valid_keys(*valid_keys); end + + # A hash is blank if it's empty: + # + # {}.blank? # => true + # { key: 'value' }.blank? # => false + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:116 + def blank?; end + + # Hash#reject has its own definition, so this needs one too. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:234 + def compact_blank; end + + # Removes all blank values from the +Hash+ in place and returns self. + # Uses Object#blank? for determining if a value is blank. + # + # h = { a: "", b: 1, c: nil, d: [], e: false, f: true } + # h.compact_blank! + # # => { b: 1, f: true } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:244 + def compact_blank!; end + + # Returns a deep copy of hash. + # + # hash = { a: { b: 'b' } } + # dup = hash.deep_dup + # dup[:a][:c] = 'c' + # + # hash[:a][:c] # => nil + # dup[:a][:c] # => "c" + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:43 + def deep_dup; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:40 + def deep_merge?(other); end + + # Returns a new hash with all keys converted to strings. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_stringify_keys + # # => {"person"=>{"name"=>"Rob", "age"=>"28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:84 + def deep_stringify_keys; end + + # Destructively converts all keys to strings. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:91 + def deep_stringify_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. This includes the keys from the root hash + # and from all nested hashes and arrays. + # + # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } + # + # hash.deep_symbolize_keys + # # => {:person=>{:name=>"Rob", :age=>"28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:103 + def deep_symbolize_keys; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:110 + def deep_symbolize_keys!; end + + # Returns a new hash with all keys converted by the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_transform_keys{ |key| key.to_s.upcase } + # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:65 + def deep_transform_keys(&block); end + + # Destructively converts all keys by using the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:72 + def deep_transform_keys!(&block); end + + # Returns a new hash with all values converted by the block operation. + # This includes the values from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_transform_values{ |value| value.to_s.upcase } + # # => {person: {name: "ROB", age: "28"}} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_transform_values.rb:12 + def deep_transform_values(&block); end + + # Destructively converts all values by using the block operation. + # This includes the values from the root hash and from all + # nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_transform_values.rb:19 + def deep_transform_values!(&block); end + + # Removes the given keys from hash and returns it. + # hash = { a: true, b: false, c: nil } + # hash.except!(:c) # => { a: true, b: false } + # hash # => { a: true, b: false } + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/except.rb:8 + def except!(*keys); end + + # Removes and returns the key/value pairs matching the given keys. + # + # hash = { a: 1, b: 2, c: 3, d: 4 } + # hash.extract!(:a, :b) # => {:a=>1, :b=>2} + # hash # => {:c=>3, :d=>4} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/slice.rb:24 + def extract!(*keys); end + + # By default, only instances of Hash itself are extractable. + # Subclasses of Hash may implement this method and return + # true to declare themselves as extractable. If a Hash + # is extractable, Array#extract_options! pops it from + # the Array when it is the last element of the Array. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:9 + def extractable_options?; end + + # Called when object is nested under an object that receives + # #with_indifferent_access. This method will be called on the current object + # by the enclosing object and is aliased to #with_indifferent_access by + # default. Subclasses of Hash may override this method to return +self+ if + # converting to an ActiveSupport::HashWithIndifferentAccess would not be + # desirable. + # + # b = { b: 1 } + # { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access + # # => {"b"=>1} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:23 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:118 + def present?; end + + # Merges the caller into +other_hash+. For example, + # + # options = options.reverse_merge(size: 25, velocity: 10) + # + # is equivalent to + # + # options = { size: 25, velocity: 10 }.merge(options) + # + # This is particularly useful for initializing an options hash + # with default values. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:14 + def reverse_merge(other_hash); end + + # Destructive +reverse_merge+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:20 + def reverse_merge!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:23 + def reverse_update(other_hash); end + + # Replaces the hash with only the given keys. + # Returns a hash containing the removed key/value pairs. + # + # hash = { a: 1, b: 2, c: 3, d: 4 } + # hash.slice!(:a, :b) # => {:c=>3, :d=>4} + # hash # => {:a=>1, :b=>2} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/slice.rb:10 + def slice!(*keys); end + + # Returns a new hash with all keys converted to strings. + # + # hash = { name: 'Rob', age: '28' } + # + # hash.stringify_keys + # # => {"name"=>"Rob", "age"=>"28"} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:10 + def stringify_keys; end + + # Destructively converts all keys to strings. Same as + # +stringify_keys+, but modifies +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:16 + def stringify_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. + # + # hash = { 'name' => 'Rob', 'age' => '28' } + # + # hash.symbolize_keys + # # => {:name=>"Rob", :age=>"28"} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:27 + def symbolize_keys; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:34 + def symbolize_keys!; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:30 + def to_options; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:37 + def to_options!; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:92 + def to_param(namespace = T.unsafe(nil)); end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # {name: 'David', nationality: 'Danish'}.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # {name: 'David', nationality: 'Danish'}.to_query('user') + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs "key=value" that conform the query string + # are sorted lexicographically in ascending order. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:81 + def to_query(namespace = T.unsafe(nil)); end + + # Returns a string containing an XML representation of its receiver: + # + # { foo: 1, bar: 2 }.to_xml + # # => + # # + # # + # # 1 + # # 2 + # # + # + # To do so, the method loops over the pairs and builds nodes that depend on + # the _values_. Given a pair +key+, +value+: + # + # * If +value+ is a hash there's a recursive call with +key+ as :root. + # + # * If +value+ is an array there's a recursive call with +key+ as :root, + # and +key+ singularized as :children. + # + # * If +value+ is a callable object it must expect one or two arguments. Depending + # on the arity, the callable is invoked with the +options+ hash as first argument + # with +key+ as :root, and +key+ singularized as second argument. The + # callable can add nodes by using options[:builder]. + # + # {foo: lambda { |options, key| options[:builder].b(key) }}.to_xml + # # => "foo" + # + # * If +value+ responds to +to_xml+ the method is invoked with +key+ as :root. + # + # class Foo + # def to_xml(options) + # options[:builder].bar 'fooing!' + # end + # end + # + # { foo: Foo.new }.to_xml(skip_instruct: true) + # # => + # # + # # fooing! + # # + # + # * Otherwise, a node with +key+ as tag is created with a string representation of + # +value+ as text node. If +value+ is +nil+ an attribute "nil" set to "true" is added. + # Unless the option :skip_types exists and is true, an attribute "type" is + # added as well according to the following mapping: + # + # XML_TYPE_NAMES = { + # "Symbol" => "symbol", + # "Integer" => "integer", + # "BigDecimal" => "decimal", + # "Float" => "float", + # "TrueClass" => "boolean", + # "FalseClass" => "boolean", + # "Date" => "date", + # "DateTime" => "dateTime", + # "Time" => "dateTime" + # } + # + # By default the root node is "hash", but that's configurable via the :root option. + # + # The default XML builder is a fresh instance of +Builder::XmlMarkup+. You can + # configure your own builder with the :builder option. The method also accepts + # options like :dasherize and friends, they are forwarded to the builder. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:74 + def to_xml(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:17 + def with_defaults(other_hash); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:24 + def with_defaults!(other_hash); end + + # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: + # + # { a: 1 }.with_indifferent_access['a'] # => 1 + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:9 + def with_indifferent_access; end + + private + + # Support methods for deep transforming nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:116 + def _deep_transform_keys_in_object(object, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:129 + def _deep_transform_keys_in_object!(object, &block); end + + # Support methods for deep transforming nested hashes and arrays. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_transform_values.rb:25 + def _deep_transform_values_in_object(object, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_transform_values.rb:36 + def _deep_transform_values_in_object!(object, &block); end + + class << self + # Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:133 + def from_trusted_xml(xml); end + + # Returns a Hash containing a collection of pairs when the key is the node name and the value is + # its content + # + # xml = <<-XML + # + # + # 1 + # 2 + # + # XML + # + # hash = Hash.from_xml(xml) + # # => {"hash"=>{"foo"=>1, "bar"=>2}} + # + # +DisallowedType+ is raised if the XML contains attributes with type="yaml" or + # type="symbol". Use Hash.from_trusted_xml to + # parse this XML. + # + # Custom +disallowed_types+ can also be passed in the form of an + # array. + # + # xml = <<-XML + # + # + # 1 + # "David" + # + # XML + # + # hash = Hash.from_xml(xml, ['integer']) + # # => ActiveSupport::XMLConverter::DisallowedType: Disallowed type attribute: "integer" + # + # Note that passing custom disallowed types will override the default types, + # which are Symbol and YAML. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:128 + def from_xml(xml, disallowed_types = T.unsafe(nil)); end + end +end + +# :stopdoc: +# +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:465 +HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess + +# :enddoc: +# +# pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:9 +module I18n; end + +# pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:10 +class I18n::Railtie < ::Rails::Railtie + class << self + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:103 + def include_fallbacks_module; end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:107 + def init_fallbacks(fallbacks); end + + # Setup i18n configuration. + # + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:36 + def initialize_i18n(app); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:84 + def setup_raise_on_missing_translations_config(app, strict); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:123 + def validate_fallbacks(fallbacks); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:134 + def watched_dirs_with_extensions(paths); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:151 +class IO + include ::Enumerable + include ::File::Constants + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:152 + def as_json(options = T.unsafe(nil)); end +end + +class IO::Buffer + include ::Comparable + + def initialize(*_arg0); end + + def &(_arg0); end + def <=>(_arg0); end + def ^(_arg0); end + def and!(_arg0); end + def clear(*_arg0); end + def copy(*_arg0); end + def each(*_arg0); end + def each_byte(*_arg0); end + def empty?; end + def external?; end + def free; end + def get_string(*_arg0); end + def get_value(_arg0, _arg1); end + def get_values(_arg0, _arg1); end + def hexdump(*_arg0); end + def inspect; end + def internal?; end + def locked; end + def locked?; end + def mapped?; end + def not!; end + def null?; end + def or!(_arg0); end + def pread(*_arg0); end + def private?; end + def pwrite(*_arg0); end + def read(*_arg0); end + def readonly?; end + def resize(_arg0); end + def set_string(*_arg0); end + def set_value(_arg0, _arg1, _arg2); end + def set_values(_arg0, _arg1, _arg2); end + def shared?; end + def size; end + def slice(*_arg0); end + def to_s; end + def transfer; end + def valid?; end + def values(*_arg0); end + def write(*_arg0); end + def xor!(_arg0); end + def |(_arg0); end + def ~; end + + private + + def initialize_copy(_arg0); end + + class << self + def for(_arg0); end + def map(*_arg0); end + def size_of(_arg0); end + def string(_arg0); end + end +end + +class IO::Buffer::AccessError < ::RuntimeError; end +class IO::Buffer::AllocationError < ::RuntimeError; end +IO::Buffer::BIG_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::EXTERNAL = T.let(T.unsafe(nil), Integer) +IO::Buffer::HOST_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::INTERNAL = T.let(T.unsafe(nil), Integer) +class IO::Buffer::InvalidatedError < ::RuntimeError; end +IO::Buffer::LITTLE_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::LOCKED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::LockedError < ::RuntimeError; end +IO::Buffer::MAPPED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::MaskError < ::ArgumentError; end +IO::Buffer::NETWORK_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::PAGE_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer) +IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer) +IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer) + +class IO::EAGAINWaitReadable < ::Errno::EAGAIN + include ::IO::WaitReadable +end + +class IO::EAGAINWaitWritable < ::Errno::EAGAIN + include ::IO::WaitWritable +end + +class IO::EINPROGRESSWaitReadable < ::Errno::EINPROGRESS + include ::IO::WaitReadable +end + +class IO::EINPROGRESSWaitWritable < ::Errno::EINPROGRESS + include ::IO::WaitWritable +end + +IO::EWOULDBLOCKWaitReadable = IO::EAGAINWaitReadable +IO::EWOULDBLOCKWaitWritable = IO::EAGAINWaitWritable +IO::PRIORITY = T.let(T.unsafe(nil), Integer) +IO::READABLE = T.let(T.unsafe(nil), Integer) +IO::WRITABLE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:6 +class Integer < ::Numeric + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:13 + def month; end + + # Returns a Duration instance matching the number of months provided. + # + # 2.months # => 2 months + # + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:10 + def months; end + + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:21 + def year; end + + # Returns a Duration instance matching the number of years provided. + # + # 2.years # => 2 years + # + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:18 + def years; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:3 +module Kernel + private + + # Sets $VERBOSE to +true+ for the duration of the block and back to its + # original value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:20 + def enable_warnings(&block); end + + # Sets $VERBOSE to +nil+ for the duration of the block and back to its original + # value afterwards. + # + # silence_warnings do + # value = noisy_call # no warning voiced + # end + # + # noisy_call # warning voiced + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:14 + def silence_warnings(&block); end + + # Blocks and ignores any exception passed as argument if raised within the block. + # + # suppress(ZeroDivisionError) do + # 1/0 + # puts 'This code is NOT reached' + # end + # + # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:41 + def suppress(*exception_classes); end + + # Sets $VERBOSE for the duration of the block and back to its original + # value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 + def with_warnings(flag); end + + class << self + # Sets $VERBOSE to +true+ for the duration of the block and back to its + # original value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:20 + def enable_warnings(&block); end + + # Sets $VERBOSE to +nil+ for the duration of the block and back to its original + # value afterwards. + # + # silence_warnings do + # value = noisy_call # no warning voiced + # end + # + # noisy_call # warning voiced + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:14 + def silence_warnings(&block); end + + # Blocks and ignores any exception passed as argument if raised within the block. + # + # suppress(ZeroDivisionError) do + # 1/0 + # puts 'This code is NOT reached' + # end + # + # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:41 + def suppress(*exception_classes); end + + # Sets $VERBOSE for the duration of the block and back to its original + # value afterwards. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 + def with_warnings(flag); end + end +end + +# == Attribute Accessors +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes. +# == Attribute Accessors per Thread +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes, but does so on a per-thread basis. +# +# So the values are scoped within the Thread.current space under the class name +# of the module. +# +# Note that it can also be scoped per-fiber if +Rails.application.config.active_support.isolation_level+ +# is set to +:fiber+. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:3 +class Module + include ::Module::Concerning + + # Allows you to make aliases for attributes, which includes + # getter, setter, and a predicate. + # + # class Content < ActiveRecord::Base + # # has a title attribute + # end + # + # class Email < Content + # alias_attribute :subject, :title + # end + # + # e = Email.find(1) + # e.title # => "Superstars" + # e.subject # => "Superstars" + # e.subject? # => true + # e.subject = "Megastars" + # e.title # => "Megastars" + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/aliasing.rb:21 + def alias_attribute(new_name, old_name); end + + # A module may or may not have a name. + # + # module M; end + # M.name # => "M" + # + # m = Module.new + # m.name # => nil + # + # +anonymous?+ method returns true if module does not have a name, false otherwise: + # + # Module.new.anonymous? # => true + # + # module M; end + # M.anonymous? # => false + # + # A module gets a name when it is first assigned to a constant. Either + # via the +module+ or +class+ keyword or by an explicit assignment: + # + # m = Module.new # creates an anonymous module + # m.anonymous? # => true + # M = m # m gets a name here as a side-effect + # m.name # => "M" + # m.anonymous? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/anonymous.rb:27 + def anonymous?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:53 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:20 + def attr_internal(*attrs); end + + # Declares an attribute reader and writer backed by an internally-named instance + # variable. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:16 + def attr_internal_accessor(*attrs); end + + # Declares an attribute reader backed by an internally-named instance variable. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:5 + def attr_internal_reader(*attrs); end + + # Declares an attribute writer backed by an internally-named instance variable. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:10 + def attr_internal_writer(*attrs); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:213 + def cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:75 + def cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:140 + def cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Returns a copy of module or class if it's anonymous. If it's + # named, returns +self+. + # + # Object.deep_dup == Object # => true + # klass = Class.new + # klass.deep_dup == klass # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:64 + def deep_dup; end + + # Provides a +delegate+ class method to easily expose contained objects' + # public methods as your own. + # + # ==== Options + # * :to - Specifies the target object name as a symbol or string + # * :prefix - Prefixes the new method with the target name or a custom prefix + # * :allow_nil - If set to true, prevents a +ActiveSupport::DelegationError+ + # from being raised + # * :private - If set to true, changes method visibility to private + # + # The macro receives one or more method names (specified as symbols or + # strings) and the name of the target object via the :to option + # (also a symbol or string). + # + # Delegation is particularly useful with Active Record associations: + # + # class Greeter < ActiveRecord::Base + # def hello + # 'hello' + # end + # + # def goodbye + # 'goodbye' + # end + # end + # + # class Foo < ActiveRecord::Base + # belongs_to :greeter + # delegate :hello, to: :greeter + # end + # + # Foo.new.hello # => "hello" + # Foo.new.goodbye # => NoMethodError: undefined method `goodbye' for # + # + # Multiple delegates to the same target are allowed: + # + # class Foo < ActiveRecord::Base + # belongs_to :greeter + # delegate :hello, :goodbye, to: :greeter + # end + # + # Foo.new.goodbye # => "goodbye" + # + # Methods can be delegated to instance variables, class variables, or constants + # by providing them as a symbols: + # + # class Foo + # CONSTANT_ARRAY = [0,1,2,3] + # @@class_array = [4,5,6,7] + # + # def initialize + # @instance_array = [8,9,10,11] + # end + # delegate :sum, to: :CONSTANT_ARRAY + # delegate :min, to: :@@class_array + # delegate :max, to: :@instance_array + # end + # + # Foo.new.sum # => 6 + # Foo.new.min # => 4 + # Foo.new.max # => 11 + # + # It's also possible to delegate a method to the class by using +:class+: + # + # class Foo + # def self.hello + # "world" + # end + # + # delegate :hello, to: :class + # end + # + # Foo.new.hello # => "world" + # + # Delegates can optionally be prefixed using the :prefix option. If the value + # is true, the delegate methods are prefixed with the name of the object being + # delegated to. + # + # Person = Struct.new(:name, :address) + # + # class Invoice < Struct.new(:client) + # delegate :name, :address, to: :client, prefix: true + # end + # + # john_doe = Person.new('John Doe', 'Vimmersvej 13') + # invoice = Invoice.new(john_doe) + # invoice.client_name # => "John Doe" + # invoice.client_address # => "Vimmersvej 13" + # + # It is also possible to supply a custom prefix. + # + # class Invoice < Struct.new(:client) + # delegate :name, :address, to: :client, prefix: :customer + # end + # + # invoice = Invoice.new(john_doe) + # invoice.customer_name # => 'John Doe' + # invoice.customer_address # => 'Vimmersvej 13' + # + # The delegated methods are public by default. + # Pass private: true to change that. + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :first_name, to: :profile + # delegate :date_of_birth, to: :profile, private: true + # + # def age + # Date.today.year - date_of_birth.year + # end + # end + # + # User.new.first_name # => "Tomas" + # User.new.date_of_birth # => NoMethodError: private method `date_of_birth' called for # + # User.new.age # => 2 + # + # If the target is +nil+ and does not respond to the delegated method a + # +ActiveSupport::DelegationError+ is raised. If you wish to instead return +nil+, + # use the :allow_nil option. + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :age, to: :profile + # end + # + # User.new.age + # # => ActiveSupport::DelegationError: User#age delegated to profile.age, but profile is nil + # + # But if not having a profile yet is fine and should not be an error + # condition: + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :age, to: :profile, allow_nil: true + # end + # + # User.new.age # nil + # + # Note that if the target is not +nil+ then the call is attempted regardless of the + # :allow_nil option, and thus an exception is still raised if said object + # does not respond to the method: + # + # class Foo + # def initialize(bar) + # @bar = bar + # end + # + # delegate :name, to: :@bar, allow_nil: true + # end + # + # Foo.new("Bar").name # raises NoMethodError: undefined method `name' + # + # The target method must be public, otherwise it will raise +NoMethodError+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:160 + def delegate(*methods, to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), private: T.unsafe(nil)); end + + # When building decorators, a common pattern may emerge: + # + # class Partition + # def initialize(event) + # @event = event + # end + # + # def person + # detail.person || creator + # end + # + # private + # def respond_to_missing?(name, include_private = false) + # @event.respond_to?(name, include_private) + # end + # + # def method_missing(method, *args, &block) + # @event.send(method, *args, &block) + # end + # end + # + # With Module#delegate_missing_to, the above is condensed to: + # + # class Partition + # delegate_missing_to :@event + # + # def initialize(event) + # @event = event + # end + # + # def person + # detail.person || creator + # end + # end + # + # The target can be anything callable within the object, e.g. instance + # variables, methods, constants, etc. + # + # The delegated method must be public on the target, otherwise it will + # raise +ActiveSupport::DelegationError+. If you wish to instead return +nil+, + # use the :allow_nil option. + # + # The marshal_dump and _dump methods are exempt from + # delegation due to possible interference when calling + # Marshal.dump(object), should the delegation target method + # of object add or remove instance variables. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:218 + def delegate_missing_to(target, allow_nil: T.unsafe(nil)); end + + # deprecate :foo, deprecator: MyLib.deprecator + # deprecate :foo, bar: "warning!", deprecator: MyLib.deprecator + # + # A deprecator is typically an instance of ActiveSupport::Deprecation, but you can also pass any object that responds + # to deprecation_warning(deprecated_method_name, message, caller_backtrace) where you can implement your + # custom warning behavior. + # + # class MyLib::Deprecator + # def deprecation_warning(deprecated_method_name, message, caller_backtrace = nil) + # message = "#{deprecated_method_name} is deprecated and will be removed from MyLibrary | #{message}" + # Kernel.warn message + # end + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/deprecation.rb:17 + def deprecate(*method_names, deprecator:, **options); end + + # Defines both class and instance accessors for class attributes. + # All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_accessor :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black, :blonde, :red] + # HairColors.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # + # If a subclass changes the value then that would also change the value for + # parent class. Similarly if parent class changes the value then that would + # change the value of subclasses too. + # + # class Citizen < Person + # end + # + # Citizen.new.hair_colors << :blue + # Person.new.hair_colors # => [:brown, :black, :blonde, :red, :blue] + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # module HairColors + # mattr_accessor :hair_colors, instance_writer: false, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # module HairColors + # mattr_accessor :hair_colors, instance_accessor: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_accessor(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:208 + def mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # Defines a class attribute and creates a class and instance reader methods. + # The underlying class variable is set to +nil+, if it is not previously + # defined. All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_reader :hair_colors + # end + # + # HairColors.hair_colors # => nil + # HairColors.class_variable_set("@@hair_colors", [:brown, :black]) + # HairColors.hair_colors # => [:brown, :black] + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # module HairColors + # mattr_reader :hair_colors, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_reader(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_styles # => [:long, :short] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:55 + def mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Defines a class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. All class and instance methods created + # will be public, even if this method is called with a private or protected + # access modifier. + # + # module HairColors + # mattr_writer :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black] + # Person.class_variable_get("@@hair_colors") # => [:brown, :black] + # Person.new.hair_colors = [:blonde, :red] + # HairColors.class_variable_get("@@hair_colors") # => [:blonde, :red] + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # module HairColors + # mattr_writer :hair_colors, instance_writer: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:blonde, :red] # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_writer(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:121 + def mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:30 + def method_visibility(method); end + + # Returns the module which contains this one according to its name. + # + # module M + # module N + # end + # end + # X = M::N + # + # M::N.module_parent # => M + # X.module_parent # => M + # + # The parent of top-level and anonymous modules is Object. + # + # M.module_parent # => Object + # Module.new.module_parent # => Object + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:37 + def module_parent; end + + # Returns the name of the module containing this one. + # + # M::N.module_parent_name # => "M" + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:9 + def module_parent_name; end + + # Returns all the parents of this module according to its name, ordered from + # nested outwards. The receiver is not contained within the result. + # + # module M + # module N + # end + # end + # X = M::N + # + # M.module_parents # => [Object] + # M::N.module_parents # => [M, Object] + # X.module_parents # => [M, Object] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:53 + def module_parents; end + + # Replaces the existing method definition, if there is one, with the passed + # block as its body. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:17 + def redefine_method(method, &block); end + + # Replaces the existing singleton method definition, if there is one, with + # the passed block as its body. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:26 + def redefine_singleton_method(method, &block); end + + # Removes the named method, if it exists. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/remove_method.rb:7 + def remove_possible_method(method); end + + # Removes the named singleton method, if it exists. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/remove_method.rb:14 + def remove_possible_singleton_method(method); end + + # Marks the named method as intended to be redefined, if it exists. + # Suppresses the Ruby method redefinition warning. Prefer + # #redefine_method where possible. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:7 + def silence_redefinition_of_method(method); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:174 + def thread_cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:81 + def thread_cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:123 + def thread_cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end + + # Defines both class and instance accessors for class attributes. + # + # class Account + # thread_mattr_accessor :user + # end + # + # Account.user = "DHH" + # Account.user # => "DHH" + # Account.new.user # => "DHH" + # + # Unlike +mattr_accessor+, values are *not* shared with subclasses or parent classes. + # If a subclass changes the value, the parent class' value is not changed. + # If the parent class changes the value, the value of subclasses is not changed. + # + # class Customer < Account + # end + # + # Account.user # => "DHH" + # Customer.user # => nil + # Customer.user = "Rafael" + # Customer.user # => "Rafael" + # Account.user # => "DHH" + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class Current + # thread_mattr_accessor :user, instance_writer: false, instance_reader: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class Current + # thread_mattr_accessor :user, instance_accessor: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # A default value may be specified using the +:default+ option. Because + # multiple threads can access the default value, non-frozen default values + # will be duped and frozen. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:170 + def thread_mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates class and instance reader methods. + # The underlying per-thread class variable is set to +nil+, if it is not previously defined. + # + # module Current + # thread_mattr_reader :user + # end + # + # Current.user = "DHH" + # Current.user # => "DHH" + # Thread.new { Current.user }.value # => nil + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # thread_mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # class Current + # thread_mattr_reader :user, instance_reader: false + # end + # + # Current.new.user # => NoMethodError + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:41 + def thread_mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. + # + # module Current + # thread_mattr_writer :user + # end + # + # Current.user = "DHH" + # Thread.current[:attr_Current_user] # => "DHH" + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # class Current + # thread_mattr_writer :user, instance_writer: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors_per_thread.rb:101 + def thread_mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:40 + def attr_internal_define(attr_name, type); end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:23 + def attr_internal_naming_format; end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:25 + def attr_internal_naming_format=(format); end + end +end + +# == Bite-sized separation of concerns +# +# We often find ourselves with a medium-sized chunk of behavior that we'd +# like to extract, but only mix in to a single class. +# +# Extracting a plain old Ruby object to encapsulate it and collaborate or +# delegate to the original object is often a good choice, but when there's +# no additional state to encapsulate or we're making DSL-style declarations +# about the parent class, introducing new collaborators can obfuscate rather +# than simplify. +# +# The typical route is to just dump everything in a monolithic class, perhaps +# with a comment, as a least-bad alternative. Using modules in separate files +# means tedious sifting to get a big-picture view. +# +# == Dissatisfying ways to separate small concerns +# +# === Using comments: +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# ## Event tracking +# has_many :events +# +# before_create :track_creation +# +# private +# def track_creation +# # ... +# end +# end +# +# === With an inline module: +# +# Noisy syntax. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# module EventTracking +# extend ActiveSupport::Concern +# +# included do +# has_many :events +# before_create :track_creation +# end +# +# private +# def track_creation +# # ... +# end +# end +# include EventTracking +# end +# +# === Mix-in noise exiled to its own file: +# +# Once our chunk of behavior starts pushing the scroll-to-understand-it +# boundary, we give in and move it to a separate file. At this size, the +# increased overhead can be a reasonable tradeoff even if it reduces our +# at-a-glance perception of how things work. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# include TodoEventTracking +# end +# +# == Introducing Module#concerning +# +# By quieting the mix-in noise, we arrive at a natural, low-ceremony way to +# separate bite-sized concerns. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# concerning :EventTracking do +# included do +# has_many :events +# before_create :track_creation +# end +# +# private +# def track_creation +# # ... +# end +# end +# end +# +# Todo.ancestors +# # => [Todo, Todo::EventTracking, ApplicationRecord, Object] +# +# This small step has some wonderful ripple effects. We can +# * grok the behavior of our class in one glance, +# * clean up monolithic junk-drawer classes by separating their concerns, and +# * stop leaning on protected/private for crude "this is internal stuff" modularity. +# +# === Prepending concerning +# +# concerning supports a prepend: true argument which will prepend the +# concern instead of using include for it. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:112 +module Module::Concerning + # A low-cruft shortcut to define a concern. + # + # concern :EventTracking do + # ... + # end + # + # is equivalent to + # + # module EventTracking + # extend ActiveSupport::Concern + # + # ... + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:132 + def concern(topic, &module_definition); end + + # Define a new concern and mix it in. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:114 + def concerning(topic, prepend: T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:5 +Module::DelegationError = ActiveSupport::DelegationError + +# pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:3 +class NameError < ::StandardError + include ::ErrorHighlight::CoreExt + include ::DidYouMean::Correctable + + # Extract the name of the missing constant from the exception message. + # + # begin + # HelloWorld + # rescue NameError => e + # e.missing_name + # end + # # => "HelloWorld" + # + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:12 + def missing_name; end + + # Was this exception raised because the given name was missing? + # + # begin + # HelloWorld + # rescue NameError => e + # e.missing_name?("HelloWorld") + # end + # # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:44 + def missing_name?(name); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:56 + def real_mod_name(mod); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:53 +NameError::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:50 +class NilClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:93 + def as_json(options = T.unsafe(nil)); end + + # +nil+ is blank: + # + # nil.blank? # => true + # + # @return [true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:56 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:60 + def present?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:26 + def to_param; end + + # Returns a CGI-escaped +key+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:21 + def to_query(key); end + + # Calling +try+ on +nil+ always returns +nil+. + # It becomes especially helpful when navigating through associations that may return +nil+. + # + # nil.try(:name) # => nil + # + # Without +try+ + # @person && @person.children.any? && @person.children.first.name + # + # With +try+ + # @person.try(:children).try(:first).try(:name) + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:148 + def try(*, &); end + + # Calling +try!+ on +nil+ always returns +nil+. + # + # nil.try!(:name) # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:155 + def try!(*, &); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:170 +class Numeric + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:111 + def as_json(options = T.unsafe(nil)); end + + # No number is blank: + # + # 1.blank? # => false + # 0.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:177 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:18 + def byte; end + + # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes + # + # 2.bytes # => 2 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:15 + def bytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:40 + def day; end + + # Returns a Duration instance matching the number of days provided. + # + # 2.days # => 2 days + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:37 + def days; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:66 + def exabyte; end + + # Returns the number of bytes equivalent to the exabytes provided. + # + # 2.exabytes # => 2_305_843_009_213_693_952 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:63 + def exabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:56 + def fortnight; end + + # Returns a Duration instance matching the number of fortnights provided. + # + # 2.fortnights # => 4 weeks + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:53 + def fortnights; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:42 + def gigabyte; end + + # Returns the number of bytes equivalent to the gigabytes provided. + # + # 2.gigabytes # => 2_147_483_648 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:39 + def gigabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:32 + def hour; end + + # Returns a Duration instance matching the number of hours provided. + # + # 2.hours # => 2 hours + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:29 + def hours; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:13 + def html_safe?; end + + # Returns the number of milliseconds equivalent to the seconds provided. + # Used with the standard time durations. + # + # 2.in_milliseconds # => 2000 + # 1.hour.in_milliseconds # => 3600000 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:63 + def in_milliseconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:26 + def kilobyte; end + + # Returns the number of bytes equivalent to the kilobytes provided. + # + # 2.kilobytes # => 2048 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:23 + def kilobytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:34 + def megabyte; end + + # Returns the number of bytes equivalent to the megabytes provided. + # + # 2.megabytes # => 2_097_152 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:31 + def megabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:24 + def minute; end + + # Returns a Duration instance matching the number of minutes provided. + # + # 2.minutes # => 2 minutes + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:21 + def minutes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:58 + def petabyte; end + + # Returns the number of bytes equivalent to the petabytes provided. + # + # 2.petabytes # => 2_251_799_813_685_248 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:55 + def petabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:181 + def present?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:16 + def second; end + + # Returns a Duration instance matching the number of seconds provided. + # + # 2.seconds # => 2 seconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:13 + def seconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:50 + def terabyte; end + + # Returns the number of bytes equivalent to the terabytes provided. + # + # 2.terabytes # => 2_199_023_255_552 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:47 + def terabytes; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:48 + def week; end + + # Returns a Duration instance matching the number of weeks provided. + # + # 2.weeks # => 2 weeks + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:45 + def weeks; end + + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:74 + def zettabyte; end + + # Returns the number of bytes equivalent to the zettabytes provided. + # + # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:71 + def zettabytes; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:9 +Numeric::EXABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:6 +Numeric::GIGABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:4 +Numeric::KILOBYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:5 +Numeric::MEGABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:8 +Numeric::PETABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:7 +Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:10 +Numeric::ZETTABYTE = T.let(T.unsafe(nil), Integer) + +# -- +# Most objects are cloneable, but not all. For example you can't dup methods: +# +# method(:puts).dup # => TypeError: allocator undefined for Method +# +# Classes may signal their instances are not duplicable removing +dup+/+clone+ +# or raising exceptions from them. So, to dup an arbitrary object you normally +# use an optimistic approach and are ready to catch an exception, say: +# +# arbitrary_object.dup rescue object +# +# Rails dups objects in a few critical spots where they are not that arbitrary. +# That rescue is very expensive (like 40 times slower than a predicate), and it +# is often triggered. +# +# That's why we hardcode the following cases and check duplicable? instead of +# using that rescue idiom. +# ++ +# +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:21 +class Object < ::BasicObject + include ::ActiveSupport::Dependencies::RequireDependency + include ::Kernel + include ::PP::ObjectMixin + include ::ActiveSupport::Tryable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + + # Provides a way to check whether some class acts like some other class based on the existence of + # an appropriately-named marker method. + # + # A class that provides the same interface as SomeClass may define a marker method named + # acts_like_some_class? to signal its compatibility to callers of + # acts_like?(:some_class). + # + # For example, Active Support extends Date to define an acts_like_date? method, + # and extends Time to define acts_like_time?. As a result, developers can call + # x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, + # and classes that are able to act like Time can also define an acts_like_time? + # method to interoperate. + # + # Note that the marker method is only expected to exist. It isn't called, so its body or return + # value are irrelevant. + # + # ==== Example: A class that provides the same interface as String + # + # This class may define: + # + # class Stringish + # def acts_like_string? + # end + # end + # + # Then client code can query for duck-type-safeness this way: + # + # Stringish.new.acts_like?(:string) # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/acts_like.rb:33 + def acts_like?(duck); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:59 + def as_json(options = T.unsafe(nil)); end + + # An object is blank if it's false, empty, or a whitespace string. + # For example, +nil+, '', ' ', [], {}, and +false+ are all blank. + # + # This simplifies + # + # !address || address.empty? + # + # to + # + # address.blank? + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:18 + def blank?; end + + # Returns a deep copy of object if it's duplicable. If it's + # not duplicable, returns +self+. + # + # object = Object.new + # dup = object.deep_dup + # dup.instance_variable_set(:@a, 1) + # + # object.instance_variable_defined?(:@a) # => false + # dup.instance_variable_defined?(:@a) # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:15 + def deep_dup; end + + # Can you safely dup this object? + # + # False for method objects; + # true otherwise. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:26 + def duplicable?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:7 + def html_safe?; end + + # Returns true if this object is included in the argument. + # + # When argument is a +Range+, +#cover?+ is used to properly handle inclusion + # check within open ranges. Otherwise, argument must be any object which responds + # to +#include?+. Usage: + # + # characters = ["Konata", "Kagami", "Tsukasa"] + # "Konata".in?(characters) # => true + # + # For non +Range+ arguments, this will throw an +ArgumentError+ if the argument + # doesn't respond to +#include?+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/inclusion.rb:15 + def in?(another_object); end + + # Returns a hash with string keys that maps instance variable names without "@" to their + # corresponding values. + # + # class C + # def initialize(x, y) + # @x, @y = x, y + # end + # end + # + # C.new(0, 1).instance_values # => {"x" => 0, "y" => 1} + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:14 + def instance_values; end + + # Returns an array of instance variable names as strings including "@". + # + # class C + # def initialize(x, y) + # @x, @y = x, y + # end + # end + # + # C.new(0, 1).instance_variable_names # => ["@x", "@y"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:29 + def instance_variable_names; end + + # Returns the receiver if it's present otherwise returns +nil+. + # object.presence is equivalent to + # + # object.present? ? object : nil + # + # For example, something like + # + # state = params[:state] if params[:state].present? + # country = params[:country] if params[:country].present? + # region = state || country || 'US' + # + # becomes + # + # region = params[:state].presence || params[:country].presence || 'US' + # + # @return [Object] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:45 + def presence; end + + # Returns the receiver if it's included in the argument otherwise returns +nil+. + # Argument must be any object which responds to +#include?+. Usage: + # + # params[:bucket_type].presence_in %w( project calendar ) + # + # This will throw an +ArgumentError+ if the argument doesn't respond to +#include?+. + # + # @return [Object] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/inclusion.rb:34 + def presence_in(another_object); end + + # An object is present if it's not blank. + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:25 + def present?; end + + # Alias of to_s. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:8 + def to_param; end + + # Converts an object into a string suitable for use as a URL query string, + # using the given key as the param name. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:14 + def to_query(key); end + + # Set and restore public attributes around a block. + # + # client.timeout # => 5 + # client.with(timeout: 1) do |c| + # c.timeout # => 1 + # end + # client.timeout # => 5 + # + # The receiver is yielded to the provided block. + # + # This method is a shorthand for the common begin/ensure pattern: + # + # old_value = object.attribute + # begin + # object.attribute = new_value + # # do things + # ensure + # object.attribute = old_value + # end + # + # It can be used on any object as long as both the reader and writer methods + # are public. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/with.rb:26 + def with(**attributes); end + + # An elegant way to factor duplication out of options passed to a series of + # method calls. Each method called in the block, with the block variable as + # the receiver, will have its options merged with the default +options+ + # Hash or Hash-like object provided. Each method called on + # the block variable must take an options hash as its final argument. + # + # Without with_options, this code contains duplication: + # + # class Account < ActiveRecord::Base + # has_many :customers, dependent: :destroy + # has_many :products, dependent: :destroy + # has_many :invoices, dependent: :destroy + # has_many :expenses, dependent: :destroy + # end + # + # Using with_options, we can remove the duplication: + # + # class Account < ActiveRecord::Base + # with_options dependent: :destroy do |assoc| + # assoc.has_many :customers + # assoc.has_many :products + # assoc.has_many :invoices + # assoc.has_many :expenses + # end + # end + # + # It can also be used with an explicit receiver: + # + # I18n.with_options locale: user.locale, scope: 'newsletter' do |i18n| + # subject i18n.t :subject + # body i18n.t :body, user_name: user.name + # end + # + # When you don't pass an explicit receiver, it executes the whole block + # in merging options context: + # + # class Account < ActiveRecord::Base + # with_options dependent: :destroy do + # has_many :customers + # has_many :products + # has_many :invoices + # has_many :expenses + # end + # end + # + # with_options can also be nested since the call is forwarded to its receiver. + # + # NOTE: Each nesting level will merge inherited defaults in addition to their own. + # + # class Post < ActiveRecord::Base + # with_options if: :persisted?, length: { minimum: 50 } do + # validates :content, if: -> { content.present? } + # end + # end + # + # The code is equivalent to: + # + # validates :content, length: { minimum: 50 }, if: -> { content.present? } + # + # Hence the inherited default for +if+ key is ignored. + # + # NOTE: You cannot call class methods implicitly inside of +with_options+. + # You can access these methods using the class name instead: + # + # class Phone < ActiveRecord::Base + # enum :phone_number_type, { home: 0, office: 1, mobile: 2 } + # + # with_options presence: true do + # validates :phone_number_type, inclusion: { in: Phone.phone_number_types.keys } + # end + # end + # + # When the block argument is omitted, the decorated Object instance is returned: + # + # module MyStyledHelpers + # def styled + # with_options style: "color: red;" + # end + # end + # + # styled.link_to "I'm red", "/" + # # => I'm red + # + # styled.button_tag "I'm red too!" + # # => + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/with_options.rb:92 + def with_options(options, &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:236 +class Pathname + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:237 + def as_json(options = T.unsafe(nil)); end +end + +module Process + extend ::ConnectionPool::ForkTracker + extend ::RedisClient::PIDCache::CoreExt + extend ::ActiveSupport::ForkTracker::CoreExt + + class << self + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 + def _fork; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:257 +class Process::Status + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:258 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:157 +class Range + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:158 + def as_json(options = T.unsafe(nil)); end + + # Optimize range sum to use arithmetic progression if a block is not given and + # we have a range of numeric values. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:253 + def sum(initial_value = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:139 +class Regexp + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:140 + def as_json(options = T.unsafe(nil)); end + + # Returns +true+ if the regexp has the multiline flag set. + # + # (/./).multiline? # => false + # (/./m).multiline? # => true + # + # Regexp.new(".").multiline? # => false + # Regexp.new(".", Regexp::MULTILINE).multiline? # => true + # + # pkg:gem/activesupport#lib/active_support/core_ext/regexp.rb:11 + def multiline?; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:62 +module Singleton + mixes_in_class_methods ::Singleton::SingletonClassMethods + + # Singleton instances are not duplicable: + # + # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:66 + def duplicable?; end +end + +# String inflections define new methods on the String class to transform names for different purposes. +# For instance, you can figure out the name of a table from the name of a class. +# +# 'ScaleScore'.tableize # => "scale_scores" +# +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:135 +class String + include ::Comparable + + # Enables more predictable duck-typing on String-like classes. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/behavior.rb:5 + def acts_like_string?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:99 + def as_json(options = T.unsafe(nil)); end + + # If you pass a single integer, returns a substring of one character at that + # position. The first character of the string is at position 0, the next at + # position 1, and so on. If a range is supplied, a substring containing + # characters at offsets given by the range is returned. In both cases, if an + # offset is negative, it is counted from the end of the string. Returns +nil+ + # if the initial offset falls outside the string. Returns an empty string if + # the beginning of the range is greater than the end of the string. + # + # str = "hello" + # str.at(0) # => "h" + # str.at(1..3) # => "ell" + # str.at(-2) # => "l" + # str.at(-2..-1) # => "lo" + # str.at(5) # => nil + # str.at(5..-1) # => "" + # + # If a Regexp is given, the matching portion of the string is returned. + # If a String is given, that given string is returned if it occurs in + # the string. In both cases, +nil+ is returned if there is no match. + # + # str = "hello" + # str.at(/lo/) # => "lo" + # str.at(/ol/) # => nil + # str.at("lo") # => "lo" + # str.at("ol") # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:29 + def at(position); end + + # A string is blank if it's empty or contains whitespaces only: + # + # ''.blank? # => true + # ' '.blank? # => true + # "\t\n\r".blank? # => true + # ' blah '.blank? # => false + # + # Unicode whitespace is supported: + # + # "\u00a0".blank? # => true + # + # @return [true, false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:153 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:111 + def camelcase(first_letter = T.unsafe(nil)); end + + # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize + # is set to :lower then camelize produces lowerCamelCase. + # + # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces. + # + # 'active_record'.camelize # => "ActiveRecord" + # 'active_record'.camelize(:lower) # => "activeRecord" + # 'active_record/errors'.camelize # => "ActiveRecord::Errors" + # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" + # + # See ActiveSupport::Inflector.camelize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:101 + def camelize(first_letter = T.unsafe(nil)); end + + # Creates a class name from a plural table name like \Rails does for table names to models. + # Note that this returns a string and not a class. (To convert to an actual class + # follow +classify+ with +constantize+.) + # + # 'ham_and_eggs'.classify # => "HamAndEgg" + # 'posts'.classify # => "Post" + # + # See ActiveSupport::Inflector.classify. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:239 + def classify; end + + # +constantize+ tries to find a declared constant with the name specified + # in the string. It raises a NameError when the name is not in CamelCase + # or is not initialized. + # + # 'Module'.constantize # => Module + # 'Class'.constantize # => Class + # 'blargle'.constantize # => NameError: wrong constant name blargle + # + # See ActiveSupport::Inflector.constantize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:73 + def constantize; end + + # Replaces underscores with dashes in the string. + # + # 'puni_puni'.dasherize # => "puni-puni" + # + # See ActiveSupport::Inflector.dasherize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:148 + def dasherize; end + + # Removes the rightmost segment from the constant expression in the string. + # + # 'Net::HTTP'.deconstantize # => "Net" + # '::Net::HTTP'.deconstantize # => "::Net" + # 'String'.deconstantize # => "" + # '::String'.deconstantize # => "" + # ''.deconstantize # => "" + # + # See ActiveSupport::Inflector.deconstantize. + # + # See also +demodulize+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:177 + def deconstantize; end + + # Removes the module part from the constant expression in the string. + # + # 'ActiveSupport::Inflector::Inflections'.demodulize # => "Inflections" + # 'Inflections'.demodulize # => "Inflections" + # '::Inflections'.demodulize # => "Inflections" + # ''.demodulize # => '' + # + # See ActiveSupport::Inflector.demodulize. + # + # See also +deconstantize+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:162 + def demodulize; end + + # Converts the first character to lowercase. + # + # 'If they enjoyed The Matrix'.downcase_first # => "if they enjoyed The Matrix" + # 'I'.downcase_first # => "i" + # ''.downcase_first # => "" + # + # See ActiveSupport::Inflector.downcase_first. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:284 + def downcase_first; end + + # Returns the first character. If a limit is supplied, returns a substring + # from the beginning of the string until it reaches the limit value. If the + # given limit is greater than or equal to the string length, returns a copy of self. + # + # str = "hello" + # str.first # => "h" + # str.first(1) # => "h" + # str.first(2) # => "he" + # str.first(0) # => "" + # str.first(6) # => "hello" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:78 + def first(limit = T.unsafe(nil)); end + + # Creates a foreign key name from a class name. + # +separate_class_name_and_id_with_underscore+ sets whether + # the method should put '_' between the name and 'id'. + # + # 'Message'.foreign_key # => "message_id" + # 'Message'.foreign_key(false) # => "messageid" + # 'Admin::Post'.foreign_key # => "post_id" + # + # See ActiveSupport::Inflector.foreign_key. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:297 + def foreign_key(separate_class_name_and_id_with_underscore = T.unsafe(nil)); end + + # Returns a substring from the given position to the end of the string. + # If the position is negative, it is counted from the end of the string. + # + # str = "hello" + # str.from(0) # => "hello" + # str.from(3) # => "lo" + # str.from(-2) # => "lo" + # + # You can mix it with +to+ method and do fun things like: + # + # str = "hello" + # str.from(0).to(-1) # => "hello" + # str.from(1).to(-2) # => "ell" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:46 + def from(position); end + + # Marks a string as trusted safe. It will be inserted into HTML with no + # additional escaping performed. It is your responsibility to ensure that the + # string contains no malicious content. This method is equivalent to the + # +raw+ helper in views. It is recommended that you use +sanitize+ instead of + # this method. It should never be called on user input. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:241 + def html_safe; end + + # Capitalizes the first word, turns underscores into spaces, and (by default) strips a + # trailing '_id' if present. + # Like +titleize+, this is meant for creating pretty output. + # + # The capitalization of the first word can be turned off by setting the + # optional parameter +capitalize+ to false. + # By default, this parameter is true. + # + # The trailing '_id' can be kept by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'employee_salary'.humanize # => "Employee salary" + # 'author_id'.humanize # => "Author" + # 'author_id'.humanize(capitalize: false) # => "author" + # '_id'.humanize # => "Id" + # 'author_id'.humanize(keep_id_suffix: true) # => "Author id" + # + # See ActiveSupport::Inflector.humanize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:262 + def humanize(capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end + + # Returns +true+ if string has utf_8 encoding. + # + # utf_8_str = "some string".encode "UTF-8" + # iso_str = "some string".encode "ISO-8859-1" + # + # utf_8_str.is_utf8? # => true + # iso_str.is_utf8? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:57 + def is_utf8?; end + + # Returns the last character of the string. If a limit is supplied, returns a substring + # from the end of the string until it reaches the limit value (counting backwards). If + # the given limit is greater than or equal to the string length, returns a copy of self. + # + # str = "hello" + # str.last # => "o" + # str.last(1) # => "o" + # str.last(2) # => "lo" + # str.last(0) # => "" + # str.last(6) # => "hello" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:92 + def last(limit = T.unsafe(nil)); end + + # == Multibyte proxy + # + # +mb_chars+ is a multibyte safe proxy for string methods. + # + # It creates and returns an instance of the ActiveSupport::Multibyte::Chars class which + # encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy + # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsulated string. + # + # >> "lj".mb_chars.upcase.to_s + # # => "LJ" + # + # NOTE: Ruby 2.4 and later support native Unicode case mappings: + # + # >> "lj".upcase + # # => "LJ" + # + # == \Method chaining + # + # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows + # method chaining on the result of any of these methods. + # + # name.mb_chars.reverse.length # => 12 + # + # == Interoperability and configuration + # + # The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between + # String and Char work like expected. The bang! methods change the internal string representation in the Chars + # object. Interoperability problems can be resolved easily with a +to_s+ call. + # + # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For + # information about how to change the default Multibyte behavior see ActiveSupport::Multibyte. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:37 + def mb_chars; end + + # Replaces special characters in a string so that it may be used as part of a 'pretty' URL. + # + # If the optional parameter +locale+ is specified, + # the word will be parameterized as a word of that language. + # By default, this parameter is set to nil and it will use + # the configured I18n.locale. + # + # class Person + # def to_param + # "#{id}-#{name.parameterize}" + # end + # end + # + # @person = Person.find(1) + # # => # + # + # <%= link_to(@person.name, person_path) %> + # # => Donald E. Knuth + # + # To preserve the case of the characters in a string, use the +preserve_case+ argument. + # + # class Person + # def to_param + # "#{id}-#{name.parameterize(preserve_case: true)}" + # end + # end + # + # @person = Person.find(1) + # # => # + # + # <%= link_to(@person.name, person_path) %> + # # => Donald E. Knuth + # + # See ActiveSupport::Inflector.parameterize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:215 + def parameterize(separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # If the optional parameter +count+ is specified, + # the singular form will be returned if count == 1. + # For any other value of +count+ the plural will be returned. + # + # If the optional parameter +locale+ is specified, + # the word will be pluralized as a word of that language. + # By default, this parameter is set to :en. + # You must define your own inflection rules for languages other than English. + # + # 'post'.pluralize # => "posts" + # 'octopus'.pluralize # => "octopi" + # 'sheep'.pluralize # => "sheep" + # 'words'.pluralize # => "words" + # 'the blue mailman'.pluralize # => "the blue mailmen" + # 'CamelOctopus'.pluralize # => "CamelOctopi" + # 'apple'.pluralize(1) # => "apple" + # 'apple'.pluralize(2) # => "apples" + # 'ley'.pluralize(:es) # => "leyes" + # 'ley'.pluralize(1, :es) # => "ley" + # + # See ActiveSupport::Inflector.pluralize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:35 + def pluralize(count = T.unsafe(nil), locale = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:165 + def present?; end + + # Returns a new string with all occurrences of the patterns removed. + # str = "foo bar test" + # str.remove(" test") # => "foo bar" + # str.remove(" test", /bar/) # => "foo " + # str # => "foo bar test" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:32 + def remove(*patterns); end + + # Alters the string by removing all occurrences of the patterns. + # str = "foo bar test" + # str.remove!(" test", /bar/) # => "foo " + # str # => "foo " + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:40 + def remove!(*patterns); end + + # +safe_constantize+ tries to find a declared constant with the name specified + # in the string. It returns +nil+ when the name is not in CamelCase + # or is not initialized. + # + # 'Module'.safe_constantize # => Module + # 'Class'.safe_constantize # => Class + # 'blargle'.safe_constantize # => nil + # + # See ActiveSupport::Inflector.safe_constantize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:86 + def safe_constantize; end + + # The reverse of +pluralize+, returns the singular form of a word in a string. + # + # If the optional parameter +locale+ is specified, + # the word will be singularized as a word of that language. + # By default, this parameter is set to :en. + # You must define your own inflection rules for languages other than English. + # + # 'posts'.singularize # => "post" + # 'octopi'.singularize # => "octopus" + # 'sheep'.singularize # => "sheep" + # 'word'.singularize # => "word" + # 'the blue mailmen'.singularize # => "the blue mailman" + # 'CamelOctopi'.singularize # => "CamelOctopus" + # 'leyes'.singularize(:es) # => "ley" + # + # See ActiveSupport::Inflector.singularize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:60 + def singularize(locale = T.unsafe(nil)); end + + # Returns the string, first removing all whitespace on both ends of + # the string, and then changing remaining consecutive whitespace + # groups into one space each. + # + # Note that it handles both ASCII and Unicode whitespace. + # + # %{ Multi-line + # string }.squish # => "Multi-line string" + # " foo bar \n \t boo".squish # => "foo bar boo" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:13 + def squish; end + + # Performs a destructive squish. See String#squish. + # str = " foo bar \n \t boo" + # str.squish! # => "foo bar boo" + # str # => "foo bar boo" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:21 + def squish!; end + + # Creates the name of a table like \Rails does for models to table names. This method + # uses the +pluralize+ method on the last word in the string. + # + # 'RawScaledScorer'.tableize # => "raw_scaled_scorers" + # 'ham_and_egg'.tableize # => "ham_and_eggs" + # 'fancyCategory'.tableize # => "fancy_categories" + # + # See ActiveSupport::Inflector.tableize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:227 + def tableize; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:129 + def titlecase(keep_id_suffix: T.unsafe(nil)); end + + # Capitalizes all the words and replaces some characters in the string to create + # a nicer looking title. +titleize+ is meant for creating pretty output. It is not + # used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'man from the boondocks'.titleize # => "Man From The Boondocks" + # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" + # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" + # + # See ActiveSupport::Inflector.titleize. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:126 + def titleize(keep_id_suffix: T.unsafe(nil)); end + + # Returns a substring from the beginning of the string to the given position. + # If the position is negative, it is counted from the end of the string. + # + # str = "hello" + # str.to(0) # => "h" + # str.to(3) # => "hell" + # str.to(-2) # => "hell" + # + # You can mix it with +from+ method and do fun things like: + # + # str = "hello" + # str.from(0).to(-1) # => "hello" + # str.from(1).to(-2) # => "ell" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/access.rb:63 + def to(position); end + + # Converts a string to a Date value. + # + # "1-1-2012".to_date # => Sun, 01 Jan 2012 + # "01/01/2012".to_date # => Sun, 01 Jan 2012 + # "2012-12-13".to_date # => Thu, 13 Dec 2012 + # "12/13/2012".to_date # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:47 + def to_date; end + + # Converts a string to a DateTime value. + # + # "1-1-2012".to_datetime # => Sun, 01 Jan 2012 00:00:00 +0000 + # "01/01/2012 23:59:59".to_datetime # => Sun, 01 Jan 2012 23:59:59 +0000 + # "2012-12-13 12:50".to_datetime # => Thu, 13 Dec 2012 12:50:00 +0000 + # "12/13/2012".to_datetime # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:57 + def to_datetime; end + + # Converts a string to a Time value. + # The +form+ can be either +:utc+ or +:local+ (default +:local+). + # + # The time is parsed using Time.parse method. + # If +form+ is +:local+, then the time is in the system timezone. + # If the date part is missing then the current date is used and if + # the time part is missing then it is assumed to be 00:00:00. + # + # "13-12-2012".to_time # => 2012-12-13 00:00:00 +0100 + # "06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13 06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13T06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13T06:12".to_time(:utc) # => 2012-12-13 06:12:00 UTC + # "12/13/2012".to_time # => ArgumentError: argument out of range + # "1604326192".to_time # => ArgumentError: argument out of range + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/conversions.rb:22 + def to_time(form = T.unsafe(nil)); end + + # Truncates a given +text+ to length truncate_to if +text+ is longer than truncate_to: + # + # 'Once upon a time in a world far far away'.truncate(27) + # # => "Once upon a time in a wo..." + # + # Pass a string or regexp :separator to truncate +text+ at a natural break: + # + # 'Once upon a time in a world far far away'.truncate(27, separator: ' ') + # # => "Once upon a time in a..." + # + # 'Once upon a time in a world far far away'.truncate(27, separator: /\s/) + # # => "Once upon a time in a..." + # + # The last characters will be replaced with the :omission string (defaults to "..."). + # The total length will not exceed truncate_to unless both +text+ and :omission + # are longer than truncate_to: + # + # 'And they found that many people were sleeping better.'.truncate(25, omission: '... (continued)') + # # => "And they f... (continued)" + # + # 'And they found that many people were sleeping better.'.truncate(4, omission: '... (continued)') + # # => "... (continued)" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:70 + def truncate(truncate_to, options = T.unsafe(nil)); end + + # Truncates +text+ to at most truncate_to bytes in length without + # breaking string encoding by splitting multibyte characters or breaking + # grapheme clusters ("perceptual characters") by truncating at combining + # characters. + # + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".size + # # => 20 + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".bytesize + # # => 80 + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".truncate_bytes(20) + # # => "🔪🔪🔪🔪…" + # + # The truncated text ends with the :omission string, defaulting + # to "…", for a total length not exceeding truncate_to. + # + # Raises +ArgumentError+ when the bytesize of :omission exceeds truncate_to. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:103 + def truncate_bytes(truncate_to, omission: T.unsafe(nil)); end + + # Truncates a given +text+ after a given number of words (words_count): + # + # 'Once upon a time in a world far far away'.truncate_words(4) + # # => "Once upon a time..." + # + # Pass a string or regexp :separator to specify a different separator of words: + # + # 'Once
    upon
    a
    time
    in
    a
    world'.truncate_words(5, separator: '
    ') + # # => "Once
    upon
    a
    time
    in..." + # + # The last characters will be replaced with the :omission string (defaults to "..."): + # + # 'And they found that many people were sleeping better.'.truncate_words(5, omission: '... (continued)') + # # => "And they found that many... (continued)" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:144 + def truncate_words(words_count, options = T.unsafe(nil)); end + + # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string. + # + # +underscore+ will also change '::' to '/' to convert namespaces to paths. + # + # 'ActiveModel'.underscore # => "active_model" + # 'ActiveModel::Errors'.underscore # => "active_model/errors" + # + # See ActiveSupport::Inflector.underscore. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:139 + def underscore; end + + # Converts the first character to uppercase. + # + # 'what a Lovely Day'.upcase_first # => "What a Lovely Day" + # 'w'.upcase_first # => "W" + # ''.upcase_first # => "" + # + # See ActiveSupport::Inflector.upcase_first. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:273 + def upcase_first; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:136 +String::BLANK_RE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:137 +String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:74 +class Struct + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:75 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:123 +class Symbol + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:105 + def as_json(options = T.unsafe(nil)); end + + # A Symbol is blank if it's empty: + # + # :''.blank? # => true + # :symbol.blank? # => false + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:128 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:130 + def present?; end +end + +class Thread + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:7 + def active_support_execution_state; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:7 + def active_support_execution_state=(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/thread/backtrace/location.rb:3 +class Thread::Backtrace::Location + # pkg:gem/activesupport#lib/active_support/core_ext/thread/backtrace/location.rb:4 + def spot(ex); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:186 +class Time + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:302 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:312 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:342 + def <=>(other); end + + # Duck-types as a Time-like class. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/acts_like.rb:7 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days + # according to the proleptic Gregorian calendar. The +options+ parameter + # takes a hash with any of these keys: :years, :months, + # :weeks, :days, :hours, :minutes, + # :seconds. + # + # Time.new(2015, 8, 1, 14, 35, 0).advance(seconds: 1) # => 2015-08-01 14:35:01 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(minutes: 1) # => 2015-08-01 14:36:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(hours: 1) # => 2015-08-01 15:35:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(days: 1) # => 2015-08-02 14:35:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(weeks: 1) # => 2015-08-08 14:35:00 -0700 + # + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:197 + def advance(options); end + + # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:224 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:201 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:240 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:267 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:283 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:261 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:277 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:292 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:248 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:250 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:239 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:249 + def at_noon; end + + # Returns a new Time representing the start of the day (0:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:235 + def beginning_of_day; end + + # Returns a new Time representing the start of the hour (x:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:264 + def beginning_of_hour; end + + # Returns a new Time representing the start of the minute (x:xx:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:280 + def beginning_of_minute; end + + # No Time is blank: + # + # Time.now.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:192 + def blank?; end + + # Returns a new Time where one or more of the elements have been changed according + # to the +options+ parameter. The time options (:hour, :min, + # :sec, :usec, :nsec) reset cascadingly, so if only + # the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour + # and minute is passed, then sec, usec, and nsec is set to 0. The +options+ parameter + # takes a hash with any of these keys: :year, :month, :day, + # :hour, :min, :sec, :usec, :nsec, + # :offset. Pass either :usec or :nsec, not both. + # + # Time.new(2012, 8, 29, 22, 35, 0).change(day: 1) # => Time.new(2012, 8, 1, 22, 35, 0) + # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => Time.new(1981, 8, 1, 22, 35, 0) + # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => Time.new(1981, 8, 29, 0, 0, 0) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:126 + def change(options); end + + # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances + # can be chronologically compared with a Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:326 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:341 + def compare_without_coercion(_arg0); end + + # Returns a new Time representing the end of the day, 23:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:253 + def end_of_day; end + + # Returns a new Time representing the end of the hour, x:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:270 + def end_of_hour; end + + # Returns a new Time representing the end of the minute, x:xx:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:286 + def end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:352 + def eql?(other); end + + # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances + # can be eql? to an equivalent Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:346 + def eql_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:351 + def eql_without_coercion(_arg0); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # Time.local(2000).formatted_offset # => "-06:00" + # Time.local(2000).formatted_offset(false) # => "-0600" + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:69 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:232 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:246 + def midday; end + + # Returns a new Time representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:243 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:238 + def midnight; end + + # Time#- can also be used to determine the number of seconds between two Time instances. + # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances + # are coerced into values that Time#- will recognize + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:317 + def minus_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:304 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:321 + def minus_without_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:311 + def minus_without_duration(_arg0); end + + # Returns a new time the specified number of days in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:360 + def next_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:370 + def next_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:380 + def next_year(years = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:247 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:294 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:301 + def plus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:196 + def present?; end + + # Returns a new time the specified number of days ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:355 + def prev_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:365 + def prev_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:375 + def prev_year(years = T.unsafe(nil)); end + + # Aliased to +xmlschema+ for compatibility with +DateTime+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:74 + def rfc3339(*_arg0); end + + # Returns the fraction of a second as a +Rational+ + # + # Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:110 + def sec_fraction; end + + # Returns the number of seconds since 00:00:00. + # + # Time.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0.0 + # Time.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296.0 + # Time.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399.0 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:94 + def seconds_since_midnight; end + + # Returns the number of seconds until 23:59:59. + # + # Time.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 + # Time.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 + # Time.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:103 + def seconds_until_end_of_day; end + + # Returns a new Time representing the time a number of seconds since the instance time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:229 + def since(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:62 + def to_formatted_s(format = T.unsafe(nil)); end + + # Converts to a formatted string. See DATE_FORMATS for built-in formats. + # + # This method is aliased to to_formatted_s. + # + # time = Time.now # => 2007-01-18 06:10:17 -06:00 + # + # time.to_fs(:time) # => "06:10" + # time.to_formatted_s(:time) # => "06:10" + # + # time.to_fs(:db) # => "2007-01-18 06:10:17" + # time.to_fs(:number) # => "20070118061017" + # time.to_fs(:short) # => "18 Jan 06:10" + # time.to_fs(:long) # => "January 18, 2007 06:10" + # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" + # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" + # + # == Adding your own time formats to +to_fs+ + # You can add your own formats to the Time::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a time argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:55 + def to_fs(format = T.unsafe(nil)); end + + class << self + # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:19 + def ===(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:61 + def at(time_or_number, *args, **); end + + # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime + # instances can be used when called with a single argument + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:46 + def at_with_coercion(time_or_number, *args, **); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:60 + def at_without_coercion(time, subsec = T.unsafe(nil), unit = T.unsafe(nil), in: T.unsafe(nil)); end + + # Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:40 + def current; end + + # Returns the number of days in the given month. + # If no year is specified, it will use the current year. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:25 + def days_in_month(month, year = T.unsafe(nil)); end + + # Returns the number of days in the given year. + # If no year is specified, it will use the current year. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:35 + def days_in_year(year = T.unsafe(nil)); end + + # Returns a TimeZone instance matching the time zone provided. + # Accepts the time zone in any format supported by Time.zone=. + # Returns +nil+ for invalid time zones. + # + # Time.find_zone "America/New_York" # => # + # Time.find_zone "NOT-A-TIMEZONE" # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:93 + def find_zone(time_zone); end + + # Returns a TimeZone instance matching the time zone provided. + # Accepts the time zone in any format supported by Time.zone=. + # Raises an +ArgumentError+ for invalid time zones. + # + # Time.find_zone! "America/New_York" # => # + # Time.find_zone! "EST" # => # + # Time.find_zone! -5.hours # => # + # Time.find_zone! nil # => nil + # Time.find_zone! false # => false + # Time.find_zone! "NOT-A-TIMEZONE" # => ArgumentError: Invalid Timezone: NOT-A-TIMEZONE + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:81 + def find_zone!(time_zone); end + + # Creates a +Time+ instance from an RFC 3339 string. + # + # Time.rfc3339('1999-12-31T14:00:00-10:00') # => 2000-01-01 00:00:00 -1000 + # + # If the time or offset components are missing then an +ArgumentError+ will be raised. + # + # Time.rfc3339('1999-12-31') # => ArgumentError: invalid date + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:72 + def rfc3339(str); end + + # Allows override of Time.zone locally inside supplied block; + # resets Time.zone to existing value when done. + # + # class ApplicationController < ActionController::Base + # around_action :set_time_zone + # + # private + # def set_time_zone + # Time.use_zone(current_user.timezone) { yield } + # end + # end + # + # NOTE: This won't affect any ActiveSupport::TimeWithZone + # objects that have already been created, e.g. any model timestamp + # attributes that have been read before the block will remain in + # the application's default timezone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:61 + def use_zone(time_zone); end + + # Returns the TimeZone for the current request, if this has been set (via Time.zone=). + # If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:14 + def zone; end + + # Sets Time.zone to a TimeZone object for the current request/thread. + # + # This method accepts any of the following: + # + # * A \Rails TimeZone object. + # * An identifier for a \Rails TimeZone object (e.g., "Eastern \Time (US & Canada)", -5.hours). + # * A +TZInfo::Timezone+ object. + # * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York"). + # + # Here's an example of how you might set Time.zone on a per request basis and reset it when the request is done. + # current_user.time_zone just needs to return a string identifying the user's preferred time zone: + # + # class ApplicationController < ActionController::Base + # around_action :set_time_zone + # + # def set_time_zone + # if logged_in? + # Time.use_zone(current_user.time_zone) { yield } + # else + # yield + # end + # end + # end + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:41 + def zone=(time_zone); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 + def zone_default; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 + def zone_default=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:15 +Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:8 +Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:80 +class TrueClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:81 + def as_json(options = T.unsafe(nil)); end + + # +true+ is not blank: + # + # true.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:86 + def blank?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:90 + def present?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:33 + def to_param; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:230 +class URI::Generic + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:231 + def as_json(options = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/ast@2.4.3.rbi b/sorbet/rbi/gems/ast@2.4.3.rbi new file mode 100644 index 0000000..e946b00 --- /dev/null +++ b/sorbet/rbi/gems/ast@2.4.3.rbi @@ -0,0 +1,550 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ast` gem. +# Please instead update this file by running `bin/tapioca gem ast`. + + +# {AST} is a library for manipulating abstract syntax trees. +# +# It embraces immutability; each AST node is inherently frozen at +# creation, and updating a child node requires recreating that node +# and its every parent, recursively. +# This is a design choice. It does create some pressure on +# garbage collector, but completely eliminates all concurrency +# and aliasing problems. +# +# See also {AST::Node}, {AST::Processor::Mixin} and {AST::Sexp} for +# additional recommendations and design patterns. +# +# pkg:gem/ast#lib/ast.rb:13 +module AST; end + +# Node is an immutable class, instances of which represent abstract +# syntax tree nodes. It combines semantic information (i.e. anything +# that affects the algorithmic properties of a program) with +# meta-information (line numbers or compiler intermediates). +# +# Notes on inheritance +# ==================== +# +# The distinction between semantics and metadata is important. Complete +# semantic information should be contained within just the {#type} and +# {#children} of a Node instance; in other words, if an AST was to be +# stripped of all meta-information, it should remain a valid AST which +# could be successfully processed to yield a result with the same +# algorithmic properties. +# +# Thus, Node should never be inherited in order to define methods which +# affect or return semantic information, such as getters for `class_name`, +# `superclass` and `body` in the case of a hypothetical `ClassNode`. The +# correct solution is to use a generic Node with a {#type} of `:class` +# and three children. See also {Processor} for tips on working with such +# ASTs. +# +# On the other hand, Node can and should be inherited to define +# application-specific metadata (see also {#initialize}) or customize the +# printing format. It is expected that an application would have one or two +# such classes and use them across the entire codebase. +# +# The rationale for this pattern is extensibility and maintainability. +# Unlike static ones, dynamic languages do not require the presence of a +# predefined, rigid structure, nor does it improve dispatch efficiency, +# and while such a structure can certainly be defined, it does not add +# any value but incurs a maintaining cost. +# For example, extending the AST even with a transformation-local +# temporary node type requires making globally visible changes to +# the codebase. +# +# pkg:gem/ast#lib/ast/node.rb:40 +class AST::Node + # Constructs a new instance of Node. + # + # The arguments `type` and `children` are converted with `to_sym` and + # `to_a` respectively. Additionally, the result of converting `children` + # is frozen. While mutating the arguments is generally considered harmful, + # the most common case is to pass an array literal to the constructor. If + # your code does not expect the argument to be frozen, use `#dup`. + # + # The `properties` hash is passed to {#assign_properties}. + # + # pkg:gem/ast#lib/ast/node.rb:72 + def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end + + # pkg:gem/ast#lib/ast/node.rb:172 + def +(array); end + + # pkg:gem/ast#lib/ast/node.rb:181 + def <<(element); end + + # Compares `self` to `other`, possibly converting with `to_ast`. Only + # `type` and `children` are compared; metadata is deliberately ignored. + # + # @return [Boolean] + # + # pkg:gem/ast#lib/ast/node.rb:153 + def ==(other); end + + # Appends `element` to `children` and returns the resulting node. + # + # @return [AST::Node] + # + # pkg:gem/ast#lib/ast/node.rb:177 + def append(element); end + + # Returns the children of this node. + # The returned value is frozen. + # The to_a alias is useful for decomposing nodes concisely. + # For example: + # + # node = s(:gasgn, :$foo, s(:integer, 1)) + # var_name, value = *node + # p var_name # => :$foo + # p value # => (integer 1) + # + # @return [Array] + # + # pkg:gem/ast#lib/ast/node.rb:56 + def children; end + + # pkg:gem/ast#lib/ast/node.rb:118 + def clone; end + + # Concatenates `array` with `children` and returns the resulting node. + # + # @return [AST::Node] + # + # pkg:gem/ast#lib/ast/node.rb:168 + def concat(array); end + + # Enables matching for Node, where type is the first element + # and the children are remaining items. + # + # @return [Array] + # + # pkg:gem/ast#lib/ast/node.rb:253 + def deconstruct; end + + # Nodes are already frozen, so there is no harm in returning the + # current node as opposed to initializing from scratch and freezing + # another one. + # + # @return self + # + # pkg:gem/ast#lib/ast/node.rb:115 + def dup; end + + # Test if other object is equal to + # @param [Object] other + # @return [Boolean] + # + # pkg:gem/ast#lib/ast/node.rb:85 + def eql?(other); end + + # Returns the precomputed hash value for this node + # @return [Integer] + # + # pkg:gem/ast#lib/ast/node.rb:61 + def hash; end + + # Converts `self` to a s-expression ruby string. + # The code return will recreate the node, using the sexp module s() + # + # @param [Integer] indent Base indentation level. + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:211 + def inspect(indent = T.unsafe(nil)); end + + # pkg:gem/ast#lib/ast/node.rb:57 + def to_a; end + + # @return [AST::Node] self + # + # pkg:gem/ast#lib/ast/node.rb:229 + def to_ast; end + + # pkg:gem/ast#lib/ast/node.rb:204 + def to_s(indent = T.unsafe(nil)); end + + # Converts `self` to a pretty-printed s-expression. + # + # @param [Integer] indent Base indentation level. + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:187 + def to_sexp(indent = T.unsafe(nil)); end + + # Converts `self` to an Array where the first element is the type as a Symbol, + # and subsequent elements are the same representation of its children. + # + # @return [Array] + # + # pkg:gem/ast#lib/ast/node.rb:237 + def to_sexp_array; end + + # Returns the type of this node. + # @return [Symbol] + # + # pkg:gem/ast#lib/ast/node.rb:43 + def type; end + + # Returns a new instance of Node where non-nil arguments replace the + # corresponding fields of `self`. + # + # For example, `Node.new(:foo, [ 1, 2 ]).updated(:bar)` would yield + # `(bar 1 2)`, and `Node.new(:foo, [ 1, 2 ]).updated(nil, [])` would + # yield `(foo)`. + # + # If the resulting node would be identical to `self`, does nothing. + # + # @param [Symbol, nil] type + # @param [Array, nil] children + # @param [Hash, nil] properties + # @return [AST::Node] + # + # pkg:gem/ast#lib/ast/node.rb:133 + def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end + + protected + + # By default, each entry in the `properties` hash is assigned to + # an instance variable in this instance of Node. A subclass should define + # attribute readers for such variables. The values passed in the hash + # are not frozen or whitelisted; such behavior can also be implemented + # by subclassing Node and overriding this method. + # + # @return [nil] + # + # pkg:gem/ast#lib/ast/node.rb:98 + def assign_properties(properties); end + + # Returns `@type` with all underscores replaced by dashes. This allows + # to write symbol literals without quotes in Ruby sources and yet have + # nicely looking s-expressions. + # + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:264 + def fancy_type; end + + private + + # pkg:gem/ast#lib/ast/node.rb:107 + def original_dup; end +end + +# This class includes {AST::Processor::Mixin}; however, it is +# deprecated, since the module defines all of the behaviors that +# the processor includes. Any new libraries should use +# {AST::Processor::Mixin} instead of subclassing this. +# +# @deprecated Use {AST::Processor::Mixin} instead. +# +# pkg:gem/ast#lib/ast/processor.rb:8 +class AST::Processor + include ::AST::Processor::Mixin +end + +# The processor module is a module which helps transforming one +# AST into another. In a nutshell, the {#process} method accepts +# a {Node} and dispatches it to a handler corresponding to its +# type, and returns a (possibly) updated variant of the node. +# +# The processor module has a set of associated design patterns. +# They are best explained with a concrete example. Let's define a +# simple arithmetic language and an AST format for it: +# +# Terminals (AST nodes which do not have other AST nodes inside): +# +# * `(integer )`, +# +# Nonterminals (AST nodes with other nodes as children): +# +# * `(add )`, +# * `(multiply )`, +# * `(divide )`, +# * `(negate )`, +# * `(store )`: stores value of `` +# into a variable named ``, +# * `(load )`: loads value of a variable named +# ``, +# * `(each ...)`: computes each of the ``s and +# prints the result. +# +# All AST nodes have the same Ruby class, and therefore they don't +# know how to traverse themselves. (A solution which dynamically +# checks the type of children is possible, but is slow and +# error-prone.) So, a class including the module which knows how +# to traverse the entire tree should be defined. Such classes +# have a handler for each nonterminal node which recursively +# processes children nodes: +# +# require 'ast' +# +# class ArithmeticsProcessor +# include AST::Processor::Mixin +# # This method traverses any binary operators such as (add) +# # or (multiply). +# def process_binary_op(node) +# # Children aren't decomposed automatically; it is +# # suggested to use Ruby multiple assignment expansion, +# # as it is very convenient here. +# left_expr, right_expr = *node +# +# # AST::Node#updated won't change node type if nil is +# # passed as a first argument, which allows to reuse the +# # same handler for multiple node types using `alias' +# # (below). +# node.updated(nil, [ +# process(left_expr), +# process(right_expr) +# ]) +# end +# alias_method :on_add, :process_binary_op +# alias_method :on_multiply, :process_binary_op +# alias_method :on_divide, :process_binary_op +# +# def on_negate(node) +# # It is also possible to use #process_all for more +# # compact code if every child is a Node. +# node.updated(nil, process_all(node)) +# end +# +# def on_store(node) +# expr, variable_name = *node +# +# # Note that variable_name is not a Node and thus isn't +# # passed to #process. +# node.updated(nil, [ +# process(expr), +# variable_name +# ]) +# end +# +# # (load) is effectively a terminal node, and so it does +# # not need an explicit handler, as the following is the +# # default behavior. Essentially, for any nodes that don't +# # have a defined handler, the node remains unchanged. +# def on_load(node) +# nil +# end +# +# def on_each(node) +# node.updated(nil, process_all(node)) +# end +# end +# +# Let's test our ArithmeticsProcessor: +# +# include AST::Sexp +# expr = s(:add, s(:integer, 2), s(:integer, 2)) +# +# p ArithmeticsProcessor.new.process(expr) == expr # => true +# +# As expected, it does not change anything at all. This isn't +# actually very useful, so let's now define a Calculator, which +# will compute the expression values: +# +# # This Processor folds nonterminal nodes and returns an +# # (integer) terminal node. +# class ArithmeticsCalculator < ArithmeticsProcessor +# def compute_op(node) +# # First, node children are processed and then unpacked +# # to local variables. +# nodes = process_all(node) +# +# if nodes.all? { |node| node.type == :integer } +# # If each of those nodes represents a literal, we can +# # fold this node! +# values = nodes.map { |node| node.children.first } +# AST::Node.new(:integer, [ +# yield(values) +# ]) +# else +# # Otherwise, we can just leave the current node in the +# # tree and only update it with processed children +# # nodes, which can be partially folded. +# node.updated(nil, nodes) +# end +# end +# +# def on_add(node) +# compute_op(node) { |left, right| left + right } +# end +# +# def on_multiply(node) +# compute_op(node) { |left, right| left * right } +# end +# end +# +# Let's check: +# +# p ArithmeticsCalculator.new.process(expr) # => (integer 4) +# +# Excellent, the calculator works! Now, a careful reader could +# notice that the ArithmeticsCalculator does not know how to +# divide numbers. What if we pass an expression with division to +# it? +# +# expr_with_division = \ +# s(:add, +# s(:integer, 1), +# s(:divide, +# s(:add, s(:integer, 8), s(:integer, 4)), +# s(:integer, 3))) # 1 + (8 + 4) / 3 +# +# folded_expr_with_division = ArithmeticsCalculator.new.process(expr_with_division) +# p folded_expr_with_division +# # => (add +# # (integer 1) +# # (divide +# # (integer 12) +# # (integer 3))) +# +# As you can see, the expression was folded _partially_: the inner +# `(add)` node which could be computed was folded to +# `(integer 12)`, the `(divide)` node is left as-is because there +# is no computing handler for it, and the root `(add)` node was +# also left as it is because some of its children were not +# literals. +# +# Note that this partial folding is only possible because the +# _data_ format, i.e. the format in which the computed values of +# the nodes are represented, is the same as the AST itself. +# +# Let's extend our ArithmeticsCalculator class further. +# +# class ArithmeticsCalculator +# def on_divide(node) +# compute_op(node) { |left, right| left / right } +# end +# +# def on_negate(node) +# # Note how #compute_op works regardless of the operator +# # arity. +# compute_op(node) { |value| -value } +# end +# end +# +# Now, let's apply our renewed ArithmeticsCalculator to a partial +# result of previous evaluation: +# +# p ArithmeticsCalculator.new.process(expr_with_division) # => (integer 5) +# +# Five! Excellent. This is also pretty much how CRuby 1.8 executed +# its programs. +# +# Now, let's do some automated bug searching. Division by zero is +# an error, right? So if we could detect that someone has divided +# by zero before the program is even run, that could save some +# debugging time. +# +# class DivisionByZeroVerifier < ArithmeticsProcessor +# class VerificationFailure < Exception; end +# +# def on_divide(node) +# # You need to process the children to handle nested divisions +# # such as: +# # (divide +# # (integer 1) +# # (divide (integer 1) (integer 0)) +# left, right = process_all(node) +# +# if right.type == :integer && +# right.children.first == 0 +# raise VerificationFailure, "Ouch! This code divides by zero." +# end +# end +# +# def divides_by_zero?(ast) +# process(ast) +# false +# rescue VerificationFailure +# true +# end +# end +# +# nice_expr = \ +# s(:divide, +# s(:add, s(:integer, 10), s(:integer, 2)), +# s(:integer, 4)) +# +# p DivisionByZeroVerifier.new.divides_by_zero?(nice_expr) +# # => false. Good. +# +# bad_expr = \ +# s(:add, s(:integer, 10), +# s(:divide, s(:integer, 1), s(:integer, 0))) +# +# p DivisionByZeroVerifier.new.divides_by_zero?(bad_expr) +# # => true. WHOOPS. DO NOT RUN THIS. +# +# Of course, this won't detect more complex cases... unless you +# use some partial evaluation before! The possibilites are +# endless. Have fun. +# +# pkg:gem/ast#lib/ast/processor/mixin.rb:240 +module AST::Processor::Mixin + # Default handler. Does nothing. + # + # @param [AST::Node] node + # @return [AST::Node, nil] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:284 + def handler_missing(node); end + + # Dispatches `node`. If a node has type `:foo`, then a handler + # named `on_foo` is invoked with one argument, the `node`; if + # there isn't such a handler, {#handler_missing} is invoked + # with the same argument. + # + # If the handler returns `nil`, `node` is returned; otherwise, + # the return value of the handler is passed along. + # + # @param [AST::Node, nil] node + # @return [AST::Node, nil] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:251 + def process(node); end + + # {#process}es each node from `nodes` and returns an array of + # results. + # + # @param [Array] nodes + # @return [Array] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:274 + def process_all(nodes); end +end + +# This simple module is very useful in the cases where one needs +# to define deeply nested ASTs from Ruby code, for example, in +# tests. It should be used like this: +# +# describe YourLanguage do +# include ::AST::Sexp +# +# it "should correctly parse expressions" do +# YourLanguage.parse("1 + 2 * 3").should == +# s(:add, +# s(:integer, 1), +# s(:multiply, +# s(:integer, 2), +# s(:integer, 3))) +# end +# end +# +# This way the amount of boilerplate code is greatly reduced. +# +# pkg:gem/ast#lib/ast/sexp.rb:20 +module AST::Sexp + # Creates a {Node} with type `type` and children `children`. + # Note that the resulting node is of the type AST::Node and not a + # subclass. + # This would not pose a problem with comparisons, as {Node#==} + # ignores metadata. + # + # pkg:gem/ast#lib/ast/sexp.rb:26 + def s(type, *children); end +end diff --git a/sorbet/rbi/gems/base64@0.3.0.rbi b/sorbet/rbi/gems/base64@0.3.0.rbi new file mode 100644 index 0000000..9995f72 --- /dev/null +++ b/sorbet/rbi/gems/base64@0.3.0.rbi @@ -0,0 +1,545 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `base64` gem. +# Please instead update this file by running `bin/tapioca gem base64`. + + +# \Module \Base64 provides methods for: +# +# - \Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == \Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in the encoded string, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +# +# pkg:gem/base64#lib/base64.rb:184 +module Base64 + private + + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # pkg:gem/base64#lib/base64.rb:247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # pkg:gem/base64#lib/base64.rb:222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # pkg:gem/base64#lib/base64.rb:309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # pkg:gem/base64#lib/base64.rb:282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # pkg:gem/base64#lib/base64.rb:369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # pkg:gem/base64#lib/base64.rb:343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # pkg:gem/base64#lib/base64.rb:247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # pkg:gem/base64#lib/base64.rb:222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # pkg:gem/base64#lib/base64.rb:309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # pkg:gem/base64#lib/base64.rb:282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # pkg:gem/base64#lib/base64.rb:369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # pkg:gem/base64#lib/base64.rb:343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# pkg:gem/base64#lib/base64.rb:186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/builder@3.3.0.rbi b/sorbet/rbi/gems/builder@3.3.0.rbi new file mode 100644 index 0000000..177ba9a --- /dev/null +++ b/sorbet/rbi/gems/builder@3.3.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `builder` gem. +# Please instead update this file by running `bin/tapioca gem builder`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/code_teams@1.3.1.rbi b/sorbet/rbi/gems/code_teams@1.3.1.rbi new file mode 100644 index 0000000..e827d60 --- /dev/null +++ b/sorbet/rbi/gems/code_teams@1.3.1.rbi @@ -0,0 +1,235 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `code_teams` gem. +# Please instead update this file by running `bin/tapioca gem code_teams`. + + +# pkg:gem/code_teams#lib/code_teams/plugin.rb:3 +module CodeTeams + class << self + # pkg:gem/code_teams#lib/code_teams.rb:22 + sig { returns(T::Array[::CodeTeams::Team]) } + def all; end + + # Generally, you should not ever need to do this, because once your ruby process loads, cached content should not change. + # Namely, the YML files that are the source of truth for teams should not change, so we should not need to look at the YMLs again to verify. + # The primary reason this is helpful is for clients of CodeTeams who want to test their code, and each test context has different set of teams + # + # pkg:gem/code_teams#lib/code_teams.rb:67 + sig { void } + def bust_caches!; end + + # pkg:gem/code_teams#lib/code_teams.rb:27 + sig { params(name: ::String).returns(T.nilable(::CodeTeams::Team)) } + def find(name); end + + # pkg:gem/code_teams#lib/code_teams.rb:33 + sig { params(name: ::String).returns(::CodeTeams::Team) } + def find!(name); end + + # pkg:gem/code_teams#lib/code_teams.rb:38 + sig { params(dir: ::String).returns(T::Array[::CodeTeams::Team]) } + def for_directory(dir); end + + # pkg:gem/code_teams#lib/code_teams.rb:59 + sig { params(string: ::String).returns(::String) } + def tag_value_for(string); end + + # pkg:gem/code_teams#lib/code_teams.rb:52 + sig { params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) } + def validation_errors(teams); end + end +end + +# pkg:gem/code_teams#lib/code_teams.rb:15 +class CodeTeams::IncorrectPublicApiUsageError < ::StandardError; end + +# Plugins allow a client to add validation on custom keys in the team YML. +# For now, only a single plugin is allowed to manage validation on a top-level key. +# In the future we can think of allowing plugins to be gracefully merged with each other. +# +# pkg:gem/code_teams#lib/code_teams/plugin.rb:7 +class CodeTeams::Plugin + abstract! + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:16 + sig { params(team: ::CodeTeams::Team).void } + def initialize(team); end + + class << self + # pkg:gem/code_teams#lib/code_teams/plugin.rb:37 + sig { returns(T::Array[T.class_of(CodeTeams::Plugin)]) } + def all_plugins; end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:78 + sig { void } + def bust_caches!; end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:83 + sig { void } + def clear_team_registry!; end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:21 + sig { params(key: ::String).returns(::String) } + def data_accessor_name(key = T.unsafe(nil)); end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:26 + sig { returns(::String) } + def default_data_accessor_name; end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:49 + sig { params(team: ::CodeTeams::Team).returns(T.attached_class) } + def for(team); end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:32 + sig { params(base: T.class_of(CodeTeams::Plugin)).void } + def inherited(base); end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:54 + sig { params(team: ::CodeTeams::Team, key: ::String).returns(::String) } + def missing_key_error_message(team, key); end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:44 + sig { params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) } + def validation_errors(teams); end + + private + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:66 + sig { params(team: ::CodeTeams::Team).returns(T.attached_class) } + def register_team(team); end + + # pkg:gem/code_teams#lib/code_teams/plugin.rb:59 + sig { returns(T::Hash[T.nilable(::String), T::Hash[T.class_of(CodeTeams::Plugin), ::CodeTeams::Plugin]]) } + def registry; end + end +end + +# pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:4 +module CodeTeams::Plugins; end + +# pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:5 +class CodeTeams::Plugins::Identity < ::CodeTeams::Plugin + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:12 + sig { returns(::CodeTeams::Plugins::Identity::IdentityStruct) } + def identity; end + + class << self + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:19 + sig { override.params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) } + def validation_errors(teams); end + end +end + +# pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 +class CodeTeams::Plugins::Identity::IdentityStruct < ::Struct + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def name; end + + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def name=(_); end + + class << self + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def [](*_arg0); end + + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def inspect; end + + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def keyword_init?; end + + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def members; end + + # pkg:gem/code_teams#lib/code_teams/plugins/identity.rb:9 + def new(*_arg0); end + end +end + +# pkg:gem/code_teams#lib/code_teams.rb:74 +class CodeTeams::Team + # pkg:gem/code_teams#lib/code_teams.rb:118 + sig { params(config_yml: T.nilable(::String), raw_hash: T::Hash[::String, T.untyped]).void } + def initialize(config_yml:, raw_hash:); end + + # pkg:gem/code_teams#lib/code_teams.rb:134 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/code_teams#lib/code_teams.rb:110 + sig { returns(T.nilable(::String)) } + def config_yml; end + + # pkg:gem/code_teams#lib/code_teams.rb:142 + def eql?(*args, **, &blk); end + + # pkg:gem/code_teams#lib/code_teams.rb:145 + sig { returns(::Integer) } + def hash; end + + # pkg:gem/code_teams#lib/code_teams.rb:124 + sig { returns(::String) } + def name; end + + # pkg:gem/code_teams#lib/code_teams.rb:107 + sig { returns(T::Hash[::String, T.untyped]) } + def raw_hash; end + + # pkg:gem/code_teams#lib/code_teams.rb:129 + sig { returns(::String) } + def to_tag; end + + class << self + # pkg:gem/code_teams#lib/code_teams.rb:88 + sig { params(raw_hash: T::Hash[::String, T.untyped]).returns(::CodeTeams::Team) } + def from_hash(raw_hash); end + + # pkg:gem/code_teams#lib/code_teams.rb:78 + sig { params(config_yml: ::String).returns(::CodeTeams::Team) } + def from_yml(config_yml); end + + # pkg:gem/code_teams#lib/code_teams.rb:96 + sig { void } + def register_plugins; end + end +end + +# pkg:gem/code_teams#lib/code_teams.rb:16 +class CodeTeams::TeamNotFoundError < ::StandardError; end + +# pkg:gem/code_teams#lib/code_teams.rb:18 +CodeTeams::UNKNOWN_TEAM_STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/code_teams#lib/code_teams/utils.rb:6 +module CodeTeams::Utils + private + + # Recursively converts symbol keys to strings. Top-level input should be a Hash. + # + # pkg:gem/code_teams#lib/code_teams/utils.rb:27 + sig { params(value: T.untyped).returns(T.untyped) } + def deep_stringify_keys(value); end + + # pkg:gem/code_teams#lib/code_teams/utils.rb:21 + sig { params(string: ::String).returns(::String) } + def demodulize(string); end + + # pkg:gem/code_teams#lib/code_teams/utils.rb:12 + sig { params(string: ::String).returns(::String) } + def underscore(string); end + + class << self + # Recursively converts symbol keys to strings. Top-level input should be a Hash. + # + # pkg:gem/code_teams#lib/code_teams/utils.rb:27 + def deep_stringify_keys(value); end + + # pkg:gem/code_teams#lib/code_teams/utils.rb:21 + def demodulize(string); end + + # pkg:gem/code_teams#lib/code_teams/utils.rb:12 + def underscore(string); end + end +end diff --git a/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi new file mode 100644 index 0000000..525961f --- /dev/null +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi @@ -0,0 +1,10576 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `concurrent-ruby` gem. +# Please instead update this file by running `bin/tapioca gem concurrent-ruby`. + + +# {include:file:README.md} +# load native parts first +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/constants.rb:1 +module Concurrent + extend ::Concurrent::Utility::EngineDetector + extend ::Concurrent::Utility::NativeExtensionLoader + extend ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Deprecation + + private + + # Abort a currently running transaction - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:139 + def abort_transaction; end + + # Run a block that reads and writes `TVar`s as a single atomic transaction. + # With respect to the value of `TVar` objects, the transaction is atomic, in + # that it either happens or it does not, consistent, in that the `TVar` + # objects involved will never enter an illegal state, and isolated, in that + # transactions never interfere with each other. You may recognise these + # properties from database transactions. + # + # There are some very important and unusual semantics that you must be aware of: + # + # * Most importantly, the block that you pass to atomically may be executed + # more than once. In most cases your code should be free of + # side-effects, except for via TVar. + # + # * If an exception escapes an atomically block it will abort the transaction. + # + # * It is undefined behaviour to use callcc or Fiber with atomically. + # + # * If you create a new thread within an atomically, it will not be part of + # the transaction. Creating a thread counts as a side-effect. + # + # Transactions within transactions are flattened to a single transaction. + # + # @example + # a = new TVar(100_000) + # b = new TVar(100) + # + # Concurrent::atomically do + # a.value -= 10 + # b.value += 10 + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:82 + def atomically; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:56 + def call_dataflow(method, executor, *inputs, &block); end + + # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. + # {include:file:docs-source/dataflow.md} + # + # @param [Future] inputs zero or more `Future` operations that this dataflow depends upon + # + # @yield The operation to perform once all the dependencies are met + # @yieldparam [Future] inputs each of the `Future` inputs to the dataflow + # @yieldreturn [Object] the result of the block operation + # + # @return [Object] the result of all the operations + # + # @raise [ArgumentError] if no block is given + # @raise [ArgumentError] if any of the inputs are not `IVar`s + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:34 + def dataflow(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:44 + def dataflow!(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:39 + def dataflow_with(executor, *inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:49 + def dataflow_with!(executor, *inputs, &block); end + + # Leave a transaction without committing or aborting - see `Concurrent::atomically`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:144 + def leave_transaction; end + + # @!macro monotonic_get_time + # + # Returns the current time as tracked by the application monotonic clock. + # + # @param [Symbol] unit the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # @!macro monotonic_clock_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/monotonic_time.rb:15 + def monotonic_time(unit = T.unsafe(nil)); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def abort_transaction; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def atomically; end + + # Number of processors cores available for process scheduling. + # This method takes in account the CPU quota if the process is inside a cgroup with a + # dedicated CPU quota (typically Docker). + # Otherwise it returns the same value as #processor_count but as a Float. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [Float] number of available processors + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:194 + def available_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:80 + def call_dataflow(method, executor, *inputs, &block); end + + # The maximum number of processors cores available for process scheduling. + # Returns `nil` if there is no enforced limit, or a `Float` if the + # process is inside a cgroup with a dedicated CPU quota (typically Docker). + # + # Note that nothing prevents setting a CPU quota higher than the actual number of + # cores on the system. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [nil, Float] Maximum number of available processors as set by a cgroup CPU quota, or nil if none set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:209 + def cpu_quota; end + + # The CPU shares requested by the process. For performance reasons the calculated + # value will be memoized on the first call. + # + # @return [Float, nil] CPU shares requested by the process, or nil if not set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:217 + def cpu_shares; end + + # Create a simple logger with provided level and output. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:38 + def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Create a stdlib logger with provided level and output. + # If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+. + # @deprecated + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:73 + def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:37 + def dataflow(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:47 + def dataflow!(*inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:42 + def dataflow_with(executor, *inputs, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:52 + def dataflow_with!(executor, *inputs, &block); end + + # Disables AtExit handlers including pool auto-termination handlers. + # When disabled it will be the application programmer's responsibility + # to ensure that the handlers are shutdown properly prior to application + # exit by calling `AtExit.run` method. + # + # @note this option should be needed only because of `at_exit` ordering + # issues which may arise when running some of the testing frameworks. + # E.g. Minitest's test-suite runs itself in `at_exit` callback which + # executes after the pools are already terminated. Then auto termination + # needs to be disabled and called manually after test-suite ends. + # @note This method should *never* be called + # from within a gem. It should *only* be used from within the main + # application and even then it should be used only when necessary. + # @deprecated Has no effect since it is no longer needed, see https://github.com/ruby-concurrency/concurrent-ruby/pull/841. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:48 + def disable_at_exit_handlers!; end + + # General access point to global executors. + # @param [Symbol, Executor] executor_identifier symbols: + # - :fast - {Concurrent.global_fast_executor} + # - :io - {Concurrent.global_io_executor} + # - :immediate - {Concurrent.global_immediate_executor} + # @return [Executor] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:83 + def executor(executor_identifier); end + + # Global thread pool optimized for short, fast *operations*. + # + # @return [ThreadPoolExecutor] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:55 + def global_fast_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:66 + def global_immediate_executor; end + + # Global thread pool optimized for long, blocking (IO) *tasks*. + # + # @return [ThreadPoolExecutor] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:62 + def global_io_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:114 + def global_logger; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:118 + def global_logger=(value); end + + # Global thread pool user for global *timers*. + # + # @return [Concurrent::TimerSet] the thread pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:73 + def global_timer_set; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:148 + def leave_transaction; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/monotonic_time.rb:18 + def monotonic_time(unit = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:7 + def mutex_owned_per_thread?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:87 + def new_fast_executor(opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:98 + def new_io_executor(opts = T.unsafe(nil)); end + + # Number of physical processor cores on the current system. For performance + # reasons the calculated value will be memoized on the first call. + # + # On Windows the Win32 API will be queried for the `NumberOfCores from + # Win32_Processor`. This will return the total number "of cores for the + # current instance of the processor." On Unix-like operating systems either + # the `hwprefs` or `sysctl` utility will be called in a subshell and the + # returned value will be used. In the rare case where none of these methods + # work or an exception is raised the function will simply return 1. + # + # @return [Integer] number physical processor cores on the current system + # + # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb + # + # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx + # @see http://www.unix.com/man-page/osx/1/HWPREFS/ + # @see http://linux.die.net/man/8/sysctl + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:181 + def physical_processor_count; end + + # Number of processors seen by the OS and used for process scheduling. For + # performance reasons the calculated value will be memoized on the first + # call. + # + # When running under JRuby the Java runtime call + # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According + # to the Java documentation this "value may change during a particular + # invocation of the virtual machine... [applications] should therefore + # occasionally poll this property." We still memoize this value once under + # JRuby. + # + # Otherwise Ruby's Etc.nprocessors will be used. + # + # @return [Integer] number of processors seen by the OS or Java runtime + # + # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:160 + def processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:142 + def processor_counter; end + + # Use logger created by #create_simple_logger to log concurrent-ruby messages. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:66 + def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + + # Use logger created by #create_stdlib_logger to log concurrent-ruby messages. + # @deprecated + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:101 + def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:38 +class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:44 + def initialize; end + + # @!macro exchanger_method_do_exchange + # + # Waits for another thread to arrive at this exchange point (unless the + # current thread is interrupted), and then transfers the given object to + # it, receiving its object in return. The timeout value indicates the + # approximate number of seconds the method should block while waiting + # for the exchange. When the timeout value is `nil` the method will + # block indefinitely. + # + # @param [Object] value the value to exchange with another thread + # @param [Numeric, nil] timeout in seconds, `nil` blocks indefinitely + # + # @!macro exchanger_method_exchange + # + # In some edge cases when a `timeout` is given a return value of `nil` may be + # ambiguous. Specifically, if `nil` is a valid value in the exchange it will + # be impossible to tell whether `nil` is the actual return value or if it + # signifies timeout. When `nil` is a valid value in the exchange consider + # using {#exchange!} or {#try_exchange} instead. + # + # @return [Object] the value exchanged by the other thread or `nil` on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:69 + def exchange(value, timeout = T.unsafe(nil)); end + + # @!macro exchanger_method_do_exchange + # @!macro exchanger_method_exchange_bang + # + # On timeout a {Concurrent::TimeoutError} exception will be raised. + # + # @return [Object] the value exchanged by the other thread + # @raise [Concurrent::TimeoutError] on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:80 + def exchange!(value, timeout = T.unsafe(nil)); end + + # @!macro exchanger_method_do_exchange + # @!macro exchanger_method_try_exchange + # + # The return value will be a {Concurrent::Maybe} set to `Just` on success or + # `Nothing` on timeout. + # + # @return [Concurrent::Maybe] on success a `Just` maybe will be returned with + # the item exchanged by the other thread as `#value`; on timeout a + # `Nothing` maybe will be returned with {Concurrent::TimeoutError} as `#reason` + # + # @example + # + # exchanger = Concurrent::Exchanger.new + # + # result = exchanger.exchange(:foo, 0.5) + # + # if result.just? + # puts result.value #=> :bar + # else + # puts 'timeout' + # end + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:109 + def try_exchange(value, timeout = T.unsafe(nil)); end + + private + + # @!macro exchanger_method_do_exchange + # + # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:122 + def do_exchange(value, timeout); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:41 +Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object) + +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:10 +class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + include ::Concurrent::Concern::Deprecation + + # Create a new thread pool. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:23 + def initialize(opts = T.unsafe(nil), &block); end + + # @!macro executor_service_method_auto_terminate_setter + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:72 + def auto_terminate=(value); end + + # @!macro executor_service_method_auto_terminate_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:67 + def auto_terminate?; end + + # @!macro executor_service_attr_reader_fallback_policy + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:18 + def fallback_policy; end + + # @!macro executor_service_method_kill + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:42 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:20 + def name; end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:52 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:37 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:62 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:57 + def shuttingdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:32 + def to_s; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:47 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # Returns an action which executes the `fallback_policy` once the queue + # size reaches `max_queue`. The reason for the indirection of an action + # is so that the work can be deferred outside of synchronization. + # + # @param [Array] args the arguments to the task which is being handled. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:85 + def fallback_action(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:126 + def ns_auto_terminate?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:106 + def ns_execute(*args, &task); end + + # @!macro executor_service_method_ns_kill_execution + # + # Callback method called when the executor has been killed. + # The default behavior is to do nothing. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:122 + def ns_kill_execution; end + + # @!macro executor_service_method_ns_shutdown_execution + # + # Callback method called when an orderly shutdown has completed. + # The default behavior is to signal all waiting threads. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:114 + def ns_shutdown_execution; end +end + +# The set of possible fallback policies that may be set at thread pool creation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb:15 +Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array) + +# @!visibility private +# @!macro internal_implementation_note +# +# An abstract implementation of local storage, with sub-classes for +# per-thread and per-fiber locals. +# +# Each execution context (EC, thread or fiber) has a lazily initialized array +# of local variable values. Each time a new local variable is created, we +# allocate an "index" for it. +# +# For example, if the allocated index is 1, that means slot #1 in EVERY EC's +# locals array will be used for the value of that variable. +# +# The good thing about using a per-EC structure to hold values, rather than +# a global, is that no synchronization is needed when reading and writing +# those values (since the structure is only ever accessed by a single +# thread). +# +# Of course, when a local variable is GC'd, 1) we need to recover its index +# for use by other new local variables (otherwise the locals arrays could +# get bigger and bigger with time), and 2) we need to null out all the +# references held in the now-unused slots (both to avoid blocking GC of those +# objects, and also to prevent "stale" values from being passed on to a new +# local when the index is reused). +# +# Because we need to null out freed slots, we need to keep references to +# ALL the locals arrays, so we can null out the appropriate slots in all of +# them. This is why we need to use a finalizer to clean up the locals array +# when the EC goes out of scope. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:35 +class Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:36 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:89 + def fetch(index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:71 + def free_index(index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:55 + def next_index(local); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:102 + def set(index, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:43 + def synchronize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:48 + def weak_synchronize; end + + private + + # When the local goes out of scope, clean up that slot across all locals currently assigned. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:112 + def local_finalizer(index); end + + # Returns the locals for the current scope, or nil if none exist. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:128 + def locals; end + + # Returns the locals for the current scope, creating them if necessary. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:133 + def locals!; end + + # When a thread/fiber goes out of scope, remove the array from @all_arrays. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:119 + def thread_fiber_finalizer(array_object_id); end +end + +# `Agent` is inspired by Clojure's [agent](http://clojure.org/agents) +# function. An agent is a shared, mutable variable providing independent, +# uncoordinated, *asynchronous* change of individual values. Best used when +# the value will undergo frequent, complex updates. Suitable when the result +# of an update does not need to be known immediately. `Agent` is (mostly) +# functionally equivalent to Clojure's agent, except where the runtime +# prevents parity. +# +# Agents are reactive, not autonomous - there is no imperative message loop +# and no blocking receive. The state of an Agent should be itself immutable +# and the `#value` of an Agent is always immediately available for reading by +# any thread without any messages, i.e. observation does not require +# cooperation or coordination. +# +# Agent action dispatches are made using the various `#send` methods. These +# methods always return immediately. At some point later, in another thread, +# the following will happen: +# +# 1. The given `action` will be applied to the state of the Agent and the +# `args`, if any were supplied. +# 2. The return value of `action` will be passed to the validator lambda, +# if one has been set on the Agent. +# 3. If the validator succeeds or if no validator was given, the return value +# of the given `action` will become the new `#value` of the Agent. See +# `#initialize` for details. +# 4. If any observers were added to the Agent, they will be notified. See +# `#add_observer` for details. +# 5. If during the `action` execution any other dispatches are made (directly +# or indirectly), they will be held until after the `#value` of the Agent +# has been changed. +# +# If any exceptions are thrown by an action function, no nested dispatches +# will occur, and the exception will be cached in the Agent itself. When an +# Agent has errors cached, any subsequent interactions will immediately throw +# an exception, until the agent's errors are cleared. Agent errors can be +# examined with `#error` and the agent restarted with `#restart`. +# +# The actions of all Agents get interleaved amongst threads in a thread pool. +# At any point in time, at most one action for each Agent is being executed. +# Actions dispatched to an agent from another single agent or thread will +# occur in the order they were sent, potentially interleaved with actions +# dispatched to the same agent from other sources. The `#send` method should +# be used for actions that are CPU limited, while the `#send_off` method is +# appropriate for actions that may block on IO. +# +# Unlike in Clojure, `Agent` cannot participate in `Concurrent::TVar` transactions. +# +# ## Example +# +# ``` +# def next_fibonacci(set = nil) +# return [0, 1] if set.nil? +# set + [set[-2..-1].reduce{|sum,x| sum + x }] +# end +# +# # create an agent with an initial value +# agent = Concurrent::Agent.new(next_fibonacci) +# +# # send a few update requests +# 5.times do +# agent.send{|set| next_fibonacci(set) } +# end +# +# # wait for them to complete +# agent.await +# +# # get the current value +# agent.value #=> [0, 1, 1, 2, 3, 5, 8] +# ``` +# +# ## Observation +# +# Agents support observers through the {Concurrent::Observable} mixin module. +# Notification of observers occurs every time an action dispatch returns and +# the new value is successfully validated. Observation will *not* occur if the +# action raises an exception, if validation fails, or when a {#restart} occurs. +# +# When notified the observer will receive three arguments: `time`, `old_value`, +# and `new_value`. The `time` argument is the time at which the value change +# occurred. The `old_value` is the value of the Agent when the action began +# processing. The `new_value` is the value to which the Agent was set when the +# action completed. Note that `old_value` and `new_value` may be the same. +# This is not an error. It simply means that the action returned the same +# value. +# +# ## Nested Actions +# +# It is possible for an Agent action to post further actions back to itself. +# The nested actions will be enqueued normally then processed *after* the +# outer action completes, in the order they were sent, possibly interleaved +# with action dispatches from other threads. Nested actions never deadlock +# with one another and a failure in a nested action will never affect the +# outer action. +# +# Nested actions can be called using the Agent reference from the enclosing +# scope or by passing the reference in as a "send" argument. Nested actions +# cannot be post using `self` from within the action block/proc/lambda; `self` +# in this context will not reference the Agent. The preferred method for +# dispatching nested actions is to pass the Agent as an argument. This allows +# Ruby to more effectively manage the closing scope. +# +# Prefer this: +# +# ``` +# agent = Concurrent::Agent.new(0) +# agent.send(agent) do |value, this| +# this.send {|v| v + 42 } +# 3.14 +# end +# agent.value #=> 45.14 +# ``` +# +# Over this: +# +# ``` +# agent = Concurrent::Agent.new(0) +# agent.send do |value| +# agent.send {|v| v + 42 } +# 3.14 +# end +# ``` +# +# @!macro agent_await_warning +# +# **NOTE** Never, *under any circumstances*, call any of the "await" methods +# ({#await}, {#await_for}, {#await_for!}, and {#wait}) from within an action +# block/proc/lambda. The call will block the Agent and will always fail. +# Calling either {#await} or {#wait} (with a timeout of `nil`) will +# hopelessly deadlock the Agent with no possibility of recovery. +# +# @!macro thread_safe_variable_comparison +# +# @see http://clojure.org/Agents Clojure Agents +# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:145 +class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Observable + + # Create a new `Agent` with the given initial value and options. + # + # The `:validator` option must be `nil` or a side-effect free proc/lambda + # which takes one argument. On any intended value change the validator, if + # provided, will be called. If the new value is invalid the validator should + # return `false` or raise an error. + # + # The `:error_handler` option must be `nil` or a proc/lambda which takes two + # arguments. When an action raises an error or validation fails, either by + # returning false or raising an error, the error handler will be called. The + # arguments to the error handler will be a reference to the agent itself and + # the error object which was raised. + # + # The `:error_mode` may be either `:continue` (the default if an error + # handler is given) or `:fail` (the default if error handler nil or not + # given). + # + # If an action being run by the agent throws an error or doesn't pass + # validation the error handler, if present, will be called. After the + # handler executes if the error mode is `:continue` the Agent will continue + # as if neither the action that caused the error nor the error itself ever + # happened. + # + # If the mode is `:fail` the Agent will become {#failed?} and will stop + # accepting new action dispatches. Any previously queued actions will be + # held until {#restart} is called. The {#value} method will still work, + # returning the value of the Agent before the error. + # + # @param [Object] initial the initial value + # @param [Hash] opts the configuration options + # + # @option opts [Symbol] :error_mode either `:continue` or `:fail` + # @option opts [nil, Proc] :error_handler the (optional) error handler + # @option opts [nil, Proc] :validator the (optional) validation procedure + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:220 + def initialize(initial, opts = T.unsafe(nil)); end + + # Dispatches an action to the Agent and returns immediately. Subsequently, + # in a thread from a thread pool, the {#value} will be set to the return + # value of the action. Appropriate for actions that may block on IO. + # + # @param [Proc] action the action dispatch to be enqueued + # @return [Concurrent::Agent] self + # @see #send_off + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:331 + def <<(action); end + + # Blocks the current thread (indefinitely!) until all actions dispatched + # thus far, from this thread or nested by the Agent, have occurred. Will + # block when {#failed?}. Will never return if a failed Agent is {#restart} + # with `:clear_actions` true. + # + # Returns a reference to `self` to support method chaining: + # + # ``` + # current_value = agent.await.value + # ``` + # + # @return [Boolean] self + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:350 + def await; end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:363 + def await_for(timeout); end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout + # + # @raise [Concurrent::TimeoutError] when timeout is reached + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:377 + def await_for!(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:233 + def deref; end + + # When {#failed?} and {#error_mode} is `:fail`, returns the error object + # which caused the failure, else `nil`. When {#error_mode} is `:continue` + # will *always* return `nil`. + # + # @return [nil, Error] the error which caused the failure when {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:240 + def error; end + + # The error mode this Agent is operating in. See {#initialize} for details. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:184 + def error_mode; end + + # Is the Agent in a failed state? + # + # @see #restart + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:402 + def failed?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:298 + def post(*args, &action); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:244 + def reason; end + + # When an Agent is {#failed?}, changes the Agent {#value} to `new_value` + # then un-fails the Agent so that action dispatches are allowed again. If + # the `:clear_actions` option is give and true, any actions queued on the + # Agent that were being held while it was failed will be discarded, + # otherwise those held actions will proceed. The `new_value` must pass the + # validator if any, or `restart` will raise an exception and the Agent will + # remain failed with its old {#value} and {#error}. Observers, if any, will + # not be notified of the new state. + # + # @param [Object] new_value the new value for the Agent once restarted + # @param [Hash] opts the configuration options + # @option opts [Symbol] :clear_actions true if all enqueued but unprocessed + # actions should be discarded on restart, else false (default: false) + # @return [Boolean] true + # + # @raise [Concurrent:AgentError] when not failed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:424 + def restart(new_value, opts = T.unsafe(nil)); end + + # @!macro agent_send + # + # Dispatches an action to the Agent and returns immediately. Subsequently, + # in a thread from a thread pool, the {#value} will be set to the return + # value of the action. Action dispatches are only allowed when the Agent + # is not {#failed?}. + # + # The action must be a block/proc/lambda which takes 1 or more arguments. + # The first argument is the current {#value} of the Agent. Any arguments + # passed to the send method via the `args` parameter will be passed to the + # action as the remaining arguments. The action must return the new value + # of the Agent. + # + # * {#send} and {#send!} should be used for actions that are CPU limited + # * {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that + # may block on IO + # * {#send_via} and {#send_via!} are used when a specific executor is to + # be used for the action + # + # @param [Array] args zero or more arguments to be passed to + # the action + # @param [Proc] action the action dispatch to be enqueued + # + # @yield [agent, value, *args] process the old value and return the new + # @yieldparam [Object] value the current {#value} of the Agent + # @yieldparam [Array] args zero or more arguments to pass to the + # action + # @yieldreturn [Object] the new value of the Agent + # + # @!macro send_return + # @return [Boolean] true if the action is successfully enqueued, false if + # the Agent is {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:278 + def send(*args, &action); end + + # @!macro agent_send + # + # @!macro send_bang_return_and_raise + # @return [Boolean] true if the action is successfully enqueued + # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:287 + def send!(*args, &action); end + + # @!macro agent_send + # @!macro send_return + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:294 + def send_off(*args, &action); end + + # @!macro agent_send + # @!macro send_bang_return_and_raise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:302 + def send_off!(*args, &action); end + + # @!macro agent_send + # @!macro send_return + # @param [Concurrent::ExecutorService] executor the executor on which the + # action is to be dispatched + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:311 + def send_via(executor, *args, &action); end + + # @!macro agent_send + # @!macro send_bang_return_and_raise + # @param [Concurrent::ExecutorService] executor the executor on which the + # action is to be dispatched + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:319 + def send_via!(executor, *args, &action); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:406 + def stopped?; end + + # The current value (state) of the Agent, irrespective of any pending or + # in-progress actions. The value is always available and is non-blocking. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:229 + def value; end + + # Blocks the current thread until all actions dispatched thus far, from this + # thread or nested by the Agent, have occurred, or the timeout (in seconds) + # has elapsed. Will block indefinitely when timeout is nil or not given. + # + # Provided mainly for consistency with other classes in this library. Prefer + # the various `await` methods instead. + # + # @param [Float] timeout the maximum number of seconds to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:393 + def wait(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:510 + def enqueue_action_job(action, args, executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:516 + def enqueue_await_job(latch); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:543 + def execute_next_job; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:576 + def handle_error(error); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:529 + def ns_enqueue_job(job, index = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:584 + def ns_find_last_job_for_thread; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:490 + def ns_initialize(initial, opts); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:539 + def ns_post_next_job; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:570 + def ns_validate(value); end + + class << self + # Blocks the current thread (indefinitely!) until all actions dispatched + # thus far to all the given Agents, from this thread or nested by the + # given Agents, have occurred. Will block when any of the agents are + # failed. Will never return if a failed Agent is restart with + # `:clear_actions` true. + # + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:449 + def await(*agents); end + + # Blocks the current thread until all actions dispatched thus far to all + # the given Agents, from this thread or nested by the given Agents, have + # occurred, or the timeout (in seconds) has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true if all actions complete before timeout else false + # + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:463 + def await_for(timeout, *agents); end + + # Blocks the current thread until all actions dispatched thus far to all + # the given Agents, from this thread or nested by the given Agents, have + # occurred, or the timeout (in seconds) has elapsed. + # + # @param [Float] timeout the maximum number of seconds to wait + # @param [Array] agents the Agents on which to wait + # @return [Boolean] true if all actions complete before timeout + # + # @raise [Concurrent::TimeoutError] when timeout is reached + # @!macro agent_await_warning + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:482 + def await_for!(timeout, *agents); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:154 +Concurrent::Agent::AWAIT_ACTION = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:151 +Concurrent::Agent::AWAIT_FLAG = T.let(T.unsafe(nil), Object) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:157 +Concurrent::Agent::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:160 +Concurrent::Agent::DEFAULT_VALIDATOR = T.let(T.unsafe(nil), Proc) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:148 +Concurrent::Agent::ERROR_MODES = T.let(T.unsafe(nil), Array) + +# Raised during action processing or any other time in an Agent's lifecycle. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:167 +class Concurrent::Agent::Error < ::StandardError + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:168 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 +class Concurrent::Agent::Job < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def action; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def action=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def args; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def args=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def caller; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def caller=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def executor=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:163 + def new(*_arg0); end + end +end + +# Raised when a new value obtained during action processing or at `#restart` +# fails validation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:176 +class Concurrent::Agent::ValidationError < ::Concurrent::Agent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/agent.rb:177 + def initialize(message = T.unsafe(nil)); end +end + +# @!macro concurrent_array +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/array.rb:53 +class Concurrent::Array < ::Array; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/array.rb:22 +Concurrent::ArrayImplementation = Array + +# A mixin module that provides simple asynchronous behavior to a class, +# turning it into a simple actor. Loosely based on Erlang's +# [gen_server](http://www.erlang.org/doc/man/gen_server.html), but without +# supervision or linking. +# +# A more feature-rich {Concurrent::Actor} is also available when the +# capabilities of `Async` are too limited. +# +# ```cucumber +# Feature: +# As a stateful, plain old Ruby class +# I want safe, asynchronous behavior +# So my long-running methods don't block the main thread +# ``` +# +# The `Async` module is a way to mix simple yet powerful asynchronous +# capabilities into any plain old Ruby object or class, turning each object +# into a simple Actor. Method calls are processed on a background thread. The +# caller is free to perform other actions while processing occurs in the +# background. +# +# Method calls to the asynchronous object are made via two proxy methods: +# `async` (alias `cast`) and `await` (alias `call`). These proxy methods post +# the method call to the object's background thread and return a "future" +# which will eventually contain the result of the method call. +# +# This behavior is loosely patterned after Erlang's `gen_server` behavior. +# When an Erlang module implements the `gen_server` behavior it becomes +# inherently asynchronous. The `start` or `start_link` function spawns a +# process (similar to a thread but much more lightweight and efficient) and +# returns the ID of the process. Using the process ID, other processes can +# send messages to the `gen_server` via the `cast` and `call` methods. Unlike +# Erlang's `gen_server`, however, `Async` classes do not support linking or +# supervision trees. +# +# ## Basic Usage +# +# When this module is mixed into a class, objects of the class become inherently +# asynchronous. Each object gets its own background thread on which to post +# asynchronous method calls. Asynchronous method calls are executed in the +# background one at a time in the order they are received. +# +# To create an asynchronous class, simply mix in the `Concurrent::Async` module: +# +# ``` +# class Hello +# include Concurrent::Async +# +# def hello(name) +# "Hello, #{name}!" +# end +# end +# ``` +# +# Mixing this module into a class provides each object two proxy methods: +# `async` and `await`. These methods are thread safe with respect to the +# enclosing object. The former proxy allows methods to be called +# asynchronously by posting to the object's internal thread. The latter proxy +# allows a method to be called synchronously but does so safely with respect +# to any pending asynchronous method calls and ensures proper ordering. Both +# methods return a {Concurrent::IVar} which can be inspected for the result +# of the proxied method call. Calling a method with `async` will return a +# `:pending` `IVar` whereas `await` will return a `:complete` `IVar`. +# +# ``` +# class Echo +# include Concurrent::Async +# +# def echo(msg) +# print "#{msg}\n" +# end +# end +# +# horn = Echo.new +# horn.echo('zero') # synchronous, not thread-safe +# # returns the actual return value of the method +# +# horn.async.echo('one') # asynchronous, non-blocking, thread-safe +# # returns an IVar in the :pending state +# +# horn.await.echo('two') # synchronous, blocking, thread-safe +# # returns an IVar in the :complete state +# ``` +# +# ## Let It Fail +# +# The `async` and `await` proxy methods have built-in error protection based +# on Erlang's famous "let it fail" philosophy. Instance methods should not be +# programmed defensively. When an exception is raised by a delegated method +# the proxy will rescue the exception, expose it to the caller as the `reason` +# attribute of the returned future, then process the next method call. +# +# ## Calling Methods Internally +# +# External method calls should *always* use the `async` and `await` proxy +# methods. When one method calls another method, the `async` proxy should +# rarely be used and the `await` proxy should *never* be used. +# +# When an object calls one of its own methods using the `await` proxy the +# second call will be enqueued *behind* the currently running method call. +# Any attempt to wait on the result will fail as the second call will never +# run until after the current call completes. +# +# Calling a method using the `await` proxy from within a method that was +# itself called using `async` or `await` will irreversibly deadlock the +# object. Do *not* do this, ever. +# +# ## Instance Variables and Attribute Accessors +# +# Instance variables do not need to be thread-safe so long as they are private. +# Asynchronous method calls are processed in the order they are received and +# are processed one at a time. Therefore private instance variables can only +# be accessed by one thread at a time. This is inherently thread-safe. +# +# When using private instance variables within asynchronous methods, the best +# practice is to read the instance variable into a local variable at the start +# of the method then update the instance variable at the *end* of the method. +# This way, should an exception be raised during method execution the internal +# state of the object will not have been changed. +# +# ### Reader Attributes +# +# The use of `attr_reader` is discouraged. Internal state exposed externally, +# when necessary, should be done through accessor methods. The instance +# variables exposed by these methods *must* be thread-safe, or they must be +# called using the `async` and `await` proxy methods. These two approaches are +# subtly different. +# +# When internal state is accessed via the `async` and `await` proxy methods, +# the returned value represents the object's state *at the time the call is +# processed*, which may *not* be the state of the object at the time the call +# is made. +# +# To get the state *at the current* time, irrespective of an enqueued method +# calls, a reader method must be called directly. This is inherently unsafe +# unless the instance variable is itself thread-safe, preferably using one +# of the thread-safe classes within this library. Because the thread-safe +# classes within this library are internally-locking or non-locking, they can +# be safely used from within asynchronous methods without causing deadlocks. +# +# Generally speaking, the best practice is to *not* expose internal state via +# reader methods. The best practice is to simply use the method's return value. +# +# ### Writer Attributes +# +# Writer attributes should never be used with asynchronous classes. Changing +# the state externally, even when done in the thread-safe way, is not logically +# consistent. Changes to state need to be timed with respect to all asynchronous +# method calls which my be in-process or enqueued. The only safe practice is to +# pass all necessary data to each method as arguments and let the method update +# the internal state as necessary. +# +# ## Class Constants, Variables, and Methods +# +# ### Class Constants +# +# Class constants do not need to be thread-safe. Since they are read-only and +# immutable they may be safely read both externally and from within +# asynchronous methods. +# +# ### Class Variables +# +# Class variables should be avoided. Class variables represent shared state. +# Shared state is anathema to concurrency. Should there be a need to share +# state using class variables they *must* be thread-safe, preferably +# using the thread-safe classes within this library. When updating class +# variables, never assign a new value/object to the variable itself. Assignment +# is not thread-safe in Ruby. Instead, use the thread-safe update functions +# of the variable itself to change the value. +# +# The best practice is to *never* use class variables with `Async` classes. +# +# ### Class Methods +# +# Class methods which are pure functions are safe. Class methods which modify +# class variables should be avoided, for all the reasons listed above. +# +# ## An Important Note About Thread Safe Guarantees +# +# > Thread safe guarantees can only be made when asynchronous method calls +# > are not mixed with direct method calls. Use only direct method calls +# > when the object is used exclusively on a single thread. Use only +# > `async` and `await` when the object is shared between threads. Once you +# > call a method using `async` or `await`, you should no longer call methods +# > directly on the object. Use `async` and `await` exclusively from then on. +# +# @example +# +# class Echo +# include Concurrent::Async +# +# def echo(msg) +# print "#{msg}\n" +# end +# end +# +# horn = Echo.new +# horn.echo('zero') # synchronous, not thread-safe +# # returns the actual return value of the method +# +# horn.async.echo('one') # asynchronous, non-blocking, thread-safe +# # returns an IVar in the :pending state +# +# horn.await.echo('two') # synchronous, blocking, thread-safe +# # returns an IVar in the :complete state +# +# @see Concurrent::Actor +# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia +# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server +# @see http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/ +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:217 +module Concurrent::Async + mixes_in_class_methods ::Concurrent::Async::ClassMethods + + # Causes the chained method call to be performed asynchronously on the + # object's thread. The delegated method will return a future in the + # `:pending` state and the method call will have been scheduled on the + # object's thread. The final disposition of the method call can be obtained + # by inspecting the returned future. + # + # @!macro async_thread_safety_warning + # @note The method call is guaranteed to be thread safe with respect to + # all other method calls against the same object that are called with + # either `async` or `await`. The mutable nature of Ruby references + # (and object orientation in general) prevent any other thread safety + # guarantees. Do NOT mix direct method calls with delegated method calls. + # Use *only* delegated method calls when sharing the object between threads. + # + # @return [Concurrent::IVar] the pending result of the asynchronous operation + # + # @raise [NameError] the object does not respond to the requested method + # @raise [ArgumentError] the given `args` do not match the arity of + # the requested method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:412 + def async; end + + # Causes the chained method call to be performed synchronously on the + # current thread. The delegated will return a future in either the + # `:fulfilled` or `:rejected` state and the delegated method will have + # completed. The final disposition of the delegated method can be obtained + # by inspecting the returned future. + # + # @!macro async_thread_safety_warning + # + # @return [Concurrent::IVar] the completed result of the synchronous operation + # + # @raise [NameError] the object does not respond to the requested method + # @raise [ArgumentError] the given `args` do not match the arity of the + # requested method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:430 + def await; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:433 + def call; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:415 + def cast; end + + # Initialize the internal serializer and other stnchronization mechanisms. + # + # @note This method *must* be called immediately upon object construction. + # This is the only way thread-safe initialization can be guaranteed. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:441 + def init_synchronization; end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:262 + def included(base); end + + # Check for the presence of a method on an object and determine if a given + # set of arguments matches the required arity. + # + # @param [Object] obj the object to check against + # @param [Symbol] method the method to check the object for + # @param [Array] args zero or more arguments for the arity check + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # @note This check is imperfect because of the way Ruby reports the arity of + # methods with a variable number of arguments. It is possible to determine + # if too few arguments are given but impossible to determine if too many + # arguments are given. This check may also fail to recognize dynamic behavior + # of the object, such as methods simulated with `method_missing`. + # + # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity + # @see http://ruby-doc.org/core-2.1.0/Object.html#method-i-respond_to-3F Object#respond_to? + # @see http://www.ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing BasicObject#method_missing + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:250 + def validate_argc(obj, method, *args); end + end +end + +# Delegates asynchronous, thread-safe method calls to the wrapped object. +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:282 +class Concurrent::Async::AsyncDelegator < ::Concurrent::Synchronization::LockableObject + # Create a new delegator object wrapping the given delegate. + # + # @param [Object] delegate the object to wrap and delegate method calls to + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:288 + def initialize(delegate); end + + # Delegates method calls to the wrapped object. + # + # @param [Symbol] method the method being called + # @param [Array] args zero or more arguments to the method + # + # @return [IVar] the result of the method call + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:305 + def method_missing(method, *args, &block); end + + # Perform all enqueued tasks. + # + # This method must be called from within the executor. It must not be + # called while already running. It will loop until the queue is empty. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:330 + def perform; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:348 + def reset_if_forked; end + + private + + # Check whether the method is responsive + # + # @param [Symbol] method the method being called + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:322 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# Delegates synchronous, thread-safe method calls to the wrapped object. +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:360 +class Concurrent::Async::AwaitDelegator + # Create a new delegator object wrapping the given delegate. + # + # @param [AsyncDelegator] delegate the object to wrap and delegate method calls to + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:365 + def initialize(delegate); end + + # Delegates method calls to the wrapped object. + # + # @param [Symbol] method the method being called + # @param [Array] args zero or more arguments to the method + # + # @return [IVar] the result of the method call + # + # @raise [NameError] the object does not respond to `method` method + # @raise [ArgumentError] the given `args` do not match the arity of `method` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:378 + def method_missing(method, *args, &block); end + + private + + # Check whether the method is responsive + # + # @param [Symbol] method the method being called + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:387 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:269 +module Concurrent::Async::ClassMethods + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/async.rb:270 + def new(*args, **, &block); end +end + +# Atoms provide a way to manage shared, synchronous, independent state. +# +# An atom is initialized with an initial value and an optional validation +# proc. At any time the value of the atom can be synchronously and safely +# changed. If a validator is given at construction then any new value +# will be checked against the validator and will be rejected if the +# validator returns false or raises an exception. +# +# There are two ways to change the value of an atom: {#compare_and_set} and +# {#swap}. The former will set the new value if and only if it validates and +# the current value matches the new value. The latter will atomically set the +# new value to the result of running the given block if and only if that +# value validates. +# +# ## Example +# +# ``` +# def next_fibonacci(set = nil) +# return [0, 1] if set.nil? +# set + [set[-2..-1].reduce{|sum,x| sum + x }] +# end +# +# # create an atom with an initial value +# atom = Concurrent::Atom.new(next_fibonacci) +# +# # send a few update requests +# 5.times do +# atom.swap{|set| next_fibonacci(set) } +# end +# +# # get the current value +# atom.value #=> [0, 1, 1, 2, 3, 5, 8] +# ``` +# +# ## Observation +# +# Atoms support observers through the {Concurrent::Observable} mixin module. +# Notification of observers occurs every time the value of the Atom changes. +# When notified the observer will receive three arguments: `time`, `old_value`, +# and `new_value`. The `time` argument is the time at which the value change +# occurred. The `old_value` is the value of the Atom when the change began +# The `new_value` is the value to which the Atom was set when the change +# completed. Note that `old_value` and `new_value` may be the same. This is +# not an error. It simply means that the change operation returned the same +# value. +# +# Unlike in Clojure, `Atom` cannot participate in {Concurrent::TVar} transactions. +# +# @!macro thread_safe_variable_comparison +# +# @see http://clojure.org/atoms Clojure Atoms +# @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:95 +class Concurrent::Atom < ::Concurrent::Synchronization::Object + include ::Concurrent::Concern::Observable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new atom with the given initial value. + # + # @param [Object] value The initial value + # @param [Hash] opts The options used to configure the atom + # @option opts [Proc] :validator (nil) Optional proc used to validate new + # values. It must accept one and only one argument which will be the + # intended new value. The validator will return true if the new value + # is acceptable else return false (preferably) or raise an exception. + # + # @!macro deref_options + # + # @raise [ArgumentError] if the validator is not a `Proc` (when given) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:121 + def initialize(value, opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def __initialize_atomic_fields__; end + + # Atomically sets the value of atom to the new value if and only if the + # current value of the atom is identical to the old value and the new + # value successfully validates against the (optional) validator given + # at construction. + # + # @param [Object] old_value The expected current value. + # @param [Object] new_value The intended new value. + # + # @return [Boolean] True if the value is changed else false. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:181 + def compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:102 + def deref; end + + # Atomically sets the value of atom to the new value without regard for the + # current value so long as the new value successfully validates against the + # (optional) validator given at construction. + # + # @param [Object] new_value The intended new value. + # + # @return [Object] The final value of the atom after all operations and + # validations are complete. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:198 + def reset(new_value); end + + # Atomically swaps the value of atom using the given block. The current + # value will be passed to the block, as will any arguments passed as + # arguments to the function. The new value will be validated against the + # (optional) validator proc given at construction. If validation fails the + # value will not be changed. + # + # Internally, {#swap} reads the current value, applies the block to it, and + # attempts to compare-and-set it in. Since another thread may have changed + # the value in the intervening time, it may have to retry, and does so in a + # spin loop. The net effect is that the value will always be the result of + # the application of the supplied block to a current value, atomically. + # However, because the block might be called multiple times, it must be free + # of side effects. + # + # @note The given block may be called multiple times, and thus should be free + # of side effects. + # + # @param [Object] args Zero or more arguments passed to the block. + # + # @yield [value, args] Calculates a new value for the atom based on the + # current value and any supplied arguments. + # @yieldparam value [Object] The current value of the atom. + # @yieldparam args [Object] All arguments passed to the function, in order. + # @yieldreturn [Object] The intended new value of the atom. + # + # @return [Object] The final value of the atom after all operations and + # validations are complete. + # + # @raise [ArgumentError] When no block is given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:157 + def swap(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def value; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def compare_and_set_value(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def swap_value(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def update_value(&block); end + + # Is the new value valid? + # + # @param [Object] new_value The intended new value. + # @return [Boolean] false if the validator function returns false or raises + # an exception else true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:216 + def valid?(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atom.rb:99 + def value=(value); end +end + +# @!macro atomic_boolean +# +# A boolean value that can be updated atomically. Reads and writes to an atomic +# boolean and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# @!macro thread_safe_variable_comparison +# +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicBoolean... +# 2.790000 0.000000 2.790000 ( 2.791454) +# Testing with Concurrent::CAtomicBoolean... +# 0.740000 0.000000 0.740000 ( 0.740206) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicBoolean... +# 5.240000 2.520000 7.760000 ( 3.683000) +# Testing with Concurrent::JavaAtomicBoolean... +# 3.340000 0.010000 3.350000 ( 0.855000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html java.util.concurrent.atomic.AtomicBoolean +# +# @!macro atomic_boolean_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:119 +class Concurrent::AtomicBoolean < ::Concurrent::MutexAtomicBoolean + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:125 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:121 + def to_s; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb:82 +Concurrent::AtomicBooleanImplementation = Concurrent::MutexAtomicBoolean + +# Define update methods that use direct paths +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:9 +module Concurrent::AtomicDirectUpdate + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:15 + def try_update; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:24 + def try_update!; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb:10 + def update; end +end + +# @!macro atomic_fixnum +# +# A numeric value that can be updated atomically. Reads and writes to an atomic +# fixnum and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# @!macro thread_safe_variable_comparison +# +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicFixnum... +# 3.130000 0.000000 3.130000 ( 3.136505) +# Testing with Concurrent::CAtomicFixnum... +# 0.790000 0.000000 0.790000 ( 0.785550) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicFixnum... +# 5.460000 2.460000 7.920000 ( 3.715000) +# Testing with Concurrent::JavaAtomicFixnum... +# 4.520000 0.030000 4.550000 ( 1.187000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicLong.html java.util.concurrent.atomic.AtomicLong +# +# @!macro atomic_fixnum_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:136 +class Concurrent::AtomicFixnum < ::Concurrent::MutexAtomicFixnum + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:142 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:138 + def to_s; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb:99 +Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum + +# An atomic reference which maintains an object reference along with a mark bit +# that can be updated atomically. +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html +# java.util.concurrent.atomic.AtomicMarkableReference +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:10 +class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:15 + def initialize(value = T.unsafe(nil), mark = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def __initialize_atomic_fields__; end + + # Atomically sets the value and mark to the given updated value and + # mark given both: + # - the current value == the expected value && + # - the current mark == the expected mark + # + # @param [Object] expected_val the expected value + # @param [Object] new_val the new value + # @param [Boolean] expected_mark the expected mark + # @param [Boolean] new_mark the new mark + # + # @return [Boolean] `true` if successful. A `false` return indicates + # that the actual value was not equal to the expected value or the + # actual mark was not equal to the expected mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:33 + def compare_and_set(expected_val, new_val, expected_mark, new_mark); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:59 + def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end + + # Gets the current reference and marked values. + # + # @return [Array] the current reference and marked values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:64 + def get; end + + # Gets the current marked value + # + # @return [Boolean] the current marked value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:78 + def mark; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:82 + def marked?; end + + # _Unconditionally_ sets to the given value of both the reference and + # the mark. + # + # @param [Object] new_val the new value + # @param [Boolean] new_mark the new mark + # + # @return [Array] both the new value and the new mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:91 + def set(new_val, new_mark); end + + # Pass the current value to the given block, replacing it with the + # block's result. Simply return nil if update fails. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and marked state, or nil if + # the update failed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:152 + def try_update; end + + # Pass the current value to the given block, replacing it + # with the block's result. Raise an exception if the update + # fails. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and marked state + # + # @raise [Concurrent::ConcurrentUpdateError] if the update fails + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:128 + def try_update!; end + + # Pass the current value and marked state to the given block, replacing it + # with the block's results. May retry if the value changes during the + # block's execution. + # + # @yield [Object] Calculate a new value and marked state for the atomic + # reference using given (old) value and (old) marked + # @yieldparam [Object] old_val the starting value of the atomic reference + # @yieldparam [Boolean] old_mark the starting state of marked + # + # @return [Array] the new value and new mark + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:105 + def update; end + + # Gets the current value of the reference + # + # @return [Object] the current value of the reference + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:71 + def value; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def compare_and_set_reference(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:163 + def immutable_array(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def reference; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def reference=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def swap_reference(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb:12 + def update_reference(&block); end +end + +# Special "compare and set" handling of numeric values. +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:7 +module Concurrent::AtomicNumericCompareAndSetWrapper + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:10 + def compare_and_set(old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb:33 + def compare_and_swap(old_value, new_value); end +end + +# An object reference that may be updated atomically. All read and write +# operations have java volatile semantic. +# +# @!macro thread_safe_variable_comparison +# +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html +# +# @!method initialize(value = nil) +# @!macro atomic_reference_method_initialize +# @param [Object] value The initial value. +# +# @!method get +# @!macro atomic_reference_method_get +# Gets the current value. +# @return [Object] the current value +# +# @!method set(new_value) +# @!macro atomic_reference_method_set +# Sets to the given value. +# @param [Object] new_value the new value +# @return [Object] the new value +# +# @!method get_and_set(new_value) +# @!macro atomic_reference_method_get_and_set +# Atomically sets to the given value and returns the old value. +# @param [Object] new_value the new value +# @return [Object] the old value +# +# @!method compare_and_set(old_value, new_value) +# @!macro atomic_reference_method_compare_and_set +# +# Atomically sets the value to the given updated value if +# the current value == the expected value. +# +# @param [Object] old_value the expected value +# @param [Object] new_value the new value +# +# @return [Boolean] `true` if successful. A `false` return indicates +# that the actual value was not equal to the expected value. +# +# @!method update +# Pass the current value to the given block, replacing it +# with the block's result. May retry if the value changes +# during the block's execution. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @return [Object] the new value +# +# @!method try_update +# Pass the current value to the given block, replacing it +# with the block's result. Return nil if the update fails. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @note This method was altered to avoid raising an exception by default. +# Instead, this method now returns `nil` in case of failure. For more info, +# please see: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 +# @return [Object] the new value, or nil if update failed +# +# @!method try_update! +# Pass the current value to the given block, replacing it +# with the block's result. Raise an exception if the update +# fails. +# +# @yield [Object] Calculate a new value for the atomic reference using +# given (old) value +# @yieldparam [Object] old_value the starting value of the atomic reference +# @note This behavior mimics the behavior of the original +# `AtomicReference#try_update` API. The reason this was changed was to +# avoid raising exceptions (which are inherently slow) by default. For more +# info: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 +# @return [Object] the new value +# @raise [Concurrent::ConcurrentUpdateError] if the update fails +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:133 +class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:140 + def inspect; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:136 + def to_s; end +end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb:18 +Concurrent::AtomicReferenceImplementation = Concurrent::MutexAtomicReference + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:30 +class Concurrent::CRubySet < ::Set + include ::Set::SubclassCompatible + extend ::Set::SubclassCompatible::ClassMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def initialize(*args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def &(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def +(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def -(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <<(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <=(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def <=>(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ==(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ===(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def >(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def >=(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def ^(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def add(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def add?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def classify(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def clear(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def collect!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def compare_by_identity(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def compare_by_identity?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def delete_if(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def difference(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def disjoint?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def divide(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def each(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def empty?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def encode_with(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def eql?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def filter!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def flatten!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def hash(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def include?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def init_with(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def inspect(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def intersect?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def intersection(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def join(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def keep_if(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def length(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def map!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def member?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def merge(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def pretty_print(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def pretty_print_cycle(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def proper_subset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def proper_superset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def reject!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def replace(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def reset(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def select!(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def size(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def subset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def subtract(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def superset?(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_a(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_s(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def to_set(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def union(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def |(*args); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def initialize_copy(other); end +end + +# A thread pool that dynamically grows and shrinks to fit the current workload. +# New threads are created as needed, existing threads are reused, and threads +# that remain idle for too long are killed and removed from the pool. These +# pools are particularly suited to applications that perform a high volume of +# short-lived tasks. +# +# On creation a `CachedThreadPool` has zero running threads. New threads are +# created on the pool as new operations are `#post`. The size of the pool +# will grow until `#max_length` threads are in the pool or until the number +# of threads exceeds the number of running and pending operations. When a new +# operation is post to the pool the first available idle thread will be tasked +# with the new operation. +# +# Should a thread crash for any reason the thread will immediately be removed +# from the pool. Similarly, threads which remain idle for an extended period +# of time will be killed and reclaimed. Thus these thread pools are very +# efficient at reclaiming unused resources. +# +# The API and behavior of this class are based on Java's `CachedThreadPool` +# +# @!macro thread_pool_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:27 +class Concurrent::CachedThreadPool < ::Concurrent::ThreadPoolExecutor + # @!macro cached_thread_pool_method_initialize + # + # Create a new thread pool. + # + # @param [Hash] opts the options defining pool behavior. + # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy + # + # @raise [ArgumentError] if `fallback_policy` is not a known policy + # + # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool-- + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:39 + def initialize(opts = T.unsafe(nil)); end + + private + + # @!macro cached_thread_pool_method_initialize + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb:51 + def ns_initialize(opts); end +end + +# Raised when an asynchronous operation is cancelled before execution. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:9 +class Concurrent::CancelledOperationError < ::Concurrent::Error; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:7 +module Concurrent::Collection; end + +# A thread safe observer set implemented using copy-on-read approach: +# observers are added and removed from a thread safe collection; every time +# a notification is required the internal data structure is copied to +# prevent concurrency issues +# +# @api private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:12 +class Concurrent::Collection::CopyOnNotifyObserverSet < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:14 + def initialize; end + + # @!macro observable_add_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:20 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:55 + def count_observers; end + + # @!macro observable_delete_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:39 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:47 + def delete_observers; end + + # Notifies all registered observers with optional args and deletes them. + # + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:72 + def notify_and_delete_observers(*args, &block); end + + # Notifies all registered observers with optional args + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:62 + def notify_observers(*args, &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:80 + def ns_initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:86 + def duplicate_and_clear_observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:94 + def duplicate_observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb:98 + def notify_to(observers, *args); end +end + +# A thread safe observer set implemented using copy-on-write approach: +# every time an observer is added or removed the whole internal data structure is +# duplicated and replaced with a new one. +# +# @api private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:11 +class Concurrent::Collection::CopyOnWriteObserverSet < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:13 + def initialize; end + + # @!macro observable_add_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:19 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:56 + def count_observers; end + + # @!macro observable_delete_observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:40 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:50 + def delete_observers; end + + # Notifies all registered observers with optional args and deletes them. + # + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:72 + def notify_and_delete_observers(*args, &block); end + + # Notifies all registered observers with optional args + # @param [Object] args arguments to be passed to each observer + # @return [CopyOnWriteObserverSet] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:63 + def notify_observers(*args, &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:80 + def ns_initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:102 + def clear_observers_and_return_old; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:86 + def notify_to(observers, *args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:94 + def observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb:98 + def observers=(new_set); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:10 +Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:10 +class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcurrentMapBackend + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:12 + def initialize(options = T.unsafe(nil), &default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:17 + def []=(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:61 + def clear; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:33 + def compute(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:21 + def compute_if_absent(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:29 + def compute_if_present(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:53 + def delete(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:57 + def delete_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:49 + def get_and_set(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:37 + def merge_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:45 + def replace_if_exists(key, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb:41 + def replace_pair(key, old_value, new_value); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:9 +class Concurrent::Collection::NonConcurrentMapBackend + # WARNING: all public methods of the class must operate on the @backend + # directly without calling each other. This is important because of the + # SynchronizedMapBackend which uses a non-reentrant mutex for performance + # reasons. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:15 + def initialize(options = T.unsafe(nil), &default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:21 + def [](key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:25 + def []=(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:94 + def clear; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:59 + def compute(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:29 + def compute_if_absent(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:53 + def compute_if_present(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:81 + def delete(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:85 + def delete_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:99 + def each_pair; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:71 + def get_and_set(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:110 + def get_or_default(key, default_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:77 + def key?(key); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:63 + def merge_pair(key, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:46 + def replace_if_exists(key, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:37 + def replace_pair(key, old_value, new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:106 + def size; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:130 + def dupped_backend; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:124 + def initialize_copy(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:134 + def pair?(key, expected_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:116 + def set_backend(default_proc); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb:138 + def store_computed_value(key, new_value); end +end + +# @!macro priority_queue +# +# A queue collection in which the elements are sorted based on their +# comparison (spaceship) operator `<=>`. Items are added to the queue +# at a position relative to their priority. On removal the element +# with the "highest" priority is removed. By default the sort order is +# from highest to lowest, but a lowest-to-highest sort order can be +# set on construction. +# +# The API is based on the `Queue` class from the Ruby standard library. +# +# The pure Ruby implementation, `RubyNonConcurrentPriorityQueue` uses a heap algorithm +# stored in an array. The algorithm is based on the work of Robert Sedgewick +# and Kevin Wayne. +# +# The JRuby native implementation is a thin wrapper around the standard +# library `java.util.NonConcurrentPriorityQueue`. +# +# When running under JRuby the class `NonConcurrentPriorityQueue` extends `JavaNonConcurrentPriorityQueue`. +# When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. +# +# @note This implementation is *not* thread safe. +# +# @see http://en.wikipedia.org/wiki/Priority_queue +# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html +# +# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 +# @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:50 +class Concurrent::Collection::NonConcurrentPriorityQueue < ::Concurrent::Collection::RubyNonConcurrentPriorityQueue + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:59 + def <<(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:56 + def deq; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:60 + def enq(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:52 + def has_priority?(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:57 + def shift; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:54 + def size; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb:10 +Concurrent::Collection::NonConcurrentPriorityQueueImplementation = Concurrent::Collection::RubyNonConcurrentPriorityQueue + +# @!macro priority_queue +# +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:8 +class Concurrent::Collection::RubyNonConcurrentPriorityQueue + # @!macro priority_queue_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:11 + def initialize(opts = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:85 + def <<(item); end + + # @!macro priority_queue_method_clear + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:18 + def clear; end + + # @!macro priority_queue_method_delete + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:25 + def delete(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:74 + def deq; end + + # @!macro priority_queue_method_empty + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:43 + def empty?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:86 + def enq(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:51 + def has_priority?(item); end + + # @!macro priority_queue_method_include + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:48 + def include?(item); end + + # @!macro priority_queue_method_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:54 + def length; end + + # @!macro priority_queue_method_peek + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:60 + def peek; end + + # @!macro priority_queue_method_pop + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:65 + def pop; end + + # @!macro priority_queue_method_push + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:78 + def push(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:75 + def shift; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:57 + def size; end + + private + + # Are the items at the given indexes ordered based on the priority + # order specified at construction? + # + # @param [Integer] x the first index from which to retrieve a comparable value + # @param [Integer] y the second index from which to retrieve a comparable value + # + # @return [Boolean] true if the two elements are in the correct priority order + # else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:119 + def ordered?(x, y); end + + # Percolate down to maintain heap invariant. + # + # @param [Integer] k the index at which to start the percolation + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:128 + def sink(k); end + + # Exchange the values at the given indexes within the internal array. + # + # @param [Integer] x the first index to swap + # @param [Integer] y the second index to swap + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:103 + def swap(x, y); end + + # Percolate up to maintain heap invariant. + # + # @param [Integer] k the index at which to start the percolation + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:147 + def swim(k); end + + class << self + # @!macro priority_queue_method_from_list + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb:89 + def from_list(list, opts = T.unsafe(nil)); end + end +end + +# @!visibility private +# @!macro timeout_queue +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:15 +class Concurrent::Collection::TimeoutQueue < ::Thread::Queue; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/timeout_queue.rb:5 +Concurrent::Collection::TimeoutQueueImplementation = Thread::Queue + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:2 +module Concurrent::Concern; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:8 +module Concurrent::Concern::Deprecation + include ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Logging + extend ::Concurrent::Concern::Deprecation + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:12 + def deprecated(message, strip = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/deprecation.rb:27 + def deprecated_method(old_name, new_name); end +end + +# Object references in Ruby are mutable. This can lead to serious problems when +# the `#value` of a concurrent object is a mutable reference. Which is always the +# case unless the value is a `Fixnum`, `Symbol`, or similar "primitive" data type. +# Most classes in this library that expose a `#value` getter method do so using the +# `Dereferenceable` mixin module. +# +# @!macro copy_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:11 +module Concurrent::Concern::Dereferenceable + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:24 + def deref; end + + # Return the value this object represents after applying the options specified + # by the `#set_deref_options` method. + # + # @return [Object] the current value of the object + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:21 + def value; end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:63 + def apply_deref_options(value); end + + # @!macro dereferenceable_set_deref_options + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:54 + def ns_set_deref_options(opts); end + + # @!macro dereferenceable_set_deref_options + # Set the options which define the operations #value performs before + # returning data to the caller (dereferencing). + # + # @note Most classes that include this module will call `#set_deref_options` + # from within the constructor, thus allowing these options to be set at + # object creation. + # + # @param [Hash] opts the options defining dereference behavior. + # @option opts [String] :dup_on_deref (false) call `#dup` before returning the data + # @option opts [String] :freeze_on_deref (false) call `#freeze` before returning the data + # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing + # the internal value and returning the value returned from the proc + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:48 + def set_deref_options(opts = T.unsafe(nil)); end + + # Set the internal value of this object + # + # @param [Object] value the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/dereferenceable.rb:31 + def value=(value); end +end + +# Include where logging is needed +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:9 +module Concurrent::Concern::Logging + # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger + # @param [Integer] level one of Concurrent::Concern::Logging constants + # @param [String] progname e.g. a path of an Actor + # @param [String, nil] message when nil block is used to generate the message + # @yieldreturn [String] a message + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:19 + def log(level, progname, message = T.unsafe(nil), &block); end +end + +# The same as Logger::Severity but we copy it here to avoid a dependency on the logger gem just for these 7 constants +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::DEBUG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::ERROR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::FATAL = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::INFO = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:12 +Concurrent::Concern::Logging::SEV_LABEL = T.let(T.unsafe(nil), Array) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::UNKNOWN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:11 +Concurrent::Concern::Logging::WARN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:10 +module Concurrent::Concern::Obligation + include ::Concurrent::Concern::Dereferenceable + + # Has the obligation completed processing? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:49 + def complete?; end + + # @example allows Obligation to be risen + # rejected_ivar = Ivar.new.fail + # raise rejected_ivar + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:126 + def exception(*args); end + + # Has the obligation been fulfilled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:20 + def fulfilled?; end + + # Is the obligation still awaiting completion of processing? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:56 + def incomplete?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:89 + def no_error!(timeout = T.unsafe(nil)); end + + # Is obligation completion still pending? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:35 + def pending?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:23 + def realized?; end + + # If an exception was raised during processing this will return the + # exception object. Will return `nil` when the state is pending or if + # the obligation has been successfully fulfilled. + # + # @return [Exception] the exception raised during processing or `nil` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:119 + def reason; end + + # Has the obligation been rejected? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:28 + def rejected?; end + + # The current state of the obligation. + # + # @return [Symbol] the current state + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:110 + def state; end + + # Is the obligation still unscheduled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:42 + def unscheduled?; end + + # The current value of the obligation. Will be `nil` while the state is + # pending or the operation has been rejected. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Object] see Dereferenceable#deref + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:65 + def value(timeout = T.unsafe(nil)); end + + # The current value of the obligation. Will be `nil` while the state is + # pending or the operation has been rejected. Will re-raise any exceptions + # raised during processing (but will not raise an exception on timeout). + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Object] see Dereferenceable#deref + # @raise [Exception] raises the reason when rejected + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:98 + def value!(timeout = T.unsafe(nil)); end + + # Wait until obligation is complete or the timeout has been reached. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Obligation] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:74 + def wait(timeout = T.unsafe(nil)); end + + # Wait until obligation is complete or the timeout is reached. Will re-raise + # any exceptions raised during processing (but will not raise an exception + # on timeout). + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Obligation] self + # @raise [Exception] raises the reason when rejected + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:86 + def wait!(timeout = T.unsafe(nil)); end + + protected + + # Atomic compare and set operation + # State is set to `next_state` only if `current state == expected_current`. + # + # @param [Symbol] next_state + # @param [Symbol] expected_current + # + # @return [Boolean] true is state is changed, false otherwise + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:174 + def compare_and_set_state(next_state, *expected_current); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:145 + def event; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:134 + def get_arguments_from(opts = T.unsafe(nil)); end + + # Executes the block within mutex if current state is included in expected_states + # + # @return block value if executed, false otherwise + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:190 + def if_state(*expected_states); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:139 + def init_obligation; end + + # Am I in the current state? + # + # @param [Symbol] expected The state to check against + # @return [Boolean] true if in the expected state else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:210 + def ns_check_state?(expected); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:215 + def ns_set_state(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:150 + def set_state(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/obligation.rb:161 + def state=(value); end +end + +# The [observer pattern](http://en.wikipedia.org/wiki/Observer_pattern) is one +# of the most useful design patterns. +# +# The workflow is very simple: +# - an `observer` can register itself to a `subject` via a callback +# - many `observers` can be registered to the same `subject` +# - the `subject` notifies all registered observers when its status changes +# - an `observer` can deregister itself when is no more interested to receive +# event notifications +# +# In a single threaded environment the whole pattern is very easy: the +# `subject` can use a simple data structure to manage all its subscribed +# `observer`s and every `observer` can react directly to every event without +# caring about synchronization. +# +# In a multi threaded environment things are more complex. The `subject` must +# synchronize the access to its data structure and to do so currently we're +# using two specialized ObserverSet: {Concurrent::Concern::CopyOnWriteObserverSet} +# and {Concurrent::Concern::CopyOnNotifyObserverSet}. +# +# When implementing and `observer` there's a very important rule to remember: +# **there are no guarantees about the thread that will execute the callback** +# +# Let's take this example +# ``` +# class Observer +# def initialize +# @count = 0 +# end +# +# def update +# @count += 1 +# end +# end +# +# obs = Observer.new +# [obj1, obj2, obj3, obj4].each { |o| o.add_observer(obs) } +# # execute [obj1, obj2, obj3, obj4] +# ``` +# +# `obs` is wrong because the variable `@count` can be accessed by different +# threads at the same time, so it should be synchronized (using either a Mutex +# or an AtomicFixum) +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:50 +module Concurrent::Concern::Observable + # @!macro observable_add_observer + # + # Adds an observer to this set. If a block is passed, the observer will be + # created by this method and no other params should be passed. + # + # @param [Object] observer the observer to add + # @param [Symbol] func the function to call on the observer during notification. + # Default is :update + # @return [Object] the added observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:61 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro observable_count_observers + # + # Return the number of observers associated with this object. + # + # @return [Integer] the observers count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:101 + def count_observers; end + + # @!macro observable_delete_observer + # + # Remove `observer` as an observer on this object so that it will no + # longer receive notifications. + # + # @param [Object] observer the observer to remove + # @return [Object] the deleted observer + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:82 + def delete_observer(observer); end + + # @!macro observable_delete_observers + # + # Remove all observers associated with this object. + # + # @return [Observable] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:91 + def delete_observers; end + + # As `#add_observer` but can be used for chaining. + # + # @param [Object] observer the observer to add + # @param [Symbol] func the function to call on the observer during notification. + # @return [Observable] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:70 + def with_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:107 + def observers; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/observable.rb:107 + def observers=(_arg0); end +end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:70 +class Concurrent::ConcurrentUpdateError < ::ThreadError; end + +# frozen pre-allocated backtrace to speed ConcurrentUpdateError +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:72 +Concurrent::ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE = T.let(T.unsafe(nil), Array) + +# Raised when errors occur during configuration. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:6 +class Concurrent::ConfigurationError < ::Concurrent::Error; end + +# @!macro count_down_latch +# +# A synchronization object that allows one thread to wait on multiple other threads. +# The thread that will wait creates a `CountDownLatch` and sets the initial value +# (normally equal to the number of other threads). The initiating thread passes the +# latch to the other threads then waits for the other threads by calling the `#wait` +# method. Each of the other threads calls `#count_down` when done with its work. +# When the latch counter reaches zero the waiting thread is unblocked and continues +# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset. +# +# @!macro count_down_latch_public_api +# @example Waiter and Decrementer +# latch = Concurrent::CountDownLatch.new(3) +# +# waiter = Thread.new do +# latch.wait() +# puts ("Waiter released") +# end +# +# decrementer = Thread.new do +# sleep(1) +# latch.count_down +# puts latch.count +# +# sleep(1) +# latch.count_down +# puts latch.count +# +# sleep(1) +# latch.count_down +# puts latch.count +# end +# +# [waiter, decrementer].each(&:join) +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb:98 +class Concurrent::CountDownLatch < ::Concurrent::MutexCountDownLatch; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb:56 +Concurrent::CountDownLatchImplementation = Concurrent::MutexCountDownLatch + +# A synchronization aid that allows a set of threads to all wait for each +# other to reach a common barrier point. +# @example +# barrier = Concurrent::CyclicBarrier.new(3) +# jobs = Array.new(3) { |i| -> { sleep i; p done: i } } +# process = -> (i) do +# # waiting to start at the same time +# barrier.wait +# # execute job +# jobs[i].call +# # wait for others to finish +# barrier.wait +# end +# threads = 2.times.map do |i| +# Thread.new(i, &process) +# end +# +# # use main as well +# process.call 2 +# +# # here we can be sure that all jobs are processed +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:27 +class Concurrent::CyclicBarrier < ::Concurrent::Synchronization::LockableObject + # Create a new `CyclicBarrier` that waits for `parties` threads + # + # @param [Fixnum] parties the number of parties + # @yield an optional block that will be executed that will be executed after + # the last thread arrives and before the others are released + # + # @raise [ArgumentError] if `parties` is not an integer or is less than zero + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:40 + def initialize(parties, &block); end + + # A barrier can be broken when: + # - a thread called the `reset` method while at least one other thread was waiting + # - at least one thread timed out on `wait` method + # + # A broken barrier can be restored using `reset` it's safer to create a new one + # @return [Boolean] true if the barrier is broken otherwise false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:105 + def broken?; end + + # @return [Fixnum] the number of threads currently waiting on the barrier + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:54 + def number_waiting; end + + # @return [Fixnum] the number of threads needed to pass the barrier + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:49 + def parties; end + + # resets the barrier to its initial state + # If there is at least one waiting thread, it will be woken up, the `wait` + # method will return false and the barrier will be broken + # If the barrier is broken, this method restores it to the original state + # + # @return [nil] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:95 + def reset; end + + # Blocks on the barrier until the number of waiting threads is equal to + # `parties` or until `timeout` is reached or `reset` is called + # If a block has been passed to the constructor, it will be executed once by + # the last arrived thread before releasing the others + # @param [Fixnum] timeout the number of seconds to wait for the counter or + # `nil` to block indefinitely + # @return [Boolean] `true` if the `count` reaches zero else false on + # `timeout` or on `reset` or if the barrier is broken + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:66 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:111 + def ns_generation_done(generation, status, continue = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:122 + def ns_initialize(parties, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:117 + def ns_next_generation; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 +class Concurrent::CyclicBarrier::Generation < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def status; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def status=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb:30 + def new(*_arg0); end + end +end + +# Lazy evaluation of a block yielding an immutable result. Useful for +# expensive operations that may never be needed. It may be non-blocking, +# supports the `Concern::Obligation` interface, and accepts the injection of +# custom executor upon which to execute the block. Processing of +# block will be deferred until the first time `#value` is called. +# At that time the caller can choose to return immediately and let +# the block execute asynchronously, block indefinitely, or block +# with a timeout. +# +# When a `Delay` is created its state is set to `pending`. The value and +# reason are both `nil`. The first time the `#value` method is called the +# enclosed operation will be run and the calling thread will block. Other +# threads attempting to call `#value` will block as well. Once the operation +# is complete the *value* will be set to the result of the operation or the +# *reason* will be set to the raised exception, as appropriate. All threads +# blocked on `#value` will return. Subsequent calls to `#value` will immediately +# return the cached value. The operation will only be run once. This means that +# any side effects created by the operation will only happen once as well. +# +# `Delay` includes the `Concurrent::Concern::Dereferenceable` mixin to support thread +# safety of the reference returned by `#value`. +# +# @!macro copy_options +# +# @!macro delay_note_regarding_blocking +# @note The default behavior of `Delay` is to block indefinitely when +# calling either `value` or `wait`, executing the delayed operation on +# the current thread. This makes the `timeout` value completely +# irrelevant. To enable non-blocking behavior, use the `executor` +# constructor option. This will cause the delayed operation to be +# execute on the given executor, allowing the call to timeout. +# +# @see Concurrent::Concern::Dereferenceable +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:44 +class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Obligation + + # Create a new `Delay` in the `:pending` state. + # + # @!macro executor_and_deref_options + # + # @yield the delayed operation to perform + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:62 + def initialize(opts = T.unsafe(nil), &block); end + + # Reconfigures the block returning the value if still `#incomplete?` + # + # @yield the delayed operation to perform + # @return [true, false] if success + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:146 + def reconfigure(&block); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. If the delayed operation + # raised an exception this method will return nil. The exception object + # can be accessed via the `#reason` method. + # + # @param [Numeric] timeout the maximum number of seconds to wait + # @return [Object] the current value of the object + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:77 + def value(timeout = T.unsafe(nil)); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. If the delayed operation + # raised an exception, this method will raise that exception (even when) + # the operation has already been executed). + # + # @param [Numeric] timeout the maximum number of seconds to wait + # @return [Object] the current value of the object + # @raise [Exception] when `#rejected?` raises `#reason` + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:113 + def value!(timeout = T.unsafe(nil)); end + + # Return the value this object represents after applying the options + # specified by the `#set_deref_options` method. + # + # @param [Integer] timeout (nil) the maximum number of seconds to wait for + # the value to be computed. When `nil` the caller will block indefinitely. + # + # @return [Object] self + # + # @!macro delay_note_regarding_blocking + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:132 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:160 + def ns_initialize(opts, &block); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/delay.rb:173 + def execute_task_once; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:7 +class Concurrent::DependencyCounter + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:9 + def initialize(count, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/dataflow.rb:14 + def update(time, value, reason); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:3 +class Concurrent::Error < ::StandardError; end + +# Old school kernel-style event reminiscent of Win32 programming in C++. +# +# When an `Event` is created it is in the `unset` state. Threads can choose to +# `#wait` on the event, blocking until released by another thread. When one +# thread wants to alert all blocking threads it calls the `#set` method which +# will then wake up all listeners. Once an `Event` has been set it remains set. +# New threads calling `#wait` will return immediately. An `Event` may be +# `#reset` at any time once it has been set. +# +# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx +# @example +# event = Concurrent::Event.new +# +# t1 = Thread.new do +# puts "t1 is waiting" +# event.wait(1) +# puts "event occurred" +# end +# +# t2 = Thread.new do +# puts "t2 calling set" +# event.set +# end +# +# [t1, t2].each(&:join) +# +# # prints: +# # t1 is waiting +# # t2 calling set +# # event occurred +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:36 +class Concurrent::Event < ::Concurrent::Synchronization::LockableObject + # Creates a new `Event` in the unset state. Threads calling `#wait` on the + # `Event` will block. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:40 + def initialize; end + + # Reset a previously set event back to the `unset` state. + # Has no effect if the `Event` has not yet been set. + # + # @return [Boolean] should always return `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:68 + def reset; end + + # Trigger the event, setting the state to `set` and releasing all threads + # waiting on the event. Has no effect if the `Event` has already been set. + # + # @return [Boolean] should always return `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:56 + def set; end + + # Is the object in the set state? + # + # @return [Boolean] indicating whether or not the `Event` has been set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:48 + def set?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:60 + def try?; end + + # Wait a given number of seconds for the `Event` to be set by another + # thread. Will wait forever when no `timeout` value is given. Returns + # immediately if the `Event` has already been set. + # + # @return [Boolean] true if the `Event` was set before timeout else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:83 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:104 + def ns_initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/event.rb:96 + def ns_set; end +end + +# @!macro exchanger +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:336 +class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:327 +Concurrent::ExchangerImplementation = Concurrent::RubyExchanger + +# @!macro executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:157 +module Concurrent::ExecutorService + include ::Concurrent::Concern::Logging + + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:166 + def <<(task); end + + # @!macro executor_service_method_can_overflow_question + # + # @note Always returns `false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:174 + def can_overflow?; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:161 + def post(*args, &task); end + + # @!macro executor_service_method_serialized_question + # + # @note Always returns `false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/executor_service.rb:181 + def serialized?; end +end + +# A `FiberLocalVar` is a variable where the value is different for each fiber. +# Each variable may have a default value, but when you modify the variable only +# the current fiber will ever see that change. +# +# This is similar to Ruby's built-in fiber-local variables (`Thread.current[:name]`), +# but with these major advantages: +# * `FiberLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in fiber-local variable leaks some memory forever (it's a Symbol held forever on the fiber), +# so it's only OK to create a small amount of them. +# `FiberLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in fiber-local variables leak forever the value set on each fiber (unless set to nil explicitly). +# `FiberLocalVar` automatically removes the mapping for each fiber once the `FiberLocalVar` instance is GC'd. +# +# @example +# v = FiberLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# +# @example +# v = FiberLocalVar.new(14) +# +# Fiber.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end.resume +# +# Fiber.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end.resume +# +# v.value #=> 14 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:41 +class Concurrent::FiberLocalVar + # Creates a fiber local variable. + # + # @param [Object] default the default value when otherwise unset + # @param [Proc] default_block Optional block that gets called to obtain the + # default value for each fiber + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:49 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to fiber local storage during + # execution of the given block. + # + # @param [Object] value the value to bind + # @yield the operation to be performed with the bound variable + # @return [Object] the value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:86 + def bind(value); end + + # Returns the value in the current fiber's copy of this fiber-local variable. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:68 + def value; end + + # Sets the current fiber's copy of this fiber-local variable to the specified value. + # + # @param [Object] value the value to set + # @return [Object] the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:76 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:101 + def default; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb:42 +Concurrent::FiberLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::FiberLocals) + +# @!visibility private +# @!macro internal_implementation_note +# An array-backed storage of indexed variables per fiber. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:166 +class Concurrent::FiberLocals < ::Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:167 + def locals; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:171 + def locals!; end +end + +# @!macro fixed_thread_pool +# +# A thread pool that reuses a fixed number of threads operating off an unbounded queue. +# At any point, at most `num_threads` will be active processing tasks. When all threads are busy new +# tasks `#post` to the thread pool are enqueued until a thread becomes available. +# Should a thread crash for any reason the thread will immediately be removed +# from the pool and replaced. +# +# The API and behavior of this class are based on Java's `FixedThreadPool` +# +# @!macro thread_pool_options +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb:199 +class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor + # @!macro fixed_thread_pool_method_initialize + # + # Create a new thread pool. + # + # @param [Integer] num_threads the number of threads to allocate + # @param [Hash] opts the options defining pool behavior. + # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy + # + # @raise [ArgumentError] if `num_threads` is less than or equal to zero + # @raise [ArgumentError] if `fallback_policy` is not a known policy + # + # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int- + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb:213 + def initialize(num_threads, opts = T.unsafe(nil)); end +end + +# {include:file:docs-source/future.md} +# +# @!macro copy_options +# +# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module +# @see http://clojuredocs.org/clojure_core/clojure.core/future Clojure's future function +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html java.util.concurrent.Future +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:21 +class Concurrent::Future < ::Concurrent::IVar + # Create a new `Future` in the `:unscheduled` state. + # + # @yield the asynchronous operation to perform + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:33 + def initialize(opts = T.unsafe(nil), &block); end + + # Attempt to cancel the operation if it has not already processed. + # The operation can only be cancelled while still `pending`. It cannot + # be cancelled once it has begun processing or has completed. + # + # @return [Boolean] was the operation successfully cancelled. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:99 + def cancel; end + + # Has the operation been successfully cancelled? + # + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:111 + def cancelled?; end + + # Execute an `:unscheduled` `Future`. Immediately sets the state to `:pending` and + # passes the block to a new thread/thread pool for eventual execution. + # Does nothing if the `Future` is in any state other than `:unscheduled`. + # + # @return [Future] a reference to `self` + # + # @example Instance and execute in separate steps + # future = Concurrent::Future.new{ sleep(1); 42 } + # future.state #=> :unscheduled + # future.execute + # future.state #=> :pending + # + # @example Instance and execute in one line + # future = Concurrent::Future.new{ sleep(1); 42 }.execute + # future.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:53 + def execute; end + + # @!macro ivar_set_method + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:82 + def set(value = T.unsafe(nil), &block); end + + # Wait the given number of seconds for the operation to complete. + # On timeout attempt to cancel the operation. + # + # @param [Numeric] timeout the maximum time in seconds to wait. + # @return [Boolean] true if the operation completed before the timeout + # else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:121 + def wait_or_cancel(timeout); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:133 + def ns_initialize(value, opts); end + + class << self + # Create a new `Future` object with the given block, execute it, and return the + # `:pending` object. + # + # @yield the asynchronous operation to perform + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] if no block is given + # + # @return [Future] the newly created `Future` in the `:pending` state + # + # @example + # future = Concurrent::Future.execute{ sleep(1); 42 } + # future.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/future.rb:77 + def execute(opts = T.unsafe(nil), &block); end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:18 +Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:30 +Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:22 +Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:111 +Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/configuration.rb:26 +Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay) + +# @!macro concurrent_hash +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/hash.rb:49 +class Concurrent::Hash < ::Hash; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/hash.rb:16 +Concurrent::HashImplementation = Hash + +# An `IVar` is like a future that you can assign. As a future is a value that +# is being computed that you can wait on, an `IVar` is a value that is waiting +# to be assigned, that you can wait on. `IVars` are single assignment and +# deterministic. +# +# Then, express futures as an asynchronous computation that assigns an `IVar`. +# The `IVar` becomes the primitive on which [futures](Future) and +# [dataflow](Dataflow) are built. +# +# An `IVar` is a single-element container that is normally created empty, and +# can only be set once. The I in `IVar` stands for immutable. Reading an +# `IVar` normally blocks until it is set. It is safe to set and read an `IVar` +# from different threads. +# +# If you want to have some parallel task set the value in an `IVar`, you want +# a `Future`. If you want to create a graph of parallel tasks all executed +# when the values they depend on are ready you want `dataflow`. `IVar` is +# generally a low-level primitive. +# +# ## Examples +# +# Create, set and get an `IVar` +# +# ```ruby +# ivar = Concurrent::IVar.new +# ivar.set 14 +# ivar.value #=> 14 +# ivar.set 2 # would now be an error +# ``` +# +# ## See Also +# +# 1. For the theory: Arvind, R. Nikhil, and K. Pingali. +# [I-Structures: Data structures for parallel computing](http://dl.acm.org/citation.cfm?id=69562). +# In Proceedings of Workshop on Graph Reduction, 1986. +# 2. For recent application: +# [DataDrivenFuture in Habanero Java from Rice](http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjDataDrivenFuture.html). +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:48 +class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Obligation + include ::Concurrent::Concern::Observable + + # Create a new `IVar` in the `:pending` state with the (optional) initial value. + # + # @param [Object] value the initial value + # @param [Hash] opts the options to create a message with + # @option opts [String] :dup_on_deref (false) call `#dup` before returning + # the data + # @option opts [String] :freeze_on_deref (false) call `#freeze` before + # returning the data + # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing + # the internal value and returning the value returned from the proc + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:62 + def initialize(value = T.unsafe(nil), opts = T.unsafe(nil), &block); end + + # Add an observer on this object that will receive notification on update. + # + # Upon completion the `IVar` will notify all observers in a thread-safe way. + # The `func` method of the observer will be called with three arguments: the + # `Time` at which the `Future` completed the asynchronous operation, the + # final `value` (or `nil` on rejection), and the final `reason` (or `nil` on + # fulfillment). + # + # @param [Object] observer the object that will be notified of changes + # @param [Symbol] func symbol naming the method to call when this + # `Observable` has changes` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:81 + def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end + + # @!macro ivar_fail_method + # Set the `IVar` to failed due to some error and wake or notify all threads waiting on it. + # + # @param [Object] reason for the failure + # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already + # been set or otherwise completed + # @return [IVar] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:135 + def fail(reason = T.unsafe(nil)); end + + # @!macro ivar_set_method + # Set the `IVar` to a value and wake or notify all threads waiting on it. + # + # @!macro ivar_set_parameters_and_exceptions + # @param [Object] value the value to store in the `IVar` + # @yield A block operation to use for setting the value + # @raise [ArgumentError] if both a value and a block are given + # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already + # been set or otherwise completed + # + # @return [IVar] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:113 + def set(value = T.unsafe(nil)); end + + # Attempt to set the `IVar` with the given value or block. Return a + # boolean indicating the success or failure of the set operation. + # + # @!macro ivar_set_parameters_and_exceptions + # + # @return [Boolean] true if the value was set else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:145 + def try_set(value = T.unsafe(nil), &block); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:202 + def check_for_block_or_value!(block_given, value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:177 + def complete(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:184 + def complete_without_notification(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:190 + def notify_observers(value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:195 + def ns_complete_without_notification(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:155 + def ns_initialize(value, opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/ivar.rb:168 + def safe_execute(task, args = T.unsafe(nil)); end +end + +# Raised when an operation is attempted which is not legal given the +# receiver's current state +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:20 +class Concurrent::IllegalOperationError < ::Concurrent::Error; end + +# An executor service which runs all operations on the current thread, +# blocking as necessary. Operations are performed in the order they are +# received and no two operations can be performed simultaneously. +# +# This executor service exists mainly for testing an debugging. When used +# it immediately runs every `#post` operation on the current thread, blocking +# that thread until the operation is complete. This can be very beneficial +# during testing because it makes all operations deterministic. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:17 +class Concurrent::ImmediateExecutor < ::Concurrent::AbstractExecutorService + include ::Concurrent::SerialExecutorService + + # Creates a new executor + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:21 + def initialize; end + + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:34 + def <<(task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:59 + def kill; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:26 + def post(*args, &task); end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:40 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:55 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:50 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:45 + def shuttingdown?; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/immediate_executor.rb:62 + def wait_for_termination(timeout = T.unsafe(nil)); end +end + +# Raised when an attempt is made to violate an immutability guarantee. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:16 +class Concurrent::ImmutabilityError < ::Concurrent::Error; end + +# A thread-safe, immutable variation of Ruby's standard `Struct`. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:9 +module Concurrent::ImmutableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:51 + def ==(other); end + + # @!macro struct_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:46 + def [](member); end + + # @!macro struct_each + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:56 + def each(&block); end + + # @!macro struct_each_pair + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:62 + def each_pair(&block); end + + # @!macro struct_inspect + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:29 + def inspect; end + + # @!macro struct_merge + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:36 + def merge(other, &block); end + + # @!macro struct_select + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:68 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:21 + def to_a; end + + # @!macro struct_to_h + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:41 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:33 + def to_s; end + + # @!macro struct_values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:17 + def values; end + + # @!macro struct_values_at + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:24 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:76 + def initialize_copy(original); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:12 + def included(base); end + + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:82 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/immutable_struct.rb:92 +Concurrent::ImmutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# An executor service which runs all operations on a new thread, blocking +# until it completes. Operations are performed in the order they are received +# and no two operations can be performed simultaneously. +# +# This executor service exists mainly for testing an debugging. When used it +# immediately runs every `#post` operation on a new thread, blocking the +# current thread until the operation is complete. This is similar to how the +# ImmediateExecutor works, but the operation has the full stack of the new +# thread at its disposal. This can be helpful when the operations will spawn +# more operations on the same executor and so on - such a situation might +# overflow the single stack in case of an ImmediateExecutor, which is +# inconsistent with how it would behave for a threaded executor. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:19 +class Concurrent::IndirectImmediateExecutor < ::Concurrent::ImmediateExecutor + # Creates a new executor + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:21 + def initialize; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb:27 + def post(*args, &task); end +end + +# Raised when an object's methods are called when it has not been +# properly initialized. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:24 +class Concurrent::InitializationError < ::Concurrent::Error; end + +# Raised when a lifecycle method (such as `stop`) is called in an improper +# sequence or when the object is in an inappropriate state. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:13 +class Concurrent::LifecycleError < ::Concurrent::Error; end + +# @!macro warn.edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:6 +class Concurrent::LockFreeStack < ::Concurrent::Synchronization::Object + include ::Enumerable + extend ::Concurrent::Synchronization::SafeInitialization + + # @param [Node] head + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:51 + def initialize(head = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def __initialize_atomic_fields__; end + + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:118 + def clear; end + + # @return [self] + # @yield over the cleared stack + # @yieldparam [Object] value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:142 + def clear_each(&block); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:128 + def clear_if(head); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:99 + def compare_and_clear(head); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:85 + def compare_and_pop(head); end + + # @param [Node] head + # @param [Object] value + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:65 + def compare_and_push(head, value); end + + # @param [Node] head + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:107 + def each(head = T.unsafe(nil)); end + + # @param [Node] head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:58 + def empty?(head = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:158 + def inspect; end + + # @return [Node] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:79 + def peek; end + + # @return [Object] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:90 + def pop; end + + # @param [Object] value + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:71 + def push(value); end + + # @param [Node] head + # @param [Node] new_head + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:135 + def replace_if(head, new_head); end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:154 + def to_s; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def compare_and_set_head(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def head; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def head=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def swap_head(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:37 + def update_head(&block); end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:41 + def of1(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:46 + def of2(value1, value2); end + end +end + +# The singleton for empty node +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:32 +Concurrent::LockFreeStack::EMPTY = T.let(T.unsafe(nil), Concurrent::LockFreeStack::Node) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:10 +class Concurrent::LockFreeStack::Node + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:23 + def initialize(value, next_node); end + + # @return [Node] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:14 + def next_node; end + + # @return [Object] + # @!visibility private + # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:17 + def value; end + + # @return [Object] + # @!visibility private + # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:21 + def value=(_arg0); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb:28 + def [](*_arg0); end + end +end + +# Either {FiberLocalVar} or {ThreadLocalVar} depending on whether Mutex (and Monitor) +# are held, respectively, per Fiber or per Thread. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:22 +Concurrent::LockLocalVar = Concurrent::FiberLocalVar + +# An `MVar` is a synchronized single element container. They are empty or +# contain one item. Taking a value from an empty `MVar` blocks, as does +# putting a value into a full one. You can either think of them as blocking +# queue of length one, or a special kind of mutable variable. +# +# On top of the fundamental `#put` and `#take` operations, we also provide a +# `#modify` that is atomic with respect to operations on the same instance. +# These operations all support timeouts. +# +# We also support non-blocking operations `#try_put!` and `#try_take!`, a +# `#set!` that ignores existing values, a `#value` that returns the value +# without removing it or returns `MVar::EMPTY`, and a `#modify!` that yields +# `MVar::EMPTY` if the `MVar` is empty and can be used to set `MVar::EMPTY`. +# You shouldn't use these operations in the first instance. +# +# `MVar` is a [Dereferenceable](Dereferenceable). +# +# `MVar` is related to M-structures in Id, `MVar` in Haskell and `SyncVar` in Scala. +# +# Note that unlike the original Haskell paper, our `#take` is blocking. This is how +# Haskell and Scala do it today. +# +# @!macro copy_options +# +# ## See Also +# +# 1. P. Barth, R. Nikhil, and Arvind. [M-Structures: Extending a parallel, non- strict, functional language with state](http://dl.acm.org/citation.cfm?id=652538). In Proceedings of the 5th +# ACM Conference on Functional Programming Languages and Computer Architecture (FPCA), 1991. +# +# 2. S. Peyton Jones, A. Gordon, and S. Finne. [Concurrent Haskell](http://dl.acm.org/citation.cfm?id=237794). +# In Proceedings of the 23rd Symposium on Principles of Programming Languages +# (PoPL), 1996. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:38 +class Concurrent::MVar < ::Concurrent::Synchronization::Object + include ::Concurrent::Concern::Dereferenceable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `MVar`, either empty or with an initial value. + # + # @param [Hash] opts the options controlling how the future will be processed + # + # @!macro deref_options + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:54 + def initialize(value = T.unsafe(nil), opts = T.unsafe(nil)); end + + # acquires lock on the from an `MVAR`, yields the value to provided block, + # and release lock. A timeout can be set to limit the time spent blocked, + # in which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value returned by the block, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:86 + def borrow(timeout = T.unsafe(nil)); end + + # Returns if the `MVar` is currently empty. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:195 + def empty?; end + + # Returns if the `MVar` currently contains a value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:200 + def full?; end + + # Atomically `take`, yield the value to a block for transformation, and then + # `put` the transformed value. Returns the pre-transform value. A timeout can + # be set to limit the time spent blocked, in which case it returns `TIMEOUT` + # if the time is exceeded. + # @return [Object] the pre-transform value, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:123 + def modify(timeout = T.unsafe(nil)); end + + # Non-blocking version of `modify` that will yield with `EMPTY` if there is no value yet. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:179 + def modify!; end + + # Put a value into an `MVar`, blocking if there is already a value until + # it is empty. A timeout can be set to limit the time spent blocked, in + # which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value that was put, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:103 + def put(value, timeout = T.unsafe(nil)); end + + # Non-blocking version of `put` that will overwrite an existing value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:169 + def set!(value); end + + # Remove the value from an `MVar`, leaving it empty, and blocking if there + # isn't a value. A timeout can be set to limit the time spent blocked, in + # which case it returns `TIMEOUT` if the time is exceeded. + # @return [Object] the value that was taken, or `TIMEOUT` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:66 + def take(timeout = T.unsafe(nil)); end + + # Non-blocking version of `put`, that returns whether or not it was successful. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:156 + def try_put!(value); end + + # Non-blocking version of `take`, that returns `EMPTY` instead of blocking. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:142 + def try_take!; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:206 + def synchronize(&block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:212 + def unlocked_empty?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:216 + def unlocked_full?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:224 + def wait_for_empty(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:220 + def wait_for_full(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:228 + def wait_while(condition, timeout); end +end + +# Unique value that represents that an `MVar` was empty +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:43 +Concurrent::MVar::EMPTY = T.let(T.unsafe(nil), Object) + +# Unique value that represents that an `MVar` timed out before it was able +# to produce a value. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mvar.rb:47 +Concurrent::MVar::TIMEOUT = T.let(T.unsafe(nil), Object) + +# `Concurrent::Map` is a hash-like object and should have much better performance +# characteristics, especially under high concurrency, than `Concurrent::Hash`. +# However, `Concurrent::Map `is not strictly semantically equivalent to a ruby `Hash` +# -- for instance, it does not necessarily retain ordering by insertion time as `Hash` +# does. For most uses it should do fine though, and we recommend you consider +# `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:39 +class Concurrent::Map < ::Concurrent::Collection::MriMapBackend + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:279 + def each; end + + # Iterates over each key. + # @yield for each key in the map + # @yieldparam key [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:255 + def each_key; end + + # Iterates over each key value pair. + # @yield for each key value pair in the map + # @yieldparam key [Object] + # @yieldparam value [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:274 + def each_pair; end + + # Iterates over each value. + # @yield for each value in the map + # @yieldparam value [Object] + # @return [self] + # @!macro map.atomic_method_with_block + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:264 + def each_value; end + + # Is map empty? + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:291 + def empty?; end + + # Get a value with key, or default_value when key is absent, + # or fail when no default_value is given. + # @param [Object] key + # @param [Object] default_value + # @yield default value for a key + # @yieldparam key [Object] + # @yieldreturn [Object] default value + # @return [Object] the value or default value + # @raise [KeyError] when key is missing and no default_value is provided + # @!macro map_method_not_atomic + # @note The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended + # to be use as a concurrency primitive with strong happens-before + # guarantees. It is not intended to be used as a high-level abstraction + # supporting complex operations. All read and write operations are + # thread safe, but no guarantees are made regarding race conditions + # between the fetch operation and yielding to the block. Additionally, + # this method does not support recursion. This is due to internal + # constraints that are very unlikely to change in the near future. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:183 + def fetch(key, default_value = T.unsafe(nil)); end + + # Fetch value with key, or store default value when key is absent, + # or fail when no default_value is given. This is a two step operation, + # therefore not atomic. The store can overwrite other concurrently + # stored value. + # @param [Object] key + # @param [Object] default_value + # @yield default value for a key + # @yieldparam key [Object] + # @yieldreturn [Object] default value + # @return [Object] the value or default value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:205 + def fetch_or_store(key, default_value = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:162 + def get(key); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:321 + def inspect; end + + # Find key of a value. + # @param [Object] value + # @return [Object, nil] key or nil when not found + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:284 + def key(value); end + + # All keys + # @return [::Array] keys + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:236 + def keys; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:305 + def marshal_dump; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:313 + def marshal_load(hash); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:163 + def put(key, value); end + + # Insert value into map with key if key is absent in one atomic step. + # @param [Object] key + # @param [Object] value + # @return [Object, nil] the previous value when key was present or nil when there was no key + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:215 + def put_if_absent(key, value); end + + # Is the value stored in the map. Iterates over all values. + # @param [Object] value + # @return [true, false] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:227 + def value?(value); end + + # All values + # @return [::Array] values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:244 + def values; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:331 + def initialize_copy(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:336 + def populate_from(hash); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:327 + def raise_fetch_no_key; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/map.rb:341 + def validate_options_hash!(options); end +end + +# Raised when an object with a start/stop lifecycle has been started an +# excessive number of times. Often used in conjunction with a restart +# policy or strategy. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:29 +class Concurrent::MaxRestartFrequencyError < ::Concurrent::Error; end + +# A `Maybe` encapsulates an optional value. A `Maybe` either contains a value +# of (represented as `Just`), or it is empty (represented as `Nothing`). Using +# `Maybe` is a good way to deal with errors or exceptional cases without +# resorting to drastic measures such as exceptions. +# +# `Maybe` is a replacement for the use of `nil` with better type checking. +# +# For compatibility with {Concurrent::Concern::Obligation} the predicate and +# accessor methods are aliased as `fulfilled?`, `rejected?`, `value`, and +# `reason`. +# +# ## Motivation +# +# A common pattern in languages with pattern matching, such as Erlang and +# Haskell, is to return *either* a value *or* an error from a function +# Consider this Erlang code: +# +# ```erlang +# case file:consult("data.dat") of +# {ok, Terms} -> do_something_useful(Terms); +# {error, Reason} -> lager:error(Reason) +# end. +# ``` +# +# In this example the standard library function `file:consult` returns a +# [tuple](http://erlang.org/doc/reference_manual/data_types.html#id69044) +# with two elements: an [atom](http://erlang.org/doc/reference_manual/data_types.html#id64134) +# (similar to a ruby symbol) and a variable containing ancillary data. On +# success it returns the atom `ok` and the data from the file. On failure it +# returns `error` and a string with an explanation of the problem. With this +# pattern there is no ambiguity regarding success or failure. If the file is +# empty the return value cannot be misinterpreted as an error. And when an +# error occurs the return value provides useful information. +# +# In Ruby we tend to return `nil` when an error occurs or else we raise an +# exception. Both of these idioms are problematic. Returning `nil` is +# ambiguous because `nil` may also be a valid value. It also lacks +# information pertaining to the nature of the error. Raising an exception +# is both expensive and usurps the normal flow of control. All of these +# problems can be solved with the use of a `Maybe`. +# +# A `Maybe` is unambiguous with regard to whether or not it contains a value. +# When `Just` it contains a value, when `Nothing` it does not. When `Just` +# the value it contains may be `nil`, which is perfectly valid. When +# `Nothing` the reason for the lack of a value is contained as well. The +# previous Erlang example can be duplicated in Ruby in a principled way by +# having functions return `Maybe` objects: +# +# ```ruby +# result = MyFileUtils.consult("data.dat") # returns a Maybe +# if result.just? +# do_something_useful(result.value) # or result.just +# else +# logger.error(result.reason) # or result.nothing +# end +# ``` +# +# @example Returning a Maybe from a Function +# module MyFileUtils +# def self.consult(path) +# file = File.open(path, 'r') +# Concurrent::Maybe.just(file.read) +# rescue => ex +# return Concurrent::Maybe.nothing(ex) +# ensure +# file.close if file +# end +# end +# +# maybe = MyFileUtils.consult('bogus.file') +# maybe.just? #=> false +# maybe.nothing? #=> true +# maybe.reason #=> # +# +# maybe = MyFileUtils.consult('README.md') +# maybe.just? #=> true +# maybe.nothing? #=> false +# maybe.value #=> "# Concurrent Ruby\n[![Gem Version..." +# +# @example Using Maybe with a Block +# result = Concurrent::Maybe.from do +# Client.find(10) # Client is an ActiveRecord model +# end +# +# # -- if the record was found +# result.just? #=> true +# result.value #=> # +# +# # -- if the record was not found +# result.just? #=> false +# result.reason #=> ActiveRecord::RecordNotFound +# +# @example Using Maybe with the Null Object Pattern +# # In a Rails controller... +# result = ClientService.new(10).find # returns a Maybe +# render json: result.or(NullClient.new) +# +# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe +# @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:104 +class Concurrent::Maybe < ::Concurrent::Synchronization::Object + include ::Comparable + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `Maybe` with the given attributes. + # + # @param [Object] just The value when `Just` else `NONE`. + # @param [Exception, Object] nothing The exception when `Nothing` else `NONE`. + # + # @return [Maybe] The new `Maybe`. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:224 + def initialize(just, nothing); end + + # Comparison operator. + # + # @return [Integer] 0 if self and other are both `Nothing`; + # -1 if self is `Nothing` and other is `Just`; + # 1 if self is `Just` and other is nothing; + # `self.just <=> other.just` if both self and other are `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:199 + def <=>(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:179 + def fulfilled?; end + + # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:114 + def just; end + + # Is this `Maybe` a `Just` (successfully fulfilled with a value)? + # + # @return [Boolean] True if `Just` or false if `Nothing`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:176 + def just?; end + + # The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:117 + def nothing; end + + # Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)? + # + # @return [Boolean] True if `Nothing` or false if `Just`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:184 + def nothing?; end + + # Return either the value of self or the given default value. + # + # @return [Object] The value of self when `Just`; else the given default. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:210 + def or(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:191 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:187 + def rejected?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:189 + def value; end + + class << self + # Create a new `Maybe` using the given block. + # + # Runs the given block passing all function arguments to the block as block + # arguments. If the block runs to completion without raising an exception + # a new `Just` is created with the value set to the return value of the + # block. If the block raises an exception a new `Nothing` is created with + # the reason being set to the raised exception. + # + # @param [Array] args Zero or more arguments to pass to the block. + # @yield The block from which to create a new `Maybe`. + # @yieldparam [Array] args Zero or more block arguments passed as + # arguments to the function. + # + # @return [Maybe] The newly created object. + # + # @raise [ArgumentError] when no block given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:137 + def from(*args); end + + # Create a new `Just` with the given value. + # + # @param [Object] value The value to set for the new `Maybe` object. + # + # @return [Maybe] The newly created object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:152 + def just(value); end + + # Create a new `Nothing` with the given (optional) reason. + # + # @param [Exception] error The reason to set for the new `Maybe` object. + # When given a string a new `StandardError` will be created with the + # argument as the message. When no argument is given a new + # `StandardError` with an empty message will be created. + # + # @return [Maybe] The newly created object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:164 + def nothing(error = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:119 + def new(*args, &block); end + end +end + +# Indicates that the given attribute has not been set. +# When `Just` the {#nothing} getter will return `NONE`. +# When `Nothing` the {#just} getter will return `NONE`. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/maybe.rb:111 +Concurrent::Maybe::NONE = T.let(T.unsafe(nil), Object) + +# Raised when an attempt is made to modify an immutable object +# (such as an `IVar`) after its final state has been set. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:33 +class Concurrent::MultipleAssignmentError < ::Concurrent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:36 + def initialize(message = T.unsafe(nil), inspection_data = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:41 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:34 + def inspection_data; end +end + +# Aggregates multiple exceptions. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:58 +class Concurrent::MultipleErrors < ::Concurrent::Error + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:61 + def initialize(errors, message = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:59 + def errors; end +end + +# An thread-safe variation of Ruby's standard `Struct`. Values can be set at +# construction or safely changed at any time during the object's lifecycle. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:10 +module Concurrent::MutableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # Equality + # + # @return [Boolean] true if other has the same struct subclass and has + # equal member values (according to `Object#==`) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:128 + def ==(other); end + + # @!macro struct_get + # + # Attribute Reference + # + # @param [Symbol, String, Integer] member the string or symbol name of the member + # for which to obtain the value or the member's index + # + # @return [Object] the value of the given struct member or the member at the given index. + # + # @raise [NameError] if the member does not exist + # @raise [IndexError] if the index is out of range. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:118 + def [](member); end + + # @!macro struct_set + # + # Attribute Assignment + # + # Sets the value of the given struct member or the member at the given index. + # + # @param [Symbol, String, Integer] member the string or symbol name of the member + # for which to obtain the value or the member's index + # + # @return [Object] the value of the given struct member or the member at the given index. + # + # @raise [NameError] if the name does not exist + # @raise [IndexError] if the index is out of range. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:185 + def []=(member, value); end + + # @!macro struct_each + # + # Yields the value of each struct member in order. If no block is given + # an enumerator is returned. + # + # @yield the operation to be performed on each struct member + # @yieldparam [Object] value each struct value (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:139 + def each(&block); end + + # @!macro struct_each_pair + # + # Yields the name and value of each struct member in order. If no block is + # given an enumerator is returned. + # + # @yield the operation to be performed on each struct member/value pair + # @yieldparam [Object] member each struct member (in order) + # @yieldparam [Object] value each struct value (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:152 + def each_pair(&block); end + + # @!macro struct_inspect + # + # Describe the contents of this struct in a string. + # + # @return [String] the contents of this struct in a string + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:72 + def inspect; end + + # @!macro struct_merge + # + # Returns a new struct containing the contents of `other` and the contents + # of `self`. If no block is specified, the value for entries with duplicate + # keys will be that of `other`. Otherwise the value for each duplicate key + # is determined by calling the block with the key, its value in `self` and + # its value in `other`. + # + # @param [Hash] other the hash from which to set the new values + # @yield an options block for resolving duplicate keys + # @yieldparam [String, Symbol] member the name of the member which is duplicated + # @yieldparam [Object] selfvalue the value of the member in `self` + # @yieldparam [Object] othervalue the value of the member in `other` + # + # @return [Synchronization::AbstractStruct] a new struct with the new values + # + # @raise [ArgumentError] of given a member that is not defined in the struct + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:94 + def merge(other, &block); end + + # @!macro struct_select + # + # Yields each member value from the struct to the block and returns an Array + # containing the member values from the struct for which the given block + # returns a true value (equivalent to `Enumerable#select`). + # + # @yield the operation to be performed on each struct member + # @yieldparam [Object] value each struct value (in order) + # + # @return [Array] an array containing each value for which the block returns true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:167 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:54 + def to_a; end + + # @!macro struct_to_h + # + # Returns a hash containing the names and values for the struct’s members. + # + # @return [Hash] the names and values for the struct’s members + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:103 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:75 + def to_s; end + + # @!macro struct_values + # + # Returns the values for this struct as an Array. + # + # @return [Array] the values for this struct + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:51 + def values; end + + # @!macro struct_values_at + # + # Returns the struct member values for each selector as an Array. + # + # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). + # + # @param [Fixnum, Range] indexes the index(es) from which to obatin the values (in order) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:63 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:202 + def initialize_copy(original); end + + class << self + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:210 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/mutable_struct.rb:220 +Concurrent::MutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# @!macro atomic_boolean +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:8 +class Concurrent::MutexAtomicBoolean + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_boolean_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:12 + def initialize(initial = T.unsafe(nil)); end + + # @!macro atomic_boolean_method_false_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:34 + def false?; end + + # @!macro atomic_boolean_method_make_false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:44 + def make_false; end + + # @!macro atomic_boolean_method_make_true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:39 + def make_true; end + + # @!macro atomic_boolean_method_true_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:29 + def true?; end + + # @!macro atomic_boolean_method_value_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:19 + def value; end + + # @!macro atomic_boolean_method_value_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:24 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:51 + def synchronize; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb:62 + def ns_make_value(value); end +end + +# @!macro atomic_fixnum +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:9 +class Concurrent::MutexAtomicFixnum + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_fixnum_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:13 + def initialize(initial = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:44 + def compare_and_set(expect, update); end + + # @!macro atomic_fixnum_method_decrement + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:37 + def decrement(delta = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:41 + def down(delta = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_increment + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:30 + def increment(delta = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:34 + def up(delta = T.unsafe(nil)); end + + # @!macro atomic_fixnum_method_update + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:56 + def update; end + + # @!macro atomic_fixnum_method_value_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:20 + def value; end + + # @!macro atomic_fixnum_method_value_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:25 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:65 + def synchronize; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb:76 + def ns_set(value); end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:9 +class Concurrent::MutexAtomicReference + include ::Concurrent::AtomicDirectUpdate + include ::Concurrent::AtomicNumericCompareAndSetWrapper + extend ::Concurrent::Synchronization::SafeInitialization + + # @!macro atomic_reference_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:15 + def initialize(value = T.unsafe(nil)); end + + # @!macro atomic_reference_method_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:22 + def get; end + + # @!macro atomic_reference_method_get_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:34 + def get_and_set(new_value); end + + # @!macro atomic_reference_method_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:28 + def set(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:41 + def swap(new_value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:25 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:31 + def value=(new_value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:58 + def synchronize; end + + private + + # @!macro atomic_reference_method_compare_and_set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb:44 + def _compare_and_set(old_value, new_value); end +end + +# @!macro count_down_latch +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:9 +class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableObject + # @!macro count_down_latch_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:12 + def initialize(count = T.unsafe(nil)); end + + # @!macro count_down_latch_method_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:34 + def count; end + + # @!macro count_down_latch_method_count_down + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:26 + def count_down; end + + # @!macro count_down_latch_method_wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:21 + def wait(timeout = T.unsafe(nil)); end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb:40 + def ns_initialize(count); end +end + +# @!macro semaphore +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:9 +class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject + # @!macro semaphore_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:12 + def initialize(count); end + + # @!macro semaphore_method_acquire + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:20 + def acquire(permits = T.unsafe(nil)); end + + # @!macro semaphore_method_available_permits + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:38 + def available_permits; end + + # @!macro semaphore_method_drain_permits + # + # Acquires and returns all permits that are immediately available. + # + # @return [Integer] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:47 + def drain_permits; end + + # Shrinks the number of available permits by the indicated reduction. + # + # @param [Fixnum] reduction Number of permits to remove. + # + # @raise [ArgumentError] if `reduction` is not an integer or is negative + # + # @raise [ArgumentError] if `@free` - `@reduction` is less than zero + # + # @return [nil] + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:99 + def reduce_permits(reduction); end + + # @!macro semaphore_method_release + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:77 + def release(permits = T.unsafe(nil)); end + + # @!macro semaphore_method_try_acquire + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:54 + def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:110 + def ns_initialize(count); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:117 + def try_acquire_now(permits); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb:127 + def try_acquire_timed(permits, timeout); end +end + +# Various classes within allows for +nil+ values to be stored, +# so a special +NULL+ token is required to indicate the "nil-ness". +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/constants.rb:6 +Concurrent::NULL = T.let(T.unsafe(nil), Object) + +# Suppresses all output when used for logging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/concern/logging.rb:108 +Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:6 +module Concurrent::Options + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:27 + def executor(executor_identifier); end + + # Get the requested `Executor` based on the values set in the options hash. + # + # @param [Hash] opts the options defining the requested executor + # @option opts [Executor] :executor when set use the given `Executor` instance. + # Three special values are also supported: `:fast` returns the global fast executor, + # `:io` returns the global io executor, and `:immediate` returns a new + # `ImmediateExecutor` object. + # + # @return [Executor, nil] the requested thread pool, or nil when no option specified + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/options.rb:19 + def executor_from_options(opts = T.unsafe(nil)); end + end +end + +# Promises are inspired by the JavaScript [Promises/A](http://wiki.commonjs.org/wiki/Promises/A) +# and [Promises/A+](http://promises-aplus.github.io/promises-spec/) specifications. +# +# > A promise represents the eventual value returned from the single +# > completion of an operation. +# +# Promises are similar to futures and share many of the same behaviours. +# Promises are far more robust, however. Promises can be chained in a tree +# structure where each promise may have zero or more children. Promises are +# chained using the `then` method. The result of a call to `then` is always +# another promise. Promises are resolved asynchronously (with respect to the +# main thread) but in a strict order: parents are guaranteed to be resolved +# before their children, children before their younger siblings. The `then` +# method takes two parameters: an optional block to be executed upon parent +# resolution and an optional callable to be executed upon parent failure. The +# result of each promise is passed to each of its children upon resolution. +# When a promise is rejected all its children will be summarily rejected and +# will receive the reason. +# +# Promises have several possible states: *:unscheduled*, *:pending*, +# *:processing*, *:rejected*, or *:fulfilled*. These are also aggregated as +# `#incomplete?` and `#complete?`. When a Promise is created it is set to +# *:unscheduled*. Once the `#execute` method is called the state becomes +# *:pending*. Once a job is pulled from the thread pool's queue and is given +# to a thread for processing (often immediately upon `#post`) the state +# becomes *:processing*. The future will remain in this state until processing +# is complete. A future that is in the *:unscheduled*, *:pending*, or +# *:processing* is considered `#incomplete?`. A `#complete?` Promise is either +# *:rejected*, indicating that an exception was thrown during processing, or +# *:fulfilled*, indicating success. If a Promise is *:fulfilled* its `#value` +# will be updated to reflect the result of the operation. If *:rejected* the +# `reason` will be updated with a reference to the thrown exception. The +# predicate methods `#unscheduled?`, `#pending?`, `#rejected?`, and +# `#fulfilled?` can be called at any time to obtain the state of the Promise, +# as can the `#state` method, which returns a symbol. +# +# Retrieving the value of a promise is done through the `value` (alias: +# `deref`) method. Obtaining the value of a promise is a potentially blocking +# operation. When a promise is *rejected* a call to `value` will return `nil` +# immediately. When a promise is *fulfilled* a call to `value` will +# immediately return the current value. When a promise is *pending* a call to +# `value` will block until the promise is either *rejected* or *fulfilled*. A +# *timeout* value can be passed to `value` to limit how long the call will +# block. If `nil` the call will block indefinitely. If `0` the call will not +# block. Any other integer or float value will indicate the maximum number of +# seconds to block. +# +# Promises run on the global thread pool. +# +# @!macro copy_options +# +# ### Examples +# +# Start by requiring promises +# +# ```ruby +# require 'concurrent/promise' +# ``` +# +# Then create one +# +# ```ruby +# p = Concurrent::Promise.execute do +# # do something +# 42 +# end +# ``` +# +# Promises can be chained using the `then` method. The `then` method accepts a +# block and an executor, to be executed on fulfillment, and a callable argument to be executed +# on rejection. The result of the each promise is passed as the block argument +# to chained promises. +# +# ```ruby +# p = Concurrent::Promise.new{10}.then{|x| x * 2}.then{|result| result - 10 }.execute +# ``` +# +# And so on, and so on, and so on... +# +# ```ruby +# p = Concurrent::Promise.fulfill(20). +# then{|result| result - 10 }. +# then{|result| result * 3 }. +# then(executor: different_executor){|result| result % 5 }.execute +# ``` +# +# The initial state of a newly created Promise depends on the state of its parent: +# - if parent is *unscheduled* the child will be *unscheduled* +# - if parent is *pending* the child will be *pending* +# - if parent is *fulfilled* the child will be *pending* +# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*) +# +# Promises are executed asynchronously from the main thread. By the time a +# child Promise finishes initialization it may be in a different state than its +# parent (by the time a child is created its parent may have completed +# execution and changed state). Despite being asynchronous, however, the order +# of execution of Promise objects in a chain (or tree) is strictly defined. +# +# There are multiple ways to create and execute a new `Promise`. Both ways +# provide identical behavior: +# +# ```ruby +# # create, operate, then execute +# p1 = Concurrent::Promise.new{ "Hello World!" } +# p1.state #=> :unscheduled +# p1.execute +# +# # create and immediately execute +# p2 = Concurrent::Promise.new{ "Hello World!" }.execute +# +# # execute during creation +# p3 = Concurrent::Promise.execute{ "Hello World!" } +# ``` +# +# Once the `execute` method is called a `Promise` becomes `pending`: +# +# ```ruby +# p = Concurrent::Promise.execute{ "Hello, world!" } +# p.state #=> :pending +# p.pending? #=> true +# ``` +# +# Wait a little bit, and the promise will resolve and provide a value: +# +# ```ruby +# p = Concurrent::Promise.execute{ "Hello, world!" } +# sleep(0.1) +# +# p.state #=> :fulfilled +# p.fulfilled? #=> true +# p.value #=> "Hello, world!" +# ``` +# +# If an exception occurs, the promise will be rejected and will provide +# a reason for the rejection: +# +# ```ruby +# p = Concurrent::Promise.execute{ raise StandardError.new("Here comes the Boom!") } +# sleep(0.1) +# +# p.state #=> :rejected +# p.rejected? #=> true +# p.reason #=> "#" +# ``` +# +# #### Rejection +# +# When a promise is rejected all its children will be rejected and will +# receive the rejection `reason` as the rejection callable parameter: +# +# ```ruby +# p = Concurrent::Promise.execute { Thread.pass; raise StandardError } +# +# c1 = p.then(-> reason { 42 }) +# c2 = p.then(-> reason { raise 'Boom!' }) +# +# c1.wait.state #=> :fulfilled +# c1.value #=> 42 +# c2.wait.state #=> :rejected +# c2.reason #=> # +# ``` +# +# Once a promise is rejected it will continue to accept children that will +# receive immediately rejection (they will be executed asynchronously). +# +# #### Aliases +# +# The `then` method is the most generic alias: it accepts a block to be +# executed upon parent fulfillment and a callable to be executed upon parent +# rejection. At least one of them should be passed. The default block is `{ +# |result| result }` that fulfills the child with the parent value. The +# default callable is `{ |reason| raise reason }` that rejects the child with +# the parent reason. +# +# - `on_success { |result| ... }` is the same as `then {|result| ... }` +# - `rescue { |reason| ... }` is the same as `then(Proc.new { |reason| ... } )` +# - `rescue` is aliased by `catch` and `on_error` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:190 +class Concurrent::Promise < ::Concurrent::IVar + # Initialize a new Promise with the provided options. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @option opts [Promise] :parent the parent `Promise` when building a chain/tree + # @option opts [Proc] :on_fulfill fulfillment handler + # @option opts [Proc] :on_reject rejection handler + # @option opts [object, Array] :args zero or more arguments to be passed + # the task block on execution + # + # @yield The block operation to be performed asynchronously. + # + # @raise [ArgumentError] if no block is given + # + # @see http://wiki.commonjs.org/wiki/Promises/A + # @see http://promises-aplus.github.io/promises-spec/ + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:210 + def initialize(opts = T.unsafe(nil), &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:364 + def catch(&block); end + + # Execute an `:unscheduled` `Promise`. Immediately sets the state to `:pending` and + # passes the block to a new thread/thread pool for eventual execution. + # Does nothing if the `Promise` is in any state other than `:unscheduled`. + # + # @return [Promise] a reference to `self` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:246 + def execute; end + + # @!macro ivar_fail_method + # + # @raise [Concurrent::PromiseExecutionError] if not the root promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:278 + def fail(reason = T.unsafe(nil)); end + + # Yield the successful result to the block that returns a promise. If that + # promise is also successful the result is the result of the yielded promise. + # If either part fails the whole also fails. + # + # @example + # Promise.execute { 1 }.flat_map { |v| Promise.execute { v + 2 } }.value! #=> 3 + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:375 + def flat_map(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:365 + def on_error(&block); end + + # Chain onto this promise an action to be undertaken on success + # (fulfillment). + # + # @yield The block to execute + # + # @return [Promise] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:349 + def on_success(&block); end + + # Chain onto this promise an action to be undertaken on failure + # (rejection). + # + # @yield The block to execute + # + # @return [Promise] self + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:360 + def rescue(&block); end + + # @!macro ivar_set_method + # + # @raise [Concurrent::PromiseExecutionError] if not the root promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:262 + def set(value = T.unsafe(nil), &block); end + + # Chain a new promise off the current promise. + # + # @return [Promise] the new promise + # @yield The block operation to be performed asynchronously. + # @overload then(rescuer, executor, &block) + # @param [Proc] rescuer An optional rescue block to be executed if the + # promise is rejected. + # @param [ThreadPool] executor An optional thread pool executor to be used + # in the new Promise + # @overload then(rescuer, executor: executor, &block) + # @param [Proc] rescuer An optional rescue block to be executed if the + # promise is rejected. + # @param [ThreadPool] executor An optional thread pool executor to be used + # in the new Promise + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:314 + def then(*args, &block); end + + # Builds a promise that produces the result of self and others in an Array + # and fails if any of them fails. + # + # @overload zip(*promises) + # @param [Array] others + # + # @overload zip(*promises, opts) + # @param [Array] others + # @param [Hash] opts the configuration options + # @option opts [Executor] :executor (ImmediateExecutor.new) when set use the given `Executor` instance. + # @option opts [Boolean] :execute (true) execute promise before returning + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:440 + def zip(*others); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:551 + def complete(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:545 + def notify_child(child); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:481 + def ns_initialize(value, opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:533 + def on_fulfill(result); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:539 + def on_reject(reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:562 + def realize(task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:528 + def root?; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:520 + def set_pending; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:570 + def set_state!(success, value, reason); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:576 + def synchronized_set_state!(success, value, reason); end + + class << self + # Aggregate a collection of zero or more promises under a composite promise, + # execute the aggregated promises and collect them into a standard Ruby array, + # call the given Ruby `Ennnumerable` predicate (such as `any?`, `all?`, `none?`, + # or `one?`) on the collection checking for the success or failure of each, + # then executing the composite's `#then` handlers if the predicate returns + # `true` or executing the composite's `#rescue` handlers if the predicate + # returns false. + # + # @!macro promise_self_aggregate + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:505 + def aggregate(method, *promises); end + + # Aggregates a collection of promises and executes the `then` condition + # if all aggregated promises succeed. Executes the `rescue` handler with + # a `Concurrent::PromiseExecutionError` if any of the aggregated promises + # fail. Upon execution will execute any of the aggregate promises that + # were not already executed. + # + # @!macro promise_self_aggregate + # + # The returned promise will not yet have been executed. Additional `#then` + # and `#rescue` handlers may still be provided. Once the returned promise + # is execute the aggregate promises will be also be executed (if they have + # not been executed already). The results of the aggregate promises will + # be checked upon completion. The necessary `#then` and `#rescue` blocks + # on the aggregating promise will then be executed as appropriate. If the + # `#rescue` handlers are executed the raises exception will be + # `Concurrent::PromiseExecutionError`. + # + # @param [Array] promises Zero or more promises to aggregate + # @return [Promise] an unscheduled (not executed) promise that aggregates + # the promises given as arguments + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:464 + def all?(*promises); end + + # Aggregates a collection of promises and executes the `then` condition + # if any aggregated promises succeed. Executes the `rescue` handler with + # a `Concurrent::PromiseExecutionError` if any of the aggregated promises + # fail. Upon execution will execute any of the aggregate promises that + # were not already executed. + # + # @!macro promise_self_aggregate + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:475 + def any?(*promises); end + + # Create a new `Promise` object with the given block, execute it, and return the + # `:pending` object. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @return [Promise] the newly created `Promise` in the `:pending` state + # + # @raise [ArgumentError] if no block is given + # + # @example + # promise = Concurrent::Promise.execute{ sleep(1); 42 } + # promise.state #=> :pending + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:296 + def execute(opts = T.unsafe(nil), &block); end + + # Create a new `Promise` and fulfill it immediately. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @raise [ArgumentError] if no block is given + # + # @return [Promise] the newly created `Promise` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:224 + def fulfill(value, opts = T.unsafe(nil)); end + + # Create a new `Promise` and reject it immediately. + # + # @!macro executor_and_deref_options + # + # @!macro promise_init_options + # + # @raise [ArgumentError] if no block is given + # + # @return [Promise] the newly created `Promise` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:237 + def reject(reason, opts = T.unsafe(nil)); end + + # Builds a promise that produces the result of promises in an Array + # and fails if any of them fails. + # + # @overload zip(*promises) + # @param [Array] promises + # + # @overload zip(*promises, opts) + # @param [Array] promises + # @param [Hash] opts the configuration options + # @option opts [Executor] :executor (ImmediateExecutor.new) when set use the given `Executor` instance. + # @option opts [Boolean] :execute (true) execute promise before returning + # + # @return [Promise] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:409 + def zip(*promises); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promise.rb:11 +class Concurrent::PromiseExecutionError < ::StandardError; end + +# {include:file:docs-source/promises-main.md} +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:13 +module Concurrent::Promises + extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2053 +class Concurrent::Promises::AbstractAnyPromise < ::Concurrent::Promises::BlockedPromise; end + +# Common ancestor of {Event} and {Future} classes, many shared methods are defined here. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:513 +class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization::Object + include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:522 + def initialize(promise, default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def __initialize_atomic_fields__; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:738 + def add_callback_clear_delayed_node(node); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:733 + def add_callback_notify_blocked(promise, index); end + + # For inspection. + # @!visibility private + # @return [Array] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:702 + def blocks; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:710 + def callbacks; end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:596 + def chain(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it is resolved. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @return [Future] + # @!macro promise.param.task-future + # + # @overload an_event.chain_on(executor, *args, &task) + # @yield [*args] to the task. + # @overload a_future.chain_on(executor, *args, &task) + # @yield [fulfilled, value, reason, *args] to the task. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:614 + def chain_on(executor, *args, &task); end + + # Resolves the resolvable when receiver is resolved. + # + # @param [Resolvable] resolvable + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:629 + def chain_resolvable(resolvable); end + + # Returns default executor. + # @return [Executor] default executor + # @see #with_default_executor + # @see FactoryMethods#future_on + # @see FactoryMethods#resolvable_future + # @see FactoryMethods#any_fulfilled_future_on + # @see similar + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:590 + def default_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:623 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def internal_state; end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:637 + def on_resolution(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # resolved. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # + # @overload an_event.on_resolution!(*args, &callback) + # @yield [*args] to the callback. + # @overload a_future.on_resolution!(*args, &callback) + # @yield [fulfilled, value, reason, *args] to the callback. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:655 + def on_resolution!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is resolved. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # + # @overload an_event.on_resolution_using(executor, *args, &callback) + # @yield [*args] to the callback. + # @overload a_future.on_resolution_using(executor, *args, &callback) + # @yield [fulfilled, value, reason, *args] to the callback. + # @yieldparam [true, false] fulfilled + # @yieldparam [Object] value + # @yieldparam [Object] reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:673 + def on_resolution_using(executor, *args, &callback); end + + # Is it in pending state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:549 + def pending?; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:716 + def promise; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:688 + def resolve_with(state, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Is it in resolved state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:555 + def resolved?; end + + # Returns its state. + # @return [Symbol] + # + # @overload an_event.state + # @return [:pending, :resolved] + # @overload a_future.state + # Both :fulfilled, :rejected implies :resolved. + # @return [:pending, :fulfilled, :rejected] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:543 + def state; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:633 + def tangle(resolvable); end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:619 + def to_s; end + + # Propagates touch. Requests all the delayed futures, which it depends on, to be + # executed. This method is called by any other method requiring resolved state, like {#wait}. + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:562 + def touch; end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:722 + def touched?; end + + # @!macro promises.method.wait + # Wait (block the Thread) until receiver is {#resolved?}. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.param.timeout + # @return [self, true, false] self implies timeout was not used, true implies timeout was used + # and it was resolved, false implies it was not resolved within timeout. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:578 + def wait(timeout = T.unsafe(nil)); end + + # For inspection. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:728 + def waiting_threads; end + + # @!macro promises.method.with_default_executor + # Crates new object with same class with the executor set as its new default executor. + # Any futures depending on it will use the new default executor. + # @!macro promises.shortcut.event-future + # @abstract + # @return [AbstractEventFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:683 + def with_default_executor(executor); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:743 + def with_hidden_resolvable; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:750 + def add_callback(method, *args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:812 + def async_callback_on_resolution(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:796 + def call_callback(method, state, args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:800 + def call_callbacks(state); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:763 + def callback_clear_delayed_node(state, node); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:818 + def callback_notify_blocked(state, promise, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def compare_and_set_internal_state(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def internal_state=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def swap_internal_state(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:515 + def update_internal_state(&block); end + + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:768 + def wait_until_resolved(timeout); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:808 + def with_async(executor, *args, &block); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1802 +class Concurrent::Promises::AbstractFlatPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1804 + def initialize(delayed_because, blockers_count, event_or_future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1814 + def touch; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1834 + def add_delayed_of(future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1826 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1830 + def resolvable?(countdown, future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1822 + def touched?; end +end + +# @abstract +# @private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1555 +class Concurrent::Promises::AbstractPromise < ::Concurrent::Synchronization::Object + include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1559 + def initialize(future); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1570 + def default_executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1587 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1568 + def event; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1564 + def future; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1585 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1574 + def state; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1581 + def to_s; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1578 + def touch; end + + private + + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1598 + def evaluate_to(*args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1593 + def resolve_with(new_state, raise_on_reassign = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2090 +class Concurrent::Promises::AnyFulfilledFuturePromise < ::Concurrent::Promises::AnyResolvedFuturePromise + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2094 + def resolvable?(countdown, event_or_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2056 +class Concurrent::Promises::AnyResolvedEventPromise < ::Concurrent::Promises::AbstractAnyPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2060 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2068 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2064 + def resolvable?(countdown, future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2073 +class Concurrent::Promises::AnyResolvedFuturePromise < ::Concurrent::Promises::AbstractAnyPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2077 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2085 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2081 + def resolvable?(countdown, future, index); end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1625 +class Concurrent::Promises::BlockedPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1667 + def initialize(delayed, blockers_count, future); end + + # for inspection only + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1689 + def blocked_by; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1680 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1673 + def on_blocker_resolution(future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1684 + def touch; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1697 + def clear_and_propagate_touch(stack_or_element = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1716 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1712 + def process_on_blocker_resolution(future, index); end + + # @return [true,false] if resolvable + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1708 + def resolvable?(countdown, future, index); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1658 + def add_delayed(delayed1, delayed2); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1651 + def new_blocked_by(blockers, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1629 + def new_blocked_by1(blocker, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1636 + def new_blocked_by2(blocker1, blocker2, *args, &block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1627 + def new(*args, &block); end + end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1722 +class Concurrent::Promises::BlockedTaskPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1723 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1731 + def executor; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1772 +class Concurrent::Promises::ChainPromise < ::Concurrent::Promises::BlockedTaskPromise + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1775 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2101 +class Concurrent::Promises::DelayPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2103 + def initialize(default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2114 + def delayed_because; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2110 + def touch; end +end + +# Represents an event which will happen in future (will be resolved). The event is either +# pending or resolved. It should be always resolved. Use {Future} to communicate rejections and +# cancellation. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:826 +class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:847 + def &(other); end + + # Creates a new event which will be resolved when the first of receiver, `event_or_future` + # resolves. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:853 + def any(event_or_future); end + + # Creates new event dependent on receiver which will not evaluate until touched, see {#touch}. + # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:863 + def delay; end + + # @!macro promise.method.schedule + # Creates new event dependent on receiver scheduled to execute on/in intended_time. + # In time is interpreted from the moment the receiver is resolved, therefore it inserts + # delay into the chain. + # + # @!macro promises.param.intended_time + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:875 + def schedule(intended_time); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:828 + def then(*args, &task); end + + # Returns self, since this is event + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:893 + def to_event; end + + # Converts event to a future. The future is fulfilled when the event is resolved, the future may never fail. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:885 + def to_future; end + + # @!macro promises.method.with_default_executor + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:899 + def with_default_executor(executor); end + + # @!macro promises.method.zip + # Creates a new event or a future which will be resolved when receiver and other are. + # Returns an event if receiver and other are events, otherwise returns a future. + # If just one of the parties is Future then the result + # of the returned future is equal to the result of the supplied future. If both are futures + # then the result is as described in {FactoryMethods#zip_futures_on}. + # + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:839 + def zip(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:857 + def |(event_or_future); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:910 + def callback_on_resolution(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:905 + def rejected_resolution(raise_on_reassign, state); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1978 +class Concurrent::Promises::EventWrapperPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1979 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1985 + def on_resolvable(resolved_future, index); end +end + +# Container of all {Future}, {Event} factory methods. They are never constructed directly with +# new. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:46 +module Concurrent::Promises::FactoryMethods + include ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::ReInclude + extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:282 + def any(*futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:319 + def any_event(*futures_and_or_events); end + + # Creates a new event which becomes resolved after the first futures_and_or_events resolves. + # @!macro promises.any-touch + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:329 + def any_event_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:300 + def any_fulfilled_future(*futures_and_or_events); end + + # Creates a new future which is resolved after the first futures_and_or_events is fulfilled. + # Its result equals the result of the first resolved future or if all futures_and_or_events reject, + # it has reason of the last rejected future. + # @!macro promises.any-touch + # @!macro promises.event-conversion + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:313 + def any_fulfilled_future_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:278 + def any_resolved_future(*futures_and_or_events); end + + # Creates a new future which is resolved after the first futures_and_or_events is resolved. + # Its result equals the result of the first resolved future. + # @!macro promises.any-touch + # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed + # futures un-executed if they are not required any more. + # @!macro promises.event-conversion + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:294 + def any_resolved_future_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:190 + def delay(*args, &task); end + + # Creates a new event or future which is resolved only after it is touched, + # see {Concurrent::AbstractEventFuture#touch}. + # + # @!macro promises.param.default_executor + # @overload delay_on(default_executor, *args, &task) + # If task is provided it returns a {Future} representing the result of the task. + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # @overload delay_on(default_executor) + # If no task is provided, it returns an {Event} + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:207 + def delay_on(default_executor, *args, &task); end + + # Creates a resolved future which will be fulfilled with the given value. + # + # @!macro promises.param.default_executor + # @param [Object] value + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:127 + def fulfilled_future(value, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:94 + def future(*args, &task); end + + # Constructs a new Future which will be resolved after block is evaluated on default executor. + # Evaluation begins immediately. + # + # @!macro promises.param.default_executor + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:106 + def future_on(default_executor, *args, &task); end + + # General constructor. Behaves differently based on the argument's type. It's provided for convenience + # but it's better to be explicit. + # + # @see rejected_future, resolved_event, fulfilled_future + # @!macro promises.param.default_executor + # @return [Event, Future] + # + # @overload make_future(nil, default_executor = self.default_executor) + # @param [nil] nil + # @return [Event] resolved event. + # + # @overload make_future(a_future, default_executor = self.default_executor) + # @param [Future] a_future + # @return [Future] a future which will be resolved when a_future is. + # + # @overload make_future(an_event, default_executor = self.default_executor) + # @param [Event] an_event + # @return [Event] an event which will be resolved when an_event is. + # + # @overload make_future(exception, default_executor = self.default_executor) + # @param [Exception] exception + # @return [Future] a rejected future with the exception as its reason. + # + # @overload make_future(value, default_executor = self.default_executor) + # @param [Object] value when none of the above overloads fits + # @return [Future] a fulfilled future with the value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:174 + def make_future(argument = T.unsafe(nil), default_executor = T.unsafe(nil)); end + + # Creates a resolved future which will be rejected with the given reason. + # + # @!macro promises.param.default_executor + # @param [Object] reason + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:136 + def rejected_future(reason, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [ResolvableEvent] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:63 + def resolvable_event; end + + # Creates a resolvable event, user is responsible for resolving the event once + # by calling {Promises::ResolvableEvent#resolve}. + # + # @!macro promises.param.default_executor + # @return [ResolvableEvent] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:72 + def resolvable_event_on(default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [ResolvableFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:78 + def resolvable_future; end + + # Creates resolvable future, user is responsible for resolving the future once by + # {Promises::ResolvableFuture#resolve}, {Promises::ResolvableFuture#fulfill}, + # or {Promises::ResolvableFuture#reject} + # + # @!macro promises.param.default_executor + # @return [ResolvableFuture] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:88 + def resolvable_future_on(default_executor = T.unsafe(nil)); end + + # Creates resolved event. + # + # @!macro promises.param.default_executor + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:144 + def resolved_event(default_executor = T.unsafe(nil)); end + + # Creates a resolved future with will be either fulfilled with the given value or rejected with + # the given reason. + # + # @param [true, false] fulfilled + # @param [Object] value + # @param [Object] reason + # @!macro promises.param.default_executor + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:118 + def resolved_future(fulfilled, value, reason, default_executor = T.unsafe(nil)); end + + # @!macro promises.shortcut.on + # @return [Future, Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:214 + def schedule(intended_time, *args, &task); end + + # Creates a new event or future which is resolved in intended_time. + # + # @!macro promises.param.default_executor + # @!macro promises.param.intended_time + # @param [Numeric, Time] intended_time `Numeric` means to run in `intended_time` seconds. + # `Time` means to run on `intended_time`. + # @overload schedule_on(default_executor, intended_time, *args, &task) + # If task is provided it returns a {Future} representing the result of the task. + # @!macro promises.param.args + # @yield [*args] to the task. + # @!macro promise.param.task-future + # @return [Future] + # @overload schedule_on(default_executor, intended_time) + # If no task is provided, it returns an {Event} + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:233 + def schedule_on(default_executor, intended_time, *args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:258 + def zip(*futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:262 + def zip_events(*futures_and_or_events); end + + # Creates a new event which is resolved after all futures_and_or_events are resolved. + # (Future is resolved when fulfilled or rejected.) + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:272 + def zip_events_on(default_executor, *futures_and_or_events); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:240 + def zip_futures(*futures_and_or_events); end + + # Creates a new future which is resolved after all futures_and_or_events are resolved. + # Its value is an array of zipped future values. Its reason is an array of reasons for rejection. + # If there is an error it rejects. + # @!macro promises.event-conversion + # If event is supplied, which does not have value and can be only resolved, it's + # represented as `:fulfilled` with value `nil`. + # + # @!macro promises.param.default_executor + # @param [AbstractEventFuture] futures_and_or_events + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:254 + def zip_futures_on(default_executor, *futures_and_or_events); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:50 +module Concurrent::Promises::FactoryMethods::Configuration + # @return [Executor, :io, :fast] the executor which is used when none is supplied + # to a factory method. The method can be overridden in the receivers of + # `include FactoryMethod` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:54 + def default_executor; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1846 +class Concurrent::Promises::FlatEventPromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1850 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1854 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1879 +class Concurrent::Promises::FlatFuturePromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1883 + def initialize(delayed, blockers_count, levels, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1890 + def process_on_blocker_resolution(future, index); end +end + +# Represents a value which will become available in future. May reject with a reason instead, +# e.g. when the tasks raises an exception. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:917 +class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1084 + def &(other); end + + # Creates a new event which will be resolved when the first of receiver, `event_or_future` + # resolves. Returning future will have value nil if event_or_future is event and resolves + # first. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1091 + def any(event_or_future); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1221 + def apply(args, block); end + + # Creates new future dependent on receiver which will not evaluate until touched, see {#touch}. + # In other words, it inserts delay into the chain of Futures making rest of it lazy evaluated. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1101 + def delay; end + + # Allows rejected Future to be risen with `raise` method. + # If the reason is not an exception `Runtime.new(reason)` is returned. + # + # @example + # raise Promises.rejected_future(StandardError.new("boom")) + # raise Promises.rejected_future("or just boom") + # @raise [Concurrent::Error] when raising not rejected future + # @return [Exception] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1014 + def exception(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1130 + def flat(level = T.unsafe(nil)); end + + # Creates new event which will be resolved when the returned event by receiver is. + # Be careful if the receiver rejects it will just resolve since Event does not hold reason. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1136 + def flat_event; end + + # Creates new future which will have result of the future returned by receiver. If receiver + # rejects it will have its rejection. + # + # @param [Integer] level how many levels of futures should flatten + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1126 + def flat_future(level = T.unsafe(nil)); end + + # Is it in fulfilled state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:922 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1249 + def inspect; end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1142 + def on_fulfillment(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # fulfilled. Does nothing on rejection. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [value, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1153 + def on_fulfillment!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is + # fulfilled. Does nothing on rejection. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [value, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1165 + def on_fulfillment_using(executor, *args, &callback); end + + # @!macro promises.shortcut.using + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1171 + def on_rejection(*args, &callback); end + + # Stores the callback to be executed synchronously on resolving thread after it is + # rejected. Does nothing on fulfillment. + # + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [reason, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1182 + def on_rejection!(*args, &callback); end + + # Stores the callback to be executed asynchronously on executor after it is + # rejected. Does nothing on fulfillment. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.callback + # @return [self] + # @yield [reason, *args] to the callback. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1194 + def on_rejection_using(executor, *args, &callback); end + + # Returns reason of future's rejection. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.warn.nil + # @!macro promises.param.timeout + # @!macro promises.param.timeout_value + # @return [Object, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:967 + def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # Is it in rejected state? + # @return [Boolean] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:929 + def rejected?; end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1058 + def rescue(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it rejects. Does not run + # the task if it fulfills. It will resolve though, triggering any dependent futures. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.task-future + # @return [Future] + # @yield [reason, *args] to the task. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1070 + def rescue_on(executor, *args, &task); end + + # Returns triplet fulfilled?, value, reason. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.param.timeout + # @return [Array(Boolean, Object, Object), nil] triplet of fulfilled?, value, reason, or nil + # on timeout. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:982 + def result(timeout = T.unsafe(nil)); end + + # Allows to use futures as green threads. The receiver has to evaluate to a future which + # represents what should be done next. It basically flattens indefinitely until non Future + # values is returned which becomes result of the returned future. Any encountered exception + # will become reason of the returned future. + # + # @return [Future] + # @param [#call(value)] run_test + # an object which when called returns either Future to keep running with + # or nil, then the run completes with the value. + # The run_test can be used to extract the Future from deeper structure, + # or to distinguish Future which is a resulting value from a future + # which is suppose to continue running. + # @example + # body = lambda do |v| + # v += 1 + # v < 5 ? Promises.future(v, &body) : v + # end + # Promises.future(0, &body).run.value! # => 5 + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1216 + def run(run_test = T.unsafe(nil)); end + + # @!macro promise.method.schedule + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1108 + def schedule(intended_time); end + + # @!macro promises.shortcut.on + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1040 + def then(*args, &task); end + + # Chains the task to be executed asynchronously on executor after it fulfills. Does not run + # the task if it rejects. It will resolve though, triggering any dependent futures. + # + # @!macro promises.param.executor + # @!macro promises.param.args + # @!macro promise.param.task-future + # @return [Future] + # @yield [value, *args] to the task. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1052 + def then_on(executor, *args, &task); end + + # Converts future to event which is resolved when future is resolved by fulfillment or rejection. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1228 + def to_event; end + + # Returns self, since this is a future + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1236 + def to_future; end + + # @return [String] Short string representation. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1241 + def to_s; end + + # @!macro promises.method.value + # Return value of the future. + # @!macro promises.touches + # + # @!macro promises.warn.blocks + # @!macro promises.warn.nil + # @!macro promises.param.timeout + # @!macro promises.param.timeout_value + # @param [Object] timeout_value a value returned by the method when it times out + # @return [Object, nil, timeout_value] the value of the Future when fulfilled, + # timeout_value on timeout, + # nil on rejection. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:951 + def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # @!macro promises.method.value + # @return [Object, nil, timeout_value] the value of the Future when fulfilled, + # or nil on rejection, + # or timeout_value on timeout. + # @raise [Exception] {#reason} on rejection + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:998 + def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end + + # @!macro promises.method.wait + # @raise [Exception] {#reason} on rejection + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:988 + def wait!(timeout = T.unsafe(nil)); end + + # @!macro promises.method.with_default_executor + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1117 + def with_default_executor(executor); end + + # @!macro promises.method.zip + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1076 + def zip(other); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1095 + def |(event_or_future); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1278 + def async_callback_on_fulfillment(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1284 + def async_callback_on_rejection(state, executor, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1290 + def callback_on_fulfillment(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1294 + def callback_on_rejection(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1298 + def callback_on_resolution(state, args, callback); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1257 + def rejected_resolution(raise_on_reassign, state); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1253 + def run_test(v); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1272 + def wait_until_resolved!(timeout = T.unsafe(nil)); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:918 +Concurrent::Promises::Future::SET_BACKTRACE_LOCATIONS_SUPPORTED = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1990 +class Concurrent::Promises::FutureWrapperPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1991 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1997 + def on_resolvable(resolved_future, index); end +end + +# will be immediately resolved +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1789 +class Concurrent::Promises::ImmediateEventPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1790 + def initialize(default_executor); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1795 +class Concurrent::Promises::ImmediateFuturePromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1796 + def initialize(default_executor, fulfilled, value, reason); end +end + +# @abstract +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1621 +class Concurrent::Promises::InnerPromise < ::Concurrent::Promises::AbstractPromise; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:338 +module Concurrent::Promises::InternalStates; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:397 +class Concurrent::Promises::InternalStates::Fulfilled < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:399 + def initialize(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:407 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:403 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:415 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:419 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:411 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:425 +class Concurrent::Promises::InternalStates::FulfilledArray < ::Concurrent::Promises::InternalStates::Fulfilled + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:426 + def apply(args, block); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:488 +Concurrent::Promises::InternalStates::PENDING = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Pending) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:459 +class Concurrent::Promises::InternalStates::PartiallyRejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:460 + def initialize(value, reason); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:482 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:466 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:478 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:470 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:474 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:351 +class Concurrent::Promises::InternalStates::Pending < ::Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:352 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:356 + def to_sym; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:490 +Concurrent::Promises::InternalStates::RESERVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Reserved) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:492 +Concurrent::Promises::InternalStates::RESOLVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Fulfilled) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:432 +class Concurrent::Promises::InternalStates::Rejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:433 + def initialize(reason); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:453 + def apply(args, block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:437 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:445 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:449 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:441 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:362 +class Concurrent::Promises::InternalStates::Reserved < ::Concurrent::Promises::InternalStates::Pending; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:366 +class Concurrent::Promises::InternalStates::ResolvedWithResult < ::Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:391 + def apply; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:379 + def fulfilled?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:387 + def reason; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:367 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:375 + def result; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:371 + def to_sym; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:383 + def value; end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:340 +class Concurrent::Promises::InternalStates::State + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:341 + def resolved?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:345 + def to_sym; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1754 +class Concurrent::Promises::RescuePromise < ::Concurrent::Promises::BlockedTaskPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1757 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1761 + def on_resolvable(resolved_future, index); end +end + +# Marker module of Future, Event resolved manually. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1305 +module Concurrent::Promises::Resolvable + include ::Concurrent::Promises::InternalStates +end + +# A Event which can be resolved by user. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1310 +class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event + include ::Concurrent::Promises::Resolvable + + # Makes the event resolved, which triggers all dependent futures. + # + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # @param [true, false] reserved + # Set to true if the resolvable is {#reserve}d by you, + # marks resolution of reserved resolvable events and futures explicitly. + # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1330 + def resolve(raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {AbstractEventFuture#wait} but has one additional optional argument + # resolve_on_timeout. + # + # @param [true, false] resolve_on_timeout + # If it times out and the argument is true it will also resolve the event. + # @return [self, true, false] + # @see AbstractEventFuture#wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1348 + def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Creates new event wrapping receiver, effectively hiding the resolve method. + # + # @return [Event] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1337 + def with_hidden_resolvable; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1606 +class Concurrent::Promises::ResolvableEventPromise < ::Concurrent::Promises::AbstractPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1607 + def initialize(default_executor); end +end + +# A Future which can be resolved by user. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1360 +class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future + include ::Concurrent::Promises::Resolvable + + # Evaluates the block and sets its result as future's value fulfilling, if the block raises + # an exception the future rejects with it. + # + # @yield [*args] to the block. + # @yieldreturn [Object] value + # @return [self] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1401 + def evaluate_to(*args, &block); end + + # Evaluates the block and sets its result as future's value fulfilling, if the block raises + # an exception the future rejects with it. + # + # @yield [*args] to the block. + # @yieldreturn [Object] value + # @return [self] + # @raise [Exception] also raise reason on rejection. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1412 + def evaluate_to!(*args, &block); end + + # Makes the future fulfilled with `value`, + # which triggers all dependent futures. + # + # @param [Object] value + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1381 + def fulfill(value, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {Future#reason} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Exception, timeout_value, nil] + # @see Future#reason + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1509 + def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Makes the future rejected with `reason`, + # which triggers all dependent futures. + # + # @param [Object] reason + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1391 + def reject(reason, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Makes the future resolved with result of triplet `fulfilled?`, `value`, `reason`, + # which triggers all dependent futures. + # + # @param [true, false] fulfilled + # @param [Object] value + # @param [Object] reason + # @!macro promise.param.raise_on_reassign + # @!macro promise.param.reserved + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1371 + def resolve(fulfilled = T.unsafe(nil), value = T.unsafe(nil), reason = T.unsafe(nil), raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Behaves as {Future#result} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [::Array(Boolean, Object, Exception), nil] + # @see Future#result + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1530 + def result(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#value} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Object, timeout_value, nil] + # @see Future#value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1465 + def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#value!} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [Object, timeout_value, nil] + # @raise [Exception] {#reason} on rejection + # @see Future#value! + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1487 + def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {AbstractEventFuture#wait} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [self, true, false] + # @see AbstractEventFuture#wait + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1427 + def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Behaves as {Future#wait!} but has one additional optional argument + # resolve_on_timeout. + # + # @!macro promises.resolvable.resolve_on_timeout + # @return [self, true, false] + # @raise [Exception] {#reason} on rejection + # @see Future#wait! + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1444 + def wait!(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end + + # Creates new future wrapping receiver, effectively hiding the resolve method and similar. + # + # @return [Future] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1548 + def with_hidden_resolvable; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1612 +class Concurrent::Promises::ResolvableFuturePromise < ::Concurrent::Promises::AbstractPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1613 + def initialize(default_executor); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1617 + def evaluate_to(*args, block); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1915 +class Concurrent::Promises::RunFuturePromise < ::Concurrent::Promises::AbstractFlatPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1919 + def initialize(delayed, blockers_count, default_executor, run_test); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1924 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2120 +class Concurrent::Promises::ScheduledPromise < ::Concurrent::Promises::InnerPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2131 + def initialize(default_executor, intended_time); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2125 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2121 + def intended_time; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1736 +class Concurrent::Promises::ThenPromise < ::Concurrent::Promises::BlockedTaskPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1739 + def initialize(delayed, blockers_count, default_executor, executor, args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1743 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1946 +class Concurrent::Promises::ZipEventEventPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1947 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1953 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2037 +class Concurrent::Promises::ZipEventsPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2041 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2047 + def on_resolvable(resolved_future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1958 +class Concurrent::Promises::ZipFutureEventPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1959 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1973 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:1966 + def process_on_blocker_resolution(future, index); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2002 +class Concurrent::Promises::ZipFuturesPromise < ::Concurrent::Promises::BlockedPromise + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2006 + def initialize(delayed, blockers_count, default_executor); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2019 + def on_resolvable(resolved_future, index); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/promises.rb:2013 + def process_on_blocker_resolution(future, index); end +end + +# Methods form module A included to a module B, which is already included into class C, +# will not be visible in the C class. If this module is extended to B then A's methods +# are correctly made visible to C. +# +# @example +# module A +# def a +# :a +# end +# end +# +# module B1 +# end +# +# class C1 +# include B1 +# end +# +# module B2 +# extend Concurrent::ReInclude +# end +# +# class C2 +# include B2 +# end +# +# B1.send :include, A +# B2.send :include, A +# +# C1.new.respond_to? :a # => false +# C2.new.respond_to? :a # => true +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:36 +module Concurrent::ReInclude + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:44 + def extended(base); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:50 + def include(*modules); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/re_include.rb:38 + def included(base); end +end + +# Ruby read-write lock implementation +# +# Allows any number of concurrent readers, but only one concurrent writer +# (And if the "write" lock is taken, any readers who come along will have to wait) +# +# If readers are already active when a writer comes along, the writer will wait for +# all the readers to finish before going ahead. +# Any additional readers that come when the writer is already waiting, will also +# wait (so writers are not starved). +# +# This implementation is based on `java.util.concurrent.ReentrantReadWriteLock`. +# +# @example +# lock = Concurrent::ReadWriteLock.new +# lock.with_read_lock { data.retrieve } +# lock.with_write_lock { data.modify! } +# +# @note Do **not** try to acquire the write lock while already holding a read lock +# **or** try to acquire the write lock while you already have it. +# This will lead to deadlock +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:32 +class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `ReadWriteLock` in the unlocked state. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:60 + def initialize; end + + # Acquire a read lock. If a write lock has been acquired will block until + # it is released. Will not block if other read locks have been acquired. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:113 + def acquire_read_lock; end + + # Acquire a write lock. Will block and wait for all active readers and writers. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of writers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:166 + def acquire_write_lock; end + + # Queries whether any threads are waiting to acquire the read or write lock. + # + # @return [Boolean] true if any threads are waiting for a lock else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:227 + def has_waiters?; end + + # Release a previously acquired read lock. + # + # @return [Boolean] true if the lock is successfully released + # + # @raise [Concurrent::IllegalOperationError] if no read lock is currently held. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:144 + def release_read_lock; end + + # Release a previously acquired write lock. + # + # @return [Boolean] true if the lock is successfully released + # + # @raise [Concurrent::IllegalOperationError] if the write lock is not held + # by the current thread. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:206 + def release_write_lock; end + + # Execute a block operation within a read lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:77 + def with_read_lock; end + + # Execute a block operation within a write lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:96 + def with_write_lock; end + + # Queries if the write lock is held by any thread. + # + # @return [Boolean] true if the write lock is held else false` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:220 + def write_locked?; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:259 + def max_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:264 + def max_writers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:234 + def running_readers(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:239 + def running_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:244 + def running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:254 + def waiting_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:249 + def waiting_writers(c = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:41 +Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:44 +Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:38 +Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb:35 +Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) + +# Re-entrant read-write lock implementation +# +# Allows any number of concurrent readers, but only one concurrent writer +# (And while the "write" lock is taken, no read locks can be obtained either. +# Hence, the write lock can also be called an "exclusive" lock.) +# +# If another thread has taken a read lock, any thread which wants a write lock +# will block until all the readers release their locks. However, once a thread +# starts waiting to obtain a write lock, any additional readers that come along +# will also wait (so writers are not starved). +# +# A thread can acquire both a read and write lock at the same time. A thread can +# also acquire a read lock OR a write lock more than once. Only when the read (or +# write) lock is released as many times as it was acquired, will the thread +# actually let it go, allowing other threads which might have been waiting +# to proceed. Therefore the lock can be upgraded by first acquiring +# read lock and then write lock and that the lock can be downgraded by first +# having both read and write lock a releasing just the write lock. +# +# If both read and write locks are acquired by the same thread, it is not strictly +# necessary to release them in the same order they were acquired. In other words, +# the following code is legal: +# +# @example +# lock = Concurrent::ReentrantReadWriteLock.new +# lock.acquire_write_lock +# lock.acquire_read_lock +# lock.release_write_lock +# # At this point, the current thread is holding only a read lock, not a write +# # lock. So other threads can take read locks, but not a write lock. +# lock.release_read_lock +# # Now the current thread is not holding either a read or write lock, so +# # another thread could potentially acquire a write lock. +# +# This implementation was inspired by `java.util.concurrent.ReentrantReadWriteLock`. +# +# @example +# lock = Concurrent::ReentrantReadWriteLock.new +# lock.with_read_lock { data.retrieve } +# lock.with_write_lock { data.modify! } +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:53 +class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `ReentrantReadWriteLock` in the unlocked state. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:109 + def initialize; end + + # Acquire a read lock. If a write lock is held by another thread, will block + # until it is released. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # or per-thread reentrant acquires is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:162 + def acquire_read_lock; end + + # Acquire a write lock. Will block and wait for all active readers and writers. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of writers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:264 + def acquire_write_lock; end + + # Release a previously acquired read lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:243 + def release_read_lock; end + + # Release a previously acquired write lock. + # + # @return [Boolean] true if the lock is successfully released + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:336 + def release_write_lock; end + + # Try to acquire a read lock and return true if we succeed. If it cannot be + # acquired immediately, return false. + # + # @return [Boolean] true if the lock is successfully acquired + # + # @raise [Concurrent::ResourceLimitError] if the maximum number of per-thread + # reentrant acquires is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:220 + def try_read_lock; end + + # Try to acquire a write lock and return true if we succeed. If it cannot be + # acquired immediately, return false. + # + # @return [Boolean] true if the lock is successfully acquired + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:317 + def try_write_lock; end + + # Execute a block operation within a read lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:126 + def with_read_lock; end + + # Execute a block operation within a write lock. + # + # @yield the task to be performed within the lock. + # + # @return [Object] the result of the block operation. + # + # @raise [ArgumentError] when no block is given. + # @raise [Concurrent::ResourceLimitError] if the maximum number of readers + # is exceeded. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:145 + def with_write_lock; end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:377 + def max_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:382 + def max_writers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:352 + def running_readers(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:357 + def running_readers?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:362 + def running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:372 + def waiting_or_running_writer?(c = T.unsafe(nil)); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:367 + def waiting_writers(c = T.unsafe(nil)); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:94 +Concurrent::ReentrantReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:96 +Concurrent::ReentrantReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:84 +Concurrent::ReentrantReadWriteLock::READER_BITS = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:102 +Concurrent::ReentrantReadWriteLock::READ_LOCK_MASK = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:92 +Concurrent::ReentrantReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) + +# Used with @Counter: +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:90 +Concurrent::ReentrantReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:86 +Concurrent::ReentrantReadWriteLock::WRITER_BITS = T.let(T.unsafe(nil), Integer) + +# Used with @HeldCount: +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:100 +Concurrent::ReentrantReadWriteLock::WRITE_LOCK_HELD = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:104 +Concurrent::ReentrantReadWriteLock::WRITE_LOCK_MASK = T.let(T.unsafe(nil), Integer) + +# Raised by an `Executor` when it is unable to process a given task, +# possibly because of a reject policy or other internal error. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:48 +class Concurrent::RejectedExecutionError < ::Concurrent::Error; end + +# Raised when any finite resource, such as a lock counter, exceeds its +# maximum limit/threshold. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:52 +class Concurrent::ResourceLimitError < ::Concurrent::Error; end + +# @!macro internal_implementation_note +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:129 +class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:159 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def __initialize_atomic_fields__; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def compare_and_set_slot(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def slot; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def slot=(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def swap_slot(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:165 + def update_slot(&block); end + + private + + # @!macro exchanger_method_do_exchange + # + # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:170 + def do_exchange(value, timeout); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:138 +class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:142 + def initialize(item); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def __initialize_atomic_fields__; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def compare_and_set_value(expected, value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:153 + def item; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:149 + def latch; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def swap_value(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def update_value(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/exchanger.rb:139 + def value=(value); end +end + +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:8 +class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:11 + def initialize(*args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:42 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:17 + def post(*args, &task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:33 + def shutdown; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:52 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:70 + def ns_running?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:78 + def ns_shutdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:66 + def ns_shutdown_execution; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:74 + def ns_shuttingdown?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:58 + def stop_event; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb:62 + def stopped_event; end +end + +# @!macro single_thread_executor +# @!macro abstract_executor_service_public_api +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb:9 +class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor + include ::Concurrent::SerialExecutorService + + # @!macro single_thread_executor_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb:13 + def initialize(opts = T.unsafe(nil)); end +end + +# @!macro thread_pool_executor +# @!macro thread_pool_options +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:13 +class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService + # @!macro thread_pool_executor_method_initialize + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:47 + def initialize(opts = T.unsafe(nil)); end + + # @!macro thread_pool_executor_method_active_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:67 + def active_count; end + + # @!macro executor_service_method_can_overflow_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:74 + def can_overflow?; end + + # @!macro thread_pool_executor_attr_reader_completed_task_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:62 + def completed_task_count; end + + # @!macro thread_pool_executor_attr_reader_idletime + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:38 + def idletime; end + + # @!macro thread_pool_executor_attr_reader_largest_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:52 + def largest_length; end + + # @!macro thread_pool_executor_attr_reader_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:79 + def length; end + + # @!macro thread_pool_executor_attr_reader_max_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:32 + def max_length; end + + # @!macro thread_pool_executor_attr_reader_max_queue + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:41 + def max_queue; end + + # @!macro thread_pool_executor_attr_reader_min_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:35 + def min_length; end + + # @!macro thread_pool_executor_method_prune_pool + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:139 + def prune_pool; end + + # removes the worker if it can be pruned + # + # @return [true, false] if the worker was pruned + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:104 + def prune_worker(worker); end + + # @!macro thread_pool_executor_attr_reader_queue_length + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:84 + def queue_length; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:124 + def ready_worker(worker, last_message); end + + # @!macro thread_pool_executor_attr_reader_remaining_capacity + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:89 + def remaining_capacity; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:116 + def remove_worker(worker); end + + # @!macro thread_pool_executor_attr_reader_scheduled_task_count + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:57 + def scheduled_task_count; end + + # @!macro thread_pool_executor_attr_reader_synchronous + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:44 + def synchronous; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:129 + def worker_died(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:134 + def worker_task_completed; end + + private + + # creates new worker which has to receive work to do after it's added + # @return [nil, Worker] nil of max capacity is reached + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:257 + def ns_add_busy_worker; end + + # tries to assign task to a worker, tries to get one from @ready or to create new one + # @return [true, false] if task is assigned to a worker + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:217 + def ns_assign_worker(*args, &task); end + + # tries to enqueue task + # @return [true, false] if enqueued + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:235 + def ns_enqueue(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:178 + def ns_execute(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:146 + def ns_initialize(opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:205 + def ns_kill_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:173 + def ns_limited_queue?; end + + # @return [Integer] number of excess idle workers which can be removed without + # going below min_length, or all workers if not running + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:305 + def ns_prunable_capacity; end + + # handle ready worker, giving it new job or assigning back to @ready + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:269 + def ns_ready_worker(worker, last_message, success = T.unsafe(nil)); end + + # removes a worker which is not tracked in @ready + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:287 + def ns_remove_busy_worker(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:294 + def ns_remove_ready_worker(worker); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:314 + def ns_reset_if_forked; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:190 + def ns_shutdown_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:247 + def ns_worker_died(worker); end +end + +# @!macro thread_pool_executor_constant_default_max_pool_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:17 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_max_queue_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:23 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_min_pool_size +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:20 +Concurrent::RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE = T.let(T.unsafe(nil), Integer) + +# @!macro thread_pool_executor_constant_default_synchronous +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:29 +Concurrent::RubyThreadPoolExecutor::DEFAULT_SYNCHRONOUS = T.let(T.unsafe(nil), FalseClass) + +# @!macro thread_pool_executor_constant_default_thread_timeout +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:26 +Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:328 +class Concurrent::RubyThreadPoolExecutor::Worker + include ::Concurrent::Concern::Logging + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:331 + def initialize(pool, id); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:342 + def <<(message); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350 + def kill; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:346 + def stop; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:356 + def create_worker(queue, pool, idletime); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:381 + def run_task(pool, task, args); end +end + +# A simple utility class that executes a callable and returns and array of three elements: +# success - indicating if the callable has been executed without errors +# value - filled by the callable result if it has been executed without errors, nil otherwise +# reason - the error risen by the callable if it has been executed with errors, nil otherwise +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:9 +class Concurrent::SafeTaskExecutor < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:11 + def initialize(task, opts = T.unsafe(nil)); end + + # @return [Array] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:18 + def execute(*args); end +end + +# `ScheduledTask` is a close relative of `Concurrent::Future` but with one +# important difference: A `Future` is set to execute as soon as possible +# whereas a `ScheduledTask` is set to execute after a specified delay. This +# implementation is loosely based on Java's +# [ScheduledExecutorService](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html). +# It is a more feature-rich variant of {Concurrent.timer}. +# +# The *intended* schedule time of task execution is set on object construction +# with the `delay` argument. The delay is a numeric (floating point or integer) +# representing a number of seconds in the future. Any other value or a numeric +# equal to or less than zero will result in an exception. The *actual* schedule +# time of task execution is set when the `execute` method is called. +# +# The constructor can also be given zero or more processing options. Currently +# the only supported options are those recognized by the +# [Dereferenceable](Dereferenceable) module. +# +# The final constructor argument is a block representing the task to be performed. +# If no block is given an `ArgumentError` will be raised. +# +# **States** +# +# `ScheduledTask` mixes in the [Obligation](Obligation) module thus giving it +# "future" behavior. This includes the expected lifecycle states. `ScheduledTask` +# has one additional state, however. While the task (block) is being executed the +# state of the object will be `:processing`. This additional state is necessary +# because it has implications for task cancellation. +# +# **Cancellation** +# +# A `:pending` task can be cancelled using the `#cancel` method. A task in any +# other state, including `:processing`, cannot be cancelled. The `#cancel` +# method returns a boolean indicating the success of the cancellation attempt. +# A cancelled `ScheduledTask` cannot be restarted. It is immutable. +# +# **Obligation and Observation** +# +# The result of a `ScheduledTask` can be obtained either synchronously or +# asynchronously. `ScheduledTask` mixes in both the [Obligation](Obligation) +# module and the +# [Observable](http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html) +# module from the Ruby standard library. With one exception `ScheduledTask` +# behaves identically to [Future](Observable) with regard to these modules. +# +# @!macro copy_options +# +# @example Basic usage +# +# require 'concurrent/scheduled_task' +# require 'csv' +# require 'open-uri' +# +# class Ticker +# def get_year_end_closing(symbol, year, api_key) +# uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv" +# data = [] +# csv = URI.parse(uri).read +# if csv.include?('call frequency') +# return :rate_limit_exceeded +# end +# CSV.parse(csv, headers: true) do |row| +# data << row['close'].to_f if row['timestamp'].include?(year.to_s) +# end +# year_end = data.first +# year_end +# rescue => e +# p e +# end +# end +# +# api_key = ENV['ALPHAVANTAGE_KEY'] +# abort(error_message) unless api_key +# +# # Future +# price = Concurrent::Future.execute{ Ticker.new.get_year_end_closing('TWTR', 2013, api_key) } +# price.state #=> :pending +# price.pending? #=> true +# price.value(0) #=> nil (does not block) +# +# sleep(1) # do other stuff +# +# price.value #=> 63.65 (after blocking if necessary) +# price.state #=> :fulfilled +# price.fulfilled? #=> true +# price.value #=> 63.65 +# +# @example Successful task execution +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.state #=> :unscheduled +# task.execute +# task.state #=> pending +# +# # wait for it... +# sleep(3) +# +# task.unscheduled? #=> false +# task.pending? #=> false +# task.fulfilled? #=> true +# task.rejected? #=> false +# task.value #=> 'What does the fox say?' +# +# @example One line creation and execution +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' }.execute +# task.state #=> pending +# +# task = Concurrent::ScheduledTask.execute(2){ 'What do you get when you multiply 6 by 9?' } +# task.state #=> pending +# +# @example Failed task execution +# +# task = Concurrent::ScheduledTask.execute(2){ raise StandardError.new('Call me maybe?') } +# task.pending? #=> true +# +# # wait for it... +# sleep(3) +# +# task.unscheduled? #=> false +# task.pending? #=> false +# task.fulfilled? #=> false +# task.rejected? #=> true +# task.value #=> nil +# task.reason #=> # +# +# @example Task execution with observation +# +# observer = Class.new{ +# def update(time, value, reason) +# puts "The task completed at #{time} with value '#{value}'" +# end +# }.new +# +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.add_observer(observer) +# task.execute +# task.pending? #=> true +# +# # wait for it... +# sleep(3) +# +# #>> The task completed at 2013-11-07 12:26:09 -0500 with value 'What does the fox say?' +# +# @!macro monotonic_clock_warning +# +# @see Concurrent.timer +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:158 +class Concurrent::ScheduledTask < ::Concurrent::IVar + include ::Comparable + + # Schedule a task for execution at a specified future time. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @yield the task to be performed + # + # @!macro executor_and_deref_options + # + # @option opts [object, Array] :args zero or more arguments to be passed the task + # block on execution + # + # @raise [ArgumentError] When no block is given + # @raise [ArgumentError] When given a time that is in the past + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:178 + def initialize(delay, opts = T.unsafe(nil), &task); end + + # Comparator which orders by schedule time. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:213 + def <=>(other); end + + # Cancel this task and prevent it from executing. A task can only be + # cancelled if it is pending or unscheduled. + # + # @return [Boolean] true if successfully cancelled else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:235 + def cancel; end + + # Has the task been cancelled? + # + # @return [Boolean] true if the task is in the given state else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:220 + def cancelled?; end + + # Execute an `:unscheduled` `ScheduledTask`. Immediately sets the state to `:pending` + # and starts counting down toward execution. Does nothing if the `ScheduledTask` is + # in any state other than `:unscheduled`. + # + # @return [ScheduledTask] a reference to `self` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:273 + def execute; end + + # The executor on which to execute the task. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:163 + def executor; end + + # The `delay` value given at instantiation. + # + # @return [Float] the initial delay. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:199 + def initial_delay; end + + # Execute the task. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:297 + def process_task; end + + # In the task execution in progress? + # + # @return [Boolean] true if the task is in the given state else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:227 + def processing?; end + + # Reschedule the task using the given delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @raise [ArgumentError] When given a time that is in the past + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:262 + def reschedule(delay); end + + # Reschedule the task using the original delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @return [Boolean] true if successfully rescheduled else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:250 + def reset; end + + # The monotonic time at which the the task is scheduled to be executed. + # + # @return [Float] the schedule time or nil if `unscheduled` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:206 + def schedule_time; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def fail(reason = T.unsafe(nil)); end + + # Reschedule the task using the given delay and the current time. + # A task can only be reset while it is `:pending`. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:326 + def ns_reschedule(delay); end + + # Schedule the task using the given delay and the current time. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @return [Boolean] true if successfully rescheduled else false + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:312 + def ns_schedule(delay); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def set(value = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:301 + def try_set(value = T.unsafe(nil), &block); end + + class << self + # Create a new `ScheduledTask` object with the given block, execute it, and return the + # `:pending` object. + # + # @param [Float] delay the number of seconds to wait for before executing the task + # + # @!macro executor_and_deref_options + # + # @return [ScheduledTask] the newly created `ScheduledTask` in the `:pending` state + # + # @raise [ArgumentError] if no block is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/scheduled_task.rb:290 + def execute(delay, opts = T.unsafe(nil), &task); end + end +end + +# @!macro semaphore +# +# A counting semaphore. Conceptually, a semaphore maintains a set of +# permits. Each {#acquire} blocks if necessary until a permit is +# available, and then takes it. Each {#release} adds a permit, potentially +# releasing a blocking acquirer. +# However, no actual permit objects are used; the Semaphore just keeps a +# count of the number available and acts accordingly. +# Alternatively, permits may be acquired within a block, and automatically +# released after the block finishes executing. +# +# @!macro semaphore_public_api +# @example +# semaphore = Concurrent::Semaphore.new(2) +# +# t1 = Thread.new do +# semaphore.acquire +# puts "Thread 1 acquired semaphore" +# end +# +# t2 = Thread.new do +# semaphore.acquire +# puts "Thread 2 acquired semaphore" +# end +# +# t3 = Thread.new do +# semaphore.acquire +# puts "Thread 3 acquired semaphore" +# end +# +# t4 = Thread.new do +# sleep(2) +# puts "Thread 4 releasing semaphore" +# semaphore.release +# end +# +# [t1, t2, t3, t4].each(&:join) +# +# # prints: +# # Thread 3 acquired semaphore +# # Thread 2 acquired semaphore +# # Thread 4 releasing semaphore +# # Thread 1 acquired semaphore +# +# @example +# semaphore = Concurrent::Semaphore.new(1) +# +# puts semaphore.available_permits +# semaphore.acquire do +# puts semaphore.available_permits +# end +# puts semaphore.available_permits +# +# # prints: +# # 1 +# # 0 +# # 1 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/semaphore.rb:161 +class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/semaphore.rb:96 +Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore + +# Indicates that the including `ExecutorService` guarantees +# that all operations will occur in the order they are post and that no +# two operations may occur simultaneously. This module provides no +# functionality and provides no guarantees. That is the responsibility +# of the including class. This module exists solely to allow the including +# object to be interrogated for its serialization status. +# +# @example +# class Foo +# include Concurrent::SerialExecutor +# end +# +# foo = Foo.new +# +# foo.is_a? Concurrent::ExecutorService #=> true +# foo.is_a? Concurrent::SerialExecutor #=> true +# foo.serialized? #=> true +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb:24 +module Concurrent::SerialExecutorService + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + + # @!macro executor_service_method_serialized_question + # + # @note Always returns `true` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb:30 + def serialized?; end +end + +# Ensures passed jobs in a serialized order never running at the same time. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:8 +class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject + include ::Concurrent::Concern::Logging + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:11 + def initialize; end + + # Submit a task to the executor for asynchronous processing. + # + # @param [Executor] executor to be used for this job + # + # @param [Array] args zero or more arguments to be passed to the task + # + # @yield the asynchronous task to perform + # + # @return [Boolean] `true` if the task is queued, `false` if the executor + # is not running + # + # @raise [ArgumentError] if no task is given + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:34 + def post(executor, *args, &task); end + + # As {#post} but allows to submit multiple tasks at once, it's guaranteed that they will not + # be interleaved by other tasks. + # + # @param [Array, Proc)>] posts array of triplets where + # first is a {ExecutorService}, second is array of args for task, third is a task (Proc) + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:44 + def posts(posts); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:75 + def call_job(job); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:70 + def ns_initialize; end + + # ensures next job is executed if any is stashed + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:95 + def work(job); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 +class Concurrent::SerializedExecution::Job < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def args; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def args=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def block; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def block=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:17 + def call; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def executor; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def executor=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution.rb:16 + def new(*_arg0); end + end +end + +# A wrapper/delegator for any `ExecutorService` that +# guarantees serialized execution of tasks. +# +# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) +# @see Concurrent::SerializedExecution +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:12 +class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator + include ::Concurrent::Concern::Logging + include ::Concurrent::ExecutorService + include ::Concurrent::SerialExecutorService + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:15 + def initialize(executor); end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb:22 + def post(*args, &task); end +end + +# @!macro concurrent_set +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:61 +class Concurrent::Set < ::Concurrent::CRubySet; end + +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:23 +Concurrent::SetImplementation = Concurrent::CRubySet + +# An thread-safe, write-once variation of Ruby's standard `Struct`. +# Each member can have its value set at most once, either at construction +# or any time thereafter. Attempting to assign a value to a member +# that has already been set will result in a `Concurrent::ImmutabilityError`. +# +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` +# @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:14 +module Concurrent::SettableStruct + include ::Concurrent::Synchronization::AbstractStruct + + # @!macro struct_equality + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:50 + def ==(other); end + + # @!macro struct_get + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:45 + def [](member); end + + # @!macro struct_set + # + # @raise [Concurrent::ImmutabilityError] if the given member has already been set + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:75 + def []=(member, value); end + + # @!macro struct_each + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:55 + def each(&block); end + + # @!macro struct_each_pair + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:61 + def each_pair(&block); end + + # @!macro struct_inspect + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:29 + def inspect; end + + # @!macro struct_merge + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:35 + def merge(other, &block); end + + # @!macro struct_select + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:67 + def select(&block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:21 + def to_a; end + + # @!macro struct_to_h + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:40 + def to_h; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:32 + def to_s; end + + # @!macro struct_values + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:18 + def values; end + + # @!macro struct_values_at + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:24 + def values_at(*indexes); end + + private + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:97 + def initialize_copy(original); end + + class << self + # @!macro struct_new + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:105 + def new(*args, &block); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/settable_struct.rb:115 +Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) + +# An executor service in which every operation spawns a new, +# independently operating thread. +# +# This is perhaps the most inefficient executor service in this +# library. It exists mainly for testing an debugging. Thread creation +# and management is expensive in Ruby and this executor performs no +# resource pooling. This can be very beneficial during testing and +# debugging because it decouples the using code from the underlying +# executor implementation. In production this executor will likely +# lead to suboptimal performance. +# +# @note Intended for use primarily in testing and debugging. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:21 +class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:56 + def <<(task); end + + # @!macro executor_service_method_kill + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:84 + def kill; end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:40 + def post(*args, &task); end + + # @!macro executor_service_method_running_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:62 + def running?; end + + # @!macro executor_service_method_shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:77 + def shutdown; end + + # @!macro executor_service_method_shutdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:72 + def shutdown?; end + + # @!macro executor_service_method_shuttingdown_question + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:67 + def shuttingdown?; end + + # @!macro executor_service_method_wait_for_termination + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:91 + def wait_for_termination(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:97 + def ns_initialize(*args); end + + class << self + # @!macro executor_service_method_left_shift + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:34 + def <<(task); end + + # @!macro executor_service_method_post + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb:24 + def post(*args); end + end +end + +# @!macro single_thread_executor +# +# A thread pool with a single thread an unlimited queue. Should the thread +# die for any reason it will be removed and replaced, thus ensuring that +# the executor will always remain viable and available to process jobs. +# +# A common pattern for background processing is to create a single thread +# on which an infinite loop is run. The thread's loop blocks on an input +# source (perhaps blocking I/O or a queue) and processes each input as it +# is received. This pattern has several issues. The thread itself is highly +# susceptible to errors during processing. Also, the thread itself must be +# constantly monitored and restarted should it die. `SingleThreadExecutor` +# encapsulates all these behaviors. The task processor is highly resilient +# to errors from within tasks. Also, should the thread die it will +# automatically be restarted. +# +# The API and behavior of this class are based on Java's `SingleThreadExecutor`. +# +# @!macro abstract_executor_service_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb:37 +class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb:10 +Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:2 +module Concurrent::Synchronization + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb:7 + def full_memory_barrier; end + end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:9 +class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object + protected + + # @!macro synchronization_object_method_ns_broadcast + # + # Broadcast to all waiting threads. + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def broadcast + # synchronize { ns_broadcast } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:96 + def ns_broadcast; end + + # @!macro synchronization_object_method_ns_signal + # + # Signal one waiting thread. + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def signal + # synchronize { ns_signal } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:81 + def ns_signal; end + + # @!macro synchronization_object_method_ns_wait + # + # Wait until another thread calls #signal or #broadcast, + # spurious wake-ups can happen. + # + # @param [Numeric, nil] timeout in seconds, `nil` means no timeout + # @return [self] + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def wait(timeout = nil) + # synchronize { ns_wait(timeout) } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:66 + def ns_wait(timeout = T.unsafe(nil)); end + + # @!macro synchronization_object_method_ns_wait_until + # + # Wait until condition is met or timeout passes, + # protects against spurious wake-ups. + # @param [Numeric, nil] timeout in seconds, `nil` means no timeout + # @yield condition to be met + # @yieldreturn [true, false] + # @return [true, false] if condition met + # @note only to be used inside synchronized block + # @note to provide direct access to this method in a descendant add method + # ``` + # def wait_until(timeout = nil, &condition) + # synchronize { ns_wait_until(timeout, &condition) } + # end + # ``` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:37 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # @!macro synchronization_object_method_synchronize + # + # @yield runs the block synchronized against this object, + # equivalent of java's `synchronize(this) {}` + # @note can by made public in descendants if required by `public :synchronize` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb:18 + def synchronize; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:6 +class Concurrent::Synchronization::AbstractObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:7 + def initialize; end + + # @!visibility private + # @abstract + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:13 + def full_memory_barrier; end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb:17 + def attr_volatile(*names); end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:6 +module Concurrent::Synchronization::AbstractStruct + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:9 + def initialize(*values); end + + # @!macro struct_length + # + # Returns the number of struct members. + # + # @return [Fixnum] the number of struct members + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:19 + def length; end + + # @!macro struct_members + # + # Returns the struct members as an array of symbols. + # + # @return [Array] the struct members as an array of symbols + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:29 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:22 + def size; end + + protected + + # @!macro struct_each + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:82 + def ns_each; end + + # @!macro struct_each_pair + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:89 + def ns_each_pair; end + + # @!macro struct_equality + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:75 + def ns_equality(other); end + + # @!macro struct_get + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:59 + def ns_get(member); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:119 + def ns_initialize_copy; end + + # @!macro struct_inspect + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:105 + def ns_inspect; end + + # @!macro struct_merge + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:114 + def ns_merge(other, &block); end + + # @!macro struct_select + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:98 + def ns_select; end + + # @!macro struct_to_h + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:52 + def ns_to_h; end + + # @!macro struct_values + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:38 + def ns_values; end + + # @!macro struct_values_at + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:45 + def ns_values_at(indexes); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:130 + def pr_underscore(clazz); end + + class << self + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb:141 + def define_struct_class(parent, base, name, members, &block); end + end +end + +# @!visibility private +# TODO (pitr-ch 04-Dec-2016): should be in edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:8 +class Concurrent::Synchronization::Condition < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:18 + def initialize(lock); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:47 + def broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:51 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:43 + def ns_signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:27 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:35 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:39 + def signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:23 + def wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:31 + def wait_until(timeout = T.unsafe(nil), &condition); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:15 + def private_new(*args, &block); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:16 + def new(*args, &block); end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:8 +module Concurrent::Synchronization::ConditionSignalling + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:16 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:11 + def ns_signal; end +end + +# @!visibility private +# TODO (pitr-ch 04-Dec-2016): should be in edge +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:8 +class Concurrent::Synchronization::Lock < ::Concurrent::Synchronization::LockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:31 + def broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:35 + def ns_broadcast; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:29 + def ns_signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:17 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:23 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:25 + def signal; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:11 + def synchronize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:13 + def wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lock.rb:19 + def wait_until(timeout = T.unsafe(nil), &condition); end +end + +# Safe synchronization under any Ruby implementation. +# It provides methods like {#synchronize}, {#wait}, {#signal} and {#broadcast}. +# Provides a single layer which can improve its implementation over time without changes needed to +# the classes using it. Use {Synchronization::Object} not this abstract class. +# +# @note this object does not support usage together with +# [`Thread#wakeup`](http://ruby-doc.org/core/Thread.html#method-i-wakeup) +# and [`Thread#raise`](http://ruby-doc.org/core/Thread.html#method-i-raise). +# `Thread#sleep` and `Thread#wakeup` will work as expected but mixing `Synchronization::Object#wait` and +# `Thread#wakeup` will not work on all platforms. +# +# @see Event implementation as an example of this class use +# +# @example simple +# class AnClass < Synchronization::Object +# def initialize +# super +# synchronize { @value = 'asd' } +# end +# +# def value +# synchronize { @value } +# end +# end +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb:50 +class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/condition.rb:57 + def new_condition; end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb:11 +Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:60 +class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject + include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:65 + def initialize; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:83 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:79 + def synchronize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:71 + def initialize_copy(other); end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:25 +class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject + include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:30 + def initialize; end + + protected + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:52 + def ns_wait(timeout = T.unsafe(nil)); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:44 + def synchronize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:36 + def initialize_copy(other); end +end + +# Abstract object providing final, volatile, ans CAS extensions to build other concurrent abstractions. +# - final instance variables see {Object.safe_initialization!} +# - volatile instance variables see {Object.attr_volatile} +# - volatile instance variables see {Object.attr_atomic} +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:15 +class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::AbstractObject + include ::Concurrent::Synchronization::Volatile + extend ::Concurrent::Synchronization::Volatile::ClassMethods + + # Has to be called by children. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:28 + def initialize; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:146 + def __initialize_atomic_fields__; end + + class << self + # @return [true, false] is the attribute with name atomic? + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:125 + def atomic_attribute?(name); end + + # @param [true, false] inherited should inherited volatile with CAS fields be returned? + # @return [::Array] Returns defined volatile with CAS fields on this class. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:119 + def atomic_attributes(inherited = T.unsafe(nil)); end + + # Creates methods for reading and writing to a instance variable with + # volatile (Java) semantic as {.attr_volatile} does. + # The instance variable should be accessed only through generated methods. + # This method generates following methods: `value`, `value=(new_value) #=> new_value`, + # `swap_value(new_value) #=> old_value`, + # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`. + # @param [::Array] names of the instance variables to be volatile with CAS. + # @return [::Array] names of defined method names. + # @!macro attr_atomic + # @!method $1 + # @return [Object] The $1. + # @!method $1=(new_$1) + # Set the $1. + # @return [Object] new_$1. + # @!method swap_$1(new_$1) + # Set the $1 to new_$1 and return the old $1. + # @return [Object] old $1 + # @!method compare_and_set_$1(expected_$1, new_$1) + # Sets the $1 to new_$1 if the current $1 is expected_$1 + # @return [true, false] + # @!method update_$1(&block) + # Updates the $1 using the block. + # @yield [Object] Calculate a new $1 using given (old) $1 + # @yieldparam [Object] old $1 + # @return [Object] new $1 + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:84 + def attr_atomic(*names); end + + # For testing purposes, quite slow. Injects assert code to new method which will raise if class instance contains + # any instance variables with CamelCase names and isn't {.safe_initialization?}. + # @raise when offend found + # @return [true] + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:45 + def ensure_safe_initialization_when_final_fields_are_present; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:33 + def safe_initialization!; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:37 + def safe_initialization?; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/object.rb:131 + def define_initialize_atomic_fields; end + end +end + +# @!visibility private +# @!macro internal_implementation_note +# +# By extending this module, a class and all its children are marked to be constructed safely. Meaning that +# all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures +# same behaviour as Java's final fields. +# +# Due to using Kernel#extend, the module is not included again if already present in the ancestors, +# which avoids extra overhead. +# +# @example +# class AClass < Concurrent::Synchronization::Object +# extend Concurrent::Synchronization::SafeInitialization +# +# def initialize +# @AFinalValue = 'value' # published safely, #foo will never return nil +# end +# +# def foo +# @AFinalValue +# end +# end +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb:28 +module Concurrent::Synchronization::SafeInitialization + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb:29 + def new(*args, &block); end +end + +# Volatile adds the attr_volatile class method when included. +# +# @example +# class Foo +# include Concurrent::Synchronization::Volatile +# +# attr_volatile :bar +# +# def initialize +# self.bar = 1 +# end +# end +# +# foo = Foo.new +# foo.bar +# => 1 +# foo.bar = 2 +# => 2 +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:28 +module Concurrent::Synchronization::Volatile + mixes_in_class_methods ::Concurrent::Synchronization::Volatile::ClassMethods + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:33 + def full_memory_barrier; end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:29 + def included(base); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:37 +module Concurrent::Synchronization::Volatile::ClassMethods + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/synchronization/volatile.rb:39 + def attr_volatile(*names); end +end + +# This class provides a trivial way to synchronize all calls to a given object +# by wrapping it with a `Delegator` that performs `Monitor#enter/exit` calls +# around the delegated `#send`. Example: +# +# array = [] # not thread-safe on many impls +# array = SynchronizedDelegator.new([]) # thread-safe +# +# A simple `Monitor` provides a very coarse-grained way to synchronize a given +# object, in that it will cause synchronization for methods that have no need +# for it, but this is a trivial way to get thread-safety where none may exist +# currently on some implementations. +# +# This class is currently being considered for inclusion into stdlib, via +# https://bugs.ruby-lang.org/issues/8556 +# +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:21 +class Concurrent::SynchronizedDelegator < ::SimpleDelegator + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:31 + def initialize(obj); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:36 + def method_missing(method, *args, &block); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:22 + def setup; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb:27 + def teardown; end +end + +# A `TVar` is a transactional variable - a single-element container that +# is used as part of a transaction - see `Concurrent::atomically`. +# +# @!macro thread_safe_variable_comparison +# +# {include:file:docs-source/tvar.md} +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:12 +class Concurrent::TVar < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + + # Create a new `TVar` with an initial value. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:16 + def initialize(value); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:46 + def unsafe_lock; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:36 + def unsafe_value; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:41 + def unsafe_value=(value); end + + # Get the value of a `TVar`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:22 + def value; end + + # Set the value of a `TVar`. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:29 + def value=(value); end +end + +# A `ThreadLocalVar` is a variable where the value is different for each thread. +# Each variable may have a default value, but when you modify the variable only +# the current thread will ever see that change. +# +# This is similar to Ruby's built-in thread-local variables (`Thread#thread_variable_get`), +# but with these major advantages: +# * `ThreadLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in thread-local variable leaks some memory forever (it's a Symbol held forever on the thread), +# so it's only OK to create a small amount of them. +# `ThreadLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in thread-local variables leak forever the value set on each thread (unless set to nil explicitly). +# `ThreadLocalVar` automatically removes the mapping for each thread once the `ThreadLocalVar` instance is GC'd. +# +# @!macro thread_safe_variable_comparison +# +# @example +# v = ThreadLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# +# @example +# v = ThreadLocalVar.new(14) +# +# t1 = Thread.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end +# +# t2 = Thread.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end +# +# v.value #=> 14 +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:43 +class Concurrent::ThreadLocalVar + # Creates a thread local variable. + # + # @param [Object] default the default value when otherwise unset + # @param [Proc] default_block Optional block that gets called to obtain the + # default value for each thread + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:51 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to thread local storage during + # execution of the given block. + # + # @param [Object] value the value to bind + # @yield the operation to be performed with the bound variable + # @return [Object] the value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:88 + def bind(value); end + + # Returns the value in the current thread's copy of this thread-local variable. + # + # @return [Object] the current value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:70 + def value; end + + # Sets the current thread's copy of this thread-local variable to the specified value. + # + # @param [Object] value the value to set + # @return [Object] the new value + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:78 + def value=(value); end + + protected + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:103 + def default; end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb:44 +Concurrent::ThreadLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::ThreadLocals) + +# @!visibility private +# @!macro internal_implementation_note +# An array-backed storage of indexed variables per thread. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:141 +class Concurrent::ThreadLocals < ::Concurrent::AbstractLocals + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:142 + def locals; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/atomic/locals.rb:146 + def locals!; end +end + +# @!macro thread_pool_executor +# +# An abstraction composed of one or more threads and a task queue. Tasks +# (blocks or `proc` objects) are submitted to the pool and added to the queue. +# The threads in the pool remove the tasks and execute them in the order +# they were received. +# +# A `ThreadPoolExecutor` will automatically adjust the pool size according +# to the bounds set by `min-threads` and `max-threads`. When a new task is +# submitted and fewer than `min-threads` threads are running, a new thread +# is created to handle the request, even if other worker threads are idle. +# If there are more than `min-threads` but less than `max-threads` threads +# running, a new thread will be created only if the queue is full. +# +# Threads that are idle for too long will be garbage collected, down to the +# configured minimum options. Should a thread crash it, too, will be garbage collected. +# +# `ThreadPoolExecutor` is based on the Java class of the same name. From +# the official Java documentation; +# +# > Thread pools address two different problems: they usually provide +# > improved performance when executing large numbers of asynchronous tasks, +# > due to reduced per-task invocation overhead, and they provide a means +# > of bounding and managing the resources, including threads, consumed +# > when executing a collection of tasks. Each ThreadPoolExecutor also +# > maintains some basic statistics, such as the number of completed tasks. +# > +# > To be useful across a wide range of contexts, this class provides many +# > adjustable parameters and extensibility hooks. However, programmers are +# > urged to use the more convenient Executors factory methods +# > [CachedThreadPool] (unbounded thread pool, with automatic thread reclamation), +# > [FixedThreadPool] (fixed size thread pool) and [SingleThreadExecutor] (single +# > background thread), that preconfigure settings for the most common usage +# > scenarios. +# +# @!macro thread_pool_options +# +# @!macro thread_pool_executor_public_api +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb:56 +class Concurrent::ThreadPoolExecutor < ::Concurrent::RubyThreadPoolExecutor; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb:10 +Concurrent::ThreadPoolExecutorImplementation = Concurrent::RubyThreadPoolExecutor + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:4 +module Concurrent::ThreadSafe; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:7 +module Concurrent::ThreadSafe::Util + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb:16 + def make_synchronized_on_cruby(klass); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb:41 + def make_synchronized_on_truffleruby(klass); end + end +end + +# TODO (pitr-ch 15-Oct-2016): migrate to Utility::ProcessorCounter +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:13 +Concurrent::ThreadSafe::Util::CPU_COUNT = T.let(T.unsafe(nil), Integer) + +# TODO (pitr-ch 15-Oct-2016): migrate to Utility::NativeInteger +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:10 +Concurrent::ThreadSafe::Util::FIXNUM_BIT_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:11 +Concurrent::ThreadSafe::Util::MAX_INT = T.let(T.unsafe(nil), Integer) + +# Raised when an operation times out. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/errors.rb:55 +class Concurrent::TimeoutError < ::Concurrent::Error; end + +# Executes a collection of tasks, each after a given delay. A master task +# monitors the set and schedules each task for execution at the appropriate +# time. Tasks are run on the global thread pool or on the supplied executor. +# Each task is represented as a `ScheduledTask`. +# +# @see Concurrent::ScheduledTask +# +# @!macro monotonic_clock_warning +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:19 +class Concurrent::TimerSet < ::Concurrent::RubyExecutorService + # Create a new set of timed tasks. + # + # @!macro executor_options + # + # @param [Hash] opts the options used to specify the executor on which to perform actions + # @option opts [Executor] :executor when set use the given `Executor` instance. + # Three special values are also supported: `:task` returns the global task pool, + # `:operation` returns the global operation pool, and `:immediate` returns a new + # `ImmediateExecutor` object. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:30 + def initialize(opts = T.unsafe(nil)); end + + # Begin an immediate shutdown. In-progress tasks will be allowed to + # complete but enqueued tasks will be dismissed and no new tasks + # will be accepted. Has no additional effect if the thread pool is + # not running. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:62 + def kill; end + + # Post a task to be execute run after a given delay (in seconds). If the + # delay is less than 1/100th of a second the task will be immediately post + # to the executor. + # + # @param [Float] delay the number of seconds to wait for before executing the task. + # @param [Array] args the arguments passed to the task on execution. + # + # @yield the task to be performed. + # + # @return [Concurrent::ScheduledTask, false] IVar representing the task if the post + # is successful; false after shutdown. + # + # @raise [ArgumentError] if the intended execution time is not in the future. + # @raise [ArgumentError] if no block is given. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:48 + def post(delay, *args, &task); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:67 + def <<(task); end + + # Initialize the object. + # + # @param [Hash] opts the options to create the object with. + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:75 + def ns_initialize(opts); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:95 + def ns_post_task(task); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:132 + def ns_reset_if_forked; end + + # `ExecutorService` callback called during shutdown. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:123 + def ns_shutdown_execution; end + + # Post the task to the internal queue. + # + # @note This is intended as a callback method from ScheduledTask + # only. It is not intended to be used directly. Post a task + # by using the `SchedulesTask#execute` method. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:90 + def post_task(task); end + + # Run a loop and execute tasks in the scheduled order and at the approximate + # scheduled time. If no tasks remain the thread will exit gracefully so that + # garbage collection can occur. If there are no ready tasks it will sleep + # for up to 60 seconds waiting for the next scheduled task. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:146 + def process_tasks; end + + # Remove the given task from the queue. + # + # @note This is intended as a callback method from `ScheduledTask` + # only. It is not intended to be used directly. Cancel a task + # by using the `ScheduledTask#cancel` method. + # + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/executor/timer_set.rb:116 + def remove_task(task); end +end + +# A very common concurrency pattern is to run a thread that performs a task at +# regular intervals. The thread that performs the task sleeps for the given +# interval then wakes up and performs the task. Lather, rinse, repeat... This +# pattern causes two problems. First, it is difficult to test the business +# logic of the task because the task itself is tightly coupled with the +# concurrency logic. Second, an exception raised while performing the task can +# cause the entire thread to abend. In a long-running application where the +# task thread is intended to run for days/weeks/years a crashed task thread +# can pose a significant problem. `TimerTask` alleviates both problems. +# +# When a `TimerTask` is launched it starts a thread for monitoring the +# execution interval. The `TimerTask` thread does not perform the task, +# however. Instead, the TimerTask launches the task on a separate thread. +# Should the task experience an unrecoverable crash only the task thread will +# crash. This makes the `TimerTask` very fault tolerant. Additionally, the +# `TimerTask` thread can respond to the success or failure of the task, +# performing logging or ancillary operations. +# +# One other advantage of `TimerTask` is that it forces the business logic to +# be completely decoupled from the concurrency logic. The business logic can +# be tested separately then passed to the `TimerTask` for scheduling and +# running. +# +# A `TimerTask` supports two different types of interval calculations. +# A fixed delay will always wait the same amount of time between the +# completion of one task and the start of the next. A fixed rate will +# attempt to maintain a constant rate of execution regardless of the +# duration of the task. For example, if a fixed rate task is scheduled +# to run every 60 seconds but the task itself takes 10 seconds to +# complete, the next task will be scheduled to run 50 seconds after +# the start of the previous task. If the task takes 70 seconds to +# complete, the next task will be start immediately after the previous +# task completes. Tasks will not be executed concurrently. +# +# In some cases it may be necessary for a `TimerTask` to affect its own +# execution cycle. To facilitate this, a reference to the TimerTask instance +# is passed as an argument to the provided block every time the task is +# executed. +# +# The `TimerTask` class includes the `Dereferenceable` mixin module so the +# result of the last execution is always available via the `#value` method. +# Dereferencing options can be passed to the `TimerTask` during construction or +# at any later time using the `#set_deref_options` method. +# +# `TimerTask` supports notification through the Ruby standard library +# {http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html +# Observable} module. On execution the `TimerTask` will notify the observers +# with three arguments: time of execution, the result of the block (or nil on +# failure), and any raised exceptions (or nil on success). +# +# @!macro copy_options +# +# @example Basic usage +# task = Concurrent::TimerTask.new{ puts 'Boom!' } +# task.execute +# +# task.execution_interval #=> 60 (default) +# +# # wait 60 seconds... +# #=> 'Boom!' +# +# task.shutdown #=> true +# +# @example Configuring `:execution_interval` +# task = Concurrent::TimerTask.new(execution_interval: 5) do +# puts 'Boom!' +# end +# +# task.execution_interval #=> 5 +# +# @example Immediate execution with `:run_now` +# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' } +# task.execute +# +# #=> 'Boom!' +# +# @example Configuring `:interval_type` with either :fixed_delay or :fixed_rate, default is :fixed_delay +# task = Concurrent::TimerTask.new(execution_interval: 5, interval_type: :fixed_rate) do +# puts 'Boom!' +# end +# task.interval_type #=> :fixed_rate +# +# @example Last `#value` and `Dereferenceable` mixin +# task = Concurrent::TimerTask.new( +# dup_on_deref: true, +# execution_interval: 5 +# ){ Time.now } +# +# task.execute +# Time.now #=> 2013-11-07 18:06:50 -0500 +# sleep(10) +# task.value #=> 2013-11-07 18:06:55 -0500 +# +# @example Controlling execution from within the block +# timer_task = Concurrent::TimerTask.new(execution_interval: 1) do |task| +# task.execution_interval.to_i.times{ print 'Boom! ' } +# print "\n" +# task.execution_interval += 1 +# if task.execution_interval > 5 +# puts 'Stopping...' +# task.shutdown +# end +# end +# +# timer_task.execute +# #=> Boom! +# #=> Boom! Boom! +# #=> Boom! Boom! Boom! +# #=> Boom! Boom! Boom! Boom! +# #=> Boom! Boom! Boom! Boom! Boom! +# #=> Stopping... +# +# @example Observation +# class TaskObserver +# def update(time, result, ex) +# if result +# print "(#{time}) Execution successfully returned #{result}\n" +# else +# print "(#{time}) Execution failed with error #{ex}\n" +# end +# end +# end +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ 42 } +# task.add_observer(TaskObserver.new) +# task.execute +# sleep 4 +# +# #=> (2013-10-13 19:08:58 -0400) Execution successfully returned 42 +# #=> (2013-10-13 19:08:59 -0400) Execution successfully returned 42 +# #=> (2013-10-13 19:09:00 -0400) Execution successfully returned 42 +# task.shutdown +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ sleep } +# task.add_observer(TaskObserver.new) +# task.execute +# +# #=> (2013-10-13 19:07:25 -0400) Execution timed out +# #=> (2013-10-13 19:07:27 -0400) Execution timed out +# #=> (2013-10-13 19:07:29 -0400) Execution timed out +# task.shutdown +# +# task = Concurrent::TimerTask.new(execution_interval: 1){ raise StandardError } +# task.add_observer(TaskObserver.new) +# task.execute +# +# #=> (2013-10-13 19:09:37 -0400) Execution failed with error StandardError +# #=> (2013-10-13 19:09:38 -0400) Execution failed with error StandardError +# #=> (2013-10-13 19:09:39 -0400) Execution failed with error StandardError +# task.shutdown +# +# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html +# @see http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:166 +class Concurrent::TimerTask < ::Concurrent::RubyExecutorService + include ::Concurrent::Concern::Dereferenceable + include ::Concurrent::Concern::Observable + + # Create a new TimerTask with the given task and configuration. + # + # @!macro timer_task_initialize + # @param [Hash] opts the options defining task execution. + # @option opts [Float] :execution_interval number of seconds between + # task executions (default: EXECUTION_INTERVAL) + # @option opts [Boolean] :run_now Whether to run the task immediately + # upon instantiation or to wait until the first # execution_interval + # has passed (default: false) + # @options opts [Symbol] :interval_type method to calculate the interval + # between executions, can be either :fixed_rate or :fixed_delay. + # (default: :fixed_delay) + # @option opts [Executor] executor, default is `global_io_executor` + # + # @!macro deref_options + # + # @raise ArgumentError when no block is given. + # + # @yield to the block after :execution_interval seconds have passed since + # the last yield + # @yieldparam task a reference to the `TimerTask` instance so that the + # block can control its own lifecycle. Necessary since `self` will + # refer to the execution context of the block rather than the running + # `TimerTask`. + # + # @return [TimerTask] the new `TimerTask` + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:210 + def initialize(opts = T.unsafe(nil), &task); end + + # Execute a previously created `TimerTask`. + # + # @return [TimerTask] a reference to `self` + # + # @example Instance and execute in separate steps + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" } + # task.running? #=> false + # task.execute + # task.running? #=> true + # + # @example Instance and execute in one line + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute + # task.running? #=> true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:236 + def execute; end + + # @!attribute [rw] execution_interval + # @return [Fixnum] Number of seconds after the task completes before the + # task is performed again. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:261 + def execution_interval; end + + # @!attribute [rw] execution_interval + # @return [Fixnum] Number of seconds after the task completes before the + # task is performed again. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:268 + def execution_interval=(value); end + + # @!attribute [r] interval_type + # @return [Symbol] method to calculate the interval between executions + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:278 + def interval_type; end + + # Is the executor running? + # + # @return [Boolean] `true` when running, `false` when shutting down or shutdown + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:219 + def running?; end + + # @!attribute [rw] timeout_interval + # @return [Fixnum] Number of seconds the task can run before it is + # considered to have failed. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:283 + def timeout_interval; end + + # @!attribute [rw] timeout_interval + # @return [Fixnum] Number of seconds the task can run before it is + # considered to have failed. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:290 + def timeout_interval=(value); end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:294 + def <<(task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:357 + def calculate_next_interval(start_time); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:339 + def execute_task(completion, age_when_scheduled); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:298 + def ns_initialize(opts, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:327 + def ns_kill_execution; end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:321 + def ns_shutdown_execution; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:294 + def post(*args, &task); end + + # @!visibility private + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:333 + def schedule_next_task(interval = T.unsafe(nil)); end + + class << self + # Create and execute a new `TimerTask`. + # + # @!macro timer_task_initialize + # + # @example + # task = Concurrent::TimerTask.execute(execution_interval: 10){ print "Hello World\n" } + # task.running? #=> true + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:254 + def execute(opts = T.unsafe(nil), &task); end + end +end + +# Default `:interval_type` +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:182 +Concurrent::TimerTask::DEFAULT_INTERVAL_TYPE = T.let(T.unsafe(nil), Symbol) + +# Default `:execution_interval` in seconds. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:171 +Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer) + +# Maintain the interval between the end of one execution and the start of the next execution. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:174 +Concurrent::TimerTask::FIXED_DELAY = T.let(T.unsafe(nil), Symbol) + +# Maintain the interval between the start of one execution and the start of the next. +# If execution time exceeds the interval, the next execution will start immediately +# after the previous execution finishes. Executions will not run concurrently. +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/timer_task.rb:179 +Concurrent::TimerTask::FIXED_RATE = T.let(T.unsafe(nil), Symbol) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:153 +class Concurrent::Transaction + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:162 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:192 + def abort; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:196 + def commit; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:177 + def open(tvar); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:166 + def read(tvar); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:206 + def unlock; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:171 + def write(tvar, value); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:212 + def current; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:216 + def current=(transaction); end + end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:155 +Concurrent::Transaction::ABORTED = T.let(T.unsafe(nil), Object) + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:159 +class Concurrent::Transaction::AbortError < ::StandardError; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:160 +class Concurrent::Transaction::LeaveError < ::StandardError; end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 +class Concurrent::Transaction::OpenEntry < ::Struct + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def modified; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def modified=(_); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def value; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def value=(_); end + + class << self + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def [](*_arg0); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def inspect; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def keyword_init?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def members; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tvar.rb:157 + def new(*_arg0); end + end +end + +# A fixed size array with volatile (synchronized, thread safe) getters/setters. +# Mixes in Ruby's `Enumerable` module for enhanced search, sort, and traversal. +# +# @example +# tuple = Concurrent::Tuple.new(16) +# +# tuple.set(0, :foo) #=> :foo | volatile write +# tuple.get(0) #=> :foo | volatile read +# tuple.compare_and_set(0, :foo, :bar) #=> true | strong CAS +# tuple.cas(0, :foo, :baz) #=> false | strong CAS +# tuple.get(0) #=> :bar | volatile read +# +# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia +# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple +# @see http://ruby-doc.org/core-2.2.2/Enumerable.html Enumerable +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:20 +class Concurrent::Tuple + include ::Enumerable + + # Create a new tuple of the given size. + # + # @param [Integer] size the number of elements in the tuple + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:29 + def initialize(size); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:73 + def cas(i, old_value, new_value); end + + # Set the value at the given index to the new value if and only if the current + # value matches the given old value. + # + # @param [Integer] i the index for the element to set + # @param [Object] old_value the value to compare against the current value + # @param [Object] new_value the value to set at the given index + # + # @return [Boolean] true if the value at the given element was set else false + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:69 + def compare_and_set(i, old_value, new_value); end + + # Calls the given block once for each element in self, passing that element as a parameter. + # + # @yieldparam [Object] ref the `Concurrent::AtomicReference` object at the current index + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:78 + def each; end + + # Get the value of the element at the given index. + # + # @param [Integer] i the index from which to retrieve the value + # @return [Object] the value at the given index or nil if the index is out of bounds + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:43 + def get(i); end + + # Set the element at the given index to the given value + # + # @param [Integer] i the index for the element to set + # @param [Object] value the value to set at the given index + # + # @return [Object] the new value of the element at the given index or nil if the index is out of bounds + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:55 + def set(i, value); end + + # The (fixed) size of the tuple. + # + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:24 + def size; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:47 + def volatile_get(i); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/tuple.rb:59 + def volatile_set(i, value); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:3 +module Concurrent::Utility; end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:6 +module Concurrent::Utility::EngineDetector + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:7 + def on_cruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:11 + def on_jruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:27 + def on_linux?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:23 + def on_osx?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:15 + def on_truffleruby?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:19 + def on_windows?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/engine.rb:31 + def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end +end + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:9 +module Concurrent::Utility::NativeExtensionLoader + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:11 + def allow_c_extensions?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:15 + def c_extensions_loaded?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:19 + def load_native_extensions; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:50 + def java_extensions_loaded?; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:38 + def load_error_path(error); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:46 + def set_c_extensions_loaded; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:54 + def set_java_extensions_loaded; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:58 + def try_load_c_extension(path); end +end + +# @private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:5 +module Concurrent::Utility::NativeInteger + extend ::Concurrent::Utility::NativeInteger + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:24 + def ensure_integer(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:31 + def ensure_integer_and_bounds(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:17 + def ensure_lower_bound(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:37 + def ensure_positive(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:44 + def ensure_positive_and_no_zero(value); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:10 + def ensure_upper_bound(value); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:8 +Concurrent::Utility::NativeInteger::MAX_VALUE = T.let(T.unsafe(nil), Integer) + +# http://stackoverflow.com/questions/535721/ruby-max-integer +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/native_integer.rb:7 +Concurrent::Utility::NativeInteger::MIN_VALUE = T.let(T.unsafe(nil), Integer) + +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:10 +class Concurrent::Utility::ProcessorCounter + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:11 + def initialize; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:26 + def available_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:41 + def cpu_quota; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:45 + def cpu_shares; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:22 + def physical_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:18 + def processor_count; end + + private + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:104 + def compute_cpu_quota; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:124 + def compute_cpu_shares; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:59 + def compute_physical_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:51 + def compute_processor_count; end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/utility/processor_counter.rb:99 + def run(command); end +end + +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/version.rb:2 +Concurrent::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/connection_pool@3.0.2.rbi b/sorbet/rbi/gems/connection_pool@3.0.2.rbi new file mode 100644 index 0000000..dc37f34 --- /dev/null +++ b/sorbet/rbi/gems/connection_pool@3.0.2.rbi @@ -0,0 +1,341 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `connection_pool` gem. +# Please instead update this file by running `bin/tapioca gem connection_pool`. + + +# Generic connection pool class for sharing a limited number of objects or network connections +# among many threads. Note: pool elements are lazily created. +# +# Example usage with block (faster): +# +# @pool = ConnectionPool.new { Redis.new } +# @pool.with do |redis| +# redis.lpop('my-list') if redis.llen('my-list') > 0 +# end +# +# Using optional timeout override (for that single invocation) +# +# @pool.with(timeout: 2.0) do |redis| +# redis.lpop('my-list') if redis.llen('my-list') > 0 +# end +# +# Example usage replacing an existing connection (slower): +# +# $redis = ConnectionPool.wrap { Redis.new } +# +# def do_work +# $redis.lpop('my-list') if $redis.llen('my-list') > 0 +# end +# +# Accepts the following options: +# - :size - number of connections to pool, defaults to 5 +# - :timeout - amount of time to wait for a connection if none currently available, defaults to 5 seconds +# - :auto_reload_after_fork - automatically drop all connections after fork, defaults to true +# +# pkg:gem/connection_pool#lib/connection_pool/version.rb:1 +class ConnectionPool + # pkg:gem/connection_pool#lib/connection_pool.rb:48 + def initialize(timeout: T.unsafe(nil), size: T.unsafe(nil), auto_reload_after_fork: T.unsafe(nil), name: T.unsafe(nil), &); end + + # Number of pool entries available for checkout at this instant. + # + # pkg:gem/connection_pool#lib/connection_pool.rb:173 + def available; end + + # pkg:gem/connection_pool#lib/connection_pool.rb:123 + def checkin(force: T.unsafe(nil)); end + + # pkg:gem/connection_pool#lib/connection_pool.rb:111 + def checkout(timeout: T.unsafe(nil), **); end + + # Marks the current thread's checked-out connection for discard. + # + # When a connection is marked for discard, it will not be returned to the pool + # when checked in. Instead, the connection will be discarded. + # This is useful when a connection has become invalid or corrupted + # and should not be reused. + # + # Takes an optional block that will be called with the connection to be discarded. + # The block should perform any necessary clean-up on the connection. + # + # @yield [conn] + # @yieldparam conn [Object] The connection to be discarded. + # @yieldreturn [void] + # + # + # Note: This only affects the connection currently checked out by the calling thread. + # The connection will be discarded when +checkin+ is called. + # + # @return [void] + # + # @example + # pool.with do |conn| + # begin + # conn.execute("SELECT 1") + # rescue SomeConnectionError + # pool.discard_current_connection # Mark connection as bad + # raise + # end + # end + # + # pkg:gem/connection_pool#lib/connection_pool.rb:107 + def discard_current_connection(&block); end + + # Number of pool entries created and idle in the pool. + # + # pkg:gem/connection_pool#lib/connection_pool.rb:178 + def idle; end + + # Reaps idle connections that have been idle for over +idle_seconds+. + # +idle_seconds+ defaults to 60. + # + # pkg:gem/connection_pool#lib/connection_pool.rb:168 + def reap(idle_seconds: T.unsafe(nil), &); end + + # Reloads the ConnectionPool by passing each connection to +block+ and then + # removing it the pool. Subsequent checkouts will create new connections as + # needed. + # + # pkg:gem/connection_pool#lib/connection_pool.rb:162 + def reload(&); end + + # Shuts down the ConnectionPool by passing each connection to +block+ and + # then removing it from the pool. Attempting to checkout a connection after + # shutdown will raise +ConnectionPool::PoolShuttingDownError+. + # + # pkg:gem/connection_pool#lib/connection_pool.rb:154 + def shutdown(&); end + + # pkg:gem/connection_pool#lib/connection_pool.rb:46 + def size; end + + # pkg:gem/connection_pool#lib/connection_pool.rb:75 + def then(**); end + + # pkg:gem/connection_pool#lib/connection_pool.rb:60 + def with(**); end + + class << self + # pkg:gem/connection_pool#lib/connection_pool/fork.rb:6 + def after_fork; end + + # pkg:gem/connection_pool#lib/connection_pool.rb:42 + def wrap(**, &); end + end +end + +# pkg:gem/connection_pool#lib/connection_pool.rb:5 +class ConnectionPool::Error < ::RuntimeError; end + +# pkg:gem/connection_pool#lib/connection_pool/fork.rb:21 +module ConnectionPool::ForkTracker + # pkg:gem/connection_pool#lib/connection_pool/fork.rb:22 + def _fork; end +end + +# JRuby, et al +# +# pkg:gem/connection_pool#lib/connection_pool/fork.rb:3 +ConnectionPool::INSTANCES = T.let(T.unsafe(nil), ObjectSpace::WeakMap) + +# pkg:gem/connection_pool#lib/connection_pool.rb:7 +class ConnectionPool::PoolShuttingDownError < ::ConnectionPool::Error; end + +# The TimedStack manages a pool of homogeneous connections (or any resource +# you wish to manage). Connections are created lazily up to a given maximum +# number. +# +# Examples: +# +# ts = TimedStack.new(size: 1) { MyConnection.new } +# +# # fetch a connection +# conn = ts.pop +# +# # return a connection +# ts.push conn +# +# conn = ts.pop +# ts.pop timeout: 5 +# #=> raises ConnectionPool::TimeoutError after 5 seconds +# +# pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:19 +class ConnectionPool::TimedStack + # Creates a new pool with +size+ connections that are created from the given + # +block+. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:25 + def initialize(size: T.unsafe(nil), &block); end + + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:50 + def <<(obj, **); end + + # Reduce the created count + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:143 + def decrement_created; end + + # Returns +true+ if there are no available connections. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:125 + def empty?; end + + # The number of connections created and available on the stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:137 + def idle; end + + # The number of connections available on the stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:131 + def length; end + + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:20 + def max; end + + # Retrieves a connection from the stack. If a connection is available it is + # immediately returned. If no connection is available within the given + # timeout a ConnectionPool::TimeoutError is raised. + # + # @option options [Float] :timeout (0.5) Wait this many seconds for an available entry + # @option options [Class] :exception (ConnectionPool::TimeoutError) Exception class to raise + # if an entry was not available within the timeout period. Use `exception: false` to return nil. + # + # Other options may be used by subclasses that extend TimedStack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:62 + def pop(timeout: T.unsafe(nil), exception: T.unsafe(nil), **); end + + # Returns +obj+ to the stack. Additional kwargs are ignored in TimedStack but may be + # used by subclasses that extend TimedStack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:38 + def push(obj, **); end + + # Reaps connections that were checked in more than +idle_seconds+ ago. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:106 + def reap(idle_seconds:); end + + # Shuts down the TimedStack by passing each connection to +block+ and then + # removing it from the pool. Attempting to checkout a connection after + # shutdown will raise +ConnectionPool::PoolShuttingDownError+ unless + # +:reload+ is +true+. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:92 + def shutdown(reload: T.unsafe(nil), &block); end + + private + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method must returns true if a connection is available on the stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:167 + def connection_stored?(**); end + + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:149 + def current_time; end + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method must return a connection from the stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:175 + def fetch_connection(**); end + + # This is an extension point for TimedStack and is called with a mutex. + # + # Returns true if the first connection in the stack has been idle for more than idle_seconds + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:209 + def idle_connections?(idle_seconds); end + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method returns the oldest idle connection if it has been idle for more than idle_seconds. + # This requires that the stack is kept in order of checked in time (oldest first). + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:195 + def reserve_idle_connection(idle_seconds); end + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method must shut down all connections on the stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:183 + def shutdown_connections(**); end + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method must return +obj+ to the stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:220 + def store_connection(obj, **); end + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method must create a connection if and only if the total number of + # connections allowed has not been met. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:229 + def try_create(**); end + + # This is an extension point for TimedStack and is called with a mutex. + # + # This method must returns a connection from the stack if one exists. Allows + # subclasses with expensive match/search algorithms to avoid double-handling + # their stack. + # + # pkg:gem/connection_pool#lib/connection_pool/timed_stack.rb:159 + def try_fetch_connection(**); end +end + +# pkg:gem/connection_pool#lib/connection_pool.rb:9 +class ConnectionPool::TimeoutError < ::Timeout::Error; end + +# pkg:gem/connection_pool#lib/connection_pool/version.rb:2 +ConnectionPool::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:2 +class ConnectionPool::Wrapper < ::BasicObject + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:5 + def initialize(**options, &); end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:37 + def method_missing(name, *, **, &); end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:25 + def pool_available; end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:17 + def pool_shutdown(&); end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:21 + def pool_size; end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:29 + def respond_to?(id, *, **); end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:13 + def with(**, &); end + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:9 + def wrapped_pool; end + + private + + # pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:33 + def respond_to_missing?(id, *, **); end +end + +# pkg:gem/connection_pool#lib/connection_pool/wrapper.rb:3 +ConnectionPool::Wrapper::METHODS = T.let(T.unsafe(nil), Array) + +module Process + extend ::ConnectionPool::ForkTracker + extend ::RedisClient::PIDCache::CoreExt + extend ::ActiveSupport::ForkTracker::CoreExt +end diff --git a/sorbet/rbi/gems/crass@1.0.7.rbi b/sorbet/rbi/gems/crass@1.0.7.rbi new file mode 100644 index 0000000..e5d2412 --- /dev/null +++ b/sorbet/rbi/gems/crass@1.0.7.rbi @@ -0,0 +1,648 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `crass` gem. +# Please instead update this file by running `bin/tapioca gem crass`. + + +# A CSS parser based on the CSS Syntax Module Level 3 spec. +# +# pkg:gem/crass#lib/crass/token-scanner.rb:3 +module Crass + class << self + # Parses _input_ as a CSS stylesheet and returns a parse tree. + # + # Options: + # + # * **:maximum_depth** - Maximum nesting depth for simple blocks and + # functions. Constructs nested more deeply than this are discarded to + # prevent stack exhaustion. Defaults to {Parser::DEFAULT_MAXIMUM_DEPTH}. + # + # * **:preserve_comments** - If `true`, comments will be preserved as + # `:comment` tokens. + # + # * **:preserve_hacks** - If `true`, certain non-standard browser hacks + # such as the IE "*" hack will be preserved even though they violate + # CSS 3 syntax rules. + # + # pkg:gem/crass#lib/crass.rb:22 + def parse(input, options = T.unsafe(nil)); end + + # Parses _input_ as a string of CSS properties (such as the contents of an + # HTML element's `style` attribute) and returns a parse tree. + # + # See {Crass.parse} for _options_. + # + # pkg:gem/crass#lib/crass.rb:30 + def parse_properties(input, options = T.unsafe(nil)); end + end +end + +# Parses a CSS string or list of tokens. +# +# 5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parsing +# +# pkg:gem/crass#lib/crass/parser.rb:10 +class Crass::Parser + # Initializes a parser based on the given _input_, which may be a CSS string + # or an array of tokens. + # + # See {Crass.parse} for _options_. + # + # pkg:gem/crass#lib/crass/parser.rb:140 + def initialize(input, options = T.unsafe(nil)); end + + # Consumes an at-rule and returns it. + # + # 5.4.2. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-at-rule + # + # pkg:gem/crass#lib/crass/parser.rb:153 + def consume_at_rule(input = T.unsafe(nil)); end + + # Consumes a component value and returns it, or `nil` if there are no more + # tokens. + # + # 5.4.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-component-value + # + # pkg:gem/crass#lib/crass/parser.rb:200 + def consume_component_value(input = T.unsafe(nil)); end + + # Consumes a declaration and returns it, or `nil` on parse error. + # + # 5.4.5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-declaration + # + # pkg:gem/crass#lib/crass/parser.rb:225 + def consume_declaration(input = T.unsafe(nil)); end + + # Consumes a list of declarations and returns them. + # + # By default, the returned list may include `:comment`, `:semicolon`, and + # `:whitespace` nodes, which is non-standard. + # + # Options: + # + # * **:strict** - Set to `true` to exclude non-standard `:comment`, + # `:semicolon`, and `:whitespace` nodes. + # + # 5.4.4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-list-of-declarations + # + # pkg:gem/crass#lib/crass/parser.rb:292 + def consume_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end + + # Consumes a function and returns it. + # + # 5.4.8. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-function + # + # pkg:gem/crass#lib/crass/parser.rb:342 + def consume_function(input = T.unsafe(nil)); end + + # Consumes a qualified rule and returns it, or `nil` if a parse error + # occurs. + # + # 5.4.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-qualified-rule + # + # pkg:gem/crass#lib/crass/parser.rb:383 + def consume_qualified_rule(input = T.unsafe(nil)); end + + # Consumes a list of rules and returns them. + # + # 5.4.1. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-list-of-rules + # + # pkg:gem/crass#lib/crass/parser.rb:424 + def consume_rules(flags = T.unsafe(nil)); end + + # Consumes and returns a simple block associated with the current input + # token. + # + # 5.4.7. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-simple-block + # + # pkg:gem/crass#lib/crass/parser.rb:460 + def consume_simple_block(input = T.unsafe(nil)); end + + # Creates and returns a new parse node with the given _properties_. + # + # pkg:gem/crass#lib/crass/parser.rb:526 + def create_node(type, properties = T.unsafe(nil)); end + + # Parses the given _input_ tokens into a selector node and returns it. + # + # Doesn't bother splitting the selector list into individual selectors or + # validating them. Feel free to do that yourself! It'll be fun! + # + # pkg:gem/crass#lib/crass/parser.rb:534 + def create_selector(input); end + + # Creates a `:style_rule` node from the given qualified _rule_, and returns + # it. + # + # pkg:gem/crass#lib/crass/parser.rb:542 + def create_style_rule(rule); end + + # Discards an over-nested simple block or function without recursing, then + # returns an `:error` node. Assumes `input.current` is the opening token (a + # `{`, `[`, `(`, or function token). + # + # This is reached only when the configured maximum nesting depth is + # exceeded. It iteratively consumes tokens up to the matching closing token + # (tracking nested blocks and functions with an explicit stack) so that a + # deeply nested construct can't exhaust the Ruby stack. + # + # pkg:gem/crass#lib/crass/parser.rb:501 + def discard_block(input); end + + # Parses a single component value and returns it. + # + # 5.3.7. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-component-value + # + # pkg:gem/crass#lib/crass/parser.rb:551 + def parse_component_value(input = T.unsafe(nil)); end + + # Parses a list of component values and returns an array of parsed tokens. + # + # 5.3.8. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-component-values + # + # pkg:gem/crass#lib/crass/parser.rb:578 + def parse_component_values(input = T.unsafe(nil)); end + + # Parses a single declaration and returns it. + # + # 5.3.5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-declaration + # + # pkg:gem/crass#lib/crass/parser.rb:592 + def parse_declaration(input = T.unsafe(nil)); end + + # Parses a list of declarations and returns them. + # + # See {#consume_declarations} for _options_. + # + # 5.3.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-declarations + # + # pkg:gem/crass#lib/crass/parser.rb:620 + def parse_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end + + # Parses a list of declarations and returns an array of `:property` nodes + # (and any non-declaration nodes that were in the input). This is useful for + # parsing the contents of an HTML element's `style` attribute. + # + # pkg:gem/crass#lib/crass/parser.rb:628 + def parse_properties(input = T.unsafe(nil)); end + + # Parses a single rule and returns it. + # + # 5.3.4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-rule + # + # pkg:gem/crass#lib/crass/parser.rb:654 + def parse_rule(input = T.unsafe(nil)); end + + # Returns the unescaped value of a selector name or property declaration. + # + # pkg:gem/crass#lib/crass/parser.rb:683 + def parse_value(nodes); end + + # {TokenScanner} wrapping the tokens generated from this parser's input. + # + # pkg:gem/crass#lib/crass/parser.rb:134 + def tokens; end + + class << self + # Parses CSS properties (such as the contents of an HTML element's `style` + # attribute) and returns a parse tree. + # + # See {Crass.parse} for _options_. + # + # 5.3.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-declarations + # + # pkg:gem/crass#lib/crass/parser.rb:39 + def parse_properties(input, options = T.unsafe(nil)); end + + # Parses CSS rules (such as the content of a `@media` block) and returns a + # parse tree. The only difference from {parse_stylesheet} is that CDO/CDC + # nodes (``) aren't ignored. + # + # See {Crass.parse} for _options_. + # + # 5.3.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-list-of-rules + # + # pkg:gem/crass#lib/crass/parser.rb:50 + def parse_rules(input, options = T.unsafe(nil)); end + + # Parses a CSS stylesheet and returns a parse tree. + # + # See {Crass.parse} for _options_. + # + # 5.3.2. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parse-a-stylesheet + # + # pkg:gem/crass#lib/crass/parser.rb:68 + def parse_stylesheet(input, options = T.unsafe(nil)); end + + # Converts a node or array of nodes into a CSS string based on their + # original tokenized input. + # + # Options: + # + # * **:exclude_comments** - When `true`, comments will be excluded. + # + # pkg:gem/crass#lib/crass/parser.rb:88 + def stringify(nodes, options = T.unsafe(nil)); end + end +end + +# pkg:gem/crass#lib/crass/parser.rb:11 +Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash) + +# Default maximum nesting depth for simple blocks and functions. This is far +# higher than any legitimate CSS needs, but far below the depth at which +# Ruby would raise `SystemStackError` while recursively parsing nested +# constructs. +# +# Keeping this low also bounds memory usage: each nested simple block and +# function retains a `:tokens` array spanning its descendants for +# serialization, so the total serialization metadata grows with nesting +# depth. A modest limit prevents deeply nested (but otherwise valid) input +# from amplifying memory disproportionately. +# +# It can be overridden with the `:maximum_depth` option. +# +# pkg:gem/crass#lib/crass/parser.rb:29 +Crass::Parser::DEFAULT_MAXIMUM_DEPTH = T.let(T.unsafe(nil), Integer) + +# Similar to a StringScanner, but with extra functionality needed to tokenize +# CSS while preserving the original text. +# +# pkg:gem/crass#lib/crass/scanner.rb:8 +class Crass::Scanner + # Creates a Scanner instance for the given _input_ string or IO instance. + # + # pkg:gem/crass#lib/crass/scanner.rb:29 + def initialize(input); end + + # Consumes the next character and returns it, advancing the pointer, or + # an empty string if the end of the string has been reached. + # + # pkg:gem/crass#lib/crass/scanner.rb:38 + def consume; end + + # Consumes the rest of the string and returns it, advancing the pointer to + # the end of the string. Returns an empty string is the end of the string + # has already been reached. + # + # pkg:gem/crass#lib/crass/scanner.rb:50 + def consume_rest; end + + # Current character, or `nil` if the scanner hasn't yet consumed a + # character, or is at the end of the string. + # + # pkg:gem/crass#lib/crass/scanner.rb:11 + def current; end + + # Returns `true` if the end of the string has been reached, `false` + # otherwise. + # + # pkg:gem/crass#lib/crass/scanner.rb:66 + def eos?; end + + # Sets the marker to the position of the next character that will be + # consumed. + # + # pkg:gem/crass#lib/crass/scanner.rb:72 + def mark; end + + # Returns the substring between {#marker} and {#pos}, without altering the + # pointer. + # + # pkg:gem/crass#lib/crass/scanner.rb:79 + def marked; end + + # Current marker position. Use {#marked} to get the substring between + # {#marker} and {#pos}. + # + # pkg:gem/crass#lib/crass/scanner.rb:15 + def marker; end + + # Current marker position. Use {#marked} to get the substring between + # {#marker} and {#pos}. + # + # pkg:gem/crass#lib/crass/scanner.rb:15 + def marker=(_arg0); end + + # Returns up to _length_ characters starting at the current position, but + # doesn't consume them. The number of characters returned may be less than + # _length_ if the end of the string is reached. + # + # pkg:gem/crass#lib/crass/scanner.rb:91 + def peek(length = T.unsafe(nil)); end + + # Position of the next character that will be consumed. This is a character + # position, not a byte position, so it accounts for multi-byte characters. + # + # Byte offsets (used internally for fast substring extraction) are tracked + # separately by the underlying StringScanner, whose `pos` always reflects + # the byte offset corresponding to this character position. + # + # pkg:gem/crass#lib/crass/scanner.rb:23 + def pos; end + + # Position of the next character that will be consumed. This is a character + # position, not a byte position, so it accounts for multi-byte characters. + # + # Byte offsets (used internally for fast substring extraction) are tracked + # separately by the underlying StringScanner, whose `pos` always reflects + # the byte offset corresponding to this character position. + # + # pkg:gem/crass#lib/crass/scanner.rb:23 + def pos=(_arg0); end + + # Moves the pointer back one character without changing the value of + # {#current}. The next call to {#consume} will re-consume the current + # character. + # + # pkg:gem/crass#lib/crass/scanner.rb:103 + def reconsume; end + + # Resets the pointer to the beginning of the string. + # + # pkg:gem/crass#lib/crass/scanner.rb:109 + def reset; end + + # Tries to match _pattern_ at the current position. If it matches, the + # matched substring will be returned and the pointer will be advanced. + # Otherwise, `nil` will be returned. + # + # pkg:gem/crass#lib/crass/scanner.rb:122 + def scan(pattern); end + + # Scans the string until the _pattern_ is matched. Returns the substring up + # to and including the end of the match, and advances the pointer. If there + # is no match, `nil` is returned and the pointer is not advanced. + # + # pkg:gem/crass#lib/crass/scanner.rb:134 + def scan_until(pattern); end + + # String being scanned. + # + # pkg:gem/crass#lib/crass/scanner.rb:26 + def string; end +end + +# Like {Scanner}, but for tokens! +# +# pkg:gem/crass#lib/crass/token-scanner.rb:6 +class Crass::TokenScanner + # pkg:gem/crass#lib/crass/token-scanner.rb:9 + def initialize(tokens); end + + # Executes the given block, collects all tokens that are consumed during its + # execution, and returns them. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:16 + def collect; end + + # Consumes the next token and returns it, advancing the pointer. Returns + # `nil` if there is no next token. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:24 + def consume; end + + # pkg:gem/crass#lib/crass/token-scanner.rb:7 + def current; end + + # Returns the next token without consuming it, or `nil` if there is no next + # token. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:32 + def peek; end + + # pkg:gem/crass#lib/crass/token-scanner.rb:7 + def pos; end + + # Reconsumes the current token, moving the pointer back one position. + # + # http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#reconsume-the-current-input-token + # + # pkg:gem/crass#lib/crass/token-scanner.rb:39 + def reconsume; end + + # Resets the pointer to the first token in the list. + # + # pkg:gem/crass#lib/crass/token-scanner.rb:44 + def reset; end + + # pkg:gem/crass#lib/crass/token-scanner.rb:7 + def tokens; end +end + +# Tokenizes a CSS string. +# +# 4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#tokenization +# +# pkg:gem/crass#lib/crass/tokenizer.rb:9 +class Crass::Tokenizer + # Initializes a new Tokenizer. + # + # Options: + # + # * **:preserve_comments** - If `true`, comments will be preserved as + # `:comment` tokens. + # + # * **:preserve_hacks** - If `true`, certain non-standard browser hacks + # such as the IE "*" hack will be preserved even though they violate + # CSS 3 syntax rules. + # + # pkg:gem/crass#lib/crass/tokenizer.rb:62 + def initialize(input, options = T.unsafe(nil)); end + + # Consumes a token and returns the token that was consumed. + # + # 4.3.1. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-token + # + # pkg:gem/crass#lib/crass/tokenizer.rb:70 + def consume; end + + # Consumes the remnants of a bad URL and returns the consumed text. + # + # 4.3.15. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-the-remnants-of-a-bad-url + # + # pkg:gem/crass#lib/crass/tokenizer.rb:276 + def consume_bad_url; end + + # Consumes comments and returns them, or `nil` if no comments were consumed. + # + # 4.3.2. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-comments + # + # pkg:gem/crass#lib/crass/tokenizer.rb:302 + def consume_comments; end + + # Consumes an escaped code point and returns its unescaped value. + # + # This method assumes that the `\` has already been consumed, and that the + # next character in the input has already been verified not to be a newline + # or EOF. + # + # 4.3.8. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-an-escaped-code-point + # + # pkg:gem/crass#lib/crass/tokenizer.rb:327 + def consume_escaped; end + + # Consumes an ident-like token and returns it. + # + # 4.3.4. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-an-ident-like-token + # + # pkg:gem/crass#lib/crass/tokenizer.rb:351 + def consume_ident; end + + # Consumes a name and returns it. + # + # 4.3.12. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-name + # + # pkg:gem/crass#lib/crass/tokenizer.rb:376 + def consume_name; end + + # Consumes a number and returns a 3-element array containing the number's + # original representation, its numeric value, and its type (either + # `:integer` or `:number`). + # + # 4.3.13. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-number + # + # pkg:gem/crass#lib/crass/tokenizer.rb:408 + def consume_number; end + + # Consumes a numeric token and returns it. + # + # 4.3.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-numeric-token + # + # pkg:gem/crass#lib/crass/tokenizer.rb:431 + def consume_numeric; end + + # Consumes a string token that ends at the given character, and returns the + # token. + # + # 4.3.5. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-string-token + # + # pkg:gem/crass#lib/crass/tokenizer.rb:470 + def consume_string(ending = T.unsafe(nil)); end + + # Consumes a Unicode range token and returns it. Assumes the initial "u+" or + # "U+" has already been consumed. + # + # 4.3.7. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-unicode-range-token + # + # pkg:gem/crass#lib/crass/tokenizer.rb:511 + def consume_unicode_range; end + + # Consumes a URL token and returns it. Assumes the original "url(" has + # already been consumed. + # + # 4.3.6. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#consume-a-url-token + # + # pkg:gem/crass#lib/crass/tokenizer.rb:543 + def consume_url; end + + # Converts a valid CSS number string into a number and returns the number. + # + # 4.3.14. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#convert-a-string-to-a-number + # + # pkg:gem/crass#lib/crass/tokenizer.rb:591 + def convert_string_to_number(str); end + + # Creates and returns a new token with the given _properties_. + # + # pkg:gem/crass#lib/crass/tokenizer.rb:643 + def create_token(type, properties = T.unsafe(nil)); end + + # Preprocesses _input_ to prepare it for the tokenizer. + # + # 3.3. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#input-preprocessing + # + # pkg:gem/crass#lib/crass/tokenizer.rb:654 + def preprocess(input); end + + # Returns `true` if the given three-character _text_ would start an + # identifier. If _text_ is `nil`, the current and next two characters in the + # input stream will be checked, but will not be consumed. + # + # 4.3.10. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#would-start-an-identifier + # + # pkg:gem/crass#lib/crass/tokenizer.rb:669 + def start_identifier?(text = T.unsafe(nil)); end + + # Returns `true` if the given three-character _text_ would start a number. + # If _text_ is `nil`, the current and next two characters in the input + # stream will be checked, but will not be consumed. + # + # 4.3.11. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#starts-with-a-number + # + # pkg:gem/crass#lib/crass/tokenizer.rb:693 + def start_number?(text = T.unsafe(nil)); end + + # Tokenizes the input stream and returns an array of tokens. + # + # pkg:gem/crass#lib/crass/tokenizer.rb:712 + def tokenize; end + + # Returns `true` if the given two-character _text_ is the beginning of a + # valid escape sequence. If _text_ is `nil`, the current and next character + # in the input stream will be checked, but will not be consumed. + # + # 4.3.9. https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#starts-with-a-valid-escape + # + # pkg:gem/crass#lib/crass/tokenizer.rb:729 + def valid_escape?(text = T.unsafe(nil)); end + + class << self + # Tokenizes the given _input_ as a CSS string and returns an array of + # tokens. + # + # See {#initialize} for _options_. + # + # pkg:gem/crass#lib/crass/tokenizer.rb:45 + def tokenize(input, options = T.unsafe(nil)); end + end +end + +# pkg:gem/crass#lib/crass/tokenizer.rb:10 +Crass::Tokenizer::RE_COMMENT_CLOSE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:11 +Crass::Tokenizer::RE_DIGIT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:12 +Crass::Tokenizer::RE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:13 +Crass::Tokenizer::RE_HEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:14 +Crass::Tokenizer::RE_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:15 +Crass::Tokenizer::RE_NAME_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:16 +Crass::Tokenizer::RE_NON_PRINTABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:17 +Crass::Tokenizer::RE_NUMBER_DECIMAL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:18 +Crass::Tokenizer::RE_NUMBER_EXPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:19 +Crass::Tokenizer::RE_NUMBER_SIGN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:21 +Crass::Tokenizer::RE_NUMBER_STR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:33 +Crass::Tokenizer::RE_QUOTED_URL_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:35 +Crass::Tokenizer::RE_UNICODE_RANGE_END = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:34 +Crass::Tokenizer::RE_UNICODE_RANGE_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:36 +Crass::Tokenizer::RE_WHITESPACE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/crass#lib/crass/tokenizer.rb:37 +Crass::Tokenizer::RE_WHITESPACE_ANCHORED = T.let(T.unsafe(nil), Regexp) diff --git a/sorbet/rbi/gems/diff-lcs@1.6.2.rbi b/sorbet/rbi/gems/diff-lcs@1.6.2.rbi new file mode 100644 index 0000000..fded7ac --- /dev/null +++ b/sorbet/rbi/gems/diff-lcs@1.6.2.rbi @@ -0,0 +1,1067 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `diff-lcs` gem. +# Please instead update this file by running `bin/tapioca gem diff-lcs`. + + +# pkg:gem/diff-lcs#lib/diff/lcs.rb:3 +module Diff; end + +# == How Diff Works (by Mark-Jason Dominus) +# +# I once read an article written by the authors of +diff+; they said that they +# hard worked very hard on the algorithm until they found the right one. +# +# I think what they ended up using (and I hope someone will correct me, because +# I am not very confident about this) was the `longest common subsequence' +# method. In the LCS problem, you have two sequences of items: +# +# a b c d f g h j q z +# a b c d e f g i j k r x y z +# +# and you want to find the longest sequence of items that is present in both +# original sequences in the same order. That is, you want to find a new +# sequence *S* which can be obtained from the first sequence by deleting some +# items, and from the second sequence by deleting other items. You also want +# *S* to be as long as possible. In this case *S* is: +# +# a b c d f g j z +# +# From there it's only a small step to get diff-like output: +# +# e h i k q r x y +# + - + + - + + + +# +# This module solves the LCS problem. It also includes a canned function to +# generate +diff+-like output. +# +# It might seem from the example above that the LCS of two sequences is always +# pretty obvious, but that's not always the case, especially when the two +# sequences have many repeated elements. For example, consider +# +# a x b y c z p d q +# a b c a x b y c z +# +# A naive approach might start by matching up the +a+ and +b+ that appear at +# the beginning of each sequence, like this: +# +# a x b y c z p d q +# a b c a b y c z +# +# This finds the common subsequence +a b c z+. But actually, the LCS is +a x b +# y c z+: +# +# a x b y c z p d q +# a b c a x b y c z +# +# pkg:gem/diff-lcs#lib/diff/lcs.rb:51 +module Diff::LCS + # Returns the difference set between +self+ and +other+. See Diff::LCS#diff. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:76 + def diff(other, callbacks = T.unsafe(nil), &block); end + + # Returns an Array containing the longest common subsequence(s) between + # +self+ and +other+. See Diff::LCS#lcs. + # + # lcs = seq1.lcs(seq2) + # + # A note when using objects: Diff::LCS only works properly when each object + # can be used as a key in a Hash. This means that those objects must implement + # the methods +#hash+ and +#eql?+ such that two objects containing identical values + # compare identically for key purposes. That is: + # + # O.new('a').eql?(O.new('a')) == true && + # O.new('a').hash == O.new('a').hash + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:71 + def lcs(other, &block); end + + # Attempts to patch +self+ with the provided +patchset+. A new sequence based + # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Attempts + # to autodiscover the direction of the patch. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:102 + def patch(patchset); end + + # Attempts to patch +self+ with the provided +patchset+. A new sequence based + # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Does no + # patch direction autodiscovery. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:110 + def patch!(patchset); end + + # Attempts to patch +self+ with the provided +patchset+, using #patch!. If + # the sequence this is used on supports #replace, the value of +self+ will be + # replaced. See Diff::LCS#patch. Does no patch direction autodiscovery. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:124 + def patch_me(patchset); end + + # Returns the balanced ("side-by-side") difference set between +self+ and + # +other+. See Diff::LCS#sdiff. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:82 + def sdiff(other, callbacks = T.unsafe(nil), &block); end + + # Traverses the discovered longest common subsequences between +self+ and + # +other+ using the alternate, balanced algorithm. See + # Diff::LCS#traverse_balanced. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:95 + def traverse_balanced(other, callbacks = T.unsafe(nil), &block); end + + # Traverses the discovered longest common subsequences between +self+ and + # +other+. See Diff::LCS#traverse_sequences. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:88 + def traverse_sequences(other, callbacks = T.unsafe(nil), &block); end + + # pkg:gem/diff-lcs#lib/diff/lcs.rb:105 + def unpatch(patchset); end + + # Attempts to unpatch +self+ with the provided +patchset+. A new sequence + # based on +self+ and the +patchset+ will be created. See Diff::LCS#unpatch. + # Does no patch direction autodiscovery. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:117 + def unpatch!(patchset); end + + # Attempts to unpatch +self+ with the provided +patchset+, using #unpatch!. + # If the sequence this is used on supports #replace, the value of +self+ will + # be replaced. See Diff::LCS#unpatch. Does no patch direction autodiscovery. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:135 + def unpatch_me(patchset); end + + class << self + # pkg:gem/diff-lcs#lib/diff/lcs.rb:158 + def LCS(seq1, seq2, &block); end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:52 + def callbacks_for(callbacks); end + + # #diff computes the smallest set of additions and deletions necessary to + # turn the first sequence into the second, and returns a description of these + # changes. + # + # See Diff::LCS::DiffCallbacks for the default behaviour. An alternate + # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a + # Class argument is provided for +callbacks+, #diff will attempt to + # initialise it. If the +callbacks+ object (possibly initialised) responds to + # #finish, it will be called. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:169 + def diff(seq1, seq2, callbacks = T.unsafe(nil), &block); end + + # pkg:gem/diff-lcs#lib/diff/lcs.rb:145 + def lcs(seq1, seq2, &block); end + + # Applies a +patchset+ to the sequence +src+ according to the +direction+ + # (:patch or :unpatch), producing a new sequence. + # + # If the +direction+ is not specified, Diff::LCS::patch will attempt to + # discover the direction of the +patchset+. + # + # A +patchset+ can be considered to apply forward (:patch) if the + # following expression is true: + # + # patch(s1, diff(s1, s2)) -> s2 + # + # A +patchset+ can be considered to apply backward (:unpatch) if the + # following expression is true: + # + # patch(s2, diff(s1, s2)) -> s1 + # + # If the +patchset+ contains no changes, the +src+ value will be returned as + # either src.dup or +src+. A +patchset+ can be deemed as having no + # changes if the following predicate returns true: + # + # patchset.empty? or + # patchset.flatten(1).all? { |change| change.unchanged? } + # + # === Patchsets + # + # A +patchset+ is always an enumerable sequence of changes, hunks of changes, + # or a mix of the two. A hunk of changes is an enumerable sequence of + # changes: + # + # [ # patchset + # # change + # [ # hunk + # # change + # ] + # ] + # + # The +patch+ method accepts patchsets that are enumerable sequences + # containing either Diff::LCS::Change objects (or a subclass) or the array + # representations of those objects. Prior to application, array + # representations of Diff::LCS::Change objects will be reified. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:627 + def patch(src, patchset, direction = T.unsafe(nil)); end + + # Given a set of patchset, convert the current version to the next version. + # Does no auto-discovery. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:737 + def patch!(src, patchset); end + + # #sdiff computes all necessary components to show two sequences and their + # minimized differences side by side, just like the Unix utility + # sdiff does: + # + # old < - + # same same + # before | after + # - > new + # + # See Diff::LCS::SDiffCallbacks for the default behaviour. An alternate + # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a + # Class argument is provided for +callbacks+, #diff will attempt to + # initialise it. If the +callbacks+ object (possibly initialised) responds to + # #finish, it will be called. + # + # Each element of a returned array is a Diff::LCS::ContextChange object, + # which can be implicitly converted to an array. + # + # Diff::LCS.sdiff(a, b).each do |action, (old_pos, old_element), (new_pos, new_element)| + # case action + # when '!' + # # replace + # when '-' + # # delete + # when '+' + # # insert + # end + # end + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:201 + def sdiff(seq1, seq2, callbacks = T.unsafe(nil), &block); end + + # #traverse_balanced is an alternative to #traverse_sequences. It uses a + # different algorithm to iterate through the entries in the computed longest + # common subsequence. Instead of viewing the changes as insertions or + # deletions from one of the sequences, #traverse_balanced will report + # changes between the sequences. + # + # The arguments to #traverse_balanced are the two sequences to traverse and a + # callback object, like this: + # + # traverse_balanced(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new) + # + # #sdiff is implemented with #traverse_balanced. + # + # == Callback Methods + # + # Optional callback methods are emphasized. + # + # callbacks#match:: Called when +a+ and +b+ are pointing to + # common elements in +A+ and +B+. + # callbacks#discard_a:: Called when +a+ is pointing to an + # element not in +B+. + # callbacks#discard_b:: Called when +b+ is pointing to an + # element not in +A+. + # callbacks#change:: Called when +a+ and +b+ are pointing to + # the same relative position, but + # A[a] and B[b] are not + # the same; a change has + # occurred. + # + # #traverse_balanced might be a bit slower than #traverse_sequences, + # noticeable only while processing huge amounts of data. + # + # == Algorithm + # + # a---+ + # v + # A = a b c e h j l m n p + # B = b c d e f j k l m r s t + # ^ + # b---+ + # + # === Matches + # + # If there are two arrows (+a+ and +b+) pointing to elements of sequences +A+ + # and +B+, the arrows will initially point to the first elements of their + # respective sequences. #traverse_sequences will advance the arrows through + # the sequences one element at a time, calling a method on the user-specified + # callback object before each advance. It will advance the arrows in such a + # way that if there are elements A[i] and B[j] which are + # both equal and part of the longest common subsequence, there will be some + # moment during the execution of #traverse_sequences when arrow +a+ is + # pointing to A[i] and arrow +b+ is pointing to B[j]. When + # this happens, #traverse_sequences will call callbacks#match and + # then it will advance both arrows. + # + # === Discards + # + # Otherwise, one of the arrows is pointing to an element of its sequence that + # is not part of the longest common subsequence. #traverse_sequences will + # advance that arrow and will call callbacks#discard_a or + # callbacks#discard_b, depending on which arrow it advanced. + # + # === Changes + # + # If both +a+ and +b+ point to elements that are not part of the longest + # common subsequence, then #traverse_sequences will try to call + # callbacks#change and advance both arrows. If + # callbacks#change is not implemented, then + # callbacks#discard_a and callbacks#discard_b will be + # called in turn. + # + # The methods for callbacks#match, callbacks#discard_a, + # callbacks#discard_b, and callbacks#change are invoked + # with an event comprising the action ("=", "+", "-", or "!", respectively), + # the indexes +i+ and +j+, and the elements A[i] and B[j]. + # Return values are discarded by #traverse_balanced. + # + # === Context + # + # Note that +i+ and +j+ may not be the same index position, even if +a+ and + # +b+ are considered to be pointing to matching or changed elements. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:476 + def traverse_balanced(seq1, seq2, callbacks = T.unsafe(nil)); end + + # #traverse_sequences is the most general facility provided by this module; + # #diff and #lcs are implemented as calls to it. + # + # The arguments to #traverse_sequences are the two sequences to traverse, and + # a callback object, like this: + # + # traverse_sequences(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new) + # + # == Callback Methods + # + # Optional callback methods are emphasized. + # + # callbacks#match:: Called when +a+ and +b+ are pointing to + # common elements in +A+ and +B+. + # callbacks#discard_a:: Called when +a+ is pointing to an + # element not in +B+. + # callbacks#discard_b:: Called when +b+ is pointing to an + # element not in +A+. + # callbacks#finished_a:: Called when +a+ has reached the end of + # sequence +A+. + # callbacks#finished_b:: Called when +b+ has reached the end of + # sequence +B+. + # + # == Algorithm + # + # a---+ + # v + # A = a b c e h j l m n p + # B = b c d e f j k l m r s t + # ^ + # b---+ + # + # If there are two arrows (+a+ and +b+) pointing to elements of sequences +A+ + # and +B+, the arrows will initially point to the first elements of their + # respective sequences. #traverse_sequences will advance the arrows through + # the sequences one element at a time, calling a method on the user-specified + # callback object before each advance. It will advance the arrows in such a + # way that if there are elements A[i] and B[j] which are + # both equal and part of the longest common subsequence, there will be some + # moment during the execution of #traverse_sequences when arrow +a+ is + # pointing to A[i] and arrow +b+ is pointing to B[j]. When + # this happens, #traverse_sequences will call callbacks#match and + # then it will advance both arrows. + # + # Otherwise, one of the arrows is pointing to an element of its sequence that + # is not part of the longest common subsequence. #traverse_sequences will + # advance that arrow and will call callbacks#discard_a or + # callbacks#discard_b, depending on which arrow it advanced. If both + # arrows point to elements that are not part of the longest common + # subsequence, then #traverse_sequences will advance arrow +a+ and call the + # appropriate callback, then it will advance arrow +b+ and call the appropriate + # callback. + # + # The methods for callbacks#match, callbacks#discard_a, and + # callbacks#discard_b are invoked with an event comprising the + # action ("=", "+", or "-", respectively), the indexes +i+ and +j+, and the + # elements A[i] and B[j]. Return values are discarded by + # #traverse_sequences. + # + # === End of Sequences + # + # If arrow +a+ reaches the end of its sequence before arrow +b+ does, + # #traverse_sequence will try to call callbacks#finished_a with the + # last index and element of +A+ (A[-1]) and the current index and + # element of +B+ (B[j]). If callbacks#finished_a does not + # exist, then callbacks#discard_b will be called on each element of + # +B+ until the end of the sequence is reached (the call will be done with + # A[-1] and B[j] for each element). + # + # If +b+ reaches the end of +B+ before +a+ reaches the end of +A+, + # callbacks#finished_b will be called with the current index and + # element of +A+ (A[i]) and the last index and element of +B+ + # (A[-1]). Again, if callbacks#finished_b does not exist on + # the callback object, then callbacks#discard_a will be called on + # each element of +A+ until the end of the sequence is reached (A[i] + # and B[-1]). + # + # There is a chance that one additional callbacks#discard_a or + # callbacks#discard_b will be called after the end of the sequence + # is reached, if +a+ has not yet reached the end of +A+ or +b+ has not yet + # reached the end of +B+. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:286 + def traverse_sequences(seq1, seq2, callbacks = T.unsafe(nil)); end + + # Given a set of patchset, convert the current version to the prior version. + # Does no auto-discovery. + # + # pkg:gem/diff-lcs#lib/diff/lcs.rb:731 + def unpatch!(src, patchset); end + + private + + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:4 + def diff_traversal(method, seq1, seq2, callbacks, &block); end + end +end + +# An alias for DefaultCallbacks that is used in +# Diff::LCS#traverse_balanced. +# +# Diff::LCS.LCS(seq1, seq2, Diff::LCS::BalancedCallbacks) +# +# pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:50 +Diff::LCS::BalancedCallbacks = Diff::LCS::DefaultCallbacks + +# A block is an operation removing, adding, or changing a group of items. +# Basically, this is just a list of changes, where each change adds or +# deletes a single item. Used by bin/ldiff. +# +# pkg:gem/diff-lcs#lib/diff/lcs/block.rb:6 +class Diff::LCS::Block + # pkg:gem/diff-lcs#lib/diff/lcs/block.rb:9 + def initialize(chunk); end + + # pkg:gem/diff-lcs#lib/diff/lcs/block.rb:7 + def changes; end + + # pkg:gem/diff-lcs#lib/diff/lcs/block.rb:21 + def diff_size; end + + # pkg:gem/diff-lcs#lib/diff/lcs/block.rb:7 + def insert; end + + # pkg:gem/diff-lcs#lib/diff/lcs/block.rb:25 + def op; end + + # pkg:gem/diff-lcs#lib/diff/lcs/block.rb:7 + def remove; end +end + +# Represents a simplistic (non-contextual) change. Represents the removal or +# addition of an element from either the old or the new sequenced +# enumerable. +# +# pkg:gem/diff-lcs#lib/diff/lcs/change.rb:6 +class Diff::LCS::Change + include ::Comparable + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:27 + def initialize(*args); end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:65 + def <=>(other); end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:58 + def ==(other); end + + # Returns the action this Change represents. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:20 + def action; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:72 + def adding?; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:84 + def changed?; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:76 + def deleting?; end + + # Returns the sequence element of the Change. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:25 + def element; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:88 + def finished_a?; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:92 + def finished_b?; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:34 + def inspect(*_args); end + + # Returns the position of the Change. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:23 + def position; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:38 + def to_a; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:42 + def to_ary; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:80 + def unchanged?; end + + class << self + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:44 + def from_a(arr); end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:15 + def valid_action?(action); end + end +end + +# pkg:gem/diff-lcs#lib/diff/lcs/change.rb:7 +Diff::LCS::Change::IntClass = Integer + +# The only actions valid for changes are '+' (add), '-' (delete), '=' +# (no change), '!' (changed), '<' (tail changes from first sequence), or +# '>' (tail changes from second sequence). The last two ('<>') are only +# found with Diff::LCS::diff and Diff::LCS::sdiff. +# +# pkg:gem/diff-lcs#lib/diff/lcs/change.rb:13 +Diff::LCS::Change::VALID_ACTIONS = T.let(T.unsafe(nil), Array) + +# Represents a contextual change. Contains the position and values of the +# elements in the old and the new sequenced enumerables as well as the action +# taken. +# +# pkg:gem/diff-lcs#lib/diff/lcs/change.rb:100 +class Diff::LCS::ContextChange < ::Diff::LCS::Change + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:114 + def initialize(*args); end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:166 + def <=>(other); end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:157 + def ==(other); end + + # Returns the new element being changed. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:112 + def new_element; end + + # Returns the new position being changed. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:108 + def new_position; end + + # Returns the old element being changed. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:110 + def old_element; end + + # Returns the old position being changed. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:106 + def old_position; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:122 + def to_a; end + + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:130 + def to_ary; end + + class << self + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:132 + def from_a(arr); end + + # Simplifies a context change for use in some diff callbacks. '<' actions + # are converted to '-' and '>' actions are converted to '+'. + # + # pkg:gem/diff-lcs#lib/diff/lcs/change.rb:138 + def simplify(event); end + end +end + +# This will produce a compound array of contextual diff change objects. Each +# element in the #diffs array is a "hunk" array, where each element in each +# "hunk" array is a single change. Each change is a Diff::LCS::ContextChange +# that contains both the old index and new index values for the change. The +# "hunk" provides the full context for the changes. Both old and new objects +# will be presented for changed objects. +nil+ will be substituted for a +# discarded object. +# +# seq1 = %w(a b c e h j l m n p) +# seq2 = %w(b c d e f j k l m r s t) +# +# diffs = Diff::LCS.diff(seq1, seq2, Diff::LCS::ContextDiffCallbacks) +# # This example shows a simplified array format. +# # [ [ [ '-', [ 0, 'a' ], [ 0, nil ] ] ], # 1 +# # [ [ '+', [ 3, nil ], [ 2, 'd' ] ] ], # 2 +# # [ [ '-', [ 4, 'h' ], [ 4, nil ] ], # 3 +# # [ '+', [ 5, nil ], [ 4, 'f' ] ] ], +# # [ [ '+', [ 6, nil ], [ 6, 'k' ] ] ], # 4 +# # [ [ '-', [ 8, 'n' ], [ 9, nil ] ], # 5 +# # [ '+', [ 9, nil ], [ 9, 'r' ] ], +# # [ '-', [ 9, 'p' ], [ 10, nil ] ], +# # [ '+', [ 10, nil ], [ 10, 's' ] ], +# # [ '+', [ 10, nil ], [ 11, 't' ] ] ] ] +# +# The five hunks shown are comprised of individual changes; if there is a +# related set of changes, they are still shown individually. +# +# This callback can also be used with Diff::LCS#sdiff, which will produce +# results like: +# +# diffs = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextCallbacks) +# # This example shows a simplified array format. +# # [ [ [ "-", [ 0, "a" ], [ 0, nil ] ] ], # 1 +# # [ [ "+", [ 3, nil ], [ 2, "d" ] ] ], # 2 +# # [ [ "!", [ 4, "h" ], [ 4, "f" ] ] ], # 3 +# # [ [ "+", [ 6, nil ], [ 6, "k" ] ] ], # 4 +# # [ [ "!", [ 8, "n" ], [ 9, "r" ] ], # 5 +# # [ "!", [ 9, "p" ], [ 10, "s" ] ], +# # [ "+", [ 10, nil ], [ 11, "t" ] ] ] ] +# +# The five hunks are still present, but are significantly shorter in total +# presentation, because changed items are shown as changes ("!") instead of +# potentially "mismatched" pairs of additions and deletions. +# +# The result of this operation is similar to that of +# Diff::LCS::SDiffCallbacks. They may be compared as: +# +# s = Diff::LCS.sdiff(seq1, seq2).reject { |e| e.action == "=" } +# c = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextDiffCallbacks).flatten(1) +# +# s == c # -> true +# +# === Use +# +# This callback object must be initialised and can be used by the +# Diff::LCS#diff or Diff::LCS#sdiff methods. +# +# cbo = Diff::LCS::ContextDiffCallbacks.new +# Diff::LCS.LCS(seq1, seq2, cbo) +# cbo.finish +# +# Note that the call to #finish is absolutely necessary, or the last set of +# changes will not be visible. Alternatively, can be used as: +# +# cbo = Diff::LCS::ContextDiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) } +# +# The necessary #finish call will be made. +# +# === Simplified Array Format +# +# The simplified array format used in the example above can be obtained +# with: +# +# require 'pp' +# pp diffs.map { |e| e.map { |f| f.to_a } } +# +# pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:225 +class Diff::LCS::ContextDiffCallbacks < ::Diff::LCS::DiffCallbacks + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:234 + def change(event); end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:226 + def discard_a(event); end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:230 + def discard_b(event); end +end + +# This callback object implements the default set of callback events, +# which only returns the event itself. Note that #finished_a and +# #finished_b are not implemented -- I haven't yet figured out where they +# would be useful. +# +# Note that this is intended to be called as is, e.g., +# +# Diff::LCS.LCS(seq1, seq2, Diff::LCS::DefaultCallbacks) +# +# pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:14 +class Diff::LCS::DefaultCallbacks + class << self + # Called when both the old and new values have changed. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:32 + def change(event); end + + # Called when the old value is discarded in favour of the new value. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:22 + def discard_a(event); end + + # Called when the new value is discarded in favour of the old value. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:27 + def discard_b(event); end + + # Called when two items match. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:17 + def match(event); end + + private + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:36 + def new(*_arg0); end + end +end + +# This will produce a compound array of simple diff change objects. Each +# element in the #diffs array is a +hunk+ or +hunk+ array, where each +# element in each +hunk+ array is a single Change object representing the +# addition or removal of a single element from one of the two tested +# sequences. The +hunk+ provides the full context for the changes. +# +# diffs = Diff::LCS.diff(seq1, seq2) +# # This example shows a simplified array format. +# # [ [ [ '-', 0, 'a' ] ], # 1 +# # [ [ '+', 2, 'd' ] ], # 2 +# # [ [ '-', 4, 'h' ], # 3 +# # [ '+', 4, 'f' ] ], +# # [ [ '+', 6, 'k' ] ], # 4 +# # [ [ '-', 8, 'n' ], # 5 +# # [ '-', 9, 'p' ], +# # [ '+', 9, 'r' ], +# # [ '+', 10, 's' ], +# # [ '+', 11, 't' ] ] ] +# +# There are five hunks here. The first hunk says that the +a+ at position 0 +# of the first sequence should be deleted ('-'). The second hunk +# says that the +d+ at position 2 of the second sequence should be inserted +# ('+'). The third hunk says that the +h+ at position 4 of the +# first sequence should be removed and replaced with the +f+ from position 4 +# of the second sequence. The other two hunks are described similarly. +# +# === Use +# +# This callback object must be initialised and is used by the Diff::LCS#diff +# method. +# +# cbo = Diff::LCS::DiffCallbacks.new +# Diff::LCS.LCS(seq1, seq2, cbo) +# cbo.finish +# +# Note that the call to #finish is absolutely necessary, or the last set of +# changes will not be visible. Alternatively, can be used as: +# +# cbo = Diff::LCS::DiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) } +# +# The necessary #finish call will be made. +# +# === Simplified Array Format +# +# The simplified array format used in the example above can be obtained +# with: +# +# require 'pp' +# pp diffs.map { |e| e.map { |f| f.to_a } } +# +# pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:108 +class Diff::LCS::DiffCallbacks + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:112 + def initialize; end + + # Returns the difference set collected during the diff process. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:110 + def diffs; end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:135 + def discard_a(event); end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:139 + def discard_b(event); end + + # Finalizes the diff process. If an unprocessed hunk still exists, then it + # is appended to the diff list. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:127 + def finish; end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:131 + def match(_event); end + + private + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:143 + def finish_hunk; end +end + +# A Hunk is a group of Blocks which overlap because of the context surrounding +# each block. (So if we're not using context, every hunk will contain one +# block.) Used in the diff program (bin/ldiff). +# +# pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:8 +class Diff::LCS::Hunk + # Create a hunk using references to both the old and new data, as well as the + # piece of data. + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:16 + def initialize(data_old, data_new, piece, flag_context, file_length_difference); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:64 + def blocks; end + + # Returns a diff string based on a format. + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:115 + def diff(format, last = T.unsafe(nil)); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:66 + def end_new; end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:66 + def end_old; end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:67 + def file_length_difference; end + + # Change the "start" and "end" fields to note that context should be added + # to this hunk. + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:71 + def flag_context; end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:71 + def flag_context=(context); end + + # Merges this hunk and the provided hunk together if they overlap. Returns + # a truthy value so that if there is no overlap, you can know the merge + # was skipped. + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:97 + def merge(hunk); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:347 + def missing_last_newline?(data); end + + # Determines whether there is an overlap between this hunk and the + # provided hunk. This will be true if the difference between the two hunks + # start or end positions is within one position of each other. + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:109 + def overlaps?(hunk); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:65 + def start_new; end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:65 + def start_old; end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:104 + def unshift(hunk); end + + private + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:222 + def context_diff(last = T.unsafe(nil)); end + + # Generate a range of item numbers to print. Only print 1 number if the + # range has only one item in it. Otherwise, it's 'start,end' + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:316 + def context_range(mode, op); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:284 + def ed_diff(format, last); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:360 + def encode(literal, target_encoding = T.unsafe(nil)); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:364 + def encode_as(string, *args); end + + # Note that an old diff can't have any context. Therefore, we know that + # there's only one block in the hunk. + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:134 + def old_diff(last = T.unsafe(nil)); end + + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:167 + def unified_diff(last = T.unsafe(nil)); end + + # Generate a range of item numbers to print for unified diff. Print number + # where block starts, followed by number of lines in the block + # (don't print number of lines if it's 1) + # + # pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:331 + def unified_range(mode); end +end + +# pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:10 +Diff::LCS::Hunk::ED_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash) + +# pkg:gem/diff-lcs#lib/diff/lcs/hunk.rb:9 +Diff::LCS::Hunk::OLD_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash) + +# pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:29 +module Diff::LCS::Internals + class << self + # This method will analyze the provided patchset to provide a single-pass + # normalization (conversion of the array form of Diff::LCS::Change objects to + # the object form of same) and detection of whether the patchset represents + # changes to be made. + # + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:102 + def analyze_patchset(patchset, depth = T.unsafe(nil)); end + + # Examine the patchset and the source to see in which direction the + # patch should be applied. + # + # WARNING: By default, this examines the whole patch, so this could take + # some time. This also works better with Diff::LCS::ContextChange or + # Diff::LCS::Change as its source, as an array will cause the creation + # of one of the above. + # + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:147 + def intuit_diff_direction(src, patchset, limit = T.unsafe(nil)); end + + # Compute the longest common subsequence between the sequenced + # Enumerables +a+ and +b+. The result is an array whose contents is such + # that + # + # result = Diff::LCS::Internals.lcs(a, b) + # result.each_with_index do |e, i| + # assert_equal(a[i], b[e]) unless e.nil? + # end + # + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:41 + def lcs(a, b); end + + private + + # If +vector+ maps the matching elements of another collection onto this + # Enumerable, compute the inverse of +vector+ that maps this Enumerable + # onto the collection. (Currently unused.) + # + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:286 + def inverse_vector(a, vector); end + + # Returns a hash mapping each element of an Enumerable to the set of + # positions it occupies in the Enumerable, optionally restricted to the + # elements specified in the range of indexes specified by +interval+. + # + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:298 + def position_hash(enum, interval); end + + # Find the place at which +value+ would normally be inserted into the + # Enumerable. If that place is already occupied by +value+, do nothing + # and return +nil+. If the place does not exist (i.e., it is off the end + # of the Enumerable), add it to the end. Otherwise, replace the element + # at that point with +value+. It is assumed that the Enumerable's values + # are numeric. + # + # This operation preserves the sort order. + # + # pkg:gem/diff-lcs#lib/diff/lcs/internals.rb:252 + def replace_next_larger(enum, value, last_index = T.unsafe(nil)); end + end +end + +# This will produce a simple array of diff change objects. Each element in +# the #diffs array is a single ContextChange. In the set of #diffs provided +# by SDiffCallbacks, both old and new objects will be presented for both +# changed and unchanged objects. +nil+ will be substituted +# for a discarded object. +# +# The diffset produced by this callback, when provided to Diff::LCS#sdiff, +# will compute and display the necessary components to show two sequences +# and their minimized differences side by side, just like the Unix utility +# +sdiff+. +# +# same same +# before | after +# old < - +# - > new +# +# seq1 = %w(a b c e h j l m n p) +# seq2 = %w(b c d e f j k l m r s t) +# +# diffs = Diff::LCS.sdiff(seq1, seq2) +# # This example shows a simplified array format. +# # [ [ "-", [ 0, "a"], [ 0, nil ] ], +# # [ "=", [ 1, "b"], [ 0, "b" ] ], +# # [ "=", [ 2, "c"], [ 1, "c" ] ], +# # [ "+", [ 3, nil], [ 2, "d" ] ], +# # [ "=", [ 3, "e"], [ 3, "e" ] ], +# # [ "!", [ 4, "h"], [ 4, "f" ] ], +# # [ "=", [ 5, "j"], [ 5, "j" ] ], +# # [ "+", [ 6, nil], [ 6, "k" ] ], +# # [ "=", [ 6, "l"], [ 7, "l" ] ], +# # [ "=", [ 7, "m"], [ 8, "m" ] ], +# # [ "!", [ 8, "n"], [ 9, "r" ] ], +# # [ "!", [ 9, "p"], [ 10, "s" ] ], +# # [ "+", [ 10, nil], [ 11, "t" ] ] ] +# +# The result of this operation is similar to that of +# Diff::LCS::ContextDiffCallbacks. They may be compared as: +# +# s = Diff::LCS.sdiff(seq1, seq2).reject { |e| e.action == "=" } +# c = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextDiffCallbacks).flatten(1) +# +# s == c # -> true +# +# === Use +# +# This callback object must be initialised and is used by the Diff::LCS#sdiff +# method. +# +# cbo = Diff::LCS::SDiffCallbacks.new +# Diff::LCS.LCS(seq1, seq2, cbo) +# +# As with the other initialisable callback objects, +# Diff::LCS::SDiffCallbacks can be initialised with a block. As there is no +# "fininishing" to be done, this has no effect on the state of the object. +# +# cbo = Diff::LCS::SDiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) } +# +# === Simplified Array Format +# +# The simplified array format used in the example above can be obtained +# with: +# +# require 'pp' +# pp diffs.map { |e| e.to_a } +# +# pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:303 +class Diff::LCS::SDiffCallbacks + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:307 + def initialize; end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:324 + def change(event); end + + # Returns the difference set collected during the diff process. + # + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:305 + def diffs; end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:316 + def discard_a(event); end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:320 + def discard_b(event); end + + # pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:312 + def match(event); end +end + +# An alias for DefaultCallbacks that is used in +# Diff::LCS#traverse_sequences. +# +# Diff::LCS.LCS(seq1, seq2, Diff::LCS::SequenceCallbacks) +# +# pkg:gem/diff-lcs#lib/diff/lcs/callbacks.rb:44 +Diff::LCS::SequenceCallbacks = Diff::LCS::DefaultCallbacks + +# pkg:gem/diff-lcs#lib/diff/lcs/version.rb:5 +Diff::LCS::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/erubi@1.13.1.rbi b/sorbet/rbi/gems/erubi@1.13.1.rbi new file mode 100644 index 0000000..dcc2f23 --- /dev/null +++ b/sorbet/rbi/gems/erubi@1.13.1.rbi @@ -0,0 +1,153 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `erubi` gem. +# Please instead update this file by running `bin/tapioca gem erubi`. + + +# pkg:gem/erubi#lib/erubi.rb:3 +module Erubi + private + + # Escape characters with their HTML/XML equivalents. + # + # pkg:gem/erubi#lib/erubi.rb:22 + def h(_arg0); end + + class << self + # pkg:gem/erubi#lib/erubi.rb:49 + def h(_arg0); end + end +end + +# pkg:gem/erubi#lib/erubi.rb:51 +class Erubi::Engine + # Initialize a new Erubi::Engine. Options: + # +:bufval+ :: The value to use for the buffer variable, as a string (default '::String.new'). + # +:bufvar+ :: The variable name to use for the buffer variable, as a string. + # +:chain_appends+ :: Whether to chain << calls to the buffer variable. Offers better + # performance, but can cause issues when the buffer variable is reassigned during + # template rendering (default +false+). + # +:ensure+ :: Wrap the template in a begin/ensure block restoring the previous value of bufvar. + # +:escapefunc+ :: The function to use for escaping, as a string (default: '::Erubi.h'). + # +:escape+ :: Whether to make <%= escape by default, and <%== not escape by default. + # +:escape_html+ :: Same as +:escape+, with lower priority. + # +:filename+ :: The filename for the template. + # the resulting source code. Note this may cause problems if you are wrapping the resulting + # source code in other code, because the magic comment only has an effect at the beginning of + # the file, and having the magic comment later in the file can trigger warnings. + # +:freeze_template_literals+ :: Whether to suffix all literal strings for template code with .freeze + # (default: +true+ on Ruby 2.1+, +false+ on Ruby 2.0 and older). + # Can be set to +false+ on Ruby 2.3+ when frozen string literals are enabled + # in order to improve performance. + # +:literal_prefix+ :: The prefix to output when using escaped tag delimiters (default '<%'). + # +:literal_postfix+ :: The postfix to output when using escaped tag delimiters (default '%>'). + # +:outvar+ :: Same as +:bufvar+, with lower priority. + # +:postamble+ :: The postamble for the template, by default returns the resulting source code. + # +:preamble+ :: The preamble for the template, by default initializes the buffer variable. + # +:regexp+ :: The regexp to use for scanning. + # +:src+ :: The initial value to use for the source code, an empty string by default. + # +:trim+ :: Whether to trim leading and trailing whitespace, true by default. + # + # pkg:gem/erubi#lib/erubi.rb:91 + def initialize(input, properties = T.unsafe(nil)); end + + # The variable name used for the buffer variable. + # + # pkg:gem/erubi#lib/erubi.rb:62 + def bufvar; end + + # The filename of the template, if one was given. + # + # pkg:gem/erubi#lib/erubi.rb:59 + def filename; end + + # The frozen ruby source code generated from the template, which can be evaled. + # + # pkg:gem/erubi#lib/erubi.rb:56 + def src; end + + private + + # pkg:gem/erubi#lib/erubi.rb:209 + def _dup_string_if_frozen(string); end + + # Add ruby code to the template + # + # pkg:gem/erubi#lib/erubi.rb:232 + def add_code(code); end + + # Add the given ruby expression result to the template, + # escaping it based on the indicator given and escape flag. + # + # pkg:gem/erubi#lib/erubi.rb:241 + def add_expression(indicator, code); end + + # Add the result of Ruby expression to the template + # + # pkg:gem/erubi#lib/erubi.rb:250 + def add_expression_result(code); end + + # Add the escaped result of Ruby expression to the template + # + # pkg:gem/erubi#lib/erubi.rb:255 + def add_expression_result_escaped(code); end + + # Add the given postamble to the src. Can be overridden in subclasses + # to make additional changes to src that depend on the current state. + # + # pkg:gem/erubi#lib/erubi.rb:261 + def add_postamble(postamble); end + + # Add raw text to the template. Modifies argument if argument is mutable as a memory optimization. + # Must be called with a string, cannot be called with nil (Rails's subclass depends on it). + # + # pkg:gem/erubi#lib/erubi.rb:222 + def add_text(text); end + + # Raise an exception, as the base engine class does not support handling other indicators. + # + # pkg:gem/erubi#lib/erubi.rb:267 + def handle(indicator, code, tailch, rspace, lspace); end + + # Make sure that any current expression has been terminated. + # The default is to terminate all expressions, but when + # the chain_appends option is used, expressions may not be + # terminated. + # + # pkg:gem/erubi#lib/erubi.rb:295 + def terminate_expression; end + + # Make sure the buffer variable is the target of the next append + # before yielding to the block. Mark that the buffer is the target + # of the next append after the block executes. + # + # This method should only be called if the block will result in + # code where << will append to the bufvar. + # + # pkg:gem/erubi#lib/erubi.rb:277 + def with_buffer; end +end + +# The default regular expression used for scanning. +# +# pkg:gem/erubi#lib/erubi.rb:53 +Erubi::Engine::DEFAULT_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/erubi#lib/erubi.rb:17 +Erubi::FREEZE_TEMPLATE_LITERALS = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/erubi#lib/erubi.rb:15 +Erubi::MATCH_METHOD = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/erubi#lib/erubi.rb:8 +Erubi::RANGE_FIRST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/erubi#lib/erubi.rb:9 +Erubi::RANGE_LAST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/erubi#lib/erubi.rb:16 +Erubi::SKIP_DEFINED_FOR_INSTANCE_VARIABLE = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/erubi#lib/erubi.rb:4 +Erubi::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/globalid@1.4.0.rbi b/sorbet/rbi/gems/globalid@1.4.0.rbi new file mode 100644 index 0000000..d169f02 --- /dev/null +++ b/sorbet/rbi/gems/globalid@1.4.0.rbi @@ -0,0 +1,697 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `globalid` gem. +# Please instead update this file by running `bin/tapioca gem globalid`. + + +# For Enumerable#index_by +# +# pkg:gem/globalid#lib/global_id/version.rb:2 +class GlobalID + extend ::ActiveSupport::Autoload + + # pkg:gem/globalid#lib/global_id/global_id.rb:49 + def initialize(gid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:81 + def ==(other); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:47 + def app(*, **, &); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:94 + def as_json(*); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:47 + def deconstruct_keys(*, **, &); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:84 + def eql?(other); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:53 + def find(options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:86 + def hash; end + + # pkg:gem/globalid#lib/global_id/global_id.rb:57 + def model_class; end + + # pkg:gem/globalid#lib/global_id/global_id.rb:47 + def model_id(*, **, &); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:47 + def model_name(*, **, &); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:47 + def params(*, **, &); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:90 + def to_param; end + + # pkg:gem/globalid#lib/global_id/global_id.rb:47 + def to_s(*, **, &); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:46 + def uri; end + + class << self + # pkg:gem/globalid#lib/global_id/global_id.rb:10 + def app; end + + # pkg:gem/globalid#lib/global_id/global_id.rb:32 + def app=(app); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:12 + def create(model, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:36 + def default_locator(default_locator); end + + # pkg:gem/globalid#lib/global_id.rb:22 + def deprecator; end + + # pkg:gem/globalid#lib/global_id.rb:17 + def eager_load!; end + + # pkg:gem/globalid#lib/global_id/global_id.rb:22 + def find(gid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/global_id.rb:26 + def parse(gid, options = T.unsafe(nil)); end + + private + + # pkg:gem/globalid#lib/global_id/global_id.rb:41 + def parse_encoded_gid(gid, options); end + end +end + +# Mix `GlobalID::Identification` into any model with a `#find(id)` class +# method. Support is automatically included in Active Record. +# +# class Person +# include ActiveModel::Model +# include GlobalID::Identification +# +# attr_accessor :id +# +# def self.find(id) +# new id: id +# end +# +# def ==(other) +# id == other.try(:id) +# end +# end +# +# person_gid = Person.find(1).to_global_id +# # => # # "gid://app/Person/1" +# GlobalID::Locator.locate person_gid +# # => # +# +# pkg:gem/globalid#lib/global_id/identification.rb:29 +module GlobalID::Identification + # pkg:gem/globalid#lib/global_id/identification.rb:41 + def to_gid(options = T.unsafe(nil)); end + + # Returns the Global ID parameter of the model. + # + # model = Person.new id: 1 + # model.to_gid_param # => ""Z2lkOi8vYm9yZGZvbGlvL1BlcnNvbi8x" + # + # pkg:gem/globalid#lib/global_id/identification.rb:47 + def to_gid_param(options = T.unsafe(nil)); end + + # Returns the Global ID of the model. + # + # model = Person.new id: 1 + # global_id = model.to_global_id + # global_id.model_class # => Person + # global_id.model_id # => "1" + # global_id.to_param # => "Z2lkOi8vYm9yZGZvbGlvL1BlcnNvbi8x" + # + # pkg:gem/globalid#lib/global_id/identification.rb:38 + def to_global_id(options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/identification.rb:111 + def to_sgid(options = T.unsafe(nil)); end + + # Returns the Signed Global ID parameter. + # + # model = Person.new id: 1 + # model.to_sgid_param # => "BAh7CEkiCGdpZAY6BkVUSSIiZ2..." + # + # pkg:gem/globalid#lib/global_id/identification.rb:117 + def to_sgid_param(options = T.unsafe(nil)); end + + # Returns the Signed Global ID of the model. + # Signed Global IDs ensure that the data hasn't been tampered with. + # + # model = Person.new id: 1 + # signed_global_id = model.to_signed_global_id + # signed_global_id.model_class # => Person + # signed_global_id.model_id # => "1" + # signed_global_id.to_param # => "BAh7CEkiCGdpZAY6BkVUSSIiZ2..." + # + # ==== Expiration + # + # Signed Global IDs can expire some time in the future. This is useful if + # there's a resource people shouldn't have indefinite access to, like a + # share link. + # + # expiring_sgid = Document.find(5).to_sgid(expires_in: 2.hours, for: 'sharing') + # # => # + # # Within 2 hours... + # GlobalID::Locator.locate_signed(expiring_sgid.to_s, for: 'sharing') + # # => # + # # More than 2 hours later... + # GlobalID::Locator.locate_signed(expiring_sgid.to_s, for: 'sharing') + # # => nil + # + # In Rails, an auto-expiry of 1 month is set by default. + # + # You need to explicitly pass `expires_in: nil` to generate a permanent + # SGID that will not expire, + # + # never_expiring_sgid = Document.find(5).to_sgid(expires_in: nil) + # # => # + # + # # Any time later... + # GlobalID::Locator.locate_signed never_expiring_sgid + # # => # + # + # It's also possible to pass a specific expiry time + # + # explicit_expiring_sgid = SecretAgentMessage.find(5).to_sgid(expires_at: Time.now.advance(hours: 1)) + # # => # + # + # # 1 hour later... + # GlobalID::Locator.locate_signed explicit_expiring_sgid.to_s + # # => nil + # + # Note that an explicit `:expires_at` takes precedence over a relative `:expires_in`. + # + # ==== Purpose + # + # You can even bump the security up some more by explaining what purpose a + # Signed Global ID is for. In this way evildoers can't reuse a sign-up + # form's SGID on the login page. For example. + # + # signup_person_sgid = Person.find(1).to_sgid(for: 'signup_form') + # # => # # + # + # pkg:gem/globalid#lib/global_id/identification.rb:108 + def to_signed_global_id(options = T.unsafe(nil)); end +end + +# pkg:gem/globalid#lib/global_id/locator.rb:5 +module GlobalID::Locator + class << self + # The default locator used when no app-specific locator is found. + # + # pkg:gem/globalid#lib/global_id/locator.rb:21 + def default_locator; end + + # The default locator used when no app-specific locator is found. + # + # pkg:gem/globalid#lib/global_id/locator.rb:21 + def default_locator=(_arg0); end + + # Like .locate, but instead of returning +nil+ or leaking the backend's + # own exceptions when the record can't be returned, it raises one of two + # GlobalID-specific errors so callers can tell the cases apart: + # + # * GlobalID::Locator::RecordNotFound when the record no longer exists. + # Retrying won't help. + # * GlobalID::Locator::RecordUnavailable when the record couldn't be + # located due to any other failure in the backend, like a database + # connection error. The record may still exist, so retrying may succeed. + # + # The distinction is drawn without knowing the backend's exception + # classes: the record is looked up through a query that doesn't raise on + # missing records (like .locate_many's +:ignore_missing+), so an empty + # result means the record is gone, while an error from the query itself + # means the backend is unavailable. + # + # Returns +nil+ for a blank or unparseable GlobalID, or one disallowed by + # the +:only+ option, just like .locate, and accepts the same options. + # + # Note: custom locators registered with .use need to implement locate_many + # with support for the +:ignore_missing+ option for this method to work. + # + # pkg:gem/globalid#lib/global_id/locator.rb:71 + def fetch(gid, options = T.unsafe(nil)); end + + # Takes either a GlobalID or a string that can be turned into a GlobalID + # + # Options: + # * :includes - A Symbol, Array, Hash or combination of them. + # The same structure you would pass into a +includes+ method of Active Record. + # If present, locate will load all the relationships specified here. + # See https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations. + # * :only - A class, module or Array of classes and/or modules that are + # allowed to be located. Passing one or more classes limits instances of returned + # classes to those classes or their subclasses. Passing one or more modules in limits + # instances of returned classes to those including that module. If no classes or + # modules match, +nil+ is returned. + # + # pkg:gem/globalid#lib/global_id/locator.rb:35 + def locate(gid, options = T.unsafe(nil)); end + + # Takes an array of GlobalIDs or strings that can be turned into a GlobalIDs. + # All GlobalIDs must belong to the same app, as they will be located using + # the same locator using its locate_many method. + # + # By default the GlobalIDs will be located using Model.find(array_of_ids), so the + # models must respond to that finder signature. + # + # This approach will efficiently call only one #find (or #where(id: id), when using ignore_missing) + # per model class, but still interpolate the results to match the order in which the gids were passed. + # + # Options: + # * :includes - A Symbol, Array, Hash or combination of them + # The same structure you would pass into a includes method of Active Record. + # @see https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations + # If present, locate_many will load all the relationships specified here. + # Note: It only works if all the gids models have that relationships. + # * :only - A class, module or Array of classes and/or modules that are + # allowed to be located. Passing one or more classes limits instances of returned + # classes to those classes or their subclasses. Passing one or more modules in limits + # instances of returned classes to those including that module. If no classes or + # modules match, +nil+ is returned. + # * :ignore_missing - By default, locate_many will call #find on the model to locate the + # ids extracted from the GIDs. In Active Record (and other data stores following the same pattern), + # #find will raise an exception if a named ID can't be found. When you set this option to true, + # we will use #where(id: ids) instead, which does not raise on missing records. + # + # pkg:gem/globalid#lib/global_id/locator.rb:104 + def locate_many(gids, options = T.unsafe(nil)); end + + # Takes an array of SignedGlobalIDs or strings that can be turned into a SignedGlobalIDs. + # The SignedGlobalIDs are located using Model.find(array_of_ids), so the models must respond to + # that finder signature. + # + # This approach will efficiently call only one #find per model class, but still interpolate + # the results to match the order in which the gids were passed. + # + # Options: + # * :includes - A Symbol, Array, Hash or combination of them + # The same structure you would pass into a includes method of Active Record. + # @see https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations + # If present, locate_many_signed will load all the relationships specified here. + # Note: It only works if all the gids models have that relationships. + # * :only - A class, module or Array of classes and/or modules that are + # allowed to be located. Passing one or more classes limits instances of returned + # classes to those classes or their subclasses. Passing one or more modules in limits + # instances of returned classes to those including that module. If no classes or + # modules match, +nil+ is returned. + # + # pkg:gem/globalid#lib/global_id/locator.rb:147 + def locate_many_signed(sgids, options = T.unsafe(nil)); end + + # Takes either a SignedGlobalID or a string that can be turned into a SignedGlobalID + # + # Options: + # * :includes - A Symbol, Array, Hash or combination of them + # The same structure you would pass into a includes method of Active Record. + # @see https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations + # If present, locate_signed will load all the relationships specified here. + # * :only - A class, module or Array of classes and/or modules that are + # allowed to be located. Passing one or more classes limits instances of returned + # classes to those classes or their subclasses. Passing one or more modules in limits + # instances of returned classes to those including that module. If no classes or + # modules match, +nil+ is returned. + # + # pkg:gem/globalid#lib/global_id/locator.rb:125 + def locate_signed(sgid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/locator.rb:179 + def locator_for(gid); end + + # Tie a locator to an app. + # Useful when different apps collaborate and reference each others' Global IDs. + # + # The locator can be either a block or a class. + # + # Using a block: + # + # GlobalID::Locator.use :foo do |gid, options| + # FooRemote.const_get(gid.model_name).find(gid.model_id) + # end + # + # Using a class: + # + # GlobalID::Locator.use :bar, BarLocator.new + # + # class BarLocator + # def locate(gid, options = {}) + # @search_client.search name: gid.model_name, id: gid.model_id + # end + # end + # + # pkg:gem/globalid#lib/global_id/locator.rb:171 + def use(app, locator = T.unsafe(nil), &locator_block); end + + private + + # pkg:gem/globalid#lib/global_id/locator.rb:188 + def fetch_record(gid, options); end + + # pkg:gem/globalid#lib/global_id/locator.rb:184 + def find_allowed?(gid, only = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/locator.rb:198 + def normalize_app(app); end + + # pkg:gem/globalid#lib/global_id/locator.rb:194 + def parse_allowed(gids, only = T.unsafe(nil)); end + end +end + +# pkg:gem/globalid#lib/global_id/locator.rb:206 +class GlobalID::Locator::BaseLocator + # pkg:gem/globalid#lib/global_id/locator.rb:211 + def locate(gid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/locator.rb:219 + def locate_many(gids, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/locator.rb:207 + def model_class(gid); end + + private + + # pkg:gem/globalid#lib/global_id/locator.rb:243 + def find_records(model_class, ids, options); end + + # pkg:gem/globalid#lib/global_id/locator.rb:253 + def model_id_is_valid?(gid); end + + # pkg:gem/globalid#lib/global_id/locator.rb:257 + def primary_key(model_class); end +end + +# pkg:gem/globalid#lib/global_id/locator.rb:283 +class GlobalID::Locator::BlockLocator + # pkg:gem/globalid#lib/global_id/locator.rb:284 + def initialize(block); end + + # pkg:gem/globalid#lib/global_id/locator.rb:292 + def locate(gid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/locator.rb:296 + def locate_many(gids, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/locator.rb:288 + def model_class(gid); end +end + +# pkg:gem/globalid#lib/global_id/locator.rb:7 +class GlobalID::Locator::Error < ::StandardError; end + +# pkg:gem/globalid#lib/global_id/locator.rb:6 +class GlobalID::Locator::InvalidModelIdError < ::StandardError; end + +# Raised by GlobalID::Locator.fetch when the GlobalID is valid but the +# record it references no longer exists. The record is gone for good, so +# retrying won't help. +# +# pkg:gem/globalid#lib/global_id/locator.rb:12 +class GlobalID::Locator::RecordNotFound < ::GlobalID::Locator::Error; end + +# Raised by GlobalID::Locator.fetch when the record couldn't be located +# due to any other error in the backend, such as a database connection +# error. The record may still exist, so retrying may succeed. +# +# pkg:gem/globalid#lib/global_id/locator.rb:17 +class GlobalID::Locator::RecordUnavailable < ::GlobalID::Locator::Error; end + +# pkg:gem/globalid#lib/global_id/locator.rb:262 +class GlobalID::Locator::UnscopedLocator < ::GlobalID::Locator::BaseLocator + # pkg:gem/globalid#lib/global_id/locator.rb:263 + def locate(gid, options = T.unsafe(nil)); end + + private + + # pkg:gem/globalid#lib/global_id/locator.rb:268 + def find_records(model_class, ids, options); end + + # pkg:gem/globalid#lib/global_id/locator.rb:272 + def unscoped(model_class); end +end + +# pkg:gem/globalid#lib/global_id/version.rb:3 +GlobalID::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/globalid#lib/global_id/verifier.rb:5 +class GlobalID::Verifier < ::ActiveSupport::MessageVerifier + private + + # pkg:gem/globalid#lib/global_id/verifier.rb:11 + def decode(data, **); end + + # pkg:gem/globalid#lib/global_id/verifier.rb:7 + def encode(data, **); end +end + +# pkg:gem/globalid#lib/global_id/signed_global_id.rb:5 +class SignedGlobalID < ::GlobalID + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:60 + def initialize(gid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:72 + def ==(other); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:58 + def expires_at; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:76 + def inspect; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:58 + def purpose; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:70 + def to_param; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:67 + def to_s; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:58 + def verifier; end + + private + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:81 + def pick_expiration(options); end + + class << self + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:9 + def expires_in; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:9 + def expires_in=(_arg0); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:11 + def parse(sgid, options = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:25 + def pick_purpose(options); end + + # Grab the verifier from options and fall back to SignedGlobalID.verifier. + # Raise ArgumentError if neither is available. + # + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:17 + def pick_verifier(options); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:9 + def verifier; end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:9 + def verifier=(_arg0); end + + private + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:51 + def raise_if_expired(expires_at); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:30 + def verify(sgid, options); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:41 + def verify_with_legacy_self_validated_metadata(sgid, options); end + + # pkg:gem/globalid#lib/global_id/signed_global_id.rb:35 + def verify_with_verifier_validated_metadata(sgid, options); end + end +end + +# pkg:gem/globalid#lib/global_id/signed_global_id.rb:6 +class SignedGlobalID::ExpiredMessage < ::StandardError; end + +# pkg:gem/globalid#lib/global_id/uri/gid.rb:8 +class URI::GID < ::URI::Generic + # URI::GID encodes an app unique reference to a specific model as an URI. + # It has the components: app name, model class name, model id and params. + # All components except params are required. + # + # The URI format looks like "gid://app/model_name/model_id". + # + # Simple metadata can be stored in params. Useful if your app has multiple databases, + # for instance, and you need to find out which one to look up the model in. + # + # Params will be encoded as query parameters like so + # "gid://app/model_name/model_id?key=value&another_key=another_value". + # + # Params won't be typecast, they're always strings. + # For convenience params can be accessed using both strings and symbol keys. + # + # Multi value params aren't supported. Any params encoding multiple values under + # the same key will return only the last value. For example, when decoding + # params like "key=first_value&key=last_value" key will only be last_value. + # + # Read the documentation for +parse+, +create+ and +build+ for more. + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:29 + def app; end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:111 + def deconstruct_keys(_keys); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:30 + def model_id; end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:30 + def model_name; end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:30 + def params; end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:106 + def to_s; end + + protected + + # Ruby 2.2 uses #query= instead of #set_query + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:122 + def query=(query); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:133 + def set_params(params); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:116 + def set_path(path); end + + # Ruby 2.1 or less uses #set_query to assign the query + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:128 + def set_query(query); end + + private + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:140 + def check_host(host); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:145 + def check_path(path); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:150 + def check_scheme(scheme); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:199 + def parse_query_params(query); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:158 + def set_model_components(path, validate = T.unsafe(nil)); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:178 + def validate_component(component); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:192 + def validate_model_id(model_id_part); end + + # pkg:gem/globalid#lib/global_id/uri/gid.rb:185 + def validate_model_id_section(model_id, model_name); end + + class << self + # Create a new URI::GID from components with argument check. + # + # The allowed components are app, model_name, model_id and params, which can be + # either a hash or an array. + # + # Using a hash: + # + # URI::GID.build(app: 'bcx', model_name: 'Person', model_id: '1', params: { key: 'value' }) + # + # Using an array, the arguments must be in order [app, model_name, model_id, params]: + # + # URI::GID.build(['bcx', 'Person', '1', key: 'value']) + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:92 + def build(args); end + + # Shorthand to build a URI::GID from an app, a model and optional params. + # + # URI::GID.create('bcx', Person.find(5), database: 'superhumans') + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:76 + def create(app, model, params = T.unsafe(nil)); end + + # Create a new URI::GID by parsing a gid string with argument check. + # + # URI::GID.parse 'gid://bcx/Person/1?key=value' + # + # This differs from URI() and URI.parse which do not check arguments. + # + # URI('gid://bcx') # => URI::GID instance + # URI.parse('gid://bcx') # => URI::GID instance + # URI::GID.parse('gid://bcx/') # => raises URI::InvalidComponentError + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:68 + def parse(uri); end + + # Validates +app+'s as URI hostnames containing only alphanumeric characters, + # hyphens and dashes. An ArgumentError is raised if +app+ is invalid. + # + # URI::GID.validate_app('bcx') # => 'bcx' + # URI::GID.validate_app('foo-bar') # => 'foo-bar' + # URI::GID.validate_app('foo_bar') # => 'foo_bar' + # + # URI::GID.validate_app(nil) # => ArgumentError + # URI::GID.validate_app('foo/bar') # => ArgumentError + # + # pkg:gem/globalid#lib/global_id/uri/gid.rb:52 + def validate_app(app); end + end +end + +# pkg:gem/globalid#lib/global_id/uri/gid.rb:138 +URI::GID::COMPONENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/globalid#lib/global_id/uri/gid.rb:38 +URI::GID::COMPOSITE_MODEL_ID_DELIMITER = T.let(T.unsafe(nil), String) + +# Maximum size of a model id segment +# +# pkg:gem/globalid#lib/global_id/uri/gid.rb:37 +URI::GID::COMPOSITE_MODEL_ID_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/globalid#lib/global_id/uri/gid.rb:34 +class URI::GID::InvalidModelIdError < ::URI::InvalidComponentError; end + +# Raised when creating a Global ID for a model without an id +# +# pkg:gem/globalid#lib/global_id/uri/gid.rb:33 +class URI::GID::MissingModelIdError < ::URI::InvalidComponentError; end + +# pkg:gem/globalid#lib/global_id/uri/gid.rb:40 +URI::GID::URI_PARSER = T.let(T.unsafe(nil), URI::RFC3986_Parser) diff --git a/sorbet/rbi/gems/i18n@1.15.2.rbi b/sorbet/rbi/gems/i18n@1.15.2.rbi new file mode 100644 index 0000000..b5ab2cc --- /dev/null +++ b/sorbet/rbi/gems/i18n@1.15.2.rbi @@ -0,0 +1,2285 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `i18n` gem. +# Please instead update this file by running `bin/tapioca gem i18n`. + + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:15 +module GetText; end + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:17 +class GetText::PoParser < ::Racc::Parser + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:19 + def _(x); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:282 + def _reduce_10(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:295 + def _reduce_12(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:302 + def _reduce_13(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:309 + def _reduce_14(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:316 + def _reduce_15(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:235 + def _reduce_5(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:246 + def _reduce_8(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:264 + def _reduce_9(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:323 + def _reduce_none(val, _values, result); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def next_token; end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def on_comment(comment); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def on_message(msgid, msgstr); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def parse(str, data, ignore_fuzzy = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:23 + def unescape(orig); end +end + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:184 +GetText::PoParser::Racc_arg = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:221 +GetText::PoParser::Racc_debug_parser = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/i18n#lib/i18n/gettext/po_parser.rb:200 +GetText::PoParser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) + +# This module allows you to easily cache all responses from the backend - thus +# speeding up the I18n aspects of your application quite a bit. +# +# To enable caching you can simply include the Cache module to the Simple +# backend - or whatever other backend you are using: +# +# I18n::Backend::Simple.send(:include, I18n::Backend::Cache) +# +# You will also need to set a cache store implementation that you want to use: +# +# I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store) +# +# You can use any cache implementation you want that provides the same API as +# ActiveSupport::Cache (only the methods #fetch and #write are being used). +# +# The cache_key implementation by default assumes you pass values that return +# a valid key from #hash (see +# https://www.ruby-doc.org/core/classes/Object.html#M000337). However, you can +# configure your own digest method via which responds to #hexdigest (see +# https://ruby-doc.org/stdlib/libdoc/openssl/rdoc/OpenSSL/Digest.html): +# +# I18n.cache_key_digest = OpenSSL::Digest::SHA256.new +# +# If you use a lambda as a default value in your translation like this: +# +# I18n.t(:"date.order", :default => lambda {[:month, :day, :year]}) +# +# Then you will always have a cache miss, because each time this method +# is called the lambda will have a different hash value. If you know +# the result of the lambda is a constant as in the example above, then +# to cache this you can make the lambda a constant, like this: +# +# DEFAULT_DATE_ORDER = lambda {[:month, :day, :year]} +# ... +# I18n.t(:"date.order", :default => DEFAULT_DATE_ORDER) +# +# If the lambda may result in different values for each call then consider +# also using the Memoize backend. +# +# The Cascade module adds the ability to do cascading lookups to backends that +# are compatible to the Simple backend. +# +# By cascading lookups we mean that for any key that can not be found the +# Cascade module strips one segment off the scope part of the key and then +# tries to look up the key in that scope. +# +# E.g. when a lookup for the key :"foo.bar.baz" does not yield a result then +# the segment :bar will be stripped off the scope part :"foo.bar" and the new +# scope :foo will be used to look up the key :baz. If that does not succeed +# then the remaining scope segment :foo will be omitted, too, and again the +# key :baz will be looked up (now with no scope). +# +# To enable a cascading lookup one passes the :cascade option: +# +# I18n.t(:'foo.bar.baz', :cascade => true) +# +# This will return the first translation found for :"foo.bar.baz", :"foo.baz" +# or :baz in this order. +# +# The cascading lookup takes precedence over resolving any given defaults. +# I.e. defaults will kick in after the cascading lookups haven't succeeded. +# +# This behavior is useful for libraries like ActiveRecord validations where +# the library wants to give users a bunch of more or less fine-grained options +# of scopes for a particular key. +# +# Thanks to Clemens Kofler for the initial idea and implementation! See +# http://github.com/clemens/i18n-cascading-backend +# I18n locale fallbacks are useful when you want your application to use +# translations from other locales when translations for the current locale are +# missing. E.g. you might want to use :en translations when translations in +# your applications main locale :de are missing. +# +# To enable locale fallbacks you can simply include the Fallbacks module to +# the Simple backend - or whatever other backend you are using: +# +# I18n::Backend::Simple.include(I18n::Backend::Fallbacks) +# The InterpolationCompiler module contains optimizations that can tremendously +# speed up the interpolation process on the Simple backend. +# +# It works by defining a pre-compiled method on stored translation Strings that +# already bring all the knowledge about contained interpolation variables etc. +# so that the actual recurring interpolation will be very fast. +# +# To enable pre-compiled interpolations you can simply include the +# InterpolationCompiler module to the Simple backend: +# +# I18n::Backend::Simple.include(I18n::Backend::InterpolationCompiler) +# +# Note that InterpolationCompiler does not yield meaningful results and consequently +# should not be used with Ruby 1.9 (YARV) but improves performance everywhere else +# (jRuby, Rubinius). +# Memoize module simply memoizes the values returned by lookup using +# a flat hash and can tremendously speed up the lookup process in a backend. +# +# To enable it you can simply include the Memoize module to your backend: +# +# I18n::Backend::Simple.include(I18n::Backend::Memoize) +# +# Notice that it's the responsibility of the backend to define whenever the +# cache should be cleaned. +# I18n translation metadata is useful when you want to access information +# about how a translation was looked up, pluralized or interpolated in +# your application. +# +# msg = I18n.t(:message, :default => 'Hi!', :scope => :foo) +# msg.translation_metadata +# # => { :key => :message, :scope => :foo, :default => 'Hi!' } +# +# If a :count option was passed to #translate it will be set to the metadata. +# Likewise, if any interpolation variables were passed they will also be set. +# +# To enable translation metadata you can simply include the Metadata module +# into the Simple backend class - or whatever other backend you are using: +# +# I18n::Backend::Simple.include(I18n::Backend::Metadata) +# +# I18n Pluralization are useful when you want your application to +# customize pluralization rules. +# +# To enable locale specific pluralizations you can simply include the +# Pluralization module to the Simple backend - or whatever other backend you +# are using. +# +# I18n::Backend::Simple.include(I18n::Backend::Pluralization) +# +# You also need to make sure to provide pluralization algorithms to the +# backend, i.e. include them to your I18n.load_path accordingly. +# heavily based on Masao Mutoh's gettext String interpolation extension +# http://github.com/mutoh/gettext/blob/f6566738b981fe0952548c421042ad1e0cdfb31e/lib/gettext/core_ext/string.rb +# Locale Fallbacks +# +# Extends the I18n module to hold a fallbacks instance which is set to an +# instance of I18n::Locale::Fallbacks by default but can be swapped with a +# different implementation. +# +# Locale fallbacks will compute a number of fallback locales for a given locale. +# For example: +# +#
    
    +# I18n.fallbacks[:"es-MX"] # => [:"es-MX", :es, :en] 
    +# +# Locale fallbacks always fall back to +# +# * all parent locales of a given locale (e.g. :es for :"es-MX") first, +# * the current default locales and all of their parents second +# +# The default locales are set to [] by default but can be set to something else. +# +# One can additionally add any number of additional fallback locales manually. +# These will be added before the default locales to the fallback chain. For +# example: +# +# # using a custom locale as default fallback locale +# +# I18n.fallbacks = I18n::Locale::Fallbacks.new(:"en-GB", :"de-AT" => :de, :"de-CH" => :de) +# I18n.fallbacks[:"de-AT"] # => [:"de-AT", :de, :"en-GB", :en] +# I18n.fallbacks[:"de-CH"] # => [:"de-CH", :de, :"en-GB", :en] +# +# # mapping fallbacks to an existing instance +# +# # people speaking Catalan also speak Spanish as spoken in Spain +# fallbacks = I18n.fallbacks +# fallbacks.map(:ca => :"es-ES") +# fallbacks[:ca] # => [:ca, :"es-ES", :es, :"en-US", :en] +# +# # people speaking Arabian as spoken in Palestine also speak Hebrew as spoken in Israel +# fallbacks.map(:"ar-PS" => :"he-IL") +# fallbacks[:"ar-PS"] # => [:"ar-PS", :ar, :"he-IL", :he, :"en-US", :en] +# fallbacks[:"ar-EG"] # => [:"ar-EG", :ar, :"en-US", :en] +# +# # people speaking Sami as spoken in Finland also speak Swedish and Finnish as spoken in Finland +# fallbacks.map(:sms => [:"se-FI", :"fi-FI"]) +# fallbacks[:sms] # => [:sms, :"se-FI", :se, :"fi-FI", :fi, :"en-US", :en] +# RFC 4646/47 compliant Locale tag implementation that parses locale tags to +# subtags such as language, script, region, variant etc. +# +# For more information see by http://en.wikipedia.org/wiki/IETF_language_tag +# +# Rfc4646::Parser does not implement grandfathered tags. +# Simple Locale tag implementation that computes subtags by simply splitting +# the locale tag at '-' occurrences. +# +# pkg:gem/i18n#lib/i18n/version.rb:3 +module I18n + extend ::I18n::Base + + class << self + # pkg:gem/i18n#lib/i18n/backend/cache.rb:64 + def cache_key_digest; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:68 + def cache_key_digest=(key_digest); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:56 + def cache_namespace; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:60 + def cache_namespace=(namespace); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:48 + def cache_store; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:52 + def cache_store=(store); end + + # Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:17 + def fallbacks; end + + # Sets the current fallbacks implementation. Use this to set a different fallbacks implementation. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:27 + def fallbacks=(fallbacks); end + + # Return String or raises MissingInterpolationArgument exception. + # Missing argument's logic is handled by I18n.config.missing_interpolation_argument_handler. + # + # pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:23 + def interpolate(string, values); end + + # pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:29 + def interpolate_hash(string, values); end + + # pkg:gem/i18n#lib/i18n.rb:38 + def new_double_nested_cache; end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:72 + def perform_caching?; end + + # Marks a key as reserved. Reserved keys are used internally, + # and can't also be used for interpolation. If you are using any + # extra keys as I18n options, you should call I18n.reserve_key + # before any I18n.translate (etc) calls are made. + # + # pkg:gem/i18n#lib/i18n.rb:46 + def reserve_key(key); end + + # pkg:gem/i18n#lib/i18n.rb:51 + def reserved_keys_pattern; end + end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:14 +class I18n::ArgumentError < ::ArgumentError; end + +# pkg:gem/i18n#lib/i18n/backend.rb:4 +module I18n::Backend; end + +# pkg:gem/i18n#lib/i18n/backend/base.rb:8 +module I18n::Backend::Base + include ::I18n::Backend::Transliterator + + # Returns an array of locales for which translations are available + # ignoring the reserved translation meta data key :i18n. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:97 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:105 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:71 + def exists?(locale, key, options = T.unsafe(nil)); end + + # Accepts a list of paths to translation files. Loads translations from + # plain Ruby (*.rb), YAML files (*.yml), or JSON files (*.json). See #load_rb, #load_yml, and #load_json + # for details. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:14 + def load_translations(*filenames); end + + # Acts the same as +strftime+, but uses a localized version of the + # format string. Takes a key from the date/time formats translations as + # a format argument (e.g., :short in :'date.formats'). + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:78 + def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:101 + def reload!; end + + # This method receives a locale, a data hash and options for storing translations. + # Should be implemented + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:24 + def store_translations(locale, data, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:28 + def translate(locale, key, options = T.unsafe(nil)); end + + protected + + # Deep interpolation + # + # deep_interpolate { people: { ann: "Ann is %{ann}", john: "John is %{john}" } }, + # ann: 'good', john: 'big' + # #=> { people: { ann: "Ann is good", john: "John is big" } } + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:217 + def deep_interpolate(locale, data, values = T.unsafe(nil)); end + + # Evaluates defaults. + # If given subject is an Array, it walks the array and returns the + # first translation that can be resolved. Otherwise it tries to resolve + # the translation directly. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:128 + def default(locale, object, subject, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:111 + def eager_loaded?; end + + # Interpolates values into a given subject. + # + # if the given subject is a string then: + # method interpolates "file %{file} opened by %%{user}", :file => 'test.txt', :user => 'Mr. X' + # # => "file test.txt opened by %{user}" + # + # if the given subject is an array then: + # each element of the array is recursively interpolated (until it finds a string) + # method interpolates ["yes, %{user}", ["maybe no, %{user}", "no, %{user}"]], :user => "bartuz" + # # => ["yes, bartuz", ["maybe no, bartuz", "no, bartuz"]] + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:201 + def interpolate(locale, subject, values = T.unsafe(nil)); end + + # Loads a single translations file by delegating to #load_rb or + # #load_yml depending on the file extension and directly merges the + # data to the existing translations. Raises I18n::UnknownFileType + # for all other file extensions. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:240 + def load_file(filename); end + + # Loads a JSON translations file. The data must have locales as + # toplevel keys. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:276 + def load_json(filename); end + + # Loads a plain Ruby translations file. eval'ing the file must yield + # a Hash containing translation data with locales as toplevel keys. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:254 + def load_rb(filename); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:272 + def load_yaml(filename); end + + # Loads a YAML translations file. The data must have locales as + # toplevel keys. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:261 + def load_yml(filename); end + + # The method which actually looks up for the translation in the store. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:116 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:308 + def pluralization_key(entry, count); end + + # Picks a translation from a pluralized mnemonic subkey according to English + # pluralization rules : + # - It will pick the :one subkey if count is equal to 1. + # - It will pick the :other subkey otherwise. + # - It will pick the :zero subkey in the special case where count is + # equal to 0 and there is a :zero subkey present. This behaviour is + # not standard with regards to the CLDR pluralization rules. + # Other backends can implement more flexible or complex pluralization rules. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:182 + def pluralize(locale, entry, count); end + + # Resolves a translation. + # If the given subject is a Symbol, it will be translated with the + # given options. If it is a Proc then it will be evaluated. All other + # subjects will be returned directly. + # + # pkg:gem/i18n#lib/i18n/backend/base.rb:150 + def resolve(locale, object, subject, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:172 + def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:120 + def subtrees?; end + + # pkg:gem/i18n#lib/i18n/backend/base.rb:289 + def translate_localization_format(locale, object, format, options); end +end + +# TODO Should the cache be cleared if new translations are stored? +# +# pkg:gem/i18n#lib/i18n/backend/cache.rb:79 +module I18n::Backend::Cache + # pkg:gem/i18n#lib/i18n/backend/cache.rb:80 + def translate(locale, key, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:93 + def _fetch(cache_key, &block); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:101 + def cache_key(locale, key, options); end + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:86 + def fetch(cache_key, &block); end + + private + + # pkg:gem/i18n#lib/i18n/backend/cache.rb:108 + def digest_item(key); end +end + +# Overwrites the Base load_file method to cache loaded file contents. +# +# pkg:gem/i18n#lib/i18n/backend/cache_file.rb:8 +module I18n::Backend::CacheFile + # Optionally provide path_roots array to normalize filename paths, + # to make the cached i18n data portable across environments. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:11 + def path_roots; end + + # Optionally provide path_roots array to normalize filename paths, + # to make the cached i18n data portable across environments. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:11 + def path_roots=(_arg0); end + + protected + + # Track loaded translation files in the `i18n.load_file` scope, + # and skip loading the file if its contents are still up-to-date. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:17 + def load_file(filename); end + + # Translate absolute filename to relative path for i18n key. + # + # pkg:gem/i18n#lib/i18n/backend/cache_file.rb:28 + def normalized_path(file); end +end + +# pkg:gem/i18n#lib/i18n/backend/cascade.rb:35 +module I18n::Backend::Cascade + # pkg:gem/i18n#lib/i18n/backend/cascade.rb:36 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Backend that chains multiple other backends and checks each of them when +# a translation needs to be looked up. This is useful when you want to use +# standard translations with a Simple backend but store custom application +# translations in a database or other backends. +# +# To use the Chain backend instantiate it and set it to the I18n module. +# You can add chained backends through the initializer or backends +# accessor: +# +# # preserves the existing Simple backend set to I18n.backend +# I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend) +# +# The implementation assumes that all backends added to the Chain implement +# a lookup method with the same API as Simple backend does. +# +# Fallback translations using the :default option are only used by the last backend of a chain. +# +# pkg:gem/i18n#lib/i18n/backend/chain.rb:21 +class I18n::Backend::Chain + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::Chain::Implementation +end + +# pkg:gem/i18n#lib/i18n/backend/chain.rb:22 +module I18n::Backend::Chain::Implementation + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:27 + def initialize(*backends); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:52 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:25 + def backends; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:25 + def backends=(_arg0); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:44 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:76 + def exists?(locale, key, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:31 + def initialized?; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:82 + def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:40 + def reload!; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:48 + def store_translations(locale, data, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:56 + def translate(locale, key, default_options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:92 + def init_translations; end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:108 + def namespace_lookup?(result, options); end + + # pkg:gem/i18n#lib/i18n/backend/chain.rb:98 + def translations; end + + private + + # This is approximately what gets used in ActiveSupport. + # However since we are not guaranteed to run in an ActiveSupport context + # it is wise to have our own copy. We underscore it + # to not pollute the namespace of the including class. + # + # pkg:gem/i18n#lib/i18n/backend/chain.rb:117 + def _deep_merge(hash, other_hash); end +end + +# pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:38 +module I18n::Backend::Fallbacks + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:106 + def exists?(locale, key, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:97 + def extract_non_symbol_default!(options); end + + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:75 + def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end + + # Overwrites the Base backend translate method so that it will try each + # locale given by I18n.fallbacks for the given locale. E.g. for the + # locale :"de-DE" it might try the locales :"de-DE", :de and :en + # (depends on the fallbacks implementation) until it finds a result with + # the given options. If it does not find any result for any of the + # locales it will then throw MissingTranslation as usual. + # + # The default option takes precedence over fallback locales only when + # it's a Symbol. When the default contains a String, Proc or Hash + # it is evaluated last after all the fallback locales have been tried. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:49 + def translate(locale, key, options = T.unsafe(nil)); end + + private + + # Overwrite on_fallback to add specified logic when the fallback succeeds. + # + # pkg:gem/i18n#lib/i18n/backend/fallbacks.rb:122 + def on_fallback(_original_locale, _fallback_locale, _key, _options); end +end + +# This module contains several helpers to assist flattening translations. +# You may want to flatten translations for: +# +# 1) speed up lookups, as in the Memoize backend; +# 2) In case you want to store translations in a data store, as in ActiveRecord backend; +# +# You can check both backends above for some examples. +# This module also keeps all links in a hash so they can be properly resolved when flattened. +# +# pkg:gem/i18n#lib/i18n/backend/flatten.rb:13 +module I18n::Backend::Flatten + # Flatten keys for nested Hashes by chaining up keys: + # + # >> { "a" => { "b" => { "c" => "d", "e" => "f" }, "g" => "h" }, "i" => "j"}.wind + # => { "a.b.c" => "d", "a.b.e" => "f", "a.g" => "h", "i" => "j" } + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:59 + def flatten_keys(hash, escape, prev_key = T.unsafe(nil), &block); end + + # Receives a hash of translations (where the key is a locale and + # the value is another hash) and return a hash with all + # translations flattened. + # + # Nested hashes are included in the flattened hash just if subtree + # is true and Symbols are automatically stored as links. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:74 + def flatten_translations(locale, data, escape, subtree); end + + # Store flattened links. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:50 + def links; end + + # Shortcut to I18n::Backend::Flatten.normalize_flat_keys + # and then resolve_links. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:44 + def normalize_flat_keys(locale, key, scope, separator); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:112 + def escape_default_separator(key); end + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:106 + def find_link(locale, key); end + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:93 + def resolve_link(locale, key); end + + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:89 + def store_link(locale, key, link); end + + class << self + # Receives a string and escape the default separator. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:38 + def escape_default_separator(key); end + + # normalize_keys the flatten way. This method is significantly faster + # and creates way less objects than the one at I18n.normalize_keys. + # It also handles escaping the translation keys. + # + # pkg:gem/i18n#lib/i18n/backend/flatten.rb:20 + def normalize_flat_keys(locale, key, scope, separator); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/flatten.rb:15 +I18n::Backend::Flatten::FLATTEN_SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/i18n#lib/i18n/backend/flatten.rb:14 +I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR = T.let(T.unsafe(nil), String) + +# Experimental support for using Gettext po files to store translations. +# +# To use this you can simply include the module to the Simple backend - or +# whatever other backend you are using. +# +# I18n::Backend::Simple.include(I18n::Backend::Gettext) +# +# Now you should be able to include your Gettext translation (*.po) files to +# the +I18n.load_path+ so they're loaded to the backend and you can use them as +# usual: +# +# I18n.load_path += Dir["path/to/locales/*.po"] +# +# Following the Gettext convention this implementation expects that your +# translation files are named by their locales. E.g. the file en.po would +# contain the translations for the English locale. +# +# To translate text you must use one of the translate methods provided by +# I18n::Gettext::Helpers. +# +# include I18n::Gettext::Helpers +# puts _("some string") +# +# Without it strings containing periods (".") will not be translated. +# +# pkg:gem/i18n#lib/i18n/backend/gettext.rb:33 +module I18n::Backend::Gettext + protected + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:41 + def load_po(filename); end + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:51 + def normalize(locale, data); end + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:68 + def normalize_pluralization(locale, key, value); end + + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:47 + def parse(filename); end +end + +# pkg:gem/i18n#lib/i18n/backend/gettext.rb:34 +class I18n::Backend::Gettext::PoData < ::Hash + # pkg:gem/i18n#lib/i18n/backend/gettext.rb:35 + def set_comment(msgid_or_sym, comment); end +end + +# pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:20 +module I18n::Backend::InterpolationCompiler + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:98 + def interpolate(locale, string, values); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:108 + def store_translations(locale, data, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:114 + def compile_all_strings_in(data); end +end + +# pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:21 +module I18n::Backend::InterpolationCompiler::Compiler + extend ::I18n::Backend::InterpolationCompiler::Compiler + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:26 + def compile_if_an_interpolation(string); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:39 + def interpolated_str?(str); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:59 + def compile_interpolation_token(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:49 + def compiled_interpolation_body(str); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:72 + def direct_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:92 + def escape_key_sym(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:88 + def escape_plain_str(str); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:55 + def handle_interpolation_token(token); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:68 + def interpolate_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:63 + def interpolate_or_raise_missing(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:80 + def missing_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:76 + def nil_key(key); end + + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:84 + def reserved_key(key); end + + # tokenize("foo %{bar} baz %%{buz}") # => ["foo ", "%{bar}", " baz ", "%%{buz}"] + # + # pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:45 + def tokenize(str); end +end + +# pkg:gem/i18n#lib/i18n/backend/interpolation_compiler.rb:24 +I18n::Backend::InterpolationCompiler::Compiler::TOKENIZER = T.let(T.unsafe(nil), Regexp) + +# This is a basic backend for key value stores. It receives on +# initialization the store, which should respond to three methods: +# +# * store#[](key) - Used to get a value +# * store#[]=(key, value) - Used to set a value +# * store#keys - Used to get all keys +# +# Since these stores only supports string, all values are converted +# to JSON before being stored, allowing it to also store booleans, +# hashes and arrays. However, this store does not support Procs. +# +# As the ActiveRecord backend, Symbols are just supported when loading +# translations from the filesystem or through explicit store translations. +# +# Also, avoid calling I18n.available_locales since it's a somehow +# expensive operation in most stores. +# +# == Example +# +# To setup I18n to use TokyoCabinet in memory is quite straightforward: +# +# require 'rufus/tokyo/cabinet' # gem install rufus-tokyo +# I18n.backend = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new('*')) +# +# == Performance +# +# You may make this backend even faster by including the Memoize module. +# However, notice that you should properly clear the cache if you change +# values directly in the key-store. +# +# == Subtrees +# +# In most backends, you are allowed to retrieve part of a translation tree: +# +# I18n.backend.store_translations :en, :foo => { :bar => :baz } +# I18n.t "foo" #=> { :bar => :baz } +# +# This backend supports this feature by default, but it slows down the storage +# of new data considerably and makes hard to delete entries. That said, you are +# allowed to disable the storage of subtrees on initialization: +# +# I18n::Backend::KeyValue.new(@store, false) +# +# This is useful if you are using a KeyValue backend chained to a Simple backend. +# +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:69 +class I18n::Backend::KeyValue + include ::I18n::Backend::Flatten + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::KeyValue::Implementation +end + +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:70 +module I18n::Backend::KeyValue::Implementation + include ::I18n::Backend::Flatten + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:75 + def initialize(store, subtrees = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:102 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:79 + def initialized?; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:71 + def store; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:71 + def store=(_arg0); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:83 + def store_translations(locale, data, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:124 + def init_translations; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:136 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:150 + def pluralize(locale, entry, count); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:132 + def subtrees?; end + + # Queries the translations from the key-value store and converts + # them into a hash such as the one returned from loading the + # haml files + # + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:115 + def translations; end +end + +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:161 +class I18n::Backend::KeyValue::SubtreeProxy + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:162 + def initialize(master_key, store); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:172 + def [](key); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:168 + def has_key?(key); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:196 + def inspect; end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:188 + def instance_of?(klass); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:183 + def is_a?(klass); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:186 + def kind_of?(klass); end + + # pkg:gem/i18n#lib/i18n/backend/key_value.rb:192 + def nil?; end +end + +# pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:65 +class I18n::Backend::LazyLoadable < ::I18n::Backend::Simple + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:66 + def initialize(lazy_load: T.unsafe(nil)); end + + # Parse the load path and extract all locales. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:99 + def available_locales; end + + # Eager loading is not supported in the lazy context. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:90 + def eager_load!; end + + # Returns whether the current locale is initialized. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:71 + def initialized?; end + + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:107 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # Clean up translations and uninitialize all locales. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:80 + def reload!; end + + protected + + # Load translations from files that belong to the current locale. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:121 + def init_translations; end + + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:133 + def initialized_locales; end + + private + + # Checks if a filename is named in correspondence to the translations it loaded. + # The locale extracted from the path must be the single locale loaded in the translations. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:175 + def assert_file_named_correctly!(file, translations); end + + # Select all files from I18n load path that belong to current locale. + # These files must start with the locale identifier (ie. "en", "pt-BR"), + # followed by an "_" demarcation to separate proceeding text. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:167 + def filenames_for_current_locale; end + + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:139 + def lazy_load?; end + + # Loads each file supplied and asserts that the file only loads + # translations as expected by the name. The method returns a list of + # errors corresponding to offending files. + # + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:152 + def load_translations_and_collect_file_errors(files); end +end + +# pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:143 +class I18n::Backend::LazyLoadable::FilenameIncorrect < ::StandardError + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:144 + def initialize(file, expected_locale, unexpected_locales); end +end + +# Backend that lazy loads translations based on the current locale. This +# implementation avoids loading all translations up front. Instead, it only +# loads the translations that belong to the current locale. This offers a +# performance incentive in local development and test environments for +# applications with many translations for many different locales. It's +# particularly useful when the application only refers to a single locales' +# translations at a time (ex. A Rails workload). The implementation +# identifies which translation files from the load path belong to the +# current locale by pattern matching against their path name. +# +# Specifically, a translation file is considered to belong to a locale if: +# a) the filename is in the I18n load path +# b) the filename ends in a supported extension (ie. .yml, .json, .po, .rb) +# c) the filename starts with the locale identifier +# d) the locale identifier and optional proceeding text is separated by an underscore, ie. "_". +# +# Examples: +# Valid files that will be selected by this backend: +# +# "files/locales/en_translation.yml" (Selected for locale "en") +# "files/locales/fr.po" (Selected for locale "fr") +# +# Invalid files that won't be selected by this backend: +# +# "files/locales/translation-file" +# "files/locales/en-translation.unsupported" +# "files/locales/french/translation.yml" +# "files/locales/fr/translation.yml" +# +# The implementation uses this assumption to defer the loading of +# translation files until the current locale actually requires them. +# +# The backend has two working modes: lazy_load and eager_load. +# +# Note: This backend should only be enabled in test environments! +# When the mode is set to false, the backend behaves exactly like the +# Simple backend, with an additional check that the paths being loaded +# abide by the format. If paths can't be matched to the format, an error is raised. +# +# You can configure lazy loaded backends through the initializer or backends +# accessor: +# +# # In test environments +# +# I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: true) +# +# # In other environments, such as production and CI +# +# I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: false) # default +# +# pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:55 +class I18n::Backend::LocaleExtractor + class << self + # pkg:gem/i18n#lib/i18n/backend/lazy_loadable.rb:57 + def locale_from_path(path); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/memoize.rb:14 +module I18n::Backend::Memoize + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:15 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:29 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:24 + def reload!; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:19 + def store_translations(locale, data, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:37 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:44 + def memoized_lookup; end + + # pkg:gem/i18n#lib/i18n/backend/memoize.rb:48 + def reset_memoizations!(locale = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n/backend/metadata.rb:21 +module I18n::Backend::Metadata + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:52 + def interpolate(locale, entry, values = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:57 + def pluralize(locale, entry, count); end + + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:40 + def translate(locale, key, options = T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:63 + def with_metadata(metadata, &block); end + + class << self + # pkg:gem/i18n#lib/i18n/backend/metadata.rb:23 + def included(base); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/pluralization.rb:16 +module I18n::Backend::Pluralization + # Overwrites the Base backend translate method so that it will check the + # translation meta data space (:i18n) for a locale specific pluralization + # rule and use it to pluralize the given entry. I.e., the library expects + # pluralization rules to be stored at I18n.t(:'i18n.plural.rule') + # + # Pluralization rules are expected to respond to #call(count) and + # return a pluralization key. Valid keys depend on the pluralization + # rules for the locale, as defined in the CLDR. + # As of v41, 6 locale-specific plural categories are defined: + # :few, :many, :one, :other, :two, :zero + # + # n.b., The :one plural category does not imply the number 1. + # Instead, :one is a category for any number that behaves like 1 in + # that locale. For example, in some locales, :one is used for numbers + # that end in "1" (like 1, 21, 151) but that don't end in + # 11 (like 11, 111, 10311). + # Similar notes apply to the :two, and :zero plural categories. + # + # If you want to have different strings for the categories of count == 0 + # (e.g. "I don't have any cars") or count == 1 (e.g. "I have a single car") + # use the explicit `"0"` and `"1"` keys. + # https://unicode-org.github.io/cldr/ldml/tr35-numbers.html#Explicit_0_1_rules + # + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:39 + def pluralize(locale, entry, count); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:81 + def pluralizer(locale); end + + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:77 + def pluralizers; end + + private + + # Normalizes categories of 0.0 and 1.0 + # and returns the symbolic version + # + # pkg:gem/i18n#lib/i18n/backend/pluralization.rb:89 + def symbolic_count(count); end +end + +# A simple backend that reads translations from YAML files and stores them in +# an in-memory hash. Relies on the Base backend. +# +# The implementation is provided by a Implementation module allowing to easily +# extend Simple backend's behavior by including modules. E.g.: +# +# module I18n::Backend::Pluralization +# def pluralize(*args) +# # extended pluralization logic +# super +# end +# end +# +# I18n::Backend::Simple.include(I18n::Backend::Pluralization) +# +# pkg:gem/i18n#lib/i18n/backend/simple.rb:21 +class I18n::Backend::Simple + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + include ::I18n::Backend::Simple::Implementation +end + +# pkg:gem/i18n#lib/i18n/backend/simple.rb:22 +module I18n::Backend::Simple::Implementation + include ::I18n::Backend::Transliterator + include ::I18n::Backend::Base + + # Get available locales from the translations hash + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:49 + def available_locales; end + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:64 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:28 + def initialized?; end + + # Clean up translations hash and set initialized to false on reload! + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:58 + def reload!; end + + # Stores translations for the given locale in memory. + # This uses a deep merge for the translations hash, so existing + # translations will be overwritten by new ones only at the deepest + # level of the hash. + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:36 + def store_translations(locale, data, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:69 + def translations(do_init: T.unsafe(nil)); end + + protected + + # pkg:gem/i18n#lib/i18n/backend/simple.rb:83 + def init_translations; end + + # Looks up a translation from the translations hash. Returns nil if + # either key is nil, or locale, scope or key do not exist as a key in the + # nested translations hash. Splits keys or scopes containing dots + # into multiple keys, i.e. currency.format is regarded the same as + # %w(currency format). + # + # pkg:gem/i18n#lib/i18n/backend/simple.rb:93 + def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Mutex to ensure that concurrent translations loading will be thread-safe +# +# pkg:gem/i18n#lib/i18n/backend/simple.rb:26 +I18n::Backend::Simple::Implementation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:6 +module I18n::Backend::Transliterator + # Given a locale and a UTF-8 string, return the locale's ASCII + # approximation for the string. + # + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:11 + def transliterate(locale, string, replacement = T.unsafe(nil)); end + + class << self + # Get a transliterator instance. + # + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:19 + def get(rule = T.unsafe(nil)); end + end +end + +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:7 +I18n::Backend::Transliterator::DEFAULT_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) + +# A transliterator which accepts a Hash of characters as its translation +# rule. +# +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:42 +class I18n::Backend::Transliterator::HashTransliterator + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:75 + def initialize(rule = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:81 + def transliterate(string, replacement = T.unsafe(nil)); end + + private + + # Add transliteration rules to the approximations hash. + # + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:101 + def add(hash); end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:94 + def add_default_approximations; end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:90 + def approximations; end +end + +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:43 +I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS = T.let(T.unsafe(nil), Hash) + +# A transliterator which accepts a Proc as its transliteration rule. +# +# pkg:gem/i18n#lib/i18n/backend/transliterator.rb:30 +class I18n::Backend::Transliterator::ProcTransliterator + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:31 + def initialize(rule); end + + # pkg:gem/i18n#lib/i18n/backend/transliterator.rb:35 + def transliterate(string, replacement = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n.rb:55 +module I18n::Base + # pkg:gem/i18n#lib/i18n.rb:99 + def available_locales; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def available_locales=(value); end + + # pkg:gem/i18n#lib/i18n.rb:416 + def available_locales_initialized?; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def backend; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def backend=(value); end + + # Gets I18n configuration object. + # + # pkg:gem/i18n#lib/i18n.rb:57 + def config; end + + # Sets I18n configuration object. + # + # pkg:gem/i18n#lib/i18n.rb:87 + def config=(value); end + + # pkg:gem/i18n#lib/i18n.rb:99 + def default_locale; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def default_locale=(value); end + + # pkg:gem/i18n#lib/i18n.rb:99 + def default_separator; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def default_separator=(value); end + + # Tells the backend to load translations now. Used in situations like the + # Rails production environment. Backends can implement whatever strategy + # is useful. + # + # pkg:gem/i18n#lib/i18n.rb:121 + def eager_load!; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def enforce_available_locales; end + + # Raises an InvalidLocale exception when the passed locale is not available. + # + # pkg:gem/i18n#lib/i18n.rb:410 + def enforce_available_locales!(locale); end + + # pkg:gem/i18n#lib/i18n.rb:99 + def enforce_available_locales=(value); end + + # pkg:gem/i18n#lib/i18n.rb:99 + def exception_handler; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def exception_handler=(value); end + + # Returns true if a translation exists for a given key, otherwise returns false. + # + # pkg:gem/i18n#lib/i18n.rb:295 + def exists?(key, _locale = T.unsafe(nil), locale: T.unsafe(nil), **options); end + + # Returns an array of interpolation keys for the given translation key + # + # *Examples* + # + # Suppose we have the following: + # I18n.t 'example.zero' == 'Zero interpolations' + # I18n.t 'example.one' == 'One interpolation %{foo}' + # I18n.t 'example.two' == 'Two interpolations %{foo} %{bar}' + # I18n.t 'example.three' == ['One %{foo}', 'Two %{bar}', 'Three %{baz}'] + # I18n.t 'example.one', locale: :other == 'One interpolation %{baz}' + # + # Then we can expect the following results: + # I18n.interpolation_keys('example.zero') #=> [] + # I18n.interpolation_keys('example.one') #=> ['foo'] + # I18n.interpolation_keys('example.two') #=> ['foo', 'bar'] + # I18n.interpolation_keys('example.three') #=> ['foo', 'bar', 'baz'] + # I18n.interpolation_keys('one', scope: 'example', locale: :other) #=> ['baz'] + # I18n.interpolation_keys('does-not-exist') #=> [] + # I18n.interpolation_keys('example') #=> [] + # + # pkg:gem/i18n#lib/i18n.rb:284 + def interpolation_keys(key, **options); end + + # pkg:gem/i18n#lib/i18n.rb:373 + def l(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end + + # pkg:gem/i18n#lib/i18n.rb:99 + def load_path; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def load_path=(value); end + + # pkg:gem/i18n#lib/i18n.rb:99 + def locale; end + + # pkg:gem/i18n#lib/i18n.rb:99 + def locale=(value); end + + # Returns true when the passed locale, which can be either a String or a + # Symbol, is in the list of available locales. Returns false otherwise. + # + # pkg:gem/i18n#lib/i18n.rb:405 + def locale_available?(locale); end + + # Localizes certain objects, such as dates and numbers to local formatting. + # + # pkg:gem/i18n#lib/i18n.rb:365 + def localize(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end + + # Merges the given locale, key and scope into a single array of keys. + # Splits keys that contain dots into multiple keys. Makes sure all + # keys are Symbols. + # + # pkg:gem/i18n#lib/i18n.rb:393 + def normalize_keys(locale, key, scope, separator = T.unsafe(nil)); end + + # Tells the backend to reload translations. Used in situations like the + # Rails development environment. Backends can implement whatever strategy + # is useful. + # + # pkg:gem/i18n#lib/i18n.rb:113 + def reload!; end + + # pkg:gem/i18n#lib/i18n.rb:256 + def t(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end + + # pkg:gem/i18n#lib/i18n.rb:263 + def t!(key, **options); end + + # Translates, pluralizes and interpolates a given key using a given locale, + # scope, and default, as well as interpolation values. + # + # *LOOKUP* + # + # Translation data is organized as a nested hash using the upper-level keys + # as namespaces. E.g., ActionView ships with the translation: + # :date => {:formats => {:short => "%b %d"}}. + # + # Translations can be looked up at any level of this hash using the key argument + # and the scope option. E.g., in this example I18n.t :date + # returns the whole translations hash {:formats => {:short => "%b %d"}}. + # + # Key can be either a single key or a dot-separated key (both Strings and Symbols + # work). E.g., the short format can be looked up using both: + # I18n.t 'date.formats.short' + # I18n.t :'date.formats.short' + # + # Scope can be either a single key, a dot-separated key or an array of keys + # or dot-separated keys. Keys and scopes can be combined freely. So these + # examples will all look up the same short date format: + # I18n.t 'date.formats.short' + # I18n.t 'formats.short', :scope => 'date' + # I18n.t 'short', :scope => 'date.formats' + # I18n.t 'short', :scope => %w(date formats) + # + # *INTERPOLATION* + # + # Translations can contain interpolation variables which will be replaced by + # values passed to #translate as part of the options hash, with the keys matching + # the interpolation variable names. + # + # E.g., with a translation :foo => "foo %{bar}" the option + # value for the key +bar+ will be interpolated into the translation: + # I18n.t :foo, :bar => 'baz' # => 'foo baz' + # + # *PLURALIZATION* + # + # Translation data can contain pluralized translations. Pluralized translations + # are arrays of singular/plural versions of translations like ['Foo', 'Foos']. + # + # Note that I18n::Backend::Simple only supports an algorithm for English + # pluralization rules. Other algorithms can be supported by custom backends. + # + # This returns the singular version of a pluralized translation: + # I18n.t :foo, :count => 1 # => 'Foo' + # + # These both return the plural version of a pluralized translation: + # I18n.t :foo, :count => 0 # => 'Foos' + # I18n.t :foo, :count => 2 # => 'Foos' + # + # The :count option can be used both for pluralization and interpolation. + # E.g., with the translation + # :foo => ['%{count} foo', '%{count} foos'], count will + # be interpolated to the pluralized translation: + # I18n.t :foo, :count => 1 # => '1 foo' + # + # *DEFAULTS* + # + # This returns the translation for :foo or default if no translation was found: + # I18n.t :foo, :default => 'default' + # + # This returns the translation for :foo or the translation for :bar if no + # translation for :foo was found: + # I18n.t :foo, :default => :bar + # + # Returns the translation for :foo or the translation for :bar + # or default if no translations for :foo and :bar were found. + # I18n.t :foo, :default => [:bar, 'default'] + # + # BULK LOOKUP + # + # This returns an array with the translations for :foo and :bar. + # I18n.t [:foo, :bar] + # + # Can be used with dot-separated nested keys: + # I18n.t [:'baz.foo', :'baz.bar'] + # + # Which is the same as using a scope option: + # I18n.t [:foo, :bar], :scope => :baz + # + # *LAMBDAS* + # + # Both translations and defaults can be given as Ruby lambdas. Lambdas will be + # called and passed the key and options. + # + # E.g. assuming the key :salutation resolves to: + # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" } + # + # Then I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith". + # + # Note that the string returned by lambda will go through string interpolation too, + # so the following lambda would give the same result: + # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" } + # + # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when + # a cache layer is put in front of I18n.translate it will generate a cache key + # from the argument values passed to #translate. Therefore your lambdas should + # always return the same translations/values per unique combination of argument + # values. + # + # Ruby 2.7+ keyword arguments warning + # + # This method uses keyword arguments. + # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0 + # The "hash" parameter must be passed as keyword argument. + # + # Good: + # I18n.t(:salutation, :gender => 'w', :name => 'Smith') + # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' }) + # I18n.t(:salutation, **any_hash) + # + # Bad: + # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' }) + # I18n.t(:salutation, any_hash) + # + # pkg:gem/i18n#lib/i18n.rb:241 + def translate(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end + + # Wrapper for translate that adds :raise => true. With + # this option, if no translation is found, it will raise I18n::MissingTranslationData + # + # pkg:gem/i18n#lib/i18n.rb:260 + def translate!(key, **options); end + + # Transliterates UTF-8 characters to ASCII. By default this method will + # transliterate only Latin strings to an ASCII approximation: + # + # I18n.transliterate("Ærøskøbing") + # # => "AEroskobing" + # + # I18n.transliterate("日本語") + # # => "???" + # + # It's also possible to add support for per-locale transliterations. I18n + # expects transliteration rules to be stored at + # i18n.transliterate.rule. + # + # Transliteration rules can either be a Hash or a Proc. Procs must accept a + # single string argument. Hash rules inherit the default transliteration + # rules, while Procs do not. + # + # *Examples* + # + # Setting a Hash in .yml: + # + # i18n: + # transliterate: + # rule: + # ü: "ue" + # ö: "oe" + # + # Setting a Hash using Ruby: + # + # store_translations(:de, i18n: { + # transliterate: { + # rule: { + # 'ü' => 'ue', + # 'ö' => 'oe' + # } + # } + # }) + # + # Setting a Proc: + # + # translit = lambda {|string| MyTransliterator.transliterate(string) } + # store_translations(:xx, :i18n => {:transliterate => {:rule => translit}) + # + # Transliterating strings: + # + # I18n.locale = :en + # I18n.transliterate("Jürgen") # => "Jurgen" + # I18n.locale = :de + # I18n.transliterate("Jürgen") # => "Juergen" + # I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen" + # I18n.transliterate("Jürgen", :locale => :de) # => "Juergen" + # + # pkg:gem/i18n#lib/i18n.rb:354 + def transliterate(key, throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), replacement: T.unsafe(nil), **options); end + + # Executes block with given I18n.locale set. + # + # pkg:gem/i18n#lib/i18n.rb:376 + def with_locale(tmp_locale = T.unsafe(nil)); end + + # Gets a mutable I18n configuration object. + # + # pkg:gem/i18n#lib/i18n.rb:73 + def writable_config; end + + private + + # Any exceptions thrown in translate will be sent to the @@exception_handler + # which can be a Symbol, a Proc or any other Object unless they're forced to + # be raised or thrown (MissingTranslation). + # + # If exception_handler is a Symbol then it will simply be sent to I18n as + # a method call. A Proc will simply be called. In any other case the + # method #call will be called on the exception_handler object. + # + # Examples: + # + # I18n.exception_handler = :custom_exception_handler # this is the default + # I18n.custom_exception_handler(exception, locale, key, options) # will be called like this + # + # I18n.exception_handler = lambda { |*args| ... } # a lambda + # I18n.exception_handler.call(exception, locale, key, options) # will be called like this + # + # I18n.exception_handler = I18nExceptionHandler.new # an object + # I18n.exception_handler.call(exception, locale, key, options) # will be called like this + # + # pkg:gem/i18n#lib/i18n.rb:452 + def handle_exception(handling, exception, locale, key, options); end + + # pkg:gem/i18n#lib/i18n.rb:494 + def interpolation_keys_from_translation(translation); end + + # pkg:gem/i18n#lib/i18n.rb:470 + def normalize_key(key, separator); end + + # pkg:gem/i18n#lib/i18n.rb:422 + def translate_key(key, throw, raise, locale, backend, options); end +end + +# pkg:gem/i18n#lib/i18n/config.rb:6 +class I18n::Config + # pkg:gem/i18n#lib/i18n/config.rb:13 + def initialize; end + + # Returns an array of locales for which translations are available. + # Unless you explicitly set these through I18n.available_locales= + # the call will be delegated to the backend. + # + # pkg:gem/i18n#lib/i18n/config.rb:77 + def available_locales; end + + # Sets the available locales. + # + # pkg:gem/i18n#lib/i18n/config.rb:91 + def available_locales=(locales); end + + # Returns true if the available_locales have been initialized + # + # pkg:gem/i18n#lib/i18n/config.rb:98 + def available_locales_initialized?; end + + # Caches the available locales list as both strings and symbols in a Set, so + # that we can have faster lookups to do the available locales enforce check. + # + # pkg:gem/i18n#lib/i18n/config.rb:84 + def available_locales_set; end + + # Returns the current backend. Defaults to +Backend::Simple+. + # + # pkg:gem/i18n#lib/i18n/config.rb:54 + def backend; end + + # Sets the current backend. Used to set a custom backend. + # + # pkg:gem/i18n#lib/i18n/config.rb:59 + def backend=(backend); end + + # Clears the available locales set so it can be recomputed again after I18n + # gets reloaded. + # + # pkg:gem/i18n#lib/i18n/config.rb:104 + def clear_available_locales_set; end + + # Returns the current default locale. Defaults to :'en' + # + # pkg:gem/i18n#lib/i18n/config.rb:64 + def default_locale; end + + # Sets the current default locale. Used to set a custom default locale. + # + # pkg:gem/i18n#lib/i18n/config.rb:69 + def default_locale=(locale); end + + # Returns the current default scope separator. Defaults to '.' + # + # pkg:gem/i18n#lib/i18n/config.rb:109 + def default_separator; end + + # Sets the current default scope separator. + # + # pkg:gem/i18n#lib/i18n/config.rb:114 + def default_separator=(separator); end + + # pkg:gem/i18n#lib/i18n/config.rb:175 + def enforce_available_locales; end + + # pkg:gem/i18n#lib/i18n/config.rb:179 + def enforce_available_locales=(enforce_available_locales); end + + # Returns the current exception handler. Defaults to an instance of + # I18n::ExceptionHandler. + # + # pkg:gem/i18n#lib/i18n/config.rb:120 + def exception_handler; end + + # Sets the exception handler. + # + # pkg:gem/i18n#lib/i18n/config.rb:125 + def exception_handler=(exception_handler); end + + # Returns the current interpolation patterns. Defaults to + # I18n::DEFAULT_INTERPOLATION_PATTERNS. + # + # pkg:gem/i18n#lib/i18n/config.rb:185 + def interpolation_patterns; end + + # Sets the current interpolation patterns. Used to set a interpolation + # patterns. + # + # E.g. using {{}} as a placeholder like "{{hello}}, world!": + # + # I18n.config.interpolation_patterns << /\{\{(\w+)\}\}/ + # + # pkg:gem/i18n#lib/i18n/config.rb:195 + def interpolation_patterns=(interpolation_patterns); end + + # Allow clients to register paths providing translation data sources. The + # backend defines acceptable sources. + # + # E.g. the provided SimpleBackend accepts a list of paths to translation + # files which are either named *.rb and contain plain Ruby Hashes or are + # named *.yml and contain YAML data. So for the SimpleBackend clients may + # register translation files like this: + # I18n.load_path << 'path/to/locale/en.yml' + # + # pkg:gem/i18n#lib/i18n/config.rb:160 + def load_path; end + + # Sets the load path instance. Custom implementations are expected to + # behave like a Ruby Array. + # + # pkg:gem/i18n#lib/i18n/config.rb:166 + def load_path=(load_path); end + + # The only configuration value that is not global and scoped to thread is :locale. + # It defaults to the default_locale. + # + # pkg:gem/i18n#lib/i18n/config.rb:9 + def locale; end + + # Sets the current locale pseudo-globally, i.e. in the Thread.current or Fiber local hash. + # + # pkg:gem/i18n#lib/i18n/config.rb:48 + def locale=(locale); end + + # Returns the current handler for situations when interpolation argument + # is missing. MissingInterpolationArgument will be raised by default. + # + # pkg:gem/i18n#lib/i18n/config.rb:131 + def missing_interpolation_argument_handler; end + + # Sets the missing interpolation argument handler. It can be any + # object that responds to #call. The arguments that will be passed to #call + # are the same as for MissingInterpolationArgument initializer. Use +Proc.new+ + # if you don't care about arity. + # + # == Example: + # You can suppress raising an exception and return string instead: + # + # I18n.config.missing_interpolation_argument_handler = Proc.new do |key| + # "#{key} is missing" + # end + # + # pkg:gem/i18n#lib/i18n/config.rb:148 + def missing_interpolation_argument_handler=(exception_handler); end + + # pkg:gem/i18n#lib/i18n/config.rb:17 + def owned_by?(fiber); end + + # pkg:gem/i18n#lib/i18n/config.rb:21 + def owner=(fiber); end + + # Sets this configuration as the current one for the active execution context. + # The stored configuration is frozen to avoid sharing mutable state between fibers. + # + # pkg:gem/i18n#lib/i18n/config.rb:40 + def set!; end + + # Returns a copied configuration with the provided attributes set. + # + # pkg:gem/i18n#lib/i18n/config.rb:30 + def with(**attrs); end + + private + + # pkg:gem/i18n#lib/i18n/config.rb:25 + def initialize_copy(other); end +end + +# pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:7 +I18n::DEFAULT_INTERPOLATION_PATTERNS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:16 +class I18n::Disabled < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:17 + def initialize(method); end +end + +# pkg:gem/i18n#lib/i18n.rb:36 +I18n::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:4 +class I18n::ExceptionHandler + # pkg:gem/i18n#lib/i18n/exceptions.rb:5 + def call(exception, _locale, _key, _options); end +end + +# pkg:gem/i18n#lib/i18n/gettext.rb:4 +module I18n::Gettext + class << self + # pkg:gem/i18n#lib/i18n/gettext.rb:21 + def extract_scope(msgid, separator); end + + # returns an array of plural keys for the given locale or the whole hash + # of locale mappings to plural keys so that we can convert from gettext's + # integer-index based style + # TODO move this information to the pluralization module + # + # pkg:gem/i18n#lib/i18n/gettext.rb:17 + def plural_keys(*args); end + end +end + +# pkg:gem/i18n#lib/i18n/gettext.rb:6 +I18n::Gettext::CONTEXT_SEPARATOR = T.let(T.unsafe(nil), String) + +# Implements classical Gettext style accessors. To use this include the +# module to the global namespace or wherever you want to use it. +# +# include I18n::Gettext::Helpers +# +# pkg:gem/i18n#lib/i18n/gettext/helpers.rb:11 +module I18n::Gettext::Helpers + # Makes dynamic translation messages readable for the gettext parser. + # _(fruit) cannot be understood by the gettext parser. To help the parser find all your translations, + # you can add fruit = N_("Apple") which does not translate, but tells the parser: "Apple" needs translation. + # * msgid: the message id. + # * Returns: msgid. + # + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:17 + def N_(msgsid); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:24 + def _(msgid, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:21 + def gettext(msgid, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:41 + def n_(msgid, msgid_plural, n = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:38 + def ngettext(msgid, msgid_plural, n = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:72 + def np_(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end + + # Method signatures: + # npgettext('Fruits', 'apple', 'apples', 2) + # npgettext('Fruits', ['apple', 'apples'], 2) + # + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:61 + def npgettext(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:56 + def ns_(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end + + # Method signatures: + # nsgettext('Fruits|apple', 'apples', 2) + # nsgettext(['Fruits|apple', 'apples'], 2) + # + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:46 + def nsgettext(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:36 + def p_(msgctxt, msgid); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:32 + def pgettext(msgctxt, msgid); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:30 + def s_(msgid, separator = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/gettext/helpers.rb:26 + def sgettext(msgid, separator = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n/gettext.rb:5 +I18n::Gettext::PLURAL_SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:12 +I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/i18n#lib/i18n/interpolate/ruby.rb:15 +I18n::INTERPOLATION_PATTERNS_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:132 +class I18n::InvalidFilenames < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:134 + def initialize(file_errors); end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:133 +I18n::InvalidFilenames::NUMBER_OF_ERRORS_SHOWN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:30 +class I18n::InvalidLocale < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:32 + def initialize(locale); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:31 + def locale; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:38 +class I18n::InvalidLocaleData < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:40 + def initialize(filename, exception_message); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:39 + def filename; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:90 +class I18n::InvalidPluralizationData < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:92 + def initialize(entry, count, key); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:91 + def count; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:91 + def entry; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:91 + def key; end +end + +# pkg:gem/i18n#lib/i18n/backend/key_value.rb:21 +I18n::JSON = ActiveSupport::JSON + +# pkg:gem/i18n#lib/i18n/locale.rb:4 +module I18n::Locale; end + +# pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:48 +class I18n::Locale::Fallbacks < ::Hash + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:49 + def initialize(*mappings); end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:60 + def [](locale); end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:58 + def defaults; end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:55 + def defaults=(defaults); end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:82 + def empty?; end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:86 + def inspect; end + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:67 + def map(*args, &block); end + + protected + + # pkg:gem/i18n#lib/i18n/locale/fallbacks.rb:92 + def compute(tags, include_defaults = T.unsafe(nil), exclude = T.unsafe(nil)); end +end + +# pkg:gem/i18n#lib/i18n/locale/tag.rb:5 +module I18n::Locale::Tag + class << self + # Returns the current locale tag implementation. Defaults to +I18n::Locale::Tag::Simple+. + # + # pkg:gem/i18n#lib/i18n/locale/tag.rb:12 + def implementation; end + + # Sets the current locale tag implementation. Use this to set a different locale tag implementation. + # + # pkg:gem/i18n#lib/i18n/locale/tag.rb:17 + def implementation=(implementation); end + + # Factory method for locale tags. Delegates to the current locale tag implementation. + # + # pkg:gem/i18n#lib/i18n/locale/tag.rb:22 + def tag(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:4 +module I18n::Locale::Tag::Parents + # pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:5 + def parent; end + + # pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:18 + def parents; end + + # pkg:gem/i18n#lib/i18n/locale/tag/parents.rb:14 + def self_and_parents; end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:12 +I18n::Locale::Tag::RFC4646_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:11 +I18n::Locale::Tag::RFC4646_SUBTAGS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:14 +class I18n::Locale::Tag::Rfc4646 < ::Struct + include ::I18n::Locale::Tag::Parents + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def language; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def region; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def script; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:46 + def to_a; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:42 + def to_s; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:38 + def to_sym; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:35 + def variant; end + + class << self + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:23 + def parser; end + + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:27 + def parser=(parser); end + + # Parses the given tag and returns a Tag instance if it is valid. + # Returns false if the given tag is not valid according to RFC 4646. + # + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:18 + def tag(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:50 +module I18n::Locale::Tag::Rfc4646::Parser + class << self + # pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:63 + def match(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/locale/tag/rfc4646.rb:51 +I18n::Locale::Tag::Rfc4646::Parser::PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:6 +class I18n::Locale::Tag::Simple + include ::I18n::Locale::Tag::Parents + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:17 + def initialize(*tag); end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:21 + def subtags; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:15 + def tag; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:33 + def to_a; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:29 + def to_s; end + + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:25 + def to_sym; end + + class << self + # pkg:gem/i18n#lib/i18n/locale/tag/simple.rb:8 + def tag(tag); end + end +end + +# pkg:gem/i18n#lib/i18n/middleware.rb:4 +class I18n::Middleware + # pkg:gem/i18n#lib/i18n/middleware.rb:6 + def initialize(app); end + + # pkg:gem/i18n#lib/i18n/middleware.rb:10 + def call(env); end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:98 +class I18n::MissingInterpolationArgument < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:100 + def initialize(key, values, string); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:99 + def key; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:99 + def string; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:99 + def values; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:46 +class I18n::MissingTranslation < ::I18n::ArgumentError + include ::I18n::MissingTranslation::Base +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:47 +module I18n::MissingTranslation::Base + # pkg:gem/i18n#lib/i18n/exceptions.rb:52 + def initialize(locale, key, options = T.unsafe(nil)); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:50 + def key; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:57 + def keys; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:50 + def locale; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:63 + def message; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:72 + def normalized_option(key); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:50 + def options; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:78 + def to_exception; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:76 + def to_s; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:48 +I18n::MissingTranslation::Base::PERMITTED_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:86 +class I18n::MissingTranslationData < ::I18n::ArgumentError + include ::I18n::MissingTranslation::Base +end + +# pkg:gem/i18n#lib/i18n.rb:19 +I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/i18n#lib/i18n/exceptions.rb:106 +class I18n::ReservedInterpolationKey < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:108 + def initialize(key, string); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:107 + def key; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:107 + def string; end +end + +# pkg:gem/i18n#lib/i18n/tests.rb:4 +module I18n::Tests; end + +# pkg:gem/i18n#lib/i18n/tests/localization.rb:3 +module I18n::Tests::Localization + class << self + # pkg:gem/i18n#lib/i18n/tests/localization.rb:9 + def included(base); end + end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:114 +class I18n::UnknownFileType < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:116 + def initialize(type, filename); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:115 + def filename; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:115 + def type; end +end + +# pkg:gem/i18n#lib/i18n/exceptions.rb:122 +class I18n::UnsupportedMethod < ::I18n::ArgumentError + # pkg:gem/i18n#lib/i18n/exceptions.rb:124 + def initialize(method, backend_klass, msg); end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:123 + def backend_klass; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:123 + def method; end + + # pkg:gem/i18n#lib/i18n/exceptions.rb:123 + def msg; end +end + +# pkg:gem/i18n#lib/i18n/utils.rb:4 +module I18n::Utils + class << self + # pkg:gem/i18n#lib/i18n/utils.rb:18 + def deep_merge(hash, other_hash, &block); end + + # pkg:gem/i18n#lib/i18n/utils.rb:22 + def deep_merge!(hash, other_hash, &block); end + + # pkg:gem/i18n#lib/i18n/utils.rb:34 + def deep_symbolize_keys(hash); end + + # pkg:gem/i18n#lib/i18n/utils.rb:7 + def except(hash, *keys); end + + private + + # pkg:gem/i18n#lib/i18n/utils.rb:43 + def deep_symbolize_keys_in_object(value); end + end +end + +# pkg:gem/i18n#lib/i18n/version.rb:4 +I18n::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/io-console@0.9.4.rbi b/sorbet/rbi/gems/io-console@0.9.4.rbi new file mode 100644 index 0000000..73616ab --- /dev/null +++ b/sorbet/rbi/gems/io-console@0.9.4.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `io-console` gem. +# Please instead update this file by running `bin/tapioca gem io-console`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi b/sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi new file mode 100644 index 0000000..5f91e74 --- /dev/null +++ b/sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `language_server-protocol` gem. +# Please instead update this file by running `bin/tapioca gem language_server-protocol`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/lint_roller@1.1.0.rbi b/sorbet/rbi/gems/lint_roller@1.1.0.rbi new file mode 100644 index 0000000..b6e9bd4 --- /dev/null +++ b/sorbet/rbi/gems/lint_roller@1.1.0.rbi @@ -0,0 +1,189 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `lint_roller` gem. +# Please instead update this file by running `bin/tapioca gem lint_roller`. + + +# pkg:gem/lint_roller#lib/lint_roller/context.rb:1 +module LintRoller; end + +# pkg:gem/lint_roller#lib/lint_roller/about.rb:2 +class LintRoller::About < ::Struct + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def description; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def description=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def homepage; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def homepage=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def name; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def name=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def version; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def version=(_); end + + class << self + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def [](*_arg0); end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def inspect; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def keyword_init?; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def members; end + + # pkg:gem/lint_roller#lib/lint_roller/about.rb:2 + def new(*_arg0); end + end +end + +# pkg:gem/lint_roller#lib/lint_roller/context.rb:2 +class LintRoller::Context < ::Struct + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def engine; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def engine=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def engine_version; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def engine_version=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def rule_format; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def rule_format=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def runner; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def runner=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def runner_version; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def runner_version=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def target_ruby_version; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def target_ruby_version=(_); end + + class << self + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def [](*_arg0); end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def inspect; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def keyword_init?; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def members; end + + # pkg:gem/lint_roller#lib/lint_roller/context.rb:2 + def new(*_arg0); end + end +end + +# pkg:gem/lint_roller#lib/lint_roller/error.rb:2 +class LintRoller::Error < ::StandardError; end + +# pkg:gem/lint_roller#lib/lint_roller/plugin.rb:2 +class LintRoller::Plugin + # `config' is a Hash of options passed to the plugin by the user + # + # pkg:gem/lint_roller#lib/lint_roller/plugin.rb:4 + def initialize(config = T.unsafe(nil)); end + + # pkg:gem/lint_roller#lib/lint_roller/plugin.rb:8 + def about; end + + # `context' is an instance of LintRoller::Context provided by the runner + # + # pkg:gem/lint_roller#lib/lint_roller/plugin.rb:18 + def rules(context); end + + # `context' is an instance of LintRoller::Context provided by the runner + # + # pkg:gem/lint_roller#lib/lint_roller/plugin.rb:13 + def supported?(context); end +end + +# pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 +class LintRoller::Rules < ::Struct + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def config_format; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def config_format=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def error; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def error=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def type; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def type=(_); end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def value; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def value=(_); end + + class << self + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def [](*_arg0); end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def inspect; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def keyword_init?; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def members; end + + # pkg:gem/lint_roller#lib/lint_roller/rules.rb:2 + def new(*_arg0); end + end +end + +# pkg:gem/lint_roller#lib/lint_roller/support/merges_upstream_metadata.rb:2 +module LintRoller::Support; end + +# pkg:gem/lint_roller#lib/lint_roller/support/merges_upstream_metadata.rb:3 +class LintRoller::Support::MergesUpstreamMetadata + # pkg:gem/lint_roller#lib/lint_roller/support/merges_upstream_metadata.rb:4 + def merge(plugin_yaml, upstream_yaml); end +end + +# pkg:gem/lint_roller#lib/lint_roller/version.rb:2 +LintRoller::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/loofah@2.25.2.rbi b/sorbet/rbi/gems/loofah@2.25.2.rbi new file mode 100644 index 0000000..ff48502 --- /dev/null +++ b/sorbet/rbi/gems/loofah@2.25.2.rbi @@ -0,0 +1,1134 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `loofah` gem. +# Please instead update this file by running `bin/tapioca gem loofah`. + + +# == Strings and IO Objects as Input +# +# The following methods accept any IO object in addition to accepting a string: +# +# - Loofah.html4_document +# - Loofah.html4_fragment +# - Loofah.scrub_html4_document +# - Loofah.scrub_html4_fragment +# +# - Loofah.html5_document +# - Loofah.html5_fragment +# - Loofah.scrub_html5_document +# - Loofah.scrub_html5_fragment +# +# - Loofah.xml_document +# - Loofah.xml_fragment +# - Loofah.scrub_xml_document +# - Loofah.scrub_xml_fragment +# +# - Loofah.document +# - Loofah.fragment +# - Loofah.scrub_document +# - Loofah.scrub_fragment +# +# That IO object could be a file, or a socket, or a StringIO, or anything that responds to +read+ +# and +close+. +# +# pkg:gem/loofah#lib/loofah.rb:5 +module Loofah + class << self + # pkg:gem/loofah#lib/loofah.rb:139 + def document(*args, &block); end + + # pkg:gem/loofah#lib/loofah.rb:140 + def fragment(*args, &block); end + + # Shortcut for Loofah::HTML4::Document.parse(*args, &block) + # + # This method accepts the same parameters as Nokogiri::HTML4::Document.parse + # + # pkg:gem/loofah#lib/loofah.rb:76 + def html4_document(*args, &block); end + + # Shortcut for Loofah::HTML4::DocumentFragment.parse(*args, &block) + # + # This method accepts the same parameters as Nokogiri::HTML4::DocumentFragment.parse + # + # pkg:gem/loofah#lib/loofah.rb:83 + def html4_fragment(*args, &block); end + + # Shortcut for Loofah::HTML5::Document.parse(*args, &block) + # + # This method accepts the same parameters as Nokogiri::HTML5::Document.parse + # + # pkg:gem/loofah#lib/loofah.rb:101 + def html5_document(*args, &block); end + + # Shortcut for Loofah::HTML5::DocumentFragment.parse(*args, &block) + # + # This method accepts the same parameters as Nokogiri::HTML5::DocumentFragment.parse + # + # pkg:gem/loofah#lib/loofah.rb:108 + def html5_fragment(*args, &block); end + + # pkg:gem/loofah#lib/loofah.rb:7 + def html5_support?; end + + # A helper to remove extraneous whitespace from text-ified HTML + # + # pkg:gem/loofah#lib/loofah.rb:169 + def remove_extraneous_whitespace(string); end + + # pkg:gem/loofah#lib/loofah.rb:141 + def scrub_document(string_or_io, method); end + + # pkg:gem/loofah#lib/loofah.rb:142 + def scrub_fragment(string_or_io, method); end + + # Shortcut for Loofah::HTML4::Document.parse(string_or_io).scrub!(method) + # + # pkg:gem/loofah#lib/loofah.rb:88 + def scrub_html4_document(string_or_io, method); end + + # Shortcut for Loofah::HTML4::DocumentFragment.parse(string_or_io).scrub!(method) + # + # pkg:gem/loofah#lib/loofah.rb:93 + def scrub_html4_fragment(string_or_io, method); end + + # Shortcut for Loofah::HTML5::Document.parse(string_or_io).scrub!(method) + # + # pkg:gem/loofah#lib/loofah.rb:113 + def scrub_html5_document(string_or_io, method); end + + # Shortcut for Loofah::HTML5::DocumentFragment.parse(string_or_io).scrub!(method) + # + # pkg:gem/loofah#lib/loofah.rb:118 + def scrub_html5_fragment(string_or_io, method); end + + # Shortcut for Loofah.xml_document(string_or_io).scrub!(method) + # + # pkg:gem/loofah#lib/loofah.rb:164 + def scrub_xml_document(string_or_io, method); end + + # Shortcut for Loofah.xml_fragment(string_or_io).scrub!(method) + # + # pkg:gem/loofah#lib/loofah.rb:159 + def scrub_xml_fragment(string_or_io, method); end + + # Shortcut for Loofah::XML::Document.parse(*args, &block) + # + # This method accepts the same parameters as Nokogiri::XML::Document.parse + # + # pkg:gem/loofah#lib/loofah.rb:147 + def xml_document(*args, &block); end + + # Shortcut for Loofah::XML::DocumentFragment.parse(*args, &block) + # + # This method accepts the same parameters as Nokogiri::XML::DocumentFragment.parse + # + # pkg:gem/loofah#lib/loofah.rb:154 + def xml_fragment(*args, &block); end + end +end + +# pkg:gem/loofah#lib/loofah/concerns.rb:125 +module Loofah::DocumentDecorator + # pkg:gem/loofah#lib/loofah/concerns.rb:126 + def initialize(*args, &block); end +end + +# pkg:gem/loofah#lib/loofah/elements.rb:6 +module Loofah::Elements; end + +# pkg:gem/loofah#lib/loofah/elements.rb:93 +Loofah::Elements::BLOCK_LEVEL = T.let(T.unsafe(nil), Set) + +# Elements that aren't block but should generate a newline in #to_text +# +# pkg:gem/loofah#lib/loofah/elements.rb:90 +Loofah::Elements::INLINE_LINE_BREAK = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/elements.rb:94 +Loofah::Elements::LINEBREAKERS = T.let(T.unsafe(nil), Set) + +# The following elements may also be considered block-level +# elements since they may contain block-level elements +# +# pkg:gem/loofah#lib/loofah/elements.rb:76 +Loofah::Elements::LOOSE_BLOCK_LEVEL = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/elements.rb:92 +Loofah::Elements::STRICT_BLOCK_LEVEL = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/elements.rb:7 +Loofah::Elements::STRICT_BLOCK_LEVEL_HTML4 = T.let(T.unsafe(nil), Set) + +# https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements +# +# pkg:gem/loofah#lib/loofah/elements.rb:35 +Loofah::Elements::STRICT_BLOCK_LEVEL_HTML5 = T.let(T.unsafe(nil), Set) + +# Alias for Loofah::HTML4 +# +# pkg:gem/loofah#lib/loofah.rb:70 +Loofah::HTML = Loofah::HTML4 + +# pkg:gem/loofah#lib/loofah/html4/document.rb:4 +module Loofah::HTML4; end + +# Subclass of Nokogiri::HTML4::Document. +# +# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods. +# +# pkg:gem/loofah#lib/loofah/html4/document.rb:10 +class Loofah::HTML4::Document < ::Nokogiri::HTML4::Document + include ::Loofah::ScrubBehavior::Node + include ::Loofah::DocumentDecorator + include ::Loofah::TextBehavior + include ::Loofah::HtmlDocumentBehavior + extend ::Loofah::HtmlDocumentBehavior::ClassMethods +end + +# Subclass of Nokogiri::HTML4::DocumentFragment. +# +# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods. +# +# pkg:gem/loofah#lib/loofah/html4/document_fragment.rb:10 +class Loofah::HTML4::DocumentFragment < ::Nokogiri::HTML4::DocumentFragment + include ::Loofah::TextBehavior + include ::Loofah::HtmlFragmentBehavior + extend ::Loofah::HtmlFragmentBehavior::ClassMethods +end + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:6 +module Loofah::HTML5; end + +# Subclass of Nokogiri::HTML5::Document. +# +# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods. +# +# pkg:gem/loofah#lib/loofah/html5/document.rb:10 +class Loofah::HTML5::Document < ::Nokogiri::HTML5::Document + include ::Loofah::ScrubBehavior::Node + include ::Loofah::DocumentDecorator + include ::Loofah::TextBehavior + include ::Loofah::HtmlDocumentBehavior + extend ::Loofah::HtmlDocumentBehavior::ClassMethods +end + +# Subclass of Nokogiri::HTML5::DocumentFragment. +# +# See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods. +# +# pkg:gem/loofah#lib/loofah/html5/document_fragment.rb:10 +class Loofah::HTML5::DocumentFragment < ::Nokogiri::HTML5::DocumentFragment + include ::Loofah::TextBehavior + include ::Loofah::HtmlFragmentBehavior + extend ::Loofah::HtmlFragmentBehavior::ClassMethods +end + +# HTML safelist lifted from HTML5lib sanitizer code: +# +# http://code.google.com/p/html5lib/ +# +# +# +# Copyright (c) 2006-2008 The Authors +# +# Contributors: +# James Graham - jg307@cam.ac.uk +# Anne van Kesteren - annevankesteren@gmail.com +# Lachlan Hunt - lachlan.hunt@lachy.id.au +# Matt McDonald - kanashii@kanashii.ca +# Sam Ruby - rubys@intertwingly.net +# Ian Hickson (Google) - ian@hixie.ch +# Thomas Broyer - t.broyer@ltgt.net +# Jacques Distler - distler@golem.ph.utexas.edu +# Henri Sivonen - hsivonen@iki.fi +# The Mozilla Foundation (contributions from Henri Sivonen since 2008) +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +# +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:49 +module Loofah::HTML5::SafeList; end + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:232 +Loofah::HTML5::SafeList::ACCEPTABLE_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# https://www.w3.org/TR/css-color-3/#html4 +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:743 +Loofah::HTML5::SafeList::ACCEPTABLE_CSS_COLORS = T.let(T.unsafe(nil), Set) + +# https://www.w3.org/TR/css-color-3/#svg-color +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:763 +Loofah::HTML5::SafeList::ACCEPTABLE_CSS_EXTENDED_COLORS = T.let(T.unsafe(nil), Set) + +# see https://www.quackit.com/css/functions/ +# omit `url` and `image` from that list +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:915 +Loofah::HTML5::SafeList::ACCEPTABLE_CSS_FUNCTIONS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:704 +Loofah::HTML5::SafeList::ACCEPTABLE_CSS_KEYWORDS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:631 +Loofah::HTML5::SafeList::ACCEPTABLE_CSS_PROPERTIES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:50 +Loofah::HTML5::SafeList::ACCEPTABLE_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:988 +Loofah::HTML5::SafeList::ACCEPTABLE_PROTOCOLS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:975 +Loofah::HTML5::SafeList::ACCEPTABLE_SVG_PROPERTIES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1018 +Loofah::HTML5::SafeList::ACCEPTABLE_URI_DATA_MEDIATYPES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1028 +Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1031 +Loofah::HTML5::SafeList::ALLOWED_CSS_FUNCTIONS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1030 +Loofah::HTML5::SafeList::ALLOWED_CSS_KEYWORDS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1029 +Loofah::HTML5::SafeList::ALLOWED_CSS_PROPERTIES = T.let(T.unsafe(nil), Set) + +# subclasses may define their own versions of these constants +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1027 +Loofah::HTML5::SafeList::ALLOWED_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1052 +Loofah::HTML5::SafeList::ALLOWED_ELEMENTS_WITH_LIBXML2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1033 +Loofah::HTML5::SafeList::ALLOWED_PROTOCOLS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1032 +Loofah::HTML5::SafeList::ALLOWED_SVG_PROPERTIES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1034 +Loofah::HTML5::SafeList::ALLOWED_URI_DATA_MEDIATYPES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:526 +Loofah::HTML5::SafeList::ARIA_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:582 +Loofah::HTML5::SafeList::ATTR_VAL_IS_URI = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:315 +Loofah::HTML5::SafeList::MATHML_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:147 +Loofah::HTML5::SafeList::MATHML_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:986 +Loofah::HTML5::SafeList::PROTOCOL_SEPARATOR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:968 +Loofah::HTML5::SafeList::SHORTHAND_CSS_PROPERTIES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:613 +Loofah::HTML5::SafeList::SVG_ALLOW_LOCAL_HREF = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:367 +Loofah::HTML5::SafeList::SVG_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:594 +Loofah::HTML5::SafeList::SVG_ATTR_VAL_ALLOWS_REF = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:183 +Loofah::HTML5::SafeList::SVG_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:608 +Loofah::HTML5::SafeList::SVG_HREF_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# additional tags we should consider safe since we have libxml2 fixing up our documents. +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1047 +Loofah::HTML5::SafeList::TAGS_SAFE_WITH_LIBXML2 = T.let(T.unsafe(nil), Set) + +# TODO: remove VOID_ELEMENTS in a future major release +# and put it in the tests (it is used only for testing, not for functional behavior) +# +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1038 +Loofah::HTML5::SafeList::VOID_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:9 +module Loofah::HTML5::Scrub + class << self + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:56 + def allowed_element?(element_name); end + + # Returns true if the given URI string is safe, false otherwise. This method can be used to + # validate URI attribute values without requiring a Nokogiri DOM node. + # + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:182 + def allowed_uri?(uri_string); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:266 + def cdata_escape(node); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:261 + def cdata_needs_escaping?(node); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:206 + def decode_numeric_character_references(string); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:281 + def escape_tags(string); end + + # libxml2 >= 2.9.2 fails to escape comments within some attributes. + # + # see comments about CVE-2018-8048 within the tests for more information + # + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:240 + def force_correct_attribute_escaping!(node); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:161 + def scrub_attribute_that_allows_local_ref(attr_node); end + + # alternative implementation of the html5lib attribute scrubbing algorithm + # + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:61 + def scrub_attributes(node); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:110 + def scrub_css(style); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:105 + def scrub_css_attribute(node); end + + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:226 + def scrub_uri_attribute(attr_node); end + + private + + # Returns the mediatype of a data: URI per RFC 2397, or nil when the + # required comma is absent. allowed_uri? entity-decodes, downcases, and + # strips control characters before calling this. An omitted or malformed + # mediatype resolves to "text/plain", matching the WHATWG data: URL processor. + # + # pkg:gem/loofah#lib/loofah/html5/scrub.rb:307 + def data_uri_mediatype(uri_string); end + end +end + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:10 +Loofah::HTML5::Scrub::CONTROL_CHARACTERS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:12 +Loofah::HTML5::Scrub::CRASS_SEMICOLON = T.let(T.unsafe(nil), Hash) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:13 +Loofah::HTML5::Scrub::CSS_IMPORTANT = T.let(T.unsafe(nil), String) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:11 +Loofah::HTML5::Scrub::CSS_KEYWORDISH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:15 +Loofah::HTML5::Scrub::CSS_PROPERTY_STRING_WITHOUT_EMBEDDED_QUOTES = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:14 +Loofah::HTML5::Scrub::CSS_WHITESPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:16 +Loofah::HTML5::Scrub::DATA_ATTRIBUTE_NAME = T.let(T.unsafe(nil), Regexp) + +# Matches a valid MIME type "essence" (type "/" subtype, no parameters), used to +# decide whether a data: URI mediatype is well-formed; a non-match is not a valid +# MIME type, which the data: URL processor treats as text/plain. Specs: +# +# https://mimesniff.spec.whatwg.org/#valid-mime-type +# https://mimesniff.spec.whatwg.org/#mime-type-essence +# https://mimesniff.spec.whatwg.org/#http-token-code-point +# +# The character class below is the HTTP token set (tchar) from RFC 9110 section +# 5.6.2, https://www.rfc-editor.org/rfc/rfc9110#name-tokens : +# +# tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" +# / "_" / "`" / "|" / "~" / DIGIT / ALPHA +# +# ALPHA is written a-z, not a-zA-Z, because allowed_uri? downcases the input first. +# +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:43 +Loofah::HTML5::Scrub::DATA_URI_MEDIATYPE = T.let(T.unsafe(nil), Regexp) + +# Decimal (`:`) or hexadecimal (`:`) form, with or without the trailing semicolon that +# CGI.unescapeHTML requires but browsers do not. +# +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:20 +Loofah::HTML5::Scrub::NUMERIC_CHARACTER_REFERENCE = T.let(T.unsafe(nil), Regexp) + +# A scheme (RFC 3986) followed by a protocol separator. The separator must recognize the same +# encoded-colon forms as PROTOCOL_SEPARATOR, otherwise a scheme split by an encoded colon (for +# example "javascript:alert(1)") would not be recognized as having a scheme and would skip +# protocol validation. +# +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:26 +Loofah::HTML5::Scrub::URI_PROTOCOL_REGEX = T.let(T.unsafe(nil), Regexp) + +# HTML5 named character references for whitespace that browsers strip from +# URIs. CGI.unescapeHTML does not decode these, so they are handled explicitly. +# +# pkg:gem/loofah#lib/loofah/html5/scrub.rb:53 +Loofah::HTML5::Scrub::WHITESPACE_CHARACTER_REFERENCES = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/loofah#lib/loofah/html5/safelist.rb:1055 +Loofah::HTML5::WhiteList = Loofah::HTML5::SafeList + +# pkg:gem/loofah#lib/loofah/concerns.rb:133 +module Loofah::HtmlDocumentBehavior + mixes_in_class_methods ::Loofah::HtmlDocumentBehavior::ClassMethods + + # pkg:gem/loofah#lib/loofah/concerns.rb:164 + def serialize_root; end + + class << self + # pkg:gem/loofah#lib/loofah/concerns.rb:159 + def included(base); end + end +end + +# pkg:gem/loofah#lib/loofah/concerns.rb:134 +module Loofah::HtmlDocumentBehavior::ClassMethods + # pkg:gem/loofah#lib/loofah/concerns.rb:135 + def parse(*args, &block); end + + private + + # remove comments that exist outside of the HTML element. + # + # these comments are allowed by the HTML spec: + # + # https://www.w3.org/TR/html401/struct/global.html#h-7.1 + # + # but are not scrubbed by Loofah because these nodes don't meet + # the contract that scrubbers expect of a node (e.g., it can be + # replaced, sibling and children nodes can be created). + # + # pkg:gem/loofah#lib/loofah/concerns.rb:150 + def remove_comments_before_html_element(doc); end +end + +# pkg:gem/loofah#lib/loofah/concerns.rb:169 +module Loofah::HtmlFragmentBehavior + mixes_in_class_methods ::Loofah::HtmlFragmentBehavior::ClassMethods + + # pkg:gem/loofah#lib/loofah/concerns.rb:201 + def serialize; end + + # pkg:gem/loofah#lib/loofah/concerns.rb:203 + def serialize_root; end + + # pkg:gem/loofah#lib/loofah/concerns.rb:197 + def to_s; end + + class << self + # pkg:gem/loofah#lib/loofah/concerns.rb:192 + def included(base); end + end +end + +# pkg:gem/loofah#lib/loofah/concerns.rb:170 +module Loofah::HtmlFragmentBehavior::ClassMethods + # pkg:gem/loofah#lib/loofah/concerns.rb:180 + def document_klass; end + + # pkg:gem/loofah#lib/loofah/concerns.rb:171 + def parse(tags, encoding = T.unsafe(nil)); end +end + +# constants related to working around unhelpful libxml2 behavior +# +# ಠ_ಠ +# +# pkg:gem/loofah#lib/loofah/html5/libxml2_workarounds.rb:12 +module Loofah::LibxmlWorkarounds; end + +# these attributes and qualifying parent tags are determined by the code at: +# +# https://git.gnome.org/browse/libxml2/tree/HTMLtree.c?h=v2.9.2#n714 +# +# see comments about CVE-2018-8048 within the tests for more information +# +# pkg:gem/loofah#lib/loofah/html5/libxml2_workarounds.rb:20 +Loofah::LibxmlWorkarounds::BROKEN_ESCAPING_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/loofah#lib/loofah/html5/libxml2_workarounds.rb:26 +Loofah::LibxmlWorkarounds::BROKEN_ESCAPING_ATTRIBUTES_QUALIFYING_TAG = T.let(T.unsafe(nil), Hash) + +# pkg:gem/loofah#lib/loofah/metahelpers.rb:4 +module Loofah::MetaHelpers + class << self + # pkg:gem/loofah#lib/loofah/metahelpers.rb:6 + def add_downcased_set_members_to_all_set_constants(mojule); end + end +end + +# Mixes +scrub!+ into Document, DocumentFragment, Node and NodeSet. +# +# Traverse the document or fragment, invoking the +scrubber+ on each node. +# +# +scrubber+ must either be one of the symbols representing the built-in scrubbers (see +# Scrubbers), or a Scrubber instance. +# +# span2div = Loofah::Scrubber.new do |node| +# node.name = "div" if node.name == "span" +# end +# Loofah.html5_fragment("foo

    bar

    ").scrub!(span2div).to_s +# # => "
    foo

    bar

    " +# +# or +# +# unsafe_html = "ohai!
    div is safe
    " +# Loofah.html5_fragment(unsafe_html).scrub!(:strip).to_s +# # => "ohai!
    div is safe
    " +# +# Note that this method is called implicitly from the shortcuts Loofah.scrub_html5_fragment et +# al. +# +# Please see Scrubber for more information on implementation and traversal, and README.rdoc for +# more example usage. +# +# pkg:gem/loofah#lib/loofah/concerns.rb:30 +module Loofah::ScrubBehavior + class << self + # pkg:gem/loofah#lib/loofah/concerns.rb:59 + def resolve_scrubber(scrubber); end + end +end + +# pkg:gem/loofah#lib/loofah/concerns.rb:31 +module Loofah::ScrubBehavior::Node + # pkg:gem/loofah#lib/loofah/concerns.rb:32 + def scrub!(scrubber); end +end + +# pkg:gem/loofah#lib/loofah/concerns.rb:51 +module Loofah::ScrubBehavior::NodeSet + # pkg:gem/loofah#lib/loofah/concerns.rb:52 + def scrub!(scrubber); end +end + +# A Scrubber wraps up a block (or method) that is run on an HTML node (element): +# +# # change all tags to
    tags +# span2div = Loofah::Scrubber.new do |node| +# node.name = "div" if node.name == "span" +# end +# +# Alternatively, this scrubber could have been implemented as: +# +# class Span2Div < Loofah::Scrubber +# def scrub(node) +# node.name = "div" if node.name == "span" +# end +# end +# span2div = Span2Div.new +# +# This can then be run on a document: +# +# Loofah.html5_fragment("foo

    bar

    ").scrub!(span2div).to_s +# # => "
    foo

    bar

    " +# +# Scrubbers can be run on a document in either a top-down traversal (the +# default) or bottom-up. Top-down scrubbers can optionally return +# Scrubber::STOP to terminate the traversal of a subtree. +# +# pkg:gem/loofah#lib/loofah/scrubber.rb:35 +class Loofah::Scrubber + # Options may include + # :direction => :top_down (the default) + # or + # :direction => :bottom_up + # + # For top_down traversals, if the block returns + # Loofah::Scrubber::STOP, then the traversal will be terminated + # for the current node's subtree. + # + # Alternatively, a Scrubber may inherit from Loofah::Scrubber, + # and implement +scrub+, which is slightly faster than using a + # block. + # + # pkg:gem/loofah#lib/loofah/scrubber.rb:65 + def initialize(options = T.unsafe(nil), &block); end + + # If the attribute is not set, add it + # If the attribute is set, don't overwrite the existing value + # + # pkg:gem/loofah#lib/loofah/scrubber.rb:96 + def append_attribute(node, attribute, value); end + + # When a scrubber is initialized, the optional block is saved as + # :block. Note that, if no block is passed, then the +scrub+ + # method is assumed to have been implemented. + # + # pkg:gem/loofah#lib/loofah/scrubber.rb:49 + def block; end + + # When a scrubber is initialized, the :direction may be specified + # as :top_down (the default) or :bottom_up. + # + # pkg:gem/loofah#lib/loofah/scrubber.rb:44 + def direction; end + + # When +new+ is not passed a block, the class may implement + # +scrub+, which will be called for each document node. + # + # pkg:gem/loofah#lib/loofah/scrubber.rb:88 + def scrub(node); end + + # Calling +traverse+ will cause the document to be traversed by + # either the lambda passed to the initializer or the +scrub+ + # method, in the direction specified at +new+ time. + # + # pkg:gem/loofah#lib/loofah/scrubber.rb:80 + def traverse(node); end + + private + + # pkg:gem/loofah#lib/loofah/scrubber.rb:105 + def html5lib_sanitize(node); end + + # pkg:gem/loofah#lib/loofah/scrubber.rb:131 + def traverse_conditionally_bottom_up(node); end + + # pkg:gem/loofah#lib/loofah/scrubber.rb:122 + def traverse_conditionally_top_down(node); end +end + +# Top-down Scrubbers may return CONTINUE to indicate that the subtree should be traversed. +# +# pkg:gem/loofah#lib/loofah/scrubber.rb:37 +Loofah::Scrubber::CONTINUE = T.let(T.unsafe(nil), Object) + +# Top-down Scrubbers may return STOP to indicate that the subtree should not be traversed. +# +# pkg:gem/loofah#lib/loofah/scrubber.rb:40 +Loofah::Scrubber::STOP = T.let(T.unsafe(nil), Object) + +# A RuntimeError raised when Loofah could not find an appropriate scrubber. +# +# pkg:gem/loofah#lib/loofah/scrubber.rb:7 +class Loofah::ScrubberNotFound < ::RuntimeError; end + +# Loofah provides some built-in scrubbers for sanitizing with +# HTML5lib's safelist and for accomplishing some common +# transformation tasks. +# +# +# === Loofah::Scrubbers::Strip / scrub!(:strip) +# +# +:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents: +# +# unsafe_html = "ohai!
    div is safe
    but foo is not" +# Loofah.html5_fragment(unsafe_html).scrub!(:strip) +# => "ohai!
    div is safe
    but foo is not" +# +# +# === Loofah::Scrubbers::Prune / scrub!(:prune) +# +# +:prune+ removes unknown/unsafe tags and their contents (including their subtrees): +# +# unsafe_html = "ohai!
    div is safe
    but foo is not" +# Loofah.html5_fragment(unsafe_html).scrub!(:prune) +# => "ohai!
    div is safe
    " +# +# +# === Loofah::Scrubbers::Escape / scrub!(:escape) +# +# +:escape+ performs HTML entity escaping on the unknown/unsafe tags: +# +# unsafe_html = "ohai!
    div is safe
    but foo is not" +# Loofah.html5_fragment(unsafe_html).scrub!(:escape) +# => "ohai!
    div is safe
    <foo>but foo is <b>not</b></foo>" +# +# +# === Loofah::Scrubbers::Whitewash / scrub!(:whitewash) +# +# +:whitewash+ removes all comments, styling and attributes in +# addition to doing markup-fixer-uppery and pruning unsafe tags. I +# like to call this "whitewashing", since it's like putting a new +# layer of paint on top of the HTML input to make it look nice. +# +# messy_markup = "ohai!
    div with attributes
    " +# Loofah.html5_fragment(messy_markup).scrub!(:whitewash) +# => "ohai!
    div with attributes
    " +# +# One use case for this scrubber is to clean up HTML that was +# cut-and-pasted from Microsoft Word into a WYSIWYG editor or a +# rich text editor. Microsoft's software is famous for injecting +# all kinds of cruft into its HTML output. Who needs that crap? +# Certainly not me. +# +# +# === Loofah::Scrubbers::NoFollow / scrub!(:nofollow) +# +# +:nofollow+ adds a rel="nofollow" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:nofollow) +# => "ohai! I like your blog post" +# +# +# === Loofah::Scrubbers::TargetBlank / scrub!(:targetblank) +# +# +:targetblank+ adds a target="_blank" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:targetblank) +# => "ohai! I like your blog post" +# +# +# === Loofah::Scrubbers::NoOpener / scrub!(:noopener) +# +# +:noopener+ adds a rel="noopener" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:noopener) +# => "ohai! I like your blog post" +# +# === Loofah::Scrubbers::NoReferrer / scrub!(:noreferrer) +# +# +:noreferrer+ adds a rel="noreferrer" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:noreferrer) +# => "ohai! I like your blog post" +# +# +# === Loofah::Scrubbers::Unprintable / scrub!(:unprintable) +# +# +:unprintable+ removes unprintable Unicode characters. +# +# markup = "

    Some text with an unprintable character at the end\u2028

    " +# Loofah.html5_fragment(markup).scrub!(:unprintable) +# => "

    Some text with an unprintable character at the end

    " +# +# You may not be able to see the unprintable character in the above example, but there is a +# U+2028 character right before the closing

    tag. These characters can cause issues if +# the content is ever parsed by JavaScript - more information here: +# +# http://timelessrepo.com/json-isnt-a-javascript-subset +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:104 +module Loofah::Scrubbers + class << self + # Returns an array of symbols representing the built-in scrubbers + # + # pkg:gem/loofah#lib/loofah/scrubbers.rb:425 + def scrubber_symbols; end + end +end + +# === scrub!(:double_breakpoint) +# +# +:double_breakpoint+ replaces double-break tags with closing/opening paragraph tags. +# +# markup = "

    Some text here in a logical paragraph.

    Some more text, apparently a second paragraph.

    " +# Loofah.html5_fragment(markup).scrub!(:double_breakpoint) +# => "

    Some text here in a logical paragraph.

    Some more text, apparently a second paragraph.

    " +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:362 +class Loofah::Scrubbers::DoubleBreakpoint < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:363 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:367 + def scrub(node); end + + private + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:400 + def remove_blank_text_nodes(node); end +end + +# === scrub!(:escape) +# +# +:escape+ performs HTML entity escaping on the unknown/unsafe tags: +# +# unsafe_html = "ohai!
    div is safe
    but foo is not" +# Loofah.html5_fragment(unsafe_html).scrub!(:escape) +# => "ohai!
    div is safe
    <foo>but foo is <b>not</b></foo>" +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:159 +class Loofah::Scrubbers::Escape < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:160 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:164 + def scrub(node); end +end + +# A hash that maps a symbol (like +:prune+) to the appropriate Scrubber (Loofah::Scrubbers::Prune). +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:407 +Loofah::Scrubbers::MAP = T.let(T.unsafe(nil), Hash) + +# This class probably isn't useful publicly, but is used for #to_text's current implemention +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:307 +class Loofah::Scrubbers::NewlineBlockElements < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:308 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:312 + def scrub(node); end +end + +# === scrub!(:nofollow) +# +# +:nofollow+ adds a rel="nofollow" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:nofollow) +# => "ohai! I like your blog post" +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:220 +class Loofah::Scrubbers::NoFollow < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:221 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:225 + def scrub(node); end +end + +# === scrub!(:noopener) +# +# +:noopener+ adds a rel="noopener" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:noopener) +# => "ohai! I like your blog post" +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:271 +class Loofah::Scrubbers::NoOpener < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:272 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:276 + def scrub(node); end +end + +# === scrub!(:noreferrer) +# +# +:noreferrer+ adds a rel="noreferrer" attribute to all links +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:noreferrer) +# => "ohai! I like your blog post" +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:293 +class Loofah::Scrubbers::NoReferrer < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:294 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:298 + def scrub(node); end +end + +# === scrub!(:prune) +# +# +:prune+ removes unknown/unsafe tags and their contents (including their subtrees): +# +# unsafe_html = "ohai!
    div is safe
    but foo is not" +# Loofah.html5_fragment(unsafe_html).scrub!(:prune) +# => "ohai!
    div is safe
    " +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:137 +class Loofah::Scrubbers::Prune < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:138 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:142 + def scrub(node); end +end + +# === scrub!(:strip) +# +# +:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents: +# +# unsafe_html = "ohai!
    div is safe
    but foo is not" +# Loofah.html5_fragment(unsafe_html).scrub!(:strip) +# => "ohai!
    div is safe
    but foo is not" +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:114 +class Loofah::Scrubbers::Strip < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:115 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:119 + def scrub(node); end +end + +# === scrub!(:targetblank) +# +# +:targetblank+ adds a target="_blank" attribute to all links. +# If there is a target already set, replaces it with target="_blank". +# +# link_farmers_markup = "ohai! I like your blog post" +# Loofah.html5_fragment(link_farmers_markup).scrub!(:targetblank) +# => "ohai! I like your blog post" +# +# On modern browsers, setting target="_blank" on anchor elements implicitly provides the same +# behavior as setting rel="noopener". +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:246 +class Loofah::Scrubbers::TargetBlank < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:247 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:251 + def scrub(node); end +end + +# === scrub!(:unprintable) +# +# +:unprintable+ removes unprintable Unicode characters. +# +# markup = "

    Some text with an unprintable character at the end\u2028

    " +# Loofah.html5_fragment(markup).scrub!(:unprintable) +# => "

    Some text with an unprintable character at the end

    " +# +# You may not be able to see the unprintable character in the above example, but there is a +# U+2028 character right before the closing

    tag. These characters can cause issues if +# the content is ever parsed by JavaScript - more information here: +# +# http://timelessrepo.com/json-isnt-a-javascript-subset +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:340 +class Loofah::Scrubbers::Unprintable < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:341 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:345 + def scrub(node); end +end + +# === scrub!(:whitewash) +# +# +:whitewash+ removes all comments, styling and attributes in +# addition to doing markup-fixer-uppery and pruning unsafe tags. I +# like to call this "whitewashing", since it's like putting a new +# layer of paint on top of the HTML input to make it look nice. +# +# messy_markup = "ohai!
    div with attributes
    " +# Loofah.html5_fragment(messy_markup).scrub!(:whitewash) +# => "ohai!
    div with attributes
    " +# +# One use case for this scrubber is to clean up HTML that was +# cut-and-pasted from Microsoft Word into a WYSIWYG editor or a +# rich text editor. Microsoft's software is famous for injecting +# all kinds of cruft into its HTML output. Who needs that crap? +# Certainly not me. +# +# pkg:gem/loofah#lib/loofah/scrubbers.rb:191 +class Loofah::Scrubbers::Whitewash < ::Loofah::Scrubber + # pkg:gem/loofah#lib/loofah/scrubbers.rb:192 + def initialize; end + + # pkg:gem/loofah#lib/loofah/scrubbers.rb:196 + def scrub(node); end +end + +# Overrides +text+ in Document and DocumentFragment classes, and mixes in +to_text+. +# +# pkg:gem/loofah#lib/loofah/concerns.rb:73 +module Loofah::TextBehavior + # pkg:gem/loofah#lib/loofah/concerns.rb:107 + def inner_text(options = T.unsafe(nil)); end + + # Returns a plain-text version of the markup contained by the document, with HTML entities + # encoded. + # + # This method is significantly faster than #to_text, but isn't clever about whitespace around + # block elements. + # + # Loofah.html5_document("

    Title

    Content
    ").text + # # => "TitleContent" + # + # By default, the returned text will have HTML entities escaped. If you want unescaped + # entities, and you understand that the result is unsafe to render in a browser, then you can + # pass an argument as shown: + # + # frag = Loofah.html5_fragment("<script>alert('EVIL');</script>") + # # ok for browser: + # frag.text # => "<script>alert('EVIL');</script>" + # # decidedly not ok for browser: + # frag.text(:encode_special_chars => false) # => "" + # + # pkg:gem/loofah#lib/loofah/concerns.rb:94 + def text(options = T.unsafe(nil)); end + + # pkg:gem/loofah#lib/loofah/concerns.rb:108 + def to_str(options = T.unsafe(nil)); end + + # Returns a plain-text version of the markup contained by the fragment, with HTML entities + # encoded. + # + # This method is slower than #text, but is clever about whitespace around block elements and + # line break elements. + # + # Loofah.html5_document("

    Title

    Content
    Next line
    ").to_text + # # => "\nTitle\n\nContent\nNext line\n" + # + # pkg:gem/loofah#lib/loofah/concerns.rb:120 + def to_text(options = T.unsafe(nil)); end +end + +# The version of Loofah you are using +# +# pkg:gem/loofah#lib/loofah/version.rb:5 +Loofah::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/loofah#lib/loofah/xml/document.rb:4 +module Loofah::XML; end + +# Subclass of Nokogiri::XML::Document. +# +# See Loofah::ScrubBehavior and Loofah::DocumentDecorator for additional methods. +# +# pkg:gem/loofah#lib/loofah/xml/document.rb:10 +class Loofah::XML::Document < ::Nokogiri::XML::Document + include ::Loofah::ScrubBehavior::Node + include ::Loofah::DocumentDecorator +end + +# Subclass of Nokogiri::XML::DocumentFragment. +# +# See Loofah::ScrubBehavior for additional methods. +# +# pkg:gem/loofah#lib/loofah/xml/document_fragment.rb:10 +class Loofah::XML::DocumentFragment < ::Nokogiri::XML::DocumentFragment + class << self + # pkg:gem/loofah#lib/loofah/xml/document_fragment.rb:12 + def parse(tags); end + end +end diff --git a/sorbet/rbi/gems/minitest@6.0.6.rbi b/sorbet/rbi/gems/minitest@6.0.6.rbi new file mode 100644 index 0000000..c153fca --- /dev/null +++ b/sorbet/rbi/gems/minitest@6.0.6.rbi @@ -0,0 +1,1481 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `minitest` gem. +# Please instead update this file by running `bin/tapioca gem minitest`. + + +# The top-level namespace for Minitest. Also the location of the main +# runtime. See +Minitest.run+ for more information. +# this is gonna break some shit? +# for ruby 3 +# :stopdoc: +# :startdoc: +# +# pkg:gem/minitest#lib/minitest/parallel.rb:3 +module Minitest + class << self + # A simple hook allowing you to run a block of code after everything + # is done running. Eg: + # + # Minitest.after_run { p $debugging_info } + # + # pkg:gem/minitest#lib/minitest.rb:95 + def after_run(&block); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def allow_fork; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def allow_fork=(_arg0); end + + # Registers Minitest to run at process exit + # + # pkg:gem/minitest#lib/minitest.rb:69 + def autorun; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def backtrace_filter; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def backtrace_filter=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:19 + def cattr_accessor(name); end + + # pkg:gem/minitest#lib/minitest.rb:1209 + def clock_time; end + + # pkg:gem/minitest#lib/minitest.rb:332 + def empty_run!(options); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def extensions; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def extensions=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:365 + def filter_backtrace(bt); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def info_signal; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def info_signal=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:134 + def init_plugins(options); end + + # Manually load plugins by name. + # + # pkg:gem/minitest#lib/minitest.rb:102 + def load(*names); end + + # pkg:gem/minitest#lib/minitest.rb:118 + def load_plugins; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def parallel_executor; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def parallel_executor=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:152 + def process_args(args = T.unsafe(nil)); end + + # Register a plugin to be used. Does NOT require / load it. + # + # pkg:gem/minitest#lib/minitest.rb:113 + def register_plugin(name_or_mod); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def reporter; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def reporter=(_arg0); end + + # This is the top-level run method. Everything starts from here. It + # tells each Runnable sub-class to run, and each of those are + # responsible for doing whatever they do. + # + # The overall structure of a run looks like this: + # + # [Minitest.load_plugins] optional, called by user, or require what you want + # Minitest.autorun + # Minitest.run(args) + # Minitest.process_args + # Minitest.init_plugins + # Minitest.run_all_suites(reporter, options) + # Runnable.runnables.each |runnable_klass| + # runnable_klass.run_suite(reporter, options) + # filtered_methods = runnable_klass.filter_runnable_methods options + # filtered_methods.each |runnable_method| + # runnable_klass.run(self, runnable_method, reporter) + # runnable_klass.new(runnable_method).run + # + # pkg:gem/minitest#lib/minitest.rb:299 + def run(args = T.unsafe(nil)); end + + # Internal run method. Responsible for telling all Runnable + # sub-classes to run. + # + # pkg:gem/minitest#lib/minitest.rb:352 + def run_all_suites(reporter, options); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def seed; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def seed=(_arg0); end + end +end + +# Defines the API for Reporters. Subclass this and override whatever +# you want. Go nuts. +# +# pkg:gem/minitest#lib/minitest.rb:707 +class Minitest::AbstractReporter + # pkg:gem/minitest#lib/minitest.rb:709 + def initialize; end + + # Did this run pass? + # + # pkg:gem/minitest#lib/minitest.rb:744 + def passed?; end + + # About to start running a test. This allows a reporter to show + # that it is starting or that we are in the middle of a test run. + # + # pkg:gem/minitest#lib/minitest.rb:723 + def prerecord(klass, name); end + + # Output and record the result of the test. Call + # {result#result_code}[rdoc-ref:Runnable#result_code] to get the + # result character string. Stores the result of the run if the run + # did not pass. + # + # pkg:gem/minitest#lib/minitest.rb:732 + def record(result); end + + # Outputs the summary of the run. + # + # pkg:gem/minitest#lib/minitest.rb:738 + def report; end + + # Starts reporting on the run. + # + # pkg:gem/minitest#lib/minitest.rb:716 + def start; end + + # pkg:gem/minitest#lib/minitest.rb:748 + def synchronize(&block); end +end + +# Represents run failures. +# +# pkg:gem/minitest#lib/minitest.rb:1039 +class Minitest::Assertion < ::Exception + # pkg:gem/minitest#lib/minitest.rb:1042 + def error; end + + # Where was this run before an assertion was raised? + # + # pkg:gem/minitest#lib/minitest.rb:1049 + def location; end + + # pkg:gem/minitest#lib/minitest.rb:1057 + def result_code; end + + # pkg:gem/minitest#lib/minitest.rb:1061 + def result_label; end +end + +# pkg:gem/minitest#lib/minitest.rb:1040 +Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp) + +# Minitest Assertions. All assertion methods accept a +msg+ which is +# printed if the assertion fails. +# +# Protocol: Nearly everything here boils up to +assert+, which +# expects to be able to increment an instance accessor named +# +assertions+. This is not provided by Assertions and must be +# provided by the thing including Assertions. See Minitest::Runnable +# for an example. +# +# pkg:gem/minitest#lib/minitest/assertions.rb:16 +module Minitest::Assertions + # pkg:gem/minitest#lib/minitest/assertions.rb:181 + def _synchronize; end + + # Fails unless +test+ is truthy. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:171 + def assert(test, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is empty. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:188 + def assert_empty(obj, msg = T.unsafe(nil)); end + + # Fails unless exp == act printing the difference between + # the two, if possible. + # + # If there is no visible difference but the assertion fails, you + # should suspect that your #== is buggy, or your inspect output is + # missing crucial details. For nicer structural diffing, set + # Minitest::Test.make_my_diffs_pretty! + # + # For floats use assert_in_delta. + # + # See also: Minitest::Assertions.diff + # + # pkg:gem/minitest#lib/minitest/assertions.rb:206 + def assert_equal(exp, act, msg = T.unsafe(nil)); end + + # For comparing Floats. Fails unless +exp+ and +act+ are within +delta+ + # of each other. + # + # assert_in_delta Math::PI, (22.0 / 7.0), 0.01 + # + # pkg:gem/minitest#lib/minitest/assertions.rb:220 + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # For comparing Floats. Fails unless +exp+ and +act+ have a relative + # error less than +epsilon+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:232 + def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails unless +collection+ includes +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:239 + def assert_includes(collection, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is an instance of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:249 + def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is a kind of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:260 + def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails unless +matcher+ =~ +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:271 + def assert_match(matcher, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is nil + # + # pkg:gem/minitest#lib/minitest/assertions.rb:283 + def assert_nil(obj, msg = T.unsafe(nil)); end + + # For testing with binary operators. Eg: + # + # assert_operator 5, :<=, 4 + # + # pkg:gem/minitest#lib/minitest/assertions.rb:293 + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if stdout or stderr do not output the expected results. + # Pass in nil if you don't care about that streams output. Pass in + # "" if you require it to be silent. Pass in a regexp if you want + # to pattern match. + # + # assert_output(/hey/) { method_with_output } + # + # NOTE: this uses #capture_io, not #capture_subprocess_io. + # + # See also: #assert_silent + # + # pkg:gem/minitest#lib/minitest/assertions.rb:312 + def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end + + # Fails unless +path+ exists. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:336 + def assert_path_exists(path, msg = T.unsafe(nil)); end + + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # assert_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # # fail "length mismatch (given 3, expected 1)" + # assert_pattern { [1,2,3] => [Integer] } + # + # The bare => pattern will raise a NoMatchingPatternError on failure, which would + # normally be counted as a test error. This assertion rescues NoMatchingPatternError and + # generates a test failure. Any other exception will be raised as normal and generate a test + # error. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:355 + def assert_pattern; end + + # For testing with predicates. Eg: + # + # assert_predicate str, :empty? + # + # This is really meant for specs and is front-ended by assert_operator: + # + # str.must_be :empty? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:373 + def assert_predicate(o1, op, msg = T.unsafe(nil)); end + + # Fails unless the block raises one of +exp+. Returns the + # exception matched so you can check the message, attributes, etc. + # + # +exp+ takes an optional message on the end to help explain + # failures and defaults to StandardError if no exception class is + # passed. Eg: + # + # assert_raises(CustomError) { method_with_custom_error } + # + # With custom error message: + # + # assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error } + # + # Using the returned object: + # + # error = assert_raises(CustomError) do + # raise CustomError, 'This is really bad' + # end + # + # assert_equal 'This is really bad', error.message + # + # pkg:gem/minitest#lib/minitest/assertions.rb:403 + def assert_raises(*exp); end + + # Fails unless +obj+ responds to +meth+. + # include_all defaults to false to match Object#respond_to? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:438 + def assert_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # Fails unless +exp+ and +act+ are #equal? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:446 + def assert_same(exp, act, msg = T.unsafe(nil)); end + + # Fails if the block outputs anything to stderr or stdout. + # + # See also: #assert_output + # + # pkg:gem/minitest#lib/minitest/assertions.rb:462 + def assert_silent; end + + # Fails unless the block throws +sym+ + # + # pkg:gem/minitest#lib/minitest/assertions.rb:471 + def assert_throws(sym, msg = T.unsafe(nil)); end + + # Captures $stdout and $stderr into strings: + # + # out, err = capture_io do + # puts "Some info" + # warn "You did a bad thing" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: For efficiency, this method uses StringIO and does not + # capture IO for subprocesses. Use #capture_subprocess_io for + # that. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:507 + def capture_io; end + + # Captures $stdout and $stderr into strings, using Tempfile to + # ensure that subprocess IO is captured as well. + # + # out, err = capture_subprocess_io do + # system "echo Some info" + # system "echo You did a bad thing 1>&2" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: This method is approximately 10x slower than #capture_io so + # only use it when you need to test the output of a subprocess. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:540 + def capture_subprocess_io; end + + # Returns a diff between +exp+ and +act+. If there is no known + # diff command or if it doesn't make sense to diff the output + # (single line, short output), then it simply returns a basic + # comparison between the two. + # + # See +things_to_diff+ for more info. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:57 + def diff(exp, act); end + + # Returns details for exception +e+ + # + # pkg:gem/minitest#lib/minitest/assertions.rb:572 + def exception_details(e, msg); end + + # Fails after a given date (in the local time zone). This allows + # you to put time-bombs in your tests if you need to keep + # something around until a later date lest you forget about it. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:588 + def fail_after(y, m, d, msg); end + + # Fails with +msg+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:595 + def flunk(msg = T.unsafe(nil)); end + + # Returns a proc that delays generation of an output message. If + # +msg+ is a proc (eg, from another +message+ call) return +msg+ + # as-is. Otherwise, return a proc that will output +msg+ along + # with the value of the result of the block passed to +message+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:606 + def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end + + # This returns a human-readable version of +obj+. By default + # #inspect is called. You can override this to use #pretty_inspect + # if you want. + # + # See Minitest::Test.make_my_diffs_pretty! + # + # pkg:gem/minitest#lib/minitest/assertions.rb:127 + def mu_pp(obj); end + + # This returns a diff-able more human-readable version of +obj+. + # This differs from the regular mu_pp because it expands escaped + # newlines and makes hex-values (like object_ids) generic. This + # uses mu_pp to do the first pass and then cleans it up. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:145 + def mu_pp_for_diff(obj); end + + # used for counting assertions + # + # pkg:gem/minitest#lib/minitest/assertions.rb:617 + def pass(_msg = T.unsafe(nil)); end + + # Fails if +test+ is truthy. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:624 + def refute(test, msg = T.unsafe(nil)); end + + # Fails if +obj+ is empty. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:632 + def refute_empty(obj, msg = T.unsafe(nil)); end + + # Fails if exp == act. + # + # For floats use refute_in_delta. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:642 + def refute_equal(exp, act, msg = T.unsafe(nil)); end + + # For comparing Floats. Fails if +exp+ is within +delta+ of +act+. + # + # refute_in_delta Math::PI, (22.0 / 7.0) + # + # pkg:gem/minitest#lib/minitest/assertions.rb:654 + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # For comparing Floats. Fails if +exp+ and +act+ have a relative error + # less than +epsilon+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:666 + def refute_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if +obj+ includes +sub+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:673 + def refute_includes(obj, sub, msg = T.unsafe(nil)); end + + # Fails if +obj+ is an instance of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:681 + def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is a kind of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:691 + def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails if +matcher+ =~ +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:699 + def refute_match(matcher, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is nil. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:708 + def refute_nil(obj, msg = T.unsafe(nil)); end + + # Fails if +o1+ is not +op+ +o2+. Eg: + # + # refute_operator 1, :>, 2 #=> pass + # refute_operator 1, :<, 2 #=> fail + # + # pkg:gem/minitest#lib/minitest/assertions.rb:740 + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if +path+ exists. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:750 + def refute_path_exists(path, msg = T.unsafe(nil)); end + + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # refute_pattern { [1,2,3] => [String] } + # + # # fail "NoMatchingPatternError expected, but nothing was raised." + # refute_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # This assertion expects a NoMatchingPatternError exception, and will fail if none is raised. Any + # other exceptions will be raised as normal and generate a test error. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:725 + def refute_pattern; end + + # For testing with predicates. + # + # refute_predicate str, :empty? + # + # This is really meant for specs and is front-ended by refute_operator: + # + # str.wont_be :empty? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:764 + def refute_predicate(o1, op, msg = T.unsafe(nil)); end + + # Fails if +obj+ responds to the message +meth+. + # include_all defaults to false to match Object#respond_to? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:774 + def refute_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # Fails if +exp+ is the same (by object identity) as +act+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:783 + def refute_same(exp, act, msg = T.unsafe(nil)); end + + # Skips the current run. If run in verbose-mode, the skipped run + # gets listed at the end of the run but doesn't cause a failure + # exit code. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:796 + def skip(msg = T.unsafe(nil), _ignored = T.unsafe(nil)); end + + # Skips the current run until a given date (in the local time + # zone). This allows you to put some fixes on hold until a later + # date, but still holds you accountable and prevents you from + # forgetting it. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:808 + def skip_until(y, m, d, msg); end + + # Was this testcase skipped? Meant for #teardown. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:817 + def skipped?; end + + # Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff. + # + # Criterion: + # + # 1. Strings include newlines or escaped newlines, but not both. + # 2. or: String lengths are > 30 characters. + # 3. or: Strings are equal to each other (but maybe different encodings?). + # 4. and: we found a diff executable. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:102 + def things_to_diff(exp, act); end + + class << self + # Returns the diff command to use in #diff. Tries to intelligently + # figure out what diff to use. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:27 + def diff; end + + # Set the diff command to use in #diff. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:45 + def diff=(o); end + end +end + +# pkg:gem/minitest#lib/minitest/assertions.rb:379 +Minitest::Assertions::NO_RE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/minitest#lib/minitest/assertions.rb:17 +Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object) + +# The standard backtrace filter for minitest. +# +# See Minitest.backtrace_filter=. +# +# pkg:gem/minitest#lib/minitest.rb:1174 +class Minitest::BacktraceFilter + # pkg:gem/minitest#lib/minitest.rb:1183 + def initialize(regexp = T.unsafe(nil)); end + + # Filter +bt+ to something useful. Returns the whole thing if + # $DEBUG (ruby) or $MT_DEBUG (env). + # + # pkg:gem/minitest#lib/minitest.rb:1191 + def filter(bt); end + + # The regular expression to use to filter backtraces. Defaults to +MT_RE+. + # + # pkg:gem/minitest#lib/minitest.rb:1181 + def regexp; end + + # The regular expression to use to filter backtraces. Defaults to +MT_RE+. + # + # pkg:gem/minitest#lib/minitest.rb:1181 + def regexp=(_arg0); end +end + +# pkg:gem/minitest#lib/minitest.rb:1176 +Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp) + +# Dispatch to multiple reporters as one. +# +# pkg:gem/minitest#lib/minitest.rb:989 +class Minitest::CompositeReporter < ::Minitest::AbstractReporter + # pkg:gem/minitest#lib/minitest.rb:995 + def initialize(*reporters); end + + # Add another reporter to the mix. + # + # pkg:gem/minitest#lib/minitest.rb:1007 + def <<(reporter); end + + # pkg:gem/minitest#lib/minitest.rb:1000 + def io; end + + # pkg:gem/minitest#lib/minitest.rb:1011 + def passed?; end + + # pkg:gem/minitest#lib/minitest.rb:1019 + def prerecord(klass, name); end + + # pkg:gem/minitest#lib/minitest.rb:1025 + def record(result); end + + # pkg:gem/minitest#lib/minitest.rb:1031 + def report; end + + # The list of reporters to dispatch to. + # + # pkg:gem/minitest#lib/minitest.rb:993 + def reporters; end + + # The list of reporters to dispatch to. + # + # pkg:gem/minitest#lib/minitest.rb:993 + def reporters=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:1015 + def start; end +end + +# Compresses backtraces. +# +# pkg:gem/minitest#lib/minitest/compress.rb:5 +module Minitest::Compress + # Takes a backtrace (array of strings) and compresses repeating + # cycles in it to make it more readable. + # + # pkg:gem/minitest#lib/minitest/compress.rb:11 + def compress(orig); end +end + +# Provides a simple set of guards that you can use in your tests +# to skip execution if it is not applicable. These methods are +# mixed into Test as both instance and class methods so you +# can use them inside or outside of the test methods. +# +# def test_something_for_mri +# skip "bug 1234" if jruby? +# # ... +# end +# +# if windows? then +# # ... lots of test methods ... +# end +# +# pkg:gem/minitest#lib/minitest.rb:1138 +module Minitest::Guard + # Is this running on jruby? + # + # pkg:gem/minitest#lib/minitest.rb:1143 + def jruby?(platform = T.unsafe(nil)); end + + # Is this running on mri? + # + # pkg:gem/minitest#lib/minitest.rb:1150 + def mri?(platform = T.unsafe(nil)); end + + # Is this running on macOS? + # + # pkg:gem/minitest#lib/minitest.rb:1157 + def osx?(platform = T.unsafe(nil)); end + + # Is this running on windows? + # + # pkg:gem/minitest#lib/minitest.rb:1164 + def windows?(platform = T.unsafe(nil)); end +end + +# pkg:gem/minitest#lib/minitest/parallel.rb:4 +module Minitest::Parallel; end + +# The engine used to run multiple tests in parallel. +# +# pkg:gem/minitest#lib/minitest/parallel.rb:9 +class Minitest::Parallel::Executor + # Create a parallel test executor of with +size+ workers. + # + # pkg:gem/minitest#lib/minitest/parallel.rb:19 + def initialize(size); end + + # Add a job to the queue + # + # pkg:gem/minitest#lib/minitest/parallel.rb:45 + def <<(work); end + + # Shuts down the pool of workers by signalling them to quit and + # waiting for them all to finish what they're currently working + # on. + # + # pkg:gem/minitest#lib/minitest/parallel.rb:52 + def shutdown; end + + # The size of the pool of workers. + # + # pkg:gem/minitest#lib/minitest/parallel.rb:14 + def size; end + + # Start the executor + # + # pkg:gem/minitest#lib/minitest/parallel.rb:28 + def start; end +end + +# pkg:gem/minitest#lib/minitest/parallel.rb:58 +module Minitest::Parallel::Test + # pkg:gem/minitest#lib/minitest/parallel.rb:59 + def _synchronize; end +end + +# pkg:gem/minitest#lib/minitest/parallel.rb:61 +module Minitest::Parallel::Test::ClassMethods + # pkg:gem/minitest#lib/minitest/parallel.rb:62 + def run(klass, method_name, reporter); end + + # pkg:gem/minitest#lib/minitest/parallel.rb:66 + def run_order; end +end + +# A very simple reporter that prints the "dots" during the run. +# +# This is added to the top-level CompositeReporter at the start of +# the run. If you want to change the output of minitest via a +# plugin, pull this out of the composite and replace it with your +# own. +# +# pkg:gem/minitest#lib/minitest.rb:779 +class Minitest::ProgressReporter < ::Minitest::Reporter + # pkg:gem/minitest#lib/minitest.rb:780 + def prerecord(klass, name); end + + # pkg:gem/minitest#lib/minitest.rb:787 + def record(result); end +end + +# Shared code for anything that can get passed to a Reporter. See +# Minitest::Test & Minitest::Result. +# +# pkg:gem/minitest#lib/minitest.rb:604 +module Minitest::Reportable + # pkg:gem/minitest#lib/minitest.rb:626 + def class_name; end + + # Did this run error? + # + # pkg:gem/minitest#lib/minitest.rb:647 + def error?; end + + # The location identifier of this test. Depends on a method + # existing called class_name. + # + # pkg:gem/minitest#lib/minitest.rb:621 + def location; end + + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't + # cause the process to exit non-zero. + # + # pkg:gem/minitest#lib/minitest.rb:611 + def passed?; end + + # Returns ".", "F", or "E" based on the result of the run. + # + # pkg:gem/minitest#lib/minitest.rb:633 + def result_code; end + + # Was this run skipped? + # + # pkg:gem/minitest#lib/minitest.rb:640 + def skipped?; end +end + +# pkg:gem/minitest#lib/minitest.rb:615 +Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String) + +# AbstractReportera +# +# pkg:gem/minitest#lib/minitest.rb:753 +class Minitest::Reporter < ::Minitest::AbstractReporter + # pkg:gem/minitest#lib/minitest.rb:764 + def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end + + # The IO used to report. + # + # pkg:gem/minitest#lib/minitest.rb:757 + def io; end + + # The IO used to report. + # + # pkg:gem/minitest#lib/minitest.rb:757 + def io=(_arg0); end + + # Command-line options for this run. + # + # pkg:gem/minitest#lib/minitest.rb:762 + def options; end + + # Command-line options for this run. + # + # pkg:gem/minitest#lib/minitest.rb:762 + def options=(_arg0); end +end + +# This represents a test result in a clean way that can be +# marshalled over a wire. Tests can do anything they want to the +# test instance and can create conditions that cause Marshal.dump to +# blow up. By using Result.from(a_test) you can be reasonably sure +# that the test result can be marshalled. +# +# pkg:gem/minitest#lib/minitest.rb:659 +class Minitest::Result < ::Minitest::Runnable + include ::Minitest::Reportable + + # pkg:gem/minitest#lib/minitest.rb:690 + def class_name; end + + # The class name of the test result. + # + # pkg:gem/minitest#lib/minitest.rb:665 + def klass; end + + # The class name of the test result. + # + # pkg:gem/minitest#lib/minitest.rb:665 + def klass=(_arg0); end + + # The location of the test method. + # + # pkg:gem/minitest#lib/minitest.rb:670 + def source_location; end + + # The location of the test method. + # + # pkg:gem/minitest#lib/minitest.rb:670 + def source_location=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:694 + def to_s; end + + class << self + # Create a new test result from a Runnable instance. + # + # pkg:gem/minitest#lib/minitest.rb:675 + def from(runnable); end + end +end + +# Represents anything "runnable", like Test, Spec, Benchmark, or +# whatever you can dream up. +# +# Subclasses of this are automatically registered and available in +# Runnable.runnables. +# +# pkg:gem/minitest#lib/minitest.rb:378 +class Minitest::Runnable + # pkg:gem/minitest#lib/minitest.rb:535 + def initialize(name); end + + # Number of assertions executed in this run. + # + # pkg:gem/minitest#lib/minitest.rb:382 + def assertions; end + + # Number of assertions executed in this run. + # + # pkg:gem/minitest#lib/minitest.rb:382 + def assertions=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:531 + def failure; end + + # An assertion raised during the run, if any. + # + # pkg:gem/minitest#lib/minitest.rb:387 + def failures; end + + # An assertion raised during the run, if any. + # + # pkg:gem/minitest#lib/minitest.rb:387 + def failures=(_arg0); end + + # Metadata you attach to the test results that get sent to the reporter. + # + # Lazily initializes to a hash, to keep memory down. + # + # NOTE: this data *must* be plain (read: marshal-able) data! + # Hashes! Arrays! Strings! + # + # Sets metadata, mainly used for +Result.from+. + # + # pkg:gem/minitest#lib/minitest.rb:550 + def metadata; end + + # Metadata you attach to the test results that get sent to the reporter. + # + # Lazily initializes to a hash, to keep memory down. + # + # NOTE: this data *must* be plain (read: marshal-able) data! + # Hashes! Arrays! Strings! + # + # Sets metadata, mainly used for +Result.from+. + # + # pkg:gem/minitest#lib/minitest.rb:557 + def metadata=(_arg0); end + + # Returns true if metadata exists. + # + # pkg:gem/minitest#lib/minitest.rb:562 + def metadata?; end + + # Name of the run. + # + # pkg:gem/minitest#lib/minitest.rb:405 + def name; end + + # Set the name of the run. + # + # pkg:gem/minitest#lib/minitest.rb:412 + def name=(o); end + + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't + # cause the process to exit non-zero. + # + # pkg:gem/minitest#lib/minitest.rb:579 + def passed?; end + + # Returns a single character string to print based on the result + # of the run. One of ".", "F", + # "E" or "S". + # + # pkg:gem/minitest#lib/minitest.rb:588 + def result_code; end + + # Runs a single method. Needs to return self. + # + # pkg:gem/minitest#lib/minitest.rb:569 + def run; end + + # Was this run skipped? See #passed? for more information. + # + # pkg:gem/minitest#lib/minitest.rb:595 + def skipped?; end + + # The time it took to run. + # + # pkg:gem/minitest#lib/minitest.rb:392 + def time; end + + # The time it took to run. + # + # pkg:gem/minitest#lib/minitest.rb:392 + def time=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:394 + def time_it; end + + class << self + # Returns an array of filtered +runnable_methods+. Uses + # options[:include] (--include arguments) and options[:exclude] + # (--exclude arguments) values to filter. + # + # pkg:gem/minitest#lib/minitest.rb:434 + def filter_runnable_methods(options = T.unsafe(nil)); end + + # re-open + # + # pkg:gem/minitest#lib/minitest.rb:1219 + def inherited(klass); end + + # Returns all instance methods matching the pattern +re+. + # + # pkg:gem/minitest#lib/minitest.rb:419 + def methods_matching(re); end + + # pkg:gem/minitest#lib/minitest.rb:503 + def on_signal(name, action); end + + # pkg:gem/minitest#lib/minitest.rb:423 + def reset; end + + # Runs a single method and has the reporter record the result. + # This was considered internal API but is factored out of run so + # that subclasses can specialize the running of an individual + # test. See Minitest::ParallelTest::ClassMethods for an example. + # + # pkg:gem/minitest#lib/minitest.rb:484 + def run(klass, method_name, reporter); end + + # Defines the order to run tests (:random by default). Override + # this or use a convenience method to change it for your tests. + # + # pkg:gem/minitest#lib/minitest.rb:493 + def run_order; end + + # Responsible for running all runnable methods in a given class, + # each in its own instance. Each instance is passed to the + # reporter to record. + # + # pkg:gem/minitest#lib/minitest.rb:452 + def run_suite(reporter, options = T.unsafe(nil)); end + + # Each subclass of Runnable is responsible for overriding this + # method to return all runnable methods. See #methods_matching. + # + # pkg:gem/minitest#lib/minitest.rb:520 + def runnable_methods; end + + # Returns all subclasses of Runnable. + # + # pkg:gem/minitest#lib/minitest.rb:527 + def runnables; end + + # pkg:gem/minitest#lib/minitest.rb:497 + def with_info_handler(_reporter = T.unsafe(nil), &block); end + end +end + +# pkg:gem/minitest#lib/minitest.rb:501 +Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash) + +# Assertion raised when skipping a run. +# +# pkg:gem/minitest#lib/minitest.rb:1069 +class Minitest::Skip < ::Minitest::Assertion + # pkg:gem/minitest#lib/minitest.rb:1070 + def result_label; end +end + +# A reporter that gathers statistics about a test run. Does not do +# any IO because meant to be used as a parent class for a reporter +# that does. +# +# If you want to create an entirely different type of output (eg, +# CI, HTML, etc), this is the place to start. +# +# Example: +# +# class JenkinsCIReporter < StatisticsReporter +# def report +# super # Needed to calculate some statistics +# +# print " + # + #

    first

    + #

    second

    + # + # + # eohtml + # assert_equal('second', doc.html.body.p[1].text) + # + # pkg:gem/nokogiri#lib/nokogiri.rb:91 + def Slop(*args, &block); end + + # Convenience method for Nokogiri::XML::Document.parse + # + # pkg:gem/nokogiri#lib/nokogiri/xml.rb:6 + def XML(*, **, &); end + + # Convenience method for Nokogiri::XSLT.parse + # + # pkg:gem/nokogiri#lib/nokogiri/xslt.rb:7 + def XSLT(*, **, &); end + + # pkg:gem/nokogiri#lib/nokogiri.rb:96 + def install_default_aliases; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:216 + def jruby?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:221 + def libxml2_patches; end + + # Create a new Nokogiri::XML::DocumentFragment + # + # pkg:gem/nokogiri#lib/nokogiri.rb:68 + def make(input = T.unsafe(nil), opts = T.unsafe(nil), &blk); end + + # Parse an HTML or XML document. +string+ contains the document. + # + # pkg:gem/nokogiri#lib/nokogiri.rb:42 + def parse(string, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:211 + def uses_gumbo?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:203 + def uses_libxml?(requirement = T.unsafe(nil)); end + end +end + +# Translate a CSS selector into an XPath 1.0 query +# +# pkg:gem/nokogiri#lib/nokogiri/css.rb:6 +module Nokogiri::CSS + class << self + # TODO: Deprecate this method ahead of 2.0 and delete it in 2.0. + # It is not used by Nokogiri and shouldn't be part of the public API. + # + # pkg:gem/nokogiri#lib/nokogiri/css.rb:10 + def parse(selector); end + + # :call-seq: + # xpath_for(selector_list) → Array + # xpath_for(selector_list [, prefix:] [, ns:] [, visitor:] [, cache:]) → Array + # + # Translate a CSS selector list to the equivalent XPath expressions. + # + # 💡 Note that translated queries are cached by default for performance concerns. + # + # ⚠ Users should prefer Nokogiri::XML::Searchable#css, which is mixed into all document and + # node classes, for querying documents with CSS selectors. This method is the underlying + # mechanism used by XML::Searchable and is provided solely for advanced users to translate + # \CSS selectors to XPath directly. + # + # Also see Nokogiri::XML::Searchable#css for documentation on supported CSS selector features, + # some extended syntax that Nokogiri supports, and advanced CSS features like pseudo-class + # functions. + # + # [Parameters] + # - +selector_list+ (String) + # + # The CSS selector to be translated into XPath. This is always a String, but that string + # value may be a {selector list}[https://www.w3.org/TR/selectors-4/#grouping] (see + # examples). + # + # [Keyword arguments] + # - +prefix:+ (String) + # + # The XPath expression prefix which determines the search context. See Nokogiri::XML::XPath + # for standard options. Default is +XPath::GLOBAL_SEARCH_PREFIX+. + # + # - +ns:+ (Hash, nil) + # + # Namespaces that are referenced in the query, if any. This is a hash where the keys are the + # namespace prefix and the values are the namespace URIs. Default is +nil+ indicating an + # empty set of namespaces. + # + # - +visitor:+ (Nokogiri::CSS::XPathVisitor) + # + # Use this XPathVisitor object to transform the CSS AST into XPath expressions. See + # Nokogiri::CSS::XPathVisitor for more information on some of the complex behavior that can + # be customized for your document type. Default is +Nokogiri::CSS::XPathVisitor.new+. + # + # ⚠ Note that this option is mutually exclusive with +prefix+ and +ns+. If +visitor+ is + # provided, +prefix+ and +ns+ must not be present. + # + # - +cache:+ (Boolean) + # + # Whether to use the SelectorCache for the translated query to ensure that repeated queries + # don't incur the overhead of re-parsing the selector. Default is +true+. + # + # [Returns] (Array) The equivalent set of XPath expressions for +selector_list+ + # + # *Example* with a simple selector: + # + # Nokogiri::CSS.xpath_for("div") # => ["//div"] + # + # *Example* with a compound selector: + # + # Nokogiri::CSS.xpath_for("div.xl") # => ["//div[contains(concat(' ',normalize-space(@class),' '),' xl ')]"] + # + # *Example* with a complex selector: + # + # Nokogiri::CSS.xpath_for("h1 + div") # => ["//h1/following-sibling::*[1]/self::div"] + # + # *Example* with a selector list: + # + # Nokogiri::CSS.xpath_for("h1, h2, h3") # => ["//h1", "//h2", "//h3"] + # + # pkg:gem/nokogiri#lib/nokogiri/css.rb:83 + def xpath_for(selector, options = T.unsafe(nil), prefix: T.unsafe(nil), visitor: T.unsafe(nil), ns: T.unsafe(nil), cache: T.unsafe(nil)); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/css/node.rb:5 +class Nokogiri::CSS::Node + # Create a new Node with +type+ and +value+ + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:14 + def initialize(type, value); end + + # Accept +visitor+ + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:20 + def accept(visitor); end + + # Find a node by type using +types+ + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:36 + def find_by_type(types); end + + # Convert to array + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:53 + def to_a; end + + # Convert to_type + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:46 + def to_type; end + + # Convert this CSS node to xpath with +prefix+ using +visitor+ + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:26 + def to_xpath(visitor); end + + # Get the type of this node + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:9 + def type; end + + # Get the type of this node + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:9 + def type=(_arg0); end + + # Get the value of this node + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:11 + def value; end + + # Get the value of this node + # + # pkg:gem/nokogiri#lib/nokogiri/css/node.rb:11 + def value=(_arg0); end +end + +# pkg:gem/nokogiri#lib/nokogiri/css/node.rb:6 +Nokogiri::CSS::Node::ALLOW_COMBINATOR_ON_SELF = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/css/parser_extras.rb:7 +class Nokogiri::CSS::Parser < ::Racc::Parser + # pkg:gem/nokogiri#lib/nokogiri/css/parser_extras.rb:8 + def initialize; end + + # reduce 0 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:363 + def _reduce_1(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:409 + def _reduce_10(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:414 + def _reduce_11(val, _values, result); end + + # reduce 12 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:426 + def _reduce_13(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:431 + def _reduce_14(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:436 + def _reduce_15(val, _values, result); end + + # reduce 16 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:443 + def _reduce_17(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:448 + def _reduce_18(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:453 + def _reduce_19(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:369 + def _reduce_2(val, _values, result); end + + # reduce 20 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:460 + def _reduce_21(val, _values, result); end + + # reduce 22 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:467 + def _reduce_23(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:472 + def _reduce_24(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:477 + def _reduce_25(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:484 + def _reduce_26(val, _values, result); end + + # reduce 27 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:491 + def _reduce_28(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:497 + def _reduce_29(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:374 + def _reduce_3(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:503 + def _reduce_30(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:509 + def _reduce_31(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:514 + def _reduce_32(val, _values, result); end + + # reduce 33 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:521 + def _reduce_34(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:527 + def _reduce_35(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:533 + def _reduce_36(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:539 + def _reduce_37(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:545 + def _reduce_38(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:551 + def _reduce_39(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:379 + def _reduce_4(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:556 + def _reduce_40(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:561 + def _reduce_41(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:566 + def _reduce_42(val, _values, result); end + + # reduce 44 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:575 + def _reduce_45(val, _values, result); end + + # reduce 46 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:592 + def _reduce_47(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:602 + def _reduce_48(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:618 + def _reduce_49(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:384 + def _reduce_5(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:638 + def _reduce_50(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:644 + def _reduce_51(val, _values, result); end + + # reduce 53 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:653 + def _reduce_54(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:659 + def _reduce_55(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:665 + def _reduce_56(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:671 + def _reduce_57(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:677 + def _reduce_58(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:389 + def _reduce_6(val, _values, result); end + + # reduce 63 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:693 + def _reduce_64(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:698 + def _reduce_65(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:703 + def _reduce_66(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:708 + def _reduce_67(val, _values, result); end + + # reduce 68 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:715 + def _reduce_69(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:394 + def _reduce_7(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:720 + def _reduce_70(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:725 + def _reduce_71(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:730 + def _reduce_72(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:735 + def _reduce_73(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:740 + def _reduce_74(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:745 + def _reduce_75(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:750 + def _reduce_76(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:399 + def _reduce_8(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:404 + def _reduce_9(val, _values, result); end + + # reduce 81 omitted + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:766 + def _reduce_none(val, _values, result); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser_extras.rb:18 + def next_token; end + + # On CSS parser error, raise an exception + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser_extras.rb:30 + def on_error(error_token_id, error_value, value_stack); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser_extras.rb:13 + def parse(string); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:26 + def unescape_css_identifier(identifier); end + + # pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:30 + def unescape_css_string(str); end + + # Get the xpath for +selector+ using +visitor+ + # + # pkg:gem/nokogiri#lib/nokogiri/css/parser_extras.rb:23 + def xpath_for(selector, visitor); end +end + +# pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:279 +Nokogiri::CSS::Parser::Racc_arg = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:357 +Nokogiri::CSS::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) + +# pkg:gem/nokogiri#lib/nokogiri/css/parser.rb:296 +Nokogiri::CSS::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/css/selector_cache.rb:5 +module Nokogiri::CSS::SelectorCache + class << self + # Retrieve the cached XPath expressions for the key + # + # pkg:gem/nokogiri#lib/nokogiri/css/selector_cache.rb:11 + def [](key); end + + # Insert the XPath expressions `value` at the cache key + # + # pkg:gem/nokogiri#lib/nokogiri/css/selector_cache.rb:16 + def []=(key, value); end + + # Clear the cache + # + # pkg:gem/nokogiri#lib/nokogiri/css/selector_cache.rb:21 + def clear_cache(create_new_object = T.unsafe(nil)); end + + # Construct a unique key cache key + # + # pkg:gem/nokogiri#lib/nokogiri/css/selector_cache.rb:32 + def key(selector:, visitor:); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/css/syntax_error.rb:6 +class Nokogiri::CSS::SyntaxError < ::Nokogiri::SyntaxError; end + +# pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:11 +class Nokogiri::CSS::Tokenizer + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:57 + def _next_token; end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:26 + def action; end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:17 + def filename; end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:16 + def lineno; end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:36 + def load_file(filename); end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:49 + def next_token; end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:34 + def scan(str); end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:43 + def scan_file(filename); end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:20 + def scan_setup(str); end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:30 + def scan_str(str); end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:18 + def state; end + + # pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:18 + def state=(_arg0); end +end + +# pkg:gem/nokogiri#lib/nokogiri/css/tokenizer.rb:14 +class Nokogiri::CSS::Tokenizer::ScanError < ::StandardError; end + +# When translating CSS selectors to XPath queries with Nokogiri::CSS.xpath_for, the XPathVisitor +# class allows for changing some of the behaviors related to builtin xpath functions and quirks +# of HTML5. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:9 +class Nokogiri::CSS::XPathVisitor + # :call-seq: + # new() → XPathVisitor + # new(builtins:, doctype:) → XPathVisitor + # + # [Parameters] + # - +builtins:+ (BuiltinsConfig) Determine when to use Nokogiri's built-in xpath functions for performance improvements. + # - +doctype:+ (DoctypeConfig) Make document-type-specific accommodations for CSS queries. + # + # [Returns] XPathVisitor + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:69 + def initialize(builtins: T.unsafe(nil), doctype: T.unsafe(nil), prefix: T.unsafe(nil), namespaces: T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:298 + def accept(node); end + + # The visitor configuration set via the +builtins:+ keyword argument to XPathVisitor.new. + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:48 + def builtins; end + + # :call-seq: config() → Hash + # + # [Returns] + # a Hash representing the configuration of the XPathVisitor, suitable for use as + # part of the CSS cache key. + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:93 + def config; end + + # The visitor configuration set via the +doctype:+ keyword argument to XPathVisitor.new. + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:51 + def doctype; end + + # The visitor configuration set via the +namespaces:+ keyword argument to XPathVisitor.new. + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:57 + def namespaces; end + + # The visitor configuration set via the +prefix:+ keyword argument to XPathVisitor.new. + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:54 + def prefix; end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:294 + def visit_attrib_name(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:175 + def visit_attribute_condition(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:255 + def visit_child_selector(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:237 + def visit_class_condition(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:241 + def visit_combinator(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:262 + def visit_conditional_selector(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:255 + def visit_descendant_selector(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:255 + def visit_direct_adjacent_selector(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:267 + def visit_element_name(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:255 + def visit_following_selector(node); end + + # :stopdoc: + # + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:98 + def visit_function(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:170 + def visit_id(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:161 + def visit_not(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:211 + def visit_pseudo_class(node); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:365 + def css_class(hay, needle); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:310 + def html5_element_name_needs_namespace_handling(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:355 + def is_of_type_pseudo_class?(node); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:317 + def nth(node, options = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:341 + def read_a_and_positive_b(values); end + + # pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:304 + def validate_xpath_function_name(name); end +end + +# Enum to direct XPathVisitor when to use Nokogiri builtin XPath functions. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:13 +module Nokogiri::CSS::XPathVisitor::BuiltinsConfig; end + +# Always use Nokogiri builtin functions whenever possible. This is probably only useful for testing. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:19 +Nokogiri::CSS::XPathVisitor::BuiltinsConfig::ALWAYS = T.let(T.unsafe(nil), Symbol) + +# Never use Nokogiri builtin functions, always generate vanilla XPath 1.0 queries. This is +# the default when calling Nokogiri::CSS.xpath_for directly. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:16 +Nokogiri::CSS::XPathVisitor::BuiltinsConfig::NEVER = T.let(T.unsafe(nil), Symbol) + +# Only use Nokogiri builtin functions when they will be faster than vanilla XPath. This is +# the behavior chosen when searching for CSS selectors on a Nokogiri document, fragment, or +# node. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:24 +Nokogiri::CSS::XPathVisitor::BuiltinsConfig::OPTIMAL = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:27 +Nokogiri::CSS::XPathVisitor::BuiltinsConfig::VALUES = T.let(T.unsafe(nil), Array) + +# Enum to direct XPathVisitor when to tweak the XPath query to suit the nature of the document +# being searched. Note that searches for CSS selectors from a Nokogiri document, fragment, or +# node will choose the correct option automatically. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:33 +module Nokogiri::CSS::XPathVisitor::DoctypeConfig; end + +# The document being searched is an HTML4 document. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:38 +Nokogiri::CSS::XPathVisitor::DoctypeConfig::HTML4 = T.let(T.unsafe(nil), Symbol) + +# The document being searched is an HTML5 document. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:41 +Nokogiri::CSS::XPathVisitor::DoctypeConfig::HTML5 = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:44 +Nokogiri::CSS::XPathVisitor::DoctypeConfig::VALUES = T.let(T.unsafe(nil), Array) + +# The document being searched is an XML document. This is the default. +# +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:35 +Nokogiri::CSS::XPathVisitor::DoctypeConfig::XML = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/nokogiri#lib/nokogiri/css/xpath_visitor.rb:10 +Nokogiri::CSS::XPathVisitor::WILDCARD_NAMESPACES = T.let(T.unsafe(nil), TrueClass) + +# Some classes in Nokogiri are namespaced as a group, for example +# Document, DocumentFragment, and Builder. +# +# It's sometimes necessary to look up the related class, e.g.: +# +# XML::Builder → XML::Document +# HTML4::Builder → HTML4::Document +# HTML5::Document → HTML5::DocumentFragment +# +# This module is included into those key classes who need to do this. +# +# pkg:gem/nokogiri#lib/nokogiri/class_resolver.rb:17 +module Nokogiri::ClassResolver + # :call-seq: + # related_class(class_name) → Class + # + # Find a class constant within the + # + # Some examples: + # + # Nokogiri::XML::Document.new.related_class("DocumentFragment") + # # => Nokogiri::XML::DocumentFragment + # Nokogiri::HTML4::Document.new.related_class("DocumentFragment") + # # => Nokogiri::HTML4::DocumentFragment + # + # Note this will also work for subclasses that follow the same convention, e.g.: + # + # Loofah::HTML::Document.new.related_class("DocumentFragment") + # # => Loofah::HTML::DocumentFragment + # + # And even if it's a subclass, this will iterate through the superclasses: + # + # class ThisIsATopLevelClass < Nokogiri::HTML4::Builder ; end + # ThisIsATopLevelClass.new.related_class("Document") + # # => Nokogiri::HTML4::Document + # + # pkg:gem/nokogiri#lib/nokogiri/class_resolver.rb:44 + def related_class(class_name); end +end + +# #related_class restricts matching namespaces to those matching this set. +# +# pkg:gem/nokogiri#lib/nokogiri/class_resolver.rb:19 +Nokogiri::ClassResolver::VALID_NAMESPACES = T.let(T.unsafe(nil), Set) + +# pkg:gem/nokogiri#lib/nokogiri/decorators/slop.rb:4 +module Nokogiri::Decorators; end + +# The Slop decorator implements method missing such that a methods may be +# used instead of XPath or CSS. See Nokogiri.Slop +# +# pkg:gem/nokogiri#lib/nokogiri/decorators/slop.rb:8 +module Nokogiri::Decorators::Slop + # look for node with +name+. See Nokogiri.Slop + # + # pkg:gem/nokogiri#lib/nokogiri/decorators/slop.rb:14 + def method_missing(name, *args, &block); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/decorators/slop.rb:35 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# The default XPath search context for Slop +# +# pkg:gem/nokogiri#lib/nokogiri/decorators/slop.rb:10 +Nokogiri::Decorators::Slop::XPATH_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::EncodingHandler + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def name; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def [](_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def alias(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def clear_aliases!; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def delete(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/encoding_handler.rb:15 + def install_default_aliases; end + end +end + +# Popular encoding aliases not known by all iconv implementations that Nokogiri should support. +# +# pkg:gem/nokogiri#lib/nokogiri/encoding_handler.rb:7 +Nokogiri::EncodingHandler::USEFUL_ALIASES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::Gumbo + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def fragment(*_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def parse(*_arg0); end + end +end + +# The default maximum number of attributes per element. +# +# pkg:gem/nokogiri#lib/nokogiri/gumbo.rb:6 +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES = T.let(T.unsafe(nil), Integer) + +# The default maximum number of errors for parsing a document or a fragment. +# +# pkg:gem/nokogiri#lib/nokogiri/gumbo.rb:9 +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS = T.let(T.unsafe(nil), Integer) + +# The default maximum depth of the DOM tree produced by parsing a document +# or fragment. +# +# pkg:gem/nokogiri#lib/nokogiri/gumbo.rb:13 +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH = T.let(T.unsafe(nil), Integer) + +# Alias for Nokogiri::HTML4 +# 💡 This module/namespace is an alias for Nokogiri::HTML4 as of v1.12.0. Before v1.12.0, +# Nokogiri::HTML4 did not exist, and this was the module/namespace for all HTML-related +# classes. +# +# pkg:gem/nokogiri#lib/nokogiri/html.rb:8 +Nokogiri::HTML = Nokogiri::HTML4 + +# Since v1.12.0 +# +# 💡 Before v1.12.0, Nokogiri::HTML4 did not exist, and Nokogiri::HTML was the module/namespace +# for parsing HTML. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::HTML4 + class << self + # Convenience method for Nokogiri::HTML4::DocumentFragment.parse + # + # pkg:gem/nokogiri#lib/nokogiri/html4.rb:24 + def fragment(*, **, &); end + + # Convenience method for Nokogiri::HTML4::Document.parse + # + # pkg:gem/nokogiri#lib/nokogiri/html4.rb:19 + def parse(*, **, &); end + end +end + +# Nokogiri HTML builder is used for building HTML documents. It is very +# similar to the Nokogiri::XML::Builder. In fact, you should go read the +# documentation for Nokogiri::XML::Builder before reading this +# documentation. +# +# == Synopsis: +# +# Create an HTML document with a body that has an onload attribute, and a +# span tag with a class of "bold" that has content of "Hello world". +# +# builder = Nokogiri::HTML4::Builder.new do |doc| +# doc.html { +# doc.body(:onload => 'some_func();') { +# doc.span.bold { +# doc.text "Hello world" +# } +# } +# } +# end +# puts builder.to_html +# +# The HTML builder inherits from the XML builder, so make sure to read the +# Nokogiri::XML::Builder documentation. +# 💡 This class is an alias for Nokogiri::HTML4::Builder as of v1.12.0. +# +# pkg:gem/nokogiri#lib/nokogiri/html.rb:31 +class Nokogiri::HTML4::Builder < ::Nokogiri::XML::Builder + # Convert the builder to HTML + # + # pkg:gem/nokogiri#lib/nokogiri/html4/builder.rb:32 + def to_html; end +end + +# 💡 This class is an alias for Nokogiri::HTML4::Document as of v1.12.0. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML4::Document < ::Nokogiri::XML::Document + # Create a Nokogiri::XML::DocumentFragment from +tags+ + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:149 + def fragment(tags = T.unsafe(nil)); end + + # Get the meta tag encoding for this document. If there is no meta tag, + # then nil is returned. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:12 + def meta_encoding; end + + # Set the meta tag encoding for this document. + # + # If an meta encoding tag is already present, its content is + # replaced with the given text. + # + # Otherwise, this method tries to create one at an appropriate + # place supplying head and/or html elements as necessary, which + # is inside a head element if any, and before any text node or + # content element (typically ) if any. + # + # The result when trying to set an encoding that is different + # from the document encoding is undefined. + # + # Beware in CRuby, that libxml2 automatically inserts a meta tag + # into a head element. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:36 + def meta_encoding=(encoding); end + + # Serialize Node using +options+. Save options can also be set using a block. + # + # See also Nokogiri::XML::Node::SaveOptions and Node@Serialization+and+Generating+Output. + # + # These two statements are equivalent: + # + # node.serialize(:encoding => 'UTF-8', :save_with => FORMAT | AS_XML) + # + # or + # + # node.serialize(:encoding => 'UTF-8') do |config| + # config.format.as_xml + # end + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:142 + def serialize(options = T.unsafe(nil)); end + + # Get the title string of this document. Return nil if there is + # no title tag. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:70 + def title; end + + # Set the title string of this document. + # + # If a title element is already present, its content is replaced + # with the given text. + # + # Otherwise, this method tries to create one at an appropriate + # place supplying head and/or html elements as necessary, which + # is inside a head element if any, right after a meta + # encoding/charset tag if any, and before any text node or + # content element (typically ) if any. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:85 + def title=(text); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def type; end + + # :call-seq: + # xpath_doctype() → Nokogiri::CSS::XPathVisitor::DoctypeConfig + # + # [Returns] The document type which determines CSS-to-XPath translation. + # + # See XPathVisitor for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:159 + def xpath_doctype; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:60 + def meta_content_type; end + + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:103 + def set_metadata_element(element); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + + # :call-seq: + # parse(input) { |options| ... } => Nokogiri::HTML4::Document + # + # Parse \HTML4 input from a String or IO object, and return a new HTML4::Document. + # + # [Required Parameters] + # - +input+ (String | IO) The content to be parsed. + # + # [Optional Keyword Arguments] + # - +url:+ (String) The base URI for this document. + # + # document. When not provided, the encoding will be determined based on the document + # content. + # + # - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some + # behaviors during parsing. See ParseOptions for more information. The default value is + # +ParseOptions::DEFAULT_HTML+. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which + # can be configured before parsing. See Nokogiri::XML::ParseOptions for more information. + # + # [Returns] Nokogiri::HTML4::Document + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document.rb:189 + def parse(input, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def read_io(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def read_memory(_arg0, _arg1, _arg2, _arg3); end + end +end + +# 💡 This class is an alias for Nokogiri::HTML4::DocumentFragment as of v1.12.0. +# +# pkg:gem/nokogiri#lib/nokogiri/html4/document_fragment.rb:5 +class Nokogiri::HTML4::DocumentFragment < ::Nokogiri::XML::DocumentFragment + # :call-seq: + # new(document) { |options| ... } → HTML4::DocumentFragment + # new(document, input) { |options| ... } → HTML4::DocumentFragment + # new(document, input, context:, options:) { |options| ... } → HTML4::DocumentFragment + # + # Parse \HTML4 fragment input from a String, and return a new HTML4::DocumentFragment. + # + # 💡 It's recommended to use either HTML4::DocumentFragment.parse or XML::Node#parse rather + # than call this method directly. + # + # [Required Parameters] + # - +document+ (HTML4::Document) The parent document to associate the returned fragment with. + # + # [Optional Parameters] + # - +input+ (String) The content to be parsed. + # + # [Optional Keyword Arguments] + # - +context:+ (Nokogiri::XML::Node) The context node for the subtree created. See + # below for more information. + # + # - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some + # behaviors during parsing. See ParseOptions for more information. The default value is + # +ParseOptions::DEFAULT_HTML+. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which + # can be configured before parsing. See ParseOptions for more information. + # + # [Returns] HTML4::DocumentFragment + # + # === Context \Node + # + # If a context node is specified using +context:+, then the fragment will be created by + # calling XML::Node#parse on that node, so the parser will behave as if that Node is the + # parent of the fragment subtree. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document_fragment.rb:134 + def initialize(document, input = T.unsafe(nil), context_ = T.unsafe(nil), options_ = T.unsafe(nil), context: T.unsafe(nil), options: T.unsafe(nil)); end + + class << self + # :call-seq: + # parse(input) { |options| ... } → HTML4::DocumentFragment + # + # Parse \HTML4 fragment input from a String, and return a new HTML4::DocumentFragment. This + # method creates a new, empty HTML4::Document to contain the fragment. + # + # [Required Parameters] + # - +input+ (String | IO) The content to be parsed. + # + # [Optional Keyword Arguments] + # document. When not provided, the encoding will be determined based on the document + # content. + # + # - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some + # behaviors during parsing. See ParseOptions for more information. The default value is + # +ParseOptions::DEFAULT_HTML+. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which + # can be configured before parsing. See ParseOptions for more information. + # + # [Returns] HTML4::DocumentFragment + # + # *Example:* Parsing a string + # + # fragment = HTML4::DocumentFragment.parse("
    Hello World
    ") + # + # *Example:* Parsing an IO + # + # fragment = File.open("fragment.html") do |file| + # HTML4::DocumentFragment.parse(file) + # end + # + # *Example:* Specifying encoding + # + # + # *Example:* Setting parse options dynamically + # + # HTML4::DocumentFragment.parse("
    Hello World") do |options| + # options.huge.pedantic + # end + # + # pkg:gem/nokogiri#lib/nokogiri/html4/document_fragment.rb:52 + def parse(input, encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil), &block); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML4::ElementDescription + # Is this element a block element? + # + # pkg:gem/nokogiri#lib/nokogiri/html4/element_description.rb:8 + def block?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def default_sub_element; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def deprecated?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def deprecated_attributes; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def description; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def empty?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def implied_end_tag?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def implied_start_tag?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def inline?; end + + # Inspection information + # + # pkg:gem/nokogiri#lib/nokogiri/html4/element_description.rb:20 + def inspect; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def name; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def optional_attributes; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def required_attributes; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def save_end_tag?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def sub_elements; end + + # Convert this description to a string + # + # pkg:gem/nokogiri#lib/nokogiri/html4/element_description.rb:14 + def to_s; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:32 + def default_desc; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def [](_arg0); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:436 +Nokogiri::HTML4::ElementDescription::ACTION_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:423 +Nokogiri::HTML4::ElementDescription::ALIGN_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:239 +Nokogiri::HTML4::ElementDescription::ALT_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:246 +Nokogiri::HTML4::ElementDescription::APPLET_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:258 +Nokogiri::HTML4::ElementDescription::AREA_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:212 +Nokogiri::HTML4::ElementDescription::ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:221 +Nokogiri::HTML4::ElementDescription::A_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:268 +Nokogiri::HTML4::ElementDescription::BASEFONT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:546 +Nokogiri::HTML4::ElementDescription::BGCOLOR_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:171 +Nokogiri::HTML4::ElementDescription::BLOCK = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:437 +Nokogiri::HTML4::ElementDescription::BLOCKLI_ELT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:271 +Nokogiri::HTML4::ElementDescription::BODY_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:270 +Nokogiri::HTML4::ElementDescription::BODY_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:272 +Nokogiri::HTML4::ElementDescription::BODY_DEPR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:280 +Nokogiri::HTML4::ElementDescription::BUTTON_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:213 +Nokogiri::HTML4::ElementDescription::CELLHALIGN = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:214 +Nokogiri::HTML4::ElementDescription::CELLVALIGN = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:242 +Nokogiri::HTML4::ElementDescription::CLEAR_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:292 +Nokogiri::HTML4::ElementDescription::COL_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:293 +Nokogiri::HTML4::ElementDescription::COL_ELT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:297 +Nokogiri::HTML4::ElementDescription::COMPACT_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:295 +Nokogiri::HTML4::ElementDescription::COMPACT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:439 +Nokogiri::HTML4::ElementDescription::CONTENT_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:199 +Nokogiri::HTML4::ElementDescription::COREATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:218 +Nokogiri::HTML4::ElementDescription::CORE_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:217 +Nokogiri::HTML4::ElementDescription::CORE_I18N_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:549 +Nokogiri::HTML4::ElementDescription::DIR_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:296 +Nokogiri::HTML4::ElementDescription::DL_CONTENTS = T.let(T.unsafe(nil), Array) + +# This is filled in down below. +# +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:30 +Nokogiri::HTML4::ElementDescription::DefaultDescriptions = T.let(T.unsafe(nil), Hash) + +# Methods are defined protected by method_defined? because at +# this point the C-library or Java library is already loaded, +# and we don't want to clobber any methods that have been +# defined there. +# +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:11 +Nokogiri::HTML4::ElementDescription::Desc = Struct + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:294 +Nokogiri::HTML4::ElementDescription::EDIT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:377 +Nokogiri::HTML4::ElementDescription::EMBED_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:192 +Nokogiri::HTML4::ElementDescription::EMPTY = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:201 +Nokogiri::HTML4::ElementDescription::EVENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:299 +Nokogiri::HTML4::ElementDescription::FIELDSET_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:190 +Nokogiri::HTML4::ElementDescription::FLOW = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:245 +Nokogiri::HTML4::ElementDescription::FLOW_PARAM = T.let(T.unsafe(nil), Array) + +# Attributes defined and categorized +# +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:136 +Nokogiri::HTML4::ElementDescription::FONTSTYLE = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:300 +Nokogiri::HTML4::ElementDescription::FONT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:170 +Nokogiri::HTML4::ElementDescription::FORMCTRL = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:318 +Nokogiri::HTML4::ElementDescription::FORM_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:301 +Nokogiri::HTML4::ElementDescription::FORM_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:339 +Nokogiri::HTML4::ElementDescription::FRAMESET_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:340 +Nokogiri::HTML4::ElementDescription::FRAMESET_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:328 +Nokogiri::HTML4::ElementDescription::FRAME_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:168 +Nokogiri::HTML4::ElementDescription::HEADING = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:341 +Nokogiri::HTML4::ElementDescription::HEAD_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:342 +Nokogiri::HTML4::ElementDescription::HEAD_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:241 +Nokogiri::HTML4::ElementDescription::HREF_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:352 +Nokogiri::HTML4::ElementDescription::HR_DEPR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:216 +Nokogiri::HTML4::ElementDescription::HTML_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:197 +Nokogiri::HTML4::ElementDescription::HTML_CDATA = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:354 +Nokogiri::HTML4::ElementDescription::HTML_CONTENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:194 +Nokogiri::HTML4::ElementDescription::HTML_FLOW = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:195 +Nokogiri::HTML4::ElementDescription::HTML_INLINE = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:196 +Nokogiri::HTML4::ElementDescription::HTML_PCDATA = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:200 +Nokogiri::HTML4::ElementDescription::I18N = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:219 +Nokogiri::HTML4::ElementDescription::I18N_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:355 +Nokogiri::HTML4::ElementDescription::IFRAME_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:368 +Nokogiri::HTML4::ElementDescription::IMG_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:189 +Nokogiri::HTML4::ElementDescription::INLINE = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:243 +Nokogiri::HTML4::ElementDescription::INLINE_P = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:398 +Nokogiri::HTML4::ElementDescription::INPUT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:298 +Nokogiri::HTML4::ElementDescription::LABEL_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:421 +Nokogiri::HTML4::ElementDescription::LABEL_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:484 +Nokogiri::HTML4::ElementDescription::LANGUAGE_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:422 +Nokogiri::HTML4::ElementDescription::LEGEND_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:424 +Nokogiri::HTML4::ElementDescription::LINK_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:169 +Nokogiri::HTML4::ElementDescription::LIST = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:547 +Nokogiri::HTML4::ElementDescription::LI_ELT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:434 +Nokogiri::HTML4::ElementDescription::MAP_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:438 +Nokogiri::HTML4::ElementDescription::META_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:191 +Nokogiri::HTML4::ElementDescription::MODIFIER = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:435 +Nokogiri::HTML4::ElementDescription::NAME_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:441 +Nokogiri::HTML4::ElementDescription::NOFRAMES_CONTENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:443 +Nokogiri::HTML4::ElementDescription::OBJECT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:442 +Nokogiri::HTML4::ElementDescription::OBJECT_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:459 +Nokogiri::HTML4::ElementDescription::OBJECT_DEPR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:460 +Nokogiri::HTML4::ElementDescription::OL_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:462 +Nokogiri::HTML4::ElementDescription::OPTGROUP_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:463 +Nokogiri::HTML4::ElementDescription::OPTION_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:461 +Nokogiri::HTML4::ElementDescription::OPTION_ELT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:464 +Nokogiri::HTML4::ElementDescription::PARAM_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:167 +Nokogiri::HTML4::ElementDescription::PCDATA = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:137 +Nokogiri::HTML4::ElementDescription::PHRASE = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:466 +Nokogiri::HTML4::ElementDescription::PRE_CONTENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:420 +Nokogiri::HTML4::ElementDescription::PROMPT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:269 +Nokogiri::HTML4::ElementDescription::QUOTE_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:238 +Nokogiri::HTML4::ElementDescription::ROWS_COLS_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:483 +Nokogiri::HTML4::ElementDescription::SCRIPT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:486 +Nokogiri::HTML4::ElementDescription::SELECT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:485 +Nokogiri::HTML4::ElementDescription::SELECT_CONTENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:149 +Nokogiri::HTML4::ElementDescription::SPECIAL = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:240 +Nokogiri::HTML4::ElementDescription::SRC_ALT_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:497 +Nokogiri::HTML4::ElementDescription::STYLE_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:498 +Nokogiri::HTML4::ElementDescription::TABLE_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:510 +Nokogiri::HTML4::ElementDescription::TABLE_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:509 +Nokogiri::HTML4::ElementDescription::TABLE_DEPR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:520 +Nokogiri::HTML4::ElementDescription::TALIGN_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:237 +Nokogiri::HTML4::ElementDescription::TARGET_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:533 +Nokogiri::HTML4::ElementDescription::TEXTAREA_ATTRS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:522 +Nokogiri::HTML4::ElementDescription::TH_TD_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:521 +Nokogiri::HTML4::ElementDescription::TH_TD_DEPR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:545 +Nokogiri::HTML4::ElementDescription::TR_CONTENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:519 +Nokogiri::HTML4::ElementDescription::TR_ELT = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:440 +Nokogiri::HTML4::ElementDescription::TYPE_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:548 +Nokogiri::HTML4::ElementDescription::UL_DEPR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:353 +Nokogiri::HTML4::ElementDescription::VERSION_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/element_description_defaults.rb:465 +Nokogiri::HTML4::ElementDescription::WIDTH_ATTR = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:14 +class Nokogiri::HTML4::EncodingReader + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:82 + def initialize(io); end + + # This method is used by the C extension so that + # Nokogiri::HTML4::Document#read_io() does not leak memory when + # EncodingFound is raised. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:91 + def encoding_found; end + + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:93 + def read(len); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:59 + def detect_encoding(chunk); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:15 +class Nokogiri::HTML4::EncodingReader::EncodingFound < ::StandardError + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:18 + def initialize(encoding); end + + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:16 + def found_encoding; end +end + +# pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:46 +class Nokogiri::HTML4::EncodingReader::JumpSAXHandler < ::Nokogiri::HTML4::EncodingReader::SAXHandler + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:47 + def initialize(jumptag); end + + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:52 + def start_element(name, attrs = T.unsafe(nil)); end +end + +# pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:24 +class Nokogiri::HTML4::EncodingReader::SAXHandler < ::Nokogiri::XML::SAX::Document + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:27 + def initialize; end + + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:25 + def encoding; end + + # pkg:gem/nokogiri#lib/nokogiri/html4/encoding_reader.rb:32 + def start_element(name, attrs = T.unsafe(nil)); end +end + +# pkg:gem/nokogiri#lib/nokogiri/html4/entity_lookup.rb:5 +class Nokogiri::HTML4::EntityDescription < ::Struct; end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML4::EntityLookup + # Look up entity with +name+ + # + # pkg:gem/nokogiri#lib/nokogiri/html4/entity_lookup.rb:10 + def [](name); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def get(_arg0); end +end + +# Instance of Nokogiri::HTML4::EntityLookup +# +# pkg:gem/nokogiri#lib/nokogiri/html4.rb:30 +Nokogiri::HTML4::NamedCharacters = T.let(T.unsafe(nil), Nokogiri::HTML4::EntityLookup) + +# Nokogiri provides a SAX parser to process HTML4 which will provide HTML recovery +# ("autocorrection") features. +# +# See Nokogiri::HTML4::SAX::Parser for a basic example of using a SAX parser with HTML. +# +# For more information on SAX parsers, see Nokogiri::XML::SAX +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::HTML4::SAX; end + +# This parser is a SAX style parser that reads its input as it deems necessary. The parser +# takes a Nokogiri::XML::SAX::Document, an optional encoding, then given an HTML input, sends +# messages to the Nokogiri::XML::SAX::Document. +# +# ⚠ This is an HTML4 parser and so may not support some HTML5 features and behaviors. +# +# Here is a basic usage example: +# +# class MyHandler < Nokogiri::XML::SAX::Document +# def start_element name, attributes = [] +# puts "found a #{name}" +# end +# end +# +# parser = Nokogiri::HTML4::SAX::Parser.new(MyHandler.new) +# +# # Hand an IO object to the parser, which will read the HTML from the IO. +# File.open(path_to_html) do |f| +# parser.parse(f) +# end +# +# For more information on \SAX parsers, see Nokogiri::XML::SAX or the parent class +# Nokogiri::XML::SAX::Parser. +# +# Also see Nokogiri::XML::SAX::Document for the available events. +# +# 💡 This class is an alias for Nokogiri::HTML4::SAX::Parser as of v1.12.0. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML4::SAX::Parser < ::Nokogiri::XML::SAX::Parser + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_native; end +end + +# Context object to invoke the HTML4 SAX parser on the SAX::Document handler. +# +# 💡 This class is usually not instantiated by the user. Use Nokogiri::HTML4::SAX::Parser +# instead. +# 💡 This class is an alias for Nokogiri::HTML4::SAX::ParserContext as of v1.12.0. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML4::SAX::ParserContext < ::Nokogiri::XML::SAX::ParserContext + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def parse_with(_arg0); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_file(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_memory(_arg0, _arg1); end + end +end + +# 💡 This class is an alias for Nokogiri::HTML4::SAX::PushParser as of v1.12.0. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML4::SAX::PushParser < ::Nokogiri::XML::SAX::PushParser + # pkg:gem/nokogiri#lib/nokogiri/html4/sax/push_parser.rb:11 + def initialize(doc = T.unsafe(nil), file_name = T.unsafe(nil), encoding = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/html4/sax/push_parser.rb:26 + def <<(chunk, last_chunk = T.unsafe(nil)); end + + # The Nokogiri::HTML4::SAX::Document on which the PushParser will be + # operating + # + # pkg:gem/nokogiri#lib/nokogiri/html4/sax/push_parser.rb:9 + def document; end + + # The Nokogiri::HTML4::SAX::Document on which the PushParser will be + # operating + # + # pkg:gem/nokogiri#lib/nokogiri/html4/sax/push_parser.rb:9 + def document=(_arg0); end + + # Finish the parsing. This method is only necessary for + # Nokogiri::HTML4::SAX::Document#end_document to be called. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/sax/push_parser.rb:31 + def finish; end + + # Write a +chunk+ of HTML to the PushParser. Any callback methods + # that can be called will be called immediately. + # + # pkg:gem/nokogiri#lib/nokogiri/html4/sax/push_parser.rb:23 + def write(chunk, last_chunk = T.unsafe(nil)); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_native(_arg0, _arg1, _arg2); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_write(_arg0, _arg1); end +end + +# == Usage +# +# Parse an HTML5 document: +# +# doc = Nokogiri.HTML5(input) +# +# Parse an HTML5 fragment: +# +# fragment = Nokogiri::HTML5.fragment(input) +# +# ⚠ HTML5 functionality is not available when running JRuby. +# +# == Parsing options +# +# The document and fragment parsing methods support options that are different from +# Nokogiri::HTML4::Document or Nokogiri::XML::Document. +# +# +# The four currently supported parse options are +# +# - +max_errors:+ (Integer, default 0) Maximum number of parse errors to report in HTML5::Document#errors. +# - +max_tree_depth:+ (Integer, default +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) Maximum tree depth to parse. +# - +max_attributes:+ (Integer, default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) Maximum number of attributes to parse per element. +# - +parse_noscript_content_as_text:+ (Boolean, default false) When enabled, parse +noscript+ tag content as text, mimicking the behavior of web browsers. +# +# These options are explained in the following sections. +# +# === Error reporting: +max_errors:+ +# +# Nokogiri contains an experimental HTML5 parse error reporting facility. By default, no parse +# errors are reported but this can be configured by passing the +:max_errors+ option to +# HTML5.parse or HTML5.fragment. +# +# For example, this script: +# +# doc = Nokogiri::HTML5.parse('Hi there!', max_errors: 10) +# doc.errors.each do |err| +# puts(err) +# end +# +# Emits: +# +# 1:1: ERROR: Expected a doctype token +# Hi there! +# ^ +# 1:1: ERROR: Start tag of nonvoid HTML element ends with '/>', use '>'. +# Hi there! +# ^ +# 1:17: ERROR: End tag ends with '/>', use '>'. +# Hi there! +# ^ +# 1:17: ERROR: End tag contains attributes. +# Hi there! +# ^ +# +# Using max_errors: -1 results in an unlimited number of errors being returned. +# +# The errors returned by HTML5::Document#errors are instances of Nokogiri::XML::SyntaxError. +# +# The {HTML standard}[https://html.spec.whatwg.org/multipage/parsing.html#parse-errors] defines a +# number of standard parse error codes. These error codes only cover the "tokenization" stage of +# parsing HTML. The parse errors in the "tree construction" stage do not have standardized error +# codes (yet). +# +# As a convenience to Nokogiri users, the defined error codes are available +# via Nokogiri::XML::SyntaxError#str1 method. +# +# doc = Nokogiri::HTML5.parse('Hi there!', max_errors: 10) +# doc.errors.each do |err| +# puts("#{err.line}:#{err.column}: #{err.str1}") +# end +# doc = Nokogiri::HTML5.parse('Hi there!', +# # => 1:1: generic-parser +# # 1:1: non-void-html-element-start-tag-with-trailing-solidus +# # 1:17: end-tag-with-trailing-solidus +# # 1:17: end-tag-with-attributes +# +# Note that the first error is +generic-parser+ because it's an error from the tree construction +# stage and doesn't have a standardized error code. +# +# For the purposes of semantic versioning, the error messages, error locations, and error codes +# are not part of Nokogiri's public API. That is, these are subject to change without Nokogiri's +# major version number changing. These may be stabilized in the future. +# +# === Maximum tree depth: +max_tree_depth:+ +# +# The maximum depth of the DOM tree parsed by the various parsing methods is configurable by the +# +:max_tree_depth+ option. If the depth of the tree would exceed this limit, then an +# +ArgumentError+ is thrown. +# +# This limit (which defaults to +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) can be removed by +# giving the option max_tree_depth: -1. +# +# html = '' + '
    ' * 1000 +# doc = Nokogiri.HTML5(html) +# # raises ArgumentError: Document tree depth limit exceeded +# doc = Nokogiri.HTML5(html, max_tree_depth: -1) +# +# === Attribute limit per element: +max_attributes:+ +# +# The maximum number of attributes per DOM element is configurable by the +:max_attributes+ +# option. If a given element would exceed this limit, then an +ArgumentError+ is thrown. +# +# This limit (which defaults to +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) can be removed by +# giving the option max_attributes: -1. +# +# html = '
    ' +# # "
    " +# doc = Nokogiri.HTML5(html) +# # raises ArgumentError: Attributes per element limit exceeded +# +# doc = Nokogiri.HTML5(html, max_attributes: -1) +# # parses successfully +# +# === Parse +noscript+ elements' content as text: +parse_noscript_content_as_text:+ +# +# By default, the content of +noscript+ elements is parsed as HTML elements. Browsers that +# support scripting parse the content of +noscript+ elements as raw text. +# +# The +:parse_noscript_content_as_text+ option causes Nokogiri to parse the content of +noscript+ +# elements as a single text node. +# +# html = "" +# doc = Nokogiri::HTML5.parse(html, parse_noscript_content_as_text: true) +# pp doc.at_xpath("/html/head/noscript") +# # => #(Element:0x878c { +# # name = "noscript", +# # children = [ #(Text "")] +# # }) +# +# In contrast, parse_noscript_content_as_text: false (the default) causes the +noscript+ +# element in the previous example to have two children, a +meta+ element and a +link+ element. +# +# doc = Nokogiri::HTML5.parse(html) +# puts doc.at_xpath("/html/head/noscript") +# # => #(Element:0x96b4 { +# # name = "noscript", +# # children = [ +# # #(Element:0x97e0 { name = "meta", attribute_nodes = [ #(Attr:0x990c { name = "charset", value = "UTF-8" })] }), +# # #(Element:0x9b00 { +# # name = "link", +# # attribute_nodes = [ +# # #(Attr:0x9c2c { name = "rel", value = "stylesheet" }), +# # #(Attr:0x9dd0 { name = "href", value = "!" })] +# # })] +# # }) +# +# == HTML Serialization +# +# After parsing HTML, it may be serialized using any of the Nokogiri::XML::Node serialization +# methods. In particular, XML::Node#serialize, XML::Node#to_html, and XML::Node#to_s will +# serialize a given node and its children. (This is the equivalent of JavaScript's +# +Element.outerHTML+.) Similarly, XML::Node#inner_html will serialize the children of a given +# node. (This is the equivalent of JavaScript's +Element.innerHTML+.) +# +# doc = Nokogiri::HTML5("Hello world!") +# puts doc.serialize +# # => Hello world! +# +# Due to quirks in how HTML is parsed and serialized, it's possible for a DOM tree to be +# serialized and then re-parsed, resulting in a different DOM. Mostly, this happens with DOMs +# produced from invalid HTML. Unfortunately, even valid HTML may not survive serialization and +# re-parsing. +# +# In particular, a newline at the start of +pre+, +listing+, and +textarea+ +# elements is ignored by the parser. +# +# doc = Nokogiri::HTML5(<<-EOF) +# +#
    +#   Content
    +# EOF +# puts doc.at('/html/body/pre').serialize +# # =>
    Content
    +# +# In this case, the original HTML is semantically equivalent to the serialized version. If the +# +pre+, +listing+, or +textarea+ content starts with two newlines, the first newline will be +# stripped on the first parse and the second newline will be stripped on the second, leading to +# semantically different DOMs. Passing the parameter preserve_newline: true will cause +# two or more newlines to be preserved. (A single leading newline will still be removed.) +# +# doc = Nokogiri::HTML5(<<-EOF) +# +# +# +# Content +# EOF +# puts doc.at('/html/body/listing').serialize(preserve_newline: true) +# # => +# # +# # Content +# +# == Encodings +# +# Nokogiri always parses HTML5 using {UTF-8}[https://en.wikipedia.org/wiki/UTF-8]; however, the +# encoding of the input can be explicitly selected via the optional +encoding+ parameter. This is +# most useful when the input comes not from a string but from an IO object. +# +# When serializing a document or node, the encoding of the output string can be specified via the +# +:encoding+ options. Characters that cannot be encoded in the selected encoding will be encoded +# as {HTML numeric +# entities}[https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references]. +# +# frag = Nokogiri::HTML5.fragment('아는 길도 물어가라') +# puts html +# # => 아는 길도 물어가라 +# +# frag = Nokogiri::HTML5.fragment(html) +# puts frag.serialize +# # => 아는 길도 물어가라 +# +# (There's a {bug}[https://bugs.ruby-lang.org/issues/15033] in all current versions of Ruby that +# can cause the entity encoding to fail. Of the mandated supported encodings for HTML, the only +# encoding I'm aware of that has this bug is 'ISO-2022-JP'. We recommend avoiding this +# encoding.) +# +# == Notes +# +# * The Nokogiri::HTML5.fragment function takes a String or IO and parses it as a HTML5 document +# in a +body+ context. As a result, the +html+, +head+, and +body+ elements are removed from +# this document, and any children of these elements that remain are returned as a +# Nokogiri::HTML5::DocumentFragment; but you can pass in a different context (e.g., "html" to +# get +head+ and +body+ tags in the result). +# +# * The Nokogiri::HTML5.parse function takes a String or IO and passes it to the +# gumbo_parse_with_options method, using the default options. The resulting Gumbo +# parse tree is then walked. +# +# * Instead of uppercase element names, lowercase element names are produced. +# +# * Instead of returning +unknown+ as the element name for unknown tags, the original tag name is +# returned verbatim. +# +# Since v1.12.0 +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::HTML5 + class << self + # Convenience method for Nokogiri::HTML5::DocumentFragment.parse + # + # pkg:gem/nokogiri#lib/nokogiri/html5.rb:280 + def fragment(*, **, &); end + + # Convenience method for Nokogiri::HTML5::Document.parse + # + # pkg:gem/nokogiri#lib/nokogiri/html5.rb:275 + def parse(*, **, &); end + + # pkg:gem/nokogiri#lib/nokogiri/html5.rb:285 + def read_and_encode(string, encoding); end + + private + + # Charset sniffing is a complex and controversial topic that understandably isn't done _by + # default_ by the Ruby Net::HTTP library. This being said, it is a very real problem for + # consumers of HTML as the default for HTML is iso-8859-1, most "good" producers use utf-8, and + # the Gumbo parser *only* supports utf-8. + # + # Accordingly, Nokogiri::HTML4::Document.parse provides limited encoding detection. Following + # this lead, Nokogiri::HTML5 attempts to do likewise, while attempting to more closely follow + # the HTML5 standard. + # + # http://bugs.ruby-lang.org/issues/2567 + # http://www.w3.org/TR/html5/syntax.html#determining-the-character-encoding + # + # pkg:gem/nokogiri#lib/nokogiri/html5.rb:323 + def reencode(body, content_type = T.unsafe(nil)); end + end +end + +# Nokogiri HTML5 builder is used for building HTML documents. It is very similar to the +# Nokogiri::XML::Builder. In fact, you should go read the documentation for +# Nokogiri::XML::Builder before reading this documentation. +# +# The construction behavior is identical to HTML4::Builder, but HTML5 documents implement the +# [HTML5 standard's serialization +# algorithm](https://www.w3.org/TR/2008/WD-html5-20080610/serializing.html). +# +# == Synopsis: +# +# Create an HTML5 document with a body that has an onload attribute, and a +# span tag with a class of "bold" that has content of "Hello world". +# +# builder = Nokogiri::HTML5::Builder.new do |doc| +# doc.html { +# doc.body(:onload => 'some_func();') { +# doc.span.bold { +# doc.text "Hello world" +# } +# } +# } +# end +# puts builder.to_html +# +# The HTML5 builder inherits from the XML builder, so make sure to read the +# Nokogiri::XML::Builder documentation. +# +# pkg:gem/nokogiri#lib/nokogiri/html5/builder.rb:32 +class Nokogiri::HTML5::Builder < ::Nokogiri::XML::Builder + # Convert the builder to HTML + # + # pkg:gem/nokogiri#lib/nokogiri/html5/builder.rb:35 + def to_html; end +end + +# Since v1.12.0 +# +# 💡 HTML5 functionality is not available when running JRuby. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:159 + def initialize(*args); end + + # :call-seq: + # fragment() → Nokogiri::HTML5::DocumentFragment + # fragment(markup) → Nokogiri::HTML5::DocumentFragment + # + # Parse a HTML5 document fragment from +markup+, returning a Nokogiri::HTML5::DocumentFragment. + # + # [Properties] + # - +markup+ (String) The HTML5 markup fragment to be parsed + # + # [Returns] + # Nokogiri::HTML5::DocumentFragment. This object's children will be empty if +markup+ is not + # passed, is empty, or is +nil+. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:178 + def fragment(markup = T.unsafe(nil)); end + + # Get the parser's quirks mode value. See HTML5::QuirksMode. + # + # This method returns +nil+ if the parser was not invoked (e.g., Nokogiri::HTML5::Document.new). + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:49 + def quirks_mode; end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:182 + def to_xml(options = T.unsafe(nil), &block); end + + # Get the url name for this document, as passed into Document.parse, Document.read_io, or + # Document.read_memory + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:42 + def url; end + + # :call-seq: + # xpath_doctype() → Nokogiri::CSS::XPathVisitor::DoctypeConfig + # + # [Returns] The document type which determines CSS-to-XPath translation. + # + # See CSS::XPathVisitor for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:194 + def xpath_doctype; end + + class << self + # :call-seq: + # parse(input) { |options| ... } → HTML5::Document + # parse(input, **options) → HTML5::Document + # + # Parse \HTML input with a parser compliant with the HTML5 spec. This method uses the + # parameter. + # + # [Required Parameters] + # - +input+ (String | IO) the \HTML content to be parsed. + # + # [Optional Parameters] + # - +url:+ (String) the base URI of the document. + # + # [Optional Keyword Arguments] + # document. When not provided, the encoding will be determined based on the document + # content. + # + # - +max_errors:+ (Integer) The maximum number of parse errors to record. (default + # +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS+ which is currently 0) + # + # - +max_tree_depth:+ (Integer) The maximum depth of the parse tree. (default + # +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) + # + # - +max_attributes:+ (Integer) The maximum number of attributes allowed on an + # element. (default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) + # + # - +parse_noscript_content_as_text:+ (Boolean) Whether to parse the content of +noscript+ + # elements as text. (default +false+) + # + # See rdoc-ref:HTML5@Parsing+options for a complete description of these parsing options. + # + # [Yields] + # If present, the block will be passed a Hash object to modify with parse options before the + # input is parsed. See rdoc-ref:HTML5@Parsing+options for a list of available options. + # + # + # [Returns] Nokogiri::HTML5::Document + # + # *Example:* Parse a string with a specific encoding and custom max errors limit. + # + # + # *Example:* Parse a string setting the +:parse_noscript_content_as_text+ option using the + # configuration block parameter. + # + # Nokogiri::HTML5::Document.parse(input) { |c| c[:parse_noscript_content_as_text] = true } + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:103 + def parse(string_or_io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), **options, &block); end + + # Create a new document from an IO object. + # + # 💡 Most users should prefer Document.parse to this method. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:129 + def read_io(io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), **options); end + + # Create a new document from a String. + # + # 💡 Most users should prefer Document.parse to this method. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:138 + def read_memory(string, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), **options); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:146 + def do_parse(string_or_io, url, encoding, **options); end + end +end + +# Since v1.12.0 +# +# 💡 HTML5 functionality is not available when running JRuby. +# +# pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:27 +class Nokogiri::HTML5::DocumentFragment < ::Nokogiri::HTML4::DocumentFragment + # :call-seq: + # new(document, input, **options) → HTML5::DocumentFragment + # + # Parse \HTML5 fragment input from a String, and return a new HTML5::DocumentFragment. + # + # 💡 It's recommended to use either HTML5::DocumentFragment.parse or HTML5::Node#fragment + # rather than call this method directly. + # + # [Required Parameters] + # - +document+ (HTML5::Document) The parent document to associate the returned fragment with. + # + # [Optional Parameters] + # - +input+ (String) The content to be parsed. + # + # [Optional Keyword Arguments] + # used when processing the document. When not provided, the encoding will be determined + # based on the document content. Also see Nokogiri::HTML5 for a longer explanation of how + # encoding is handled by the parser. + # + # - +context:+ (String | Nokogiri::XML::Node) The node, or the name of an HTML5 element, in + # which to parse the document fragment. (default +"body"+) + # + # - +max_errors:+ (Integer) The maximum number of parse errors to record. (default + # +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS+ which is currently 0) + # + # - +max_tree_depth:+ (Integer) The maximum depth of the parse tree. (default + # +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) + # + # - +max_attributes:+ (Integer) The maximum number of attributes allowed on an + # element. (default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) + # + # - +parse_noscript_content_as_text:+ (Boolean) Whether to parse the content of +noscript+ + # elements as text. (default +false+) + # + # See rdoc-ref:HTML5@Parsing+options for a complete description of these parsing options. + # + # [Returns] HTML5::DocumentFragment + # + # === Context \Node + # + # If a context node is specified using +context:+, then the parser will behave as if that + # Node, or a hypothetical tag named as specified, is the parent of the fragment subtree. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:144 + def initialize(doc, input = T.unsafe(nil), context_ = T.unsafe(nil), positional_options_hash = T.unsafe(nil), context: T.unsafe(nil), **options); end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:88 + def document; end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:88 + def document=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:89 + def errors; end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:89 + def errors=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:175 + def extract_params(params); end + + # Get the parser's quirks mode value. See HTML5::QuirksMode. + # + # This method returns `nil` if the parser was not invoked (e.g., + # `Nokogiri::HTML5::DocumentFragment.new(doc)`). + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:97 + def quirks_mode; end + + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:169 + def serialize(options = T.unsafe(nil), &block); end + + class << self + # :call-seq: + # parse(input, **options) → HTML5::DocumentFragment + # + # Parse \HTML5 fragment input from a String, and return a new HTML5::DocumentFragment. This + # method creates a new, empty HTML5::Document to contain the fragment. + # + # [Parameters] + # - +input+ (String | IO) The HTML5 document fragment to parse. + # + # [Optional Keyword Arguments] + # used when processing the document. When not provided, the encoding will be determined + # based on the document content. Also see Nokogiri::HTML5 for a longer explanation of how + # encoding is handled by the parser. + # + # - +context:+ (String | Nokogiri::XML::Node) The node, or the name of an HTML5 element, "in + # context" of which to parse the document fragment. See below for more + # information. (default +"body"+) + # + # - +max_errors:+ (Integer) The maximum number of parse errors to record. (default + # +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS+ which is currently 0) + # + # - +max_tree_depth:+ (Integer) The maximum depth of the parse tree. (default + # +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) + # + # - +max_attributes:+ (Integer) The maximum number of attributes allowed on an + # element. (default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) + # + # - +parse_noscript_content_as_text:+ (Boolean) Whether to parse the content of +noscript+ + # elements as text. (default +false+) + # + # See rdoc-ref:HTML5@Parsing+options for a complete description of these parsing options. + # + # [Returns] Nokogiri::HTML5::DocumentFragment + # + # === Context \Node + # + # If a context node is specified using +context:+, then the parser will behave as if that + # Node, or a hypothetical tag named as specified, is the parent of the fragment subtree. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/document_fragment.rb:69 + def parse(input, encoding_ = T.unsafe(nil), positional_options_hash = T.unsafe(nil), encoding: T.unsafe(nil), **options); end + end +end + +# Since v1.12.0 +# +# 💡 HTML5 functionality is not available when running JRuby. +# +# pkg:gem/nokogiri#lib/nokogiri/html5/node.rb:30 +module Nokogiri::HTML5::Node + # pkg:gem/nokogiri#lib/nokogiri/html5/node.rb:70 + def fragment(tags); end + + # pkg:gem/nokogiri#lib/nokogiri/html5/node.rb:31 + def inner_html(options = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/html5/node.rb:39 + def write_to(io, *options); end + + private + + # HTML elements can have attributes that contain colons. + # Nokogiri::XML::Node#[]= treats names with colons as a prefixed QName + # and tries to create an attribute in a namespace. This is especially + # annoying with attribute names like xml:lang since libxml2 will + # actually create the xml namespace if it doesn't exist already. + # + # pkg:gem/nokogiri#lib/nokogiri/html5/node.rb:83 + def add_child_node_and_reparent_attrs(node); end +end + +# Enum for the HTML5 parser quirks mode values. Values returned by HTML5::Document#quirks_mode +# +# See https://dom.spec.whatwg.org/#concept-document-quirks for more information on HTML5 quirks +# mode. +# +# Since v1.14.0 +# +# pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:30 +module Nokogiri::HTML5::QuirksMode; end + +# The document was parsed in "quirks" mode +# +# pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:33 +Nokogiri::HTML5::QuirksMode::LIMITED_QUIRKS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:31 +Nokogiri::HTML5::QuirksMode::NO_QUIRKS = T.let(T.unsafe(nil), Integer) + +# The document was parsed in "no-quirks" mode +# +# pkg:gem/nokogiri#lib/nokogiri/html5/document.rb:32 +Nokogiri::HTML5::QuirksMode::QUIRKS = T.let(T.unsafe(nil), Integer) + +Nokogiri::LIBXML2_PATCHES = T.let(T.unsafe(nil), Array) +Nokogiri::LIBXML_COMPILED_VERSION = T.let(T.unsafe(nil), String) +Nokogiri::LIBXML_HTTP_ENABLED = T.let(T.unsafe(nil), TrueClass) +Nokogiri::LIBXML_ICONV_ENABLED = T.let(T.unsafe(nil), TrueClass) +Nokogiri::LIBXML_LOADED_VERSION = T.let(T.unsafe(nil), String) +Nokogiri::LIBXML_MEMORY_MANAGEMENT = T.let(T.unsafe(nil), String) +Nokogiri::LIBXML_ZLIB_ENABLED = T.let(T.unsafe(nil), TrueClass) +Nokogiri::LIBXSLT_COMPILED_VERSION = T.let(T.unsafe(nil), String) +Nokogiri::LIBXSLT_DATETIME_ENABLED = T.let(T.unsafe(nil), TrueClass) +Nokogiri::LIBXSLT_LOADED_VERSION = T.let(T.unsafe(nil), String) +Nokogiri::LIBXSLT_PATCHES = T.let(T.unsafe(nil), Array) +Nokogiri::OTHER_LIBRARY_VERSIONS = T.let(T.unsafe(nil), String) +Nokogiri::PACKAGED_LIBRARIES = T.let(T.unsafe(nil), TrueClass) +Nokogiri::PRECOMPILED_LIBRARIES = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::SyntaxError < ::StandardError; end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::Test + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def __foreign_error_handler; end + end +end + +# The version of Nokogiri you are using +# +# pkg:gem/nokogiri#lib/nokogiri/version/constant.rb:5 +Nokogiri::VERSION = T.let(T.unsafe(nil), String) + +# Detailed version info about Nokogiri and the installed extension dependencies. +# +# pkg:gem/nokogiri#lib/nokogiri/version/info.rb:233 +Nokogiri::VERSION_INFO = T.let(T.unsafe(nil), Hash) + +# pkg:gem/nokogiri#lib/nokogiri/version/info.rb:7 +class Nokogiri::VersionInfo + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:33 + def compiled_libxml_version; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:44 + def compiled_libxslt_version; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:22 + def engine; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:10 + def jruby?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:48 + def libxml2?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:60 + def libxml2_has_http?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:52 + def libxml2_has_iconv?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:56 + def libxml2_has_zlib?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:76 + def libxml2_precompiled?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:68 + def libxml2_using_packaged?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:72 + def libxml2_using_system?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:64 + def libxslt_has_datetime?; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:26 + def loaded_libxml_version; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:37 + def loaded_libxslt_version; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:18 + def ruby_minor; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:96 + def to_hash; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:191 + def to_markdown; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:80 + def warnings; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:14 + def windows?; end + + class << self + private + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:8 + def allocate; end + + # pkg:gem/nokogiri#lib/nokogiri/version/info.rb:8 + def new(*_arg0); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::XML + class << self + # Convenience method for Nokogiri::XML::Reader.new + # + # pkg:gem/nokogiri#lib/nokogiri/xml.rb:21 + def Reader(*, **, &); end + + # :call-seq: + # RelaxNG(input) → Nokogiri::XML::RelaxNG + # RelaxNG(input, options:) → Nokogiri::XML::RelaxNG + # + # Convenience method for Nokogiri::XML::RelaxNG.new + # + # pkg:gem/nokogiri#lib/nokogiri/xml/relax_ng.rb:11 + def RelaxNG(*, **, &); end + + # :call-seq: + # Schema(input) → Nokogiri::XML::Schema + # Schema(input, parse_options) → Nokogiri::XML::Schema + # + # Convenience method for Nokogiri::XML::Schema.new + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:11 + def Schema(*, **, &); end + + # Convenience method for Nokogiri::XML::DocumentFragment.parse + # + # pkg:gem/nokogiri#lib/nokogiri/xml.rb:31 + def fragment(*, **, &); end + + # Convenience method for Nokogiri::XML::Document.parse + # + # pkg:gem/nokogiri#lib/nokogiri/xml.rb:26 + def parse(*, **, &); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Attr < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/xml/attr.rb:9 + def content=(_arg0); end + + # :call-seq: deconstruct_keys(array_of_names) → Hash + # + # Returns a hash describing the Attr, to use in pattern matching. + # + # Valid keys and their values: + # - +name+ → (String) The name of the attribute. + # - +value+ → (String) The value of the attribute. + # - +namespace+ → (Namespace, nil) The Namespace of the attribute, or +nil+ if there is no namespace. + # + # *Example* + # + # doc = Nokogiri::XML.parse(<<~XML) + # + # + # + # + # XML + # + # attributes = doc.root.elements.first.attribute_nodes + # # => [#(Attr:0x35c { name = "foo", value = "abc" }), + # # #(Attr:0x370 { + # # name = "bar", + # # namespace = #(Namespace:0x384 { + # # prefix = "noko", + # # href = "http://nokogiri.org/ns/noko" + # # }), + # # value = "def" + # # })] + # + # attributes.first.deconstruct_keys([:name, :value, :namespace]) + # # => {:name=>"foo", :value=>"abc", :namespace=>nil} + # + # attributes.last.deconstruct_keys([:name, :value, :namespace]) + # # => {:name=>"bar", + # # :value=>"def", + # # :namespace=> + # # #(Namespace:0x384 { + # # prefix = "noko", + # # href = "http://nokogiri.org/ns/noko" + # # })} + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/attr.rb:55 + def deconstruct_keys(keys); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/attr.rb:8 + def to_s; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/attr.rb:7 + def value; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def value=(_arg0); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/attr.rb:61 + def inspect_attributes; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# Represents an attribute declaration in a DTD +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::AttributeDecl < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute_type; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def default; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def enumeration; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/attribute_decl.rb:17 + def inspect_attributes; end +end + +# Nokogiri builder can be used for building XML and HTML documents. +# +# == Synopsis: +# +# builder = Nokogiri::XML::Builder.new do |xml| +# xml.root { +# xml.products { +# xml.widget { +# xml.id_ "10" +# xml.name "Awesome widget" +# } +# } +# } +# end +# puts builder.to_xml +# +# Will output: +# +# +# +# +# +# 10 +# Awesome widget +# +# +# +# +# +# === Builder scope +# +# The builder allows two forms. When the builder is supplied with a block +# that has a parameter, the outside scope is maintained. This means you +# can access variables that are outside your builder. If you don't need +# outside scope, you can use the builder without the "xml" prefix like +# this: +# +# builder = Nokogiri::XML::Builder.new do +# root { +# products { +# widget { +# id_ "10" +# name "Awesome widget" +# } +# } +# } +# end +# +# == Special Tags +# +# The builder works by taking advantage of method_missing. Unfortunately +# some methods are defined in ruby that are difficult or dangerous to +# remove. You may want to create tags with the name "type", "class", and +# "id" for example. In that case, you can use an underscore to +# disambiguate your tag name from the method call. +# +# Here is an example of using the underscore to disambiguate tag names from +# ruby methods: +# +# @objects = [Object.new, Object.new, Object.new] +# +# builder = Nokogiri::XML::Builder.new do |xml| +# xml.root { +# xml.objects { +# @objects.each do |o| +# xml.object { +# xml.type_ o.type +# xml.class_ o.class.name +# xml.id_ o.id +# } +# end +# } +# } +# end +# puts builder.to_xml +# +# The underscore may be used with any tag name, and the last underscore +# will just be removed. This code will output the following XML: +# +# +# +# +# +# Object +# Object +# 48390 +# +# +# Object +# Object +# 48380 +# +# +# Object +# Object +# 48370 +# +# +# +# +# == Tag Attributes +# +# Tag attributes may be supplied as method arguments. Here is our +# previous example, but using attributes rather than tags: +# +# @objects = [Object.new, Object.new, Object.new] +# +# builder = Nokogiri::XML::Builder.new do |xml| +# xml.root { +# xml.objects { +# @objects.each do |o| +# xml.object(:type => o.type, :class => o.class, :id => o.id) +# end +# } +# } +# end +# puts builder.to_xml +# +# === Tag Attribute Short Cuts +# +# A couple attribute short cuts are available when building tags. The +# short cuts are available by special method calls when building a tag. +# +# This example builds an "object" tag with the class attribute "classy" +# and the id of "thing": +# +# builder = Nokogiri::XML::Builder.new do |xml| +# xml.root { +# xml.objects { +# xml.object.classy.thing! +# } +# } +# end +# puts builder.to_xml +# +# Which will output: +# +# +# +# +# +# +# +# +# All other options are still supported with this syntax, including +# blocks and extra tag attributes. +# +# == Namespaces +# +# Namespaces are added similarly to attributes. Nokogiri::XML::Builder +# assumes that when an attribute starts with "xmlns", it is meant to be +# a namespace: +# +# builder = Nokogiri::XML::Builder.new { |xml| +# xml.root('xmlns' => 'default', 'xmlns:foo' => 'bar') do +# xml.tenderlove +# end +# } +# puts builder.to_xml +# +# Will output XML like this: +# +# +# +# +# +# +# === Referencing declared namespaces +# +# Tags that reference non-default namespaces (i.e. a tag "foo:bar") can be +# built by using the Nokogiri::XML::Builder#[] method. +# +# For example: +# +# builder = Nokogiri::XML::Builder.new do |xml| +# xml.root('xmlns:foo' => 'bar') { +# xml.objects { +# xml['foo'].object.classy.thing! +# } +# } +# end +# puts builder.to_xml +# +# Will output this XML: +# +# +# +# +# +# +# +# +# Note the "foo:object" tag. +# +# === Namespace inheritance +# +# In the Builder context, children will inherit their parent's namespace. This is the same +# behavior as if the underlying {XML::Document} set +namespace_inheritance+ to +true+: +# +# result = Nokogiri::XML::Builder.new do |xml| +# xml["soapenv"].Envelope("xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/") do +# xml.Header +# end +# end +# result.doc.to_xml +# # => +# # +# # +# # +# +# Users may turn this behavior off by passing a keyword argument +namespace_inheritance:false+ +# to the initializer: +# +# result = Nokogiri::XML::Builder.new(namespace_inheritance: false) do |xml| +# xml["soapenv"].Envelope("xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/") do +# xml.Header +# xml["soapenv"].Body # users may explicitly opt into the namespace +# end +# end +# result.doc.to_xml +# # => +# # +# #
    +# # +# # +# +# For more information on namespace inheritance, please see {XML::Document#namespace_inheritance} +# +# +# == Document Types +# +# To create a document type (DTD), use the Builder#doc method to get +# the current context document. Then call Node#create_internal_subset to +# create the DTD node. +# +# For example, this Ruby: +# +# builder = Nokogiri::XML::Builder.new do |xml| +# xml.doc.create_internal_subset( +# 'html', +# "-//W3C//DTD HTML 4.01 Transitional//EN", +# "http://www.w3.org/TR/html4/loose.dtd" +# ) +# xml.root do +# xml.foo +# end +# end +# +# puts builder.to_xml +# +# Will output this xml: +# +# +# +# +# +# +# +# pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:264 +class Nokogiri::XML::Builder + include ::Nokogiri::ClassResolver + + # Create a new Builder object. +options+ are sent to the top level + # Document that is being built. + # + # Building a document with a particular encoding for example: + # + # Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml| + # ... + # end + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:307 + def initialize(options = T.unsafe(nil), root = T.unsafe(nil), &block); end + + # Append the given raw XML +string+ to the document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:390 + def <<(string); end + + # Build a tag that is associated with namespace +ns+. Raises an + # ArgumentError if +ns+ has not been defined higher in the tree. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:358 + def [](ns); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:278 + def arity; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:278 + def arity=(_arg0); end + + # Create a CDATA Node with content of +string+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:345 + def cdata(string); end + + # Create a Comment Node with content of +string+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:351 + def comment(string); end + + # A context object for use when the block has no arguments + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:276 + def context; end + + # A context object for use when the block has no arguments + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:276 + def context=(_arg0); end + + # The current Document object being built + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:270 + def doc; end + + # The current Document object being built + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:270 + def doc=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:394 + def method_missing(method, *args, &block); end + + # The parent of the current node being built + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:273 + def parent; end + + # The parent of the current node being built + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:273 + def parent=(_arg0); end + + # Create a Text Node with content of +string+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:339 + def text(string); end + + # Convert this Builder object to XML + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:377 + def to_xml(*args); end + + private + + # Insert +node+ as a child of the current Node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:423 + def insert(node, &block); end + + class << self + # Create a builder with an existing root object. This is for use when + # you have an existing document that you would like to augment with + # builder methods. The builder context created will start with the + # given +root+ node. + # + # For example: + # + # doc = Nokogiri::XML(File.read('somedoc.xml')) + # Nokogiri::XML::Builder.with(doc.at_css('some_tag')) do |xml| + # # ... Use normal builder methods here ... + # xml.awesome # add the "awesome" tag below "some_tag" + # end + # + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:294 + def with(root, &block); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:267 +Nokogiri::XML::Builder::DEFAULT_DOCUMENT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:442 +class Nokogiri::XML::Builder::NodeBuilder + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:443 + def initialize(node, doc_builder); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:452 + def [](k); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:448 + def []=(k, v); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/builder.rb:456 + def method_missing(method, *args, &block); end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::CDATA < ::Nokogiri::XML::Text + # Get the name of this CDATA node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/cdata.rb:8 + def name; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::CharacterData < ::Nokogiri::XML::Node + include ::Nokogiri::XML::PP::CharacterData +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Comment < ::Nokogiri::XML::CharacterData + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::DTD < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attributes; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/dtd.rb:17 + def each; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def elements; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def entities; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def external_id; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/dtd.rb:27 + def html5_dtd?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/dtd.rb:23 + def html_dtd?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/dtd.rb:13 + def keys; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def notations; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def system_id; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def validate(_arg0); end +end + +# Nokogiri::XML::Document is the main entry point for dealing with \XML documents. The Document +# is created by parsing \XML content from a String or an IO object. See +# Nokogiri::XML::Document.parse for more information on parsing. +# +# Document inherits a great deal of functionality from its superclass Nokogiri::XML::Node, so +# please read that class's documentation as well. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Document < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:191 + def initialize(*args); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:450 + def <<(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:438 + def add_child(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def canonicalize(*_arg0); end + + # :call-seq: + # clone → Nokogiri::XML::Document + # clone(level) → Nokogiri::XML::Document + # + # Clone this node. + # + # [Parameters] + # - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy. + # [Returns] The new Nokogiri::XML::Document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:224 + def clone(level = T.unsafe(nil)); end + + # :call-seq: + # collect_namespaces() → Hash + # + # Recursively get all namespaces from this node and its subtree and return them as a + # hash. + # + # ⚠ This method will not handle duplicate namespace prefixes, since the return value is a hash. + # + # Note that this method does an xpath lookup for nodes with namespaces, and as a result the + # order (and which duplicate prefix "wins") may be dependent on the implementation of the + # underlying XML library. + # + # *Example:* Basic usage + # + # Given this document: + # + # + # + # + # + # This method will return: + # + # {"xmlns:foo"=>"bar", "xmlns"=>"default", "xmlns:hello"=>"world"} + # + # *Example:* Duplicate prefixes + # + # Given this document: + # + # + # + # + # + # The hash returned will be something like: + # + # {"xmlns:foo" => "baz"} + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:362 + def collect_namespaces; end + + # Create a CDATA Node containing +string+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:307 + def create_cdata(string, &block); end + + # Create a Comment Node containing +string+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:312 + def create_comment(string, &block); end + + # :call-seq: + # create_element(name, *contents_or_attrs, &block) → Nokogiri::XML::Element + # + # Create a new Element with `name` belonging to this document, optionally setting contents or + # attributes. + # + # This method is _not_ the most user-friendly option if your intention is to add a node to the + # document tree. Prefer one of the Nokogiri::XML::Node methods like Node#add_child, + # Node#add_next_sibling, Node#replace, etc. which will both create an element (or subtree) and + # place it in the document tree. + # + # Arguments may be passed to initialize the element: + # + # - a Hash argument will be used to set attributes + # - a non-Hash object that responds to \#to_s will be used to set the new node's contents + # + # A block may be passed to mutate the node. + # + # [Parameters] + # - `name` (String) + # - `contents_or_attrs` (\#to_s, Hash) + # [Yields] `node` (Nokogiri::XML::Element) + # [Returns] Nokogiri::XML::Element + # + # *Example:* An empty element without attributes + # + # doc.create_element("div") + # # =>
    + # + # *Example:* An element with contents + # + # doc.create_element("div", "contents") + # # =>
    contents
    + # + # *Example:* An element with attributes + # + # doc.create_element("div", {"class" => "container"}) + # # =>
    + # + # *Example:* An element with contents and attributes + # + # doc.create_element("div", "contents", {"class" => "container"}) + # # =>
    contents
    + # + # *Example:* Passing a block to mutate the element + # + # doc.create_element("div") { |node| node["class"] = "blue" if before_noon? } + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:277 + def create_element(name, *contents_or_attrs, &block); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def create_entity(*_arg0); end + + # Create a Text Node with +string+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:302 + def create_text_node(string, &block); end + + # :call-seq: deconstruct_keys(array_of_names) → Hash + # + # Returns a hash describing the Document, to use in pattern matching. + # + # Valid keys and their values: + # - +root+ → (Node, nil) The root node of the Document, or +nil+ if the document is empty. + # + # In the future, other keys may allow accessing things like doctype and processing + # instructions. If you have a use case and would like this functionality, please let us know + # by opening an issue or a discussion on the github project. + # + # *Example* + # + # doc = Nokogiri::XML.parse(<<~XML) + # + # + # + # + # XML + # + # doc.deconstruct_keys([:root]) + # # => {:root=> + # # #(Element:0x35c { + # # name = "root", + # # children = [ + # # #(Text "\n" + " "), + # # #(Element:0x370 { name = "child", children = [ #(Text "\n")] }), + # # #(Text "\n")] + # # })} + # + # *Example* of an empty document + # + # doc = Nokogiri::XML::Document.new + # + # doc.deconstruct_keys([:root]) + # # => {:root=>nil} + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:502 + def deconstruct_keys(keys); end + + # Apply any decorators to +node+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:410 + def decorate(node); end + + # Get the list of decorators given +key+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:369 + def decorators(key); end + + # A reference to +self+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:322 + def document; end + + # :call-seq: + # dup → Nokogiri::XML::Document + # dup(level) → Nokogiri::XML::Document + # + # Duplicate this node. + # + # [Parameters] + # - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy. + # [Returns] The new Nokogiri::XML::Document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:208 + def dup(level = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def encoding; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def encoding=(_arg0); end + + # The errors found while parsing a document. + # + # [Returns] Array + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:142 + def errors; end + + # The errors found while parsing a document. + # + # [Returns] Array + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:142 + def errors=(_arg0); end + + # Create a Nokogiri::XML::DocumentFragment from +tags+ + # Returns an empty fragment if +tags+ is nil. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:430 + def fragment(tags = T.unsafe(nil)); end + + # The name of this document. Always returns "document" + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:317 + def name; end + + # When `true`, reparented elements without a namespace will inherit their new parent's + # namespace (if one exists). Defaults to `false`. + # + # [Returns] Boolean + # + # *Example:* Default behavior of namespace inheritance + # + # xml = <<~EOF + # + # + # + # + # EOF + # doc = Nokogiri::XML(xml) + # parent = doc.at_xpath("//foo:parent", "foo" => "http://nokogiri.org/default_ns/test/foo") + # parent.add_child("") + # doc.to_xml + # # => + # # + # # + # # + # # + # # + # + # *Example:* Setting namespace inheritance to `true` + # + # xml = <<~EOF + # + # + # + # + # EOF + # doc = Nokogiri::XML(xml) + # doc.namespace_inheritance = true + # parent = doc.at_xpath("//foo:parent", "foo" => "http://nokogiri.org/default_ns/test/foo") + # parent.add_child("") + # doc.to_xml + # # => + # # + # # + # # + # # + # # + # + # Since v1.12.4 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:189 + def namespace_inheritance; end + + # When `true`, reparented elements without a namespace will inherit their new parent's + # namespace (if one exists). Defaults to `false`. + # + # [Returns] Boolean + # + # *Example:* Default behavior of namespace inheritance + # + # xml = <<~EOF + # + # + # + # + # EOF + # doc = Nokogiri::XML(xml) + # parent = doc.at_xpath("//foo:parent", "foo" => "http://nokogiri.org/default_ns/test/foo") + # parent.add_child("") + # doc.to_xml + # # => + # # + # # + # # + # # + # # + # + # *Example:* Setting namespace inheritance to `true` + # + # xml = <<~EOF + # + # + # + # + # EOF + # doc = Nokogiri::XML(xml) + # doc.namespace_inheritance = true + # parent = doc.at_xpath("//foo:parent", "foo" => "http://nokogiri.org/default_ns/test/foo") + # parent.add_child("") + # doc.to_xml + # # => + # # + # # + # # + # # + # # + # + # Since v1.12.4 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:189 + def namespace_inheritance=(_arg0); end + + # Get the hash of namespaces on the root Nokogiri::XML::Node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:423 + def namespaces; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def remove_namespaces!; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def root; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def root=(_arg0); end + + # Explore a document with shortcut methods. See Nokogiri::Slop for details. + # + # Note that any nodes that have been instantiated before #slop! + # is called will not be decorated with sloppy behavior. So, if you're in + # irb, the preferred idiom is: + # + # irb> doc = Nokogiri::Slop my_markup + # + # and not + # + # irb> doc = Nokogiri::HTML my_markup + # ... followed by irb's implicit inspect (and therefore instantiation of every node) ... + # irb> doc.slop! + # ... which does absolutely nothing. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:399 + def slop!; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:420 + def to_xml(*args, &block); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def url; end + + # Validate this Document against its DTD. Returns a list of errors on + # the document or +nil+ when there is no DTD. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:377 + def validate; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def version; end + + # :call-seq: + # xpath_doctype() → Nokogiri::CSS::XPathVisitor::DoctypeConfig + # + # [Returns] The document type which determines CSS-to-XPath translation. + # + # See XPathVisitor for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:458 + def xpath_doctype; end + + protected + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_copy_with_args(_arg0, _arg1); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:510 + def inspect_attributes; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + + # call-seq: + # parse(input) { |options| ... } => Nokogiri::XML::Document + # + # Parse \XML input from a String or IO object, and return a new XML::Document. + # + # 🛡 By default, Nokogiri treats documents as untrusted, and so does not attempt to load DTDs + # or access the network. See Nokogiri::XML::ParseOptions for a complete list of options; and + # that module's DEFAULT_XML constant for what's set (and not set) by default. + # + # [Required Parameters] + # - +input+ (String | IO) The content to be parsed. + # + # [Optional Keyword Arguments] + # - +url:+ (String) The base URI for this document. + # + # document. When not provided, the encoding will be determined based on the document + # content. + # + # - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some + # behaviors during parsing. See ParseOptions for more information. The default value is + # +ParseOptions::DEFAULT_XML+. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which + # can be configured before parsing. See Nokogiri::XML::ParseOptions for more information. + # + # [Returns] Nokogiri::XML::Document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:56 + def parse(string_or_io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def read_io(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def read_memory(_arg0, _arg1, _arg2, _arg3); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:97 + def empty_doc?(string_or_io); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:508 +Nokogiri::XML::Document::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:19 +Nokogiri::XML::Document::NCNAME_CHAR = T.let(T.unsafe(nil), String) + +# pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:20 +Nokogiri::XML::Document::NCNAME_RE = T.let(T.unsafe(nil), Regexp) + +# See http://www.w3.org/TR/REC-xml-names/#ns-decl for more details. Note that we're not +# attempting to handle unicode characters partly because libxml2 doesn't handle unicode +# characters in NCNAMEs. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:18 +Nokogiri::XML::Document::NCNAME_START_CHAR = T.let(T.unsafe(nil), String) + +# pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:23 +Nokogiri::XML::Document::OBJECT_CLONE_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# pkg:gem/nokogiri#lib/nokogiri/xml/document.rb:22 +Nokogiri::XML::Document::OBJECT_DUP_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# DocumentFragment represents a fragment of an \XML document. It provides the same functionality +# exposed by XML::Node and can be used to contain one or more \XML subtrees. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node + # :call-seq: + # new(document, input=nil) { |options| ... } → DocumentFragment + # new(document, input=nil, context:, options:) → DocumentFragment + # + # Parse \XML fragment input from a String, and return a new DocumentFragment that is + # associated with the given +document+. + # + # 💡 It's recommended to use either XML::DocumentFragment.parse or Node#parse rather than call + # this method directly. + # + # [Required Parameters] + # - +document+ (XML::Document) The parent document to associate the returned fragment with. + # + # [Optional Parameters] + # - +input+ (String) The content to be parsed. + # + # [Optional Keyword Arguments] + # - +context:+ (Nokogiri::XML::Node) The context node for the subtree created. See + # below for more information. + # + # - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some + # behaviors during parsing. See ParseOptions for more information. The default value is + # +ParseOptions::DEFAULT_XML+. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which + # can be configured before parsing. See ParseOptions for more information. + # + # [Returns] XML::DocumentFragment + # + # === Context \Node + # + # If a context node is specified using +context:+, then the fragment will be created by + # calling Node#parse on that node, so the parser will behave as if that Node is the parent of + # the fragment subtree, and will resolve namespaces relative to that node. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:85 + def initialize(document, tags = T.unsafe(nil), context_ = T.unsafe(nil), options_ = T.unsafe(nil), context: T.unsafe(nil), options: T.unsafe(nil)); end + + # call-seq: css *rules, [namespace-bindings, custom-pseudo-class] + # + # Search this fragment for CSS +rules+. +rules+ must be one or more CSS + # selectors. For example: + # + # For more information see Nokogiri::XML::Searchable#css + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:173 + def css(*args); end + + # :call-seq: deconstruct() → Array + # + # Returns the root nodes of this document fragment as an array, to use in pattern matching. + # + # 💡 Note that text nodes are returned as well as elements. If you wish to operate only on + # root elements, you should deconstruct the array returned by + # DocumentFragment#elements. + # + # *Example* + # + # frag = Nokogiri::HTML5.fragment(<<~HTML) + #
    Start
    + # This is a shortcut for you. + #
    End
    + # HTML + # + # frag.deconstruct + # # => [#(Element:0x35c { name = "div", children = [ #(Text "Start")] }), + # # #(Text "\n" + "This is a "), + # # #(Element:0x370 { + # # name = "a", + # # attributes = [ #(Attr:0x384 { name = "href", value = "#jump" })], + # # children = [ #(Text "shortcut")] + # # }), + # # #(Text " for you.\n"), + # # #(Element:0x398 { name = "div", children = [ #(Text "End")] }), + # # #(Text "\n")] + # + # *Example* only the elements, not the text nodes. + # + # frag.elements.deconstruct + # # => [#(Element:0x35c { name = "div", children = [ #(Text "Start")] }), + # # #(Element:0x370 { + # # name = "a", + # # attributes = [ #(Attr:0x384 { name = "href", value = "#jump" })], + # # children = [ #(Text "shortcut")] + # # }), + # # #(Element:0x398 { name = "div", children = [ #(Text "End")] })] + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:261 + def deconstruct; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:113 + def dup; end + + # A list of Nokogiri::XML::SyntaxError found when parsing a document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:207 + def errors; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:211 + def errors=(things); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:215 + def fragment(data); end + + # return the name for DocumentFragment + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:125 + def name; end + + # The options used to parse the document fragment. Returns the value of any options that were + # passed into the constructor as a parameter or set in a config block, else the default + # options for the specific subclass. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:12 + def parse_options; end + + # call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class] + # + # Search this fragment for +paths+. +paths+ must be one or more XPath or CSS queries. + # + # For more information see Nokogiri::XML::Searchable#search + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:192 + def search(*rules); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:204 + def serialize; end + + # Convert this DocumentFragment to html + # See Nokogiri::XML::NodeSet#to_html + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:138 + def to_html(*args); end + + # Convert this DocumentFragment to a string + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:131 + def to_s; end + + # Convert this DocumentFragment to xhtml + # See Nokogiri::XML::NodeSet#to_xhtml + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:150 + def to_xhtml(*args); end + + # Convert this DocumentFragment to xml + # See Nokogiri::XML::NodeSet#to_xml + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:162 + def to_xml(*args); end + + private + + # fix for issue 770 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:268 + def namespace_declarations(ctx); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_new(_arg0); end + + # Wrapper method to separate the concerns of: + # - the native object allocator's parameter (it only requires `document`) + # - the initializer's parameters + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:42 + def new(document, *, **, &); end + + # :call-seq: + # parse(input) { |options| ... } → XML::DocumentFragment + # parse(input, options:) → XML::DocumentFragment + # + # Parse \XML fragment input from a String, and return a new XML::DocumentFragment. This + # method creates a new, empty XML::Document to contain the fragment. + # + # [Required Parameters] + # - +input+ (String) The content to be parsed. + # + # [Optional Keyword Arguments] + # - +options+ (Nokogiri::XML::ParseOptions) Configuration object that determines some + # behaviors during parsing. See ParseOptions for more information. The default value is + # +ParseOptions::DEFAULT_XML+. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which + # can be configured before parsing. See Nokogiri::XML::ParseOptions for more information. + # + # [Returns] Nokogiri::XML::DocumentFragment + # + # pkg:gem/nokogiri#lib/nokogiri/xml/document_fragment.rb:35 + def parse(tags, options_ = T.unsafe(nil), options: T.unsafe(nil), &block); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Element < ::Nokogiri::XML::Node; end + +# Represents the allowed content in an Element Declaration inside a DTD: +# +# +# +# ]> +# +# +# ElementContent represents the binary tree inside the tag shown above that lists the +# possible content for the div1 tag. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::ElementContent + include ::Nokogiri::XML::PP::Node + + # Get the children of this ElementContent node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:35 + def children; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:31 + def document; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def name; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def occur; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def prefix; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def type; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def c1; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def c2; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:41 + def inspect_attributes; end +end + +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:21 +Nokogiri::XML::ElementContent::ELEMENT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:28 +Nokogiri::XML::ElementContent::MULT = T.let(T.unsafe(nil), Integer) + +# Possible content occurrences +# +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:26 +Nokogiri::XML::ElementContent::ONCE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:27 +Nokogiri::XML::ElementContent::OPT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:23 +Nokogiri::XML::ElementContent::OR = T.let(T.unsafe(nil), Integer) + +# Possible definitions of type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:20 +Nokogiri::XML::ElementContent::PCDATA = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:29 +Nokogiri::XML::ElementContent::PLUS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/element_content.rb:22 +Nokogiri::XML::ElementContent::SEQ = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::ElementDecl < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def content; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def element_type; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def prefix; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/element_decl.rb:12 + def inspect_attributes; end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::EntityDecl < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def content; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def entity_type; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def external_id; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def original_content; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def system_id; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/entity_decl.rb:18 + def inspect_attributes; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/xml/entity_decl.rb:12 + def new(name, doc, *args); end + end +end + +Nokogiri::XML::EntityDecl::EXTERNAL_GENERAL_PARSED = T.let(T.unsafe(nil), Integer) +Nokogiri::XML::EntityDecl::EXTERNAL_GENERAL_UNPARSED = T.let(T.unsafe(nil), Integer) +Nokogiri::XML::EntityDecl::EXTERNAL_PARAMETER = T.let(T.unsafe(nil), Integer) +Nokogiri::XML::EntityDecl::INTERNAL_GENERAL = T.let(T.unsafe(nil), Integer) +Nokogiri::XML::EntityDecl::INTERNAL_PARAMETER = T.let(T.unsafe(nil), Integer) +Nokogiri::XML::EntityDecl::INTERNAL_PREDEFINED = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::EntityReference < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/xml/entity_reference.rb:6 + def children; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/entity_reference.rb:15 + def inspect_attributes; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Namespace + include ::Nokogiri::XML::PP::Node + + # :call-seq: deconstruct_keys(array_of_names) → Hash + # + # Returns a hash describing the Namespace, to use in pattern matching. + # + # Valid keys and their values: + # - +prefix+ → (String, nil) The namespace's prefix, or +nil+ if there is no prefix (e.g., default namespace). + # - +href+ → (String) The namespace's URI + # + # *Example* + # + # doc = Nokogiri::XML.parse(<<~XML) + # + # + # + # + # + # XML + # + # doc.root.elements.first.namespace + # # => #(Namespace:0x35c { href = "http://nokogiri.org/ns/default" }) + # + # doc.root.elements.first.namespace.deconstruct_keys([:prefix, :href]) + # # => {:prefix=>nil, :href=>"http://nokogiri.org/ns/default"} + # + # doc.root.elements.last.namespace + # # => #(Namespace:0x370 { + # # prefix = "noko", + # # href = "http://nokogiri.org/ns/noko" + # # }) + # + # doc.root.elements.last.namespace.deconstruct_keys([:prefix, :href]) + # # => {:prefix=>"noko", :href=>"http://nokogiri.org/ns/noko"} + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/namespace.rb:46 + def deconstruct_keys(keys); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/namespace.rb:8 + def document; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def href; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def prefix; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/namespace.rb:52 + def inspect_attributes; end +end + +# Nokogiri::XML::Node is the primary API you'll use to interact with your Document. +# +# == Attributes +# +# A Nokogiri::XML::Node may be treated similarly to a hash with regard to attributes. For +# example: +# +# node = Nokogiri::XML::DocumentFragment.parse("link").at_css("a") +# node.to_html # => "link" +# node['href'] # => "#foo" +# node.keys # => ["href", "id"] +# node.values # => ["#foo", "link"] +# node['class'] = 'green' # => "green" +# node.to_html # => "link" +# +# See the method group entitled Node@Working+With+Node+Attributes for the full set of methods. +# +# == Navigation +# +# Nokogiri::XML::Node also has methods that let you move around your tree: +# +# [#parent, #children, #next, #previous] +# Navigate up, down, or through siblings. +# +# See the method group entitled Node@Traversing+Document+Structure for the full set of methods. +# +# == Serialization +# +# When printing or otherwise emitting a document or a node (and its subtree), there are a few +# methods you might want to use: +# +# [#content, #text, #inner_text, #to_str] +# These methods will all **emit plaintext**, +# meaning that entities will be replaced (e.g., +<+ will be replaced with +<+), meaning +# that any sanitizing will likely be un-done in the output. +# +# [#to_s, #to_xml, #to_html, #inner_html] +# These methods will all **emit properly-escaped markup**, meaning that it's suitable for +# consumption by browsers, parsers, etc. +# +# See the method group entitled Node@Serialization+and+Generating+Output for the full set of methods. +# +# == Searching +# +# You may search this node's subtree using methods like #xpath and #css. +# +# See the method group entitled Node@Searching+via+XPath+or+CSS+Queries for the full set of methods. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Node + include ::Nokogiri::HTML5::Node + include ::Nokogiri::XML::PP::Node + include ::Nokogiri::XML::Searchable + include ::Nokogiri::ClassResolver + include ::Enumerable + + # :call-seq: + # new(name, document) -> Nokogiri::XML::Node + # new(name, document) { |node| ... } -> Nokogiri::XML::Node + # + # Create a new node with +name+ that belongs to +document+. + # + # If you intend to add a node to a document tree, it's likely that you will prefer one of the + # Nokogiri::XML::Node methods like #add_child, #add_next_sibling, #replace, etc. which will + # both create an element (or subtree) and place it in the document tree. + # + # Another alternative, if you are concerned about performance, is + # Nokogiri::XML::Document#create_element which accepts additional arguments for contents or + # attributes but (like this method) avoids parsing markup. + # + # [Parameters] + # - +name+ (String) + # - +document+ (Nokogiri::XML::Document) The document to which the the returned node will belong. + # [Yields] Nokogiri::XML::Node + # [Returns] Nokogiri::XML::Node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:126 + def initialize(name, document); end + + # Add +node_or_tags+ as a child of this Node. + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns +self+, to support chaining of calls (e.g., root << child1 << child2) + # + # Also see related method +add_child+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:292 + def <<(node_or_tags); end + + # Compare two Node objects with respect to their Document. Nodes from + # different documents cannot be compared. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1391 + def <=>(other); end + + # Test to see if this Node is equal to +other+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1381 + def ==(other); end + + # :call-seq: [](name) → (String, nil) + # + # Fetch an attribute from this node. + # + # ⚠ Note that attributes with namespaces cannot be accessed with this method. To access + # namespaced attributes, use #attribute_with_ns. + # + # [Returns] (String, nil) value of the attribute +name+, or +nil+ if no matching attribute exists + # + # *Example* + # + # doc = Nokogiri::XML("") + # child = doc.at_css("child") + # child["size"] # => "large" + # child["class"] # => "big wide tall" + # + # *Example:* Namespaced attributes will not be returned. + # + # ⚠ Note namespaced attributes may be accessed with #attribute or #attribute_with_ns + # + # doc = Nokogiri::XML(<<~EOF) + # + # + # + # EOF + # doc.at_css("child")["size"] # => nil + # doc.at_css("child").attribute("size").value # => "broad" + # doc.at_css("child").attribute_with_ns("size", "http://example.com/widths").value + # # => "broad" + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:638 + def [](name); end + + # :call-seq: []=(name, value) → value + # + # Update the attribute +name+ to +value+, or create the attribute if it does not exist. + # + # ⚠ Note that attributes with namespaces cannot be accessed with this method. To access + # namespaced attributes for update, use #attribute_with_ns. To add a namespaced attribute, + # see the example below. + # + # [Returns] +value+ + # + # *Example* + # + # doc = Nokogiri::XML("") + # child = doc.at_css("child") + # child["size"] = "broad" + # child.to_html + # # => "" + # + # *Example:* Add a namespaced attribute. + # + # doc = Nokogiri::XML(<<~EOF) + # + # + # + # EOF + # child = doc.at_css("child") + # child["size"] = "broad" + # ns = doc.root.namespace_definitions.find { |ns| ns.prefix == "width" } + # child.attribute("size").namespace = ns + # doc.to_html + # # => "\n" + + # # " \n" + + # # "\n" + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:676 + def []=(name, value); end + + # Accept a visitor. This method calls "visit" on +visitor+ with self. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1375 + def accept(visitor); end + + # Add +node_or_tags+ as a child of this Node. + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns the reparented node (if +node_or_tags+ is a Node), or NodeSet (if +node_or_tags+ is + # a DocumentFragment, NodeSet, or String). + # + # Also see related method +<<+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:184 + def add_child(node_or_tags); end + + # :call-seq: add_class(names) → self + # + # Ensure HTML CSS classes are present on +self+. Any CSS classes in +names+ that already exist + # in the "class" attribute are _not_ added. Note that any existing duplicates in the + # "class" attribute are not removed. Compare with #append_class. + # + # This is a convenience function and is equivalent to: + # + # node.kwattr_add("class", names) + # + # See related: #kwattr_add, #classes, #append_class, #remove_class + # + # [Parameters] + # - +names+ (String, Array) + # + # CSS class names to be added to the Node's "class" attribute. May be a string containing + # whitespace-delimited names, or an Array of String names. Any class names already present + # will not be added. Any class names not present will be added. If no "class" attribute + # exists, one is created. + # + # [Returns] +self+ (Node) for ease of chaining method calls. + # + # *Example:* Ensure that the node has CSS class "section" + # + # node # =>
    + # node.add_class("section") # =>
    + # node.add_class("section") # =>
    # duplicate not added + # + # *Example:* Ensure that the node has CSS classes "section" and "header", via a String argument + # + # Note that the CSS class "section" is not added because it is already present. + # Note also that the pre-existing duplicate CSS class "section" is not removed. + # + # node # =>
    + # node.add_class("section header") # =>
    + # + # *Example:* Ensure that the node has CSS classes "section" and "header", via an Array argument + # + # node # =>
    + # node.add_class(["section", "header"]) # =>
    + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:841 + def add_class(names); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:595 + def add_namespace(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def add_namespace_definition(_arg0, _arg1); end + + # Insert +node_or_tags+ after this Node (as a sibling). + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns the reparented node (if +node_or_tags+ is a Node), or NodeSet (if +node_or_tags+ is + # a DocumentFragment, NodeSet, or String). + # + # Also see related method +after+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:324 + def add_next_sibling(node_or_tags); end + + # Insert +node_or_tags+ before this Node (as a sibling). + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns the reparented node (if +node_or_tags+ is a Node), or NodeSet (if +node_or_tags+ is + # a DocumentFragment, NodeSet, or String). + # + # Also see related method +before+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:307 + def add_previous_sibling(node_or_tags); end + + # Insert +node_or_tags+ after this node (as a sibling). + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a Nokogiri::XML::DocumentFragment, or a String + # containing markup. + # + # Returns +self+, to support chaining of calls. + # + # Also see related method +add_next_sibling+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:354 + def after(node_or_tags); end + + # Get a list of ancestor Node for this Node. If +selector+ is given, + # the ancestors must match +selector+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1344 + def ancestors(selector = T.unsafe(nil)); end + + # :call-seq: append_class(names) → self + # + # Add HTML CSS classes to +self+, regardless of duplication. Compare with #add_class. + # + # This is a convenience function and is equivalent to: + # + # node.kwattr_append("class", names) + # + # See related: #kwattr_append, #classes, #add_class, #remove_class + # + # [Parameters] + # - +names+ (String, Array) + # + # CSS class names to be appended to the Node's "class" attribute. May be a string containing + # whitespace-delimited names, or an Array of String names. All class names passed in will be + # appended to the "class" attribute even if they are already present in the attribute + # value. If no "class" attribute exists, one is created. + # + # [Returns] +self+ (Node) for ease of chaining method calls. + # + # *Example:* Append "section" to the node's CSS "class" attribute + # + # node # =>
    + # node.append_class("section") # =>
    + # node.append_class("section") # =>
    # duplicate added! + # + # *Example:* Append "section" and "header" to the noded's CSS "class" attribute, via a String argument + # + # Note that the CSS class "section" is appended even though it is already present + # + # node # =>
    + # node.append_class("section header") # =>
    + # + # *Example:* Append "section" and "header" to the node's CSS "class" attribute, via an Array argument + # + # node # =>
    + # node.append_class(["section", "header"]) # =>
    + # node.append_class(["section", "header"]) # =>
    + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:885 + def append_class(names); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1133 + def attr(name); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute_nodes; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute_with_ns(_arg0, _arg1); end + + # :call-seq: attributes() → Hash + # + # Fetch this node's attributes. + # + # ⚠ Because the keys do not include any namespace information for the attribute, in case of a + # simple name collision, not all attributes will be returned. In this case, you will need to + # use #attribute_nodes. + # + # [Returns] + # Hash containing attributes belonging to +self+. The hash keys are String attribute + # names (without the namespace), and the hash values are Nokogiri::XML::Attr. + # + # *Example* with no namespaces: + # + # doc = Nokogiri::XML("") + # doc.at_css("child").attributes + # # => {"size"=>#(Attr:0x550 { name = "size", value = "large" }), + # # "class"=>#(Attr:0x564 { name = "class", value = "big wide tall" })} + # + # *Example* with a namespace: + # + # doc = Nokogiri::XML("") + # doc.at_css("child").attributes + # # => {"size"=> + # # #(Attr:0x550 { + # # name = "size", + # # namespace = #(Namespace:0x564 { + # # prefix = "desc", + # # href = "http://example.com/sizes" + # # }), + # # value = "large" + # # })} + # + # *Example* with an attribute name collision: + # + # ⚠ Note that only one of the attributes is returned in the Hash. + # + # doc = Nokogiri::XML(<<~EOF) + # + # + # + # EOF + # doc.at_css("child").attributes + # # => {"size"=> + # # #(Attr:0x550 { + # # name = "size", + # # namespace = #(Namespace:0x564 { + # # prefix = "height", + # # href = "http://example.com/heights" + # # }), + # # value = "tall" + # # })} + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:735 + def attributes; end + + # Insert +node_or_tags+ before this node (as a sibling). + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns +self+, to support chaining of calls. + # + # Also see related method +add_previous_sibling+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:340 + def before(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def blank?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1543 + def canonicalize(mode = T.unsafe(nil), inclusive_namespaces = T.unsafe(nil), with_comments = T.unsafe(nil)); end + + # Returns true if this is a CDATA + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1265 + def cdata?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def child; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def children; end + + # Set the content for this Node +node_or_tags+ + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a Nokogiri::XML::DocumentFragment, or a String + # containing markup. + # + # Also see related method +inner_html=+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:385 + def children=(node_or_tags); end + + # :call-seq: classes() → Array + # + # Fetch CSS class names of a Node. + # + # This is a convenience function and is equivalent to: + # + # node.kwattr_values("class") + # + # See related: #kwattr_values, #add_class, #append_class, #remove_class + # + # [Returns] + # The CSS classes (Array of String) present in the Node's "class" attribute. If the + # attribute is empty or non-existent, the return value is an empty array. + # + # *Example* + # + # node # =>
    + # node.classes # => ["section", "title", "header"] + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:795 + def classes; end + + # :call-seq: + # clone → Nokogiri::XML::Node + # clone(level) → Nokogiri::XML::Node + # clone(level, new_parent_doc) → Nokogiri::XML::Node + # + # Clone this node. + # + # [Parameters] + # - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy. + # - +new_parent_doc+ + # The new node's parent Document. Defaults to the the Document of the current node. + # [Returns] The new Nokogiri::XML::Node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:162 + def clone(level = T.unsafe(nil), new_parent_doc = T.unsafe(nil)); end + + # Returns true if this is a Comment + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1260 + def comment?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def content; end + + # call-seq: + # content=(input) + # + # Set the content of this node to +input+. + # + # [Parameters] + # - +input+ (String) The new content for this node. Input is considered to be raw content, and + # so will be entity-escaped in the final DOM string. + # + # [Example] + # Note how entities are handled: + # + # doc = Nokogiri::HTML::Document.parse(<<~HTML) + # + # + #
    asdf
    + #
    asdf
    + # HTML + # + # text_node = doc.at_css("div#first").children.first + # div_node = doc.at_css("div#second") + # + # value = "You & Me" + # + # text_node.content = value + # div_node.content = value + # + # doc.css("div").to_html + # # => "
    You &amp; Me
    + # #
    You &amp; Me
    " + # + # For content that is already entity-escaped, use CGI::unescapeHTML to decode it: + # + # text_node.content = CGI::unescapeHTML(value) + # div_node.content = CGI::unescapeHTML(value) + # + # doc.css("div").to_html + # # => "
    You & Me
    + # #
    You & Me
    " + # + # See also: #native_content= + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:487 + def content=(string); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def create_external_subset(_arg0, _arg1, _arg2); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def create_internal_subset(_arg0, _arg1, _arg2); end + + # Get the path to this node as a CSS expression + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1335 + def css_path; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def data_ptr?; end + + # :call-seq: deconstruct_keys(array_of_names) → Hash + # + # Returns a hash describing the Node, to use in pattern matching. + # + # Valid keys and their values: + # - +name+ → (String) The name of this node, or "text" if it is a Text node. + # - +namespace+ → (Namespace, nil) The namespace of this node, or nil if there is no namespace. + # - +attributes+ → (Array) The attributes of this node. + # - +children+ → (Array) The children of this node. 💡 Note this includes text nodes. + # - +elements+ → (Array) The child elements of this node. 💡 Note this does not include text nodes. + # - +content+ → (String) The contents of all the text nodes in this node's subtree. See #content. + # - +inner_html+ → (String) The inner markup for the children of this node. See #inner_html. + # + # *Example* + # + # doc = Nokogiri::XML.parse(<<~XML) + # + # + # First + # Second + # + # XML + # + # doc.root.deconstruct_keys([:name, :namespace]) + # # => {:name=>"parent", + # # :namespace=> + # # #(Namespace:0x35c { href = "http://nokogiri.org/ns/default" })} + # + # doc.root.deconstruct_keys([:inner_html, :content]) + # # => {:content=>"\n" + " First\n" + " Second\n", + # # :inner_html=> + # # "\n" + + # # " First\n" + + # # " Second\n"} + # + # doc.root.elements.first.deconstruct_keys([:attributes]) + # # => {:attributes=> + # # [#(Attr:0x370 { name = "foo", value = "abc" }), + # # #(Attr:0x384 { + # # name = "bar", + # # namespace = #(Namespace:0x398 { + # # prefix = "noko", + # # href = "http://nokogiri.org/ns/noko" + # # }), + # # value = "def" + # # })]} + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1604 + def deconstruct_keys(keys); end + + # Decorate this node with the decorators set up in this node's Document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:168 + def decorate!; end + + # Adds a default namespace supplied as a string +url+ href, to self. + # The consequence is as an xmlns attribute with supplied argument were + # present in parsed XML. A default namespace set with this method will + # now show up in #attributes, but when this node is serialized to XML an + # "xmlns" attribute will appear. See also #namespace and #namespace= + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:503 + def default_namespace=(url); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1131 + def delete(name); end + + # Fetch the Nokogiri::HTML4::ElementDescription for this node. Returns + # nil on XML documents and on unknown tags. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1302 + def description; end + + # :call-seq: + # do_xinclude(options = ParseOptions::DEFAULT_XML, safe_copy: true) → self + # do_xinclude(options = ParseOptions::DEFAULT_XML, safe_copy: true) { |options| ... } → self + # + # Do XInclude substitution on the subtree below this node, replacing each ++ with + # the content it references. + # + # [Parameters] + # - +options+ (Nokogiri::XML::ParseOptions) The parser options for the substitution. (default + # +ParseOptions::DEFAULT_XML+) + # + # [Optional Keyword Arguments] + # - +safe_copy:+ (Boolean) Operate on a defensive copy of each ++ element, to + # prevent libxml2 from freeing memory that is bound to live Ruby objects. (default +true+) + # + # When +true+, each ++ is processed on an unwrapped copy of itself, so libxml2 + # frees the copy while the original node is unlinked from the document and kept alive. This + # prevents a use-after-free when the ++ node, or any of its descendants or + # namespaces, has already been exposed to Ruby; as a consequence such a wrapped node ends up + # detached from the document rather than removed or converted in place. + # + # When +false+, the document is processed in place. This is faster but only safe when nothing + # in the subtree has been exposed to Ruby (for example, immediately after parsing), which is + # why Document.parse uses it. + # + # This option has no effect on the pure-Java backend, which performs XInclude substitution + # during parsing. + # + # [Yields] + # If a block is given, a Nokogiri::XML::ParseOptions object initialized from +options+ is + # yielded to it, which can be configured before substitution. + # + # [Returns] +self+ (Nokogiri::XML::Node) + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:574 + def do_xinclude(options = T.unsafe(nil), safe_copy: T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def document; end + + # Returns true if this is a Document + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1280 + def document?; end + + # :call-seq: + # dup → Nokogiri::XML::Node + # dup(level) → Nokogiri::XML::Node + # dup(level, new_parent_doc) → Nokogiri::XML::Node + # + # Duplicate this node. + # + # [Parameters] + # - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy. + # - +new_parent_doc+ (optional Nokogiri::XML::Document) + # The new node's parent Document. Defaults to the the Document of the current node. + # [Returns] The new Nokogiri::XML::Node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:144 + def dup(level = T.unsafe(nil), new_parent_doc = T.unsafe(nil)); end + + # Iterate over each attribute name and value pair for this Node. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:761 + def each; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1320 + def elem?; end + + # Returns true if this is an Element node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1316 + def element?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def element_children; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:604 + def elements; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def encode_special_chars(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def external_subset; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def first_element_child; end + + # Create a DocumentFragment containing +tags+ that is relative to _this_ + # context node. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1148 + def fragment(tags); end + + # Returns true if this is a DocumentFragment + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1295 + def fragment?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1132 + def get_attribute(name); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1135 + def has_attribute?(_arg0); end + + # Returns true if this is an HTML4::Document or HTML5::Document node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1275 + def html?; end + + # Get the inner_html for this node's Node#children + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1330 + def inner_html(options = T.unsafe(nil)); end + + # Set the content for this Node to +node_or_tags+. + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a Nokogiri::XML::DocumentFragment, or a String + # containing markup. + # + # ⚠ Please note that despite the name, this method will *not* always parse a String argument + # as HTML. A String argument will be parsed with the +DocumentFragment+ parser related to this + # node's document. + # + # For example, if the document is an HTML4::Document then the string will be parsed as HTML4 + # using HTML4::DocumentFragment; but if the document is an XML::Document then it will + # parse the string as XML using XML::DocumentFragment. + # + # Also see related method +children=+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:374 + def inner_html=(node_or_tags); end + + # :section: + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:599 + def inner_text; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def internal_subset; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def key?(_arg0); end + + # Get the attribute names for this Node. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:755 + def keys; end + + # :call-seq: + # kwattr_add(attribute_name, keywords) → self + # + # Ensure that values are present in a keyword attribute. + # + # Any values in +keywords+ that already exist in the Node's attribute values are _not_ + # added. Note that any existing duplicates in the attribute values are not removed. Compare + # with #kwattr_append. + # + # A "keyword attribute" is a node attribute that contains a set of space-delimited + # values. Perhaps the most familiar example of this is the HTML "class" attribute used to + # contain CSS classes. But other keyword attributes exist, for instance + # {the "rel" attribute}[https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel]. + # + # See also #add_class, #kwattr_values, #kwattr_append, #kwattr_remove + # + # [Parameters] + # - +attribute_name+ (String) The name of the keyword attribute to be modified. + # - +keywords+ (String, Array) + # Keywords to be added to the attribute named +attribute_name+. May be a string containing + # whitespace-delimited values, or an Array of String values. Any values already present will + # not be added. Any values not present will be added. If the named attribute does not exist, + # it is created. + # + # [Returns] +self+ (Nokogiri::XML::Node) for ease of chaining method calls. + # + # *Example:* Ensure that a +Node+ has "nofollow" in its +rel+ attribute. + # + # Note that duplicates are not added. + # + # node # => + # node.kwattr_add("rel", "nofollow") # => + # node.kwattr_add("rel", "nofollow") # => + # + # *Example:* Ensure that a +Node+ has "nofollow" and "noreferrer" in its +rel+ attribute, via a + # String argument. + # + # Note that "nofollow" is not added because it is already present. Note also that the + # pre-existing duplicate "nofollow" is not removed. + # + # node # => + # node.kwattr_add("rel", "nofollow noreferrer") # => + # + # *Example:* Ensure that a +Node+ has "nofollow" and "noreferrer" in its +rel+ attribute, via + # an Array argument. + # + # node # => + # node.kwattr_add("rel", ["nofollow", "noreferrer"]) # => + # + # Since v1.11.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1018 + def kwattr_add(attribute_name, keywords); end + + # :call-seq: + # kwattr_append(attribute_name, keywords) → self + # + # Add keywords to a Node's keyword attribute, regardless of duplication. Compare with + # #kwattr_add. + # + # A "keyword attribute" is a node attribute that contains a set of space-delimited + # values. Perhaps the most familiar example of this is the HTML "class" attribute used to + # contain CSS classes. But other keyword attributes exist, for instance + # {the "rel" attribute}[https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel]. + # + # See also #append_class, #kwattr_values, #kwattr_add, #kwattr_remove + # + # [Parameters] + # - +attribute_name+ (String) The name of the keyword attribute to be modified. + # - +keywords+ (String, Array) + # Keywords to be added to the attribute named +attribute_name+. May be a string containing + # whitespace-delimited values, or an Array of String values. All values passed in will be + # appended to the named attribute even if they are already present in the attribute. If the + # named attribute does not exist, it is created. + # + # [Returns] +self+ (Node) for ease of chaining method calls. + # + # *Example:* Append "nofollow" to the +rel+ attribute. + # + # Note that duplicates are added. + # + # node # => + # node.kwattr_append("rel", "nofollow") # => + # node.kwattr_append("rel", "nofollow") # => + # + # *Example:* Append "nofollow" and "noreferrer" to the +rel+ attribute, via a String argument. + # + # Note that "nofollow" is appended even though it is already present. + # + # node # => + # node.kwattr_append("rel", "nofollow noreferrer") # => + # + # + # *Example:* Append "nofollow" and "noreferrer" to the +rel+ attribute, via an Array argument. + # + # node # => + # node.kwattr_append("rel", ["nofollow", "noreferrer"]) # => + # + # Since v1.11.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1071 + def kwattr_append(attribute_name, keywords); end + + # :call-seq: + # kwattr_remove(attribute_name, keywords) → self + # + # Remove keywords from a keyword attribute. Any matching keywords that exist in the named + # attribute are removed, including any multiple entries. + # + # If no keywords remain after this operation, or if +keywords+ is +nil+, the attribute is + # deleted from the node. + # + # A "keyword attribute" is a node attribute that contains a set of space-delimited + # values. Perhaps the most familiar example of this is the HTML "class" attribute used to + # contain CSS classes. But other keyword attributes exist, for instance + # {the "rel" attribute}[https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel]. + # + # See also #remove_class, #kwattr_values, #kwattr_add, #kwattr_append + # + # [Parameters] + # - +attribute_name+ (String) The name of the keyword attribute to be modified. + # - +keywords+ (String, Array) + # Keywords to be removed from the attribute named +attribute_name+. May be a string + # containing whitespace-delimited values, or an Array of String values. Any keywords present + # in the named attribute will be removed. If no keywords remain, or if +keywords+ is nil, + # the attribute is deleted. + # + # [Returns] +self+ (Node) for ease of chaining method calls. + # + # *Example:* + # + # Note that the +rel+ attribute is deleted when empty. + # + # node # => link + # node.kwattr_remove("rel", "nofollow") # => link + # node.kwattr_remove("rel", "noreferrer") # => link + # + # Since v1.11.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1114 + def kwattr_remove(attribute_name, keywords); end + + # :call-seq: + # kwattr_values(attribute_name) → Array + # + # Fetch values from a keyword attribute of a Node. + # + # A "keyword attribute" is a node attribute that contains a set of space-delimited + # values. Perhaps the most familiar example of this is the HTML "class" attribute used to + # contain CSS classes. But other keyword attributes exist, for instance + # {the "rel" attribute}[https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel]. + # + # See also #classes, #kwattr_add, #kwattr_append, #kwattr_remove + # + # [Parameters] + # - +attribute_name+ (String) The name of the keyword attribute to be inspected. + # + # [Returns] + # (Array) The values present in the Node's +attribute_name+ attribute. If the + # attribute is empty or non-existent, the return value is an empty array. + # + # *Example:* + # + # node # => link + # node.kwattr_values("rel") # => ["nofollow", "noopener", "external"] + # + # Since v1.11.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:964 + def kwattr_values(attribute_name); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def lang; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def lang=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def last_element_child; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def line; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def line=(_arg0); end + + # Returns true if this Node matches +selector+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1141 + def matches?(selector); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:602 + def name; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:594 + def name=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def namespace; end + + # Set the default namespace on this node (as would be defined with an + # "xmlns=" attribute in XML source), as a Namespace object +ns+. Note that + # a Namespace added this way will NOT be serialized as an xmlns attribute + # for this node. You probably want #default_namespace= instead, or perhaps + # #add_namespace_definition with a nil prefix argument. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:513 + def namespace=(ns); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def namespace_definitions; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def namespace_scopes; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def namespaced_key?(_arg0, _arg1); end + + # :call-seq: + # namespaces() → Hash + # + # Fetch all the namespaces on this node and its ancestors. + # + # Note that the keys in this hash XML attributes that would be used to define this namespace, + # such as "xmlns:prefix", not just the prefix. + # + # The default namespace for this node will be included with key "xmlns". + # + # See also #namespace_scopes + # + # [Returns] + # Hash containing all the namespaces on this node and its ancestors. The hash keys are the + # namespace prefix, and the hash value for each key is the namespace URI. + # + # *Example:* + # + # doc = Nokogiri::XML(<<~EOF) + # + # + # + # + # + # EOF + # doc.at_xpath("//root:first", "root" => "http://example.com/root").namespaces + # # => {"xmlns"=>"http://example.com/root", + # # "xmlns:in_scope"=>"http://example.com/in_scope"} + # doc.at_xpath("//child:second", "child" => "http://example.com/child").namespaces + # # => {"xmlns"=>"http://example.com/child", + # # "xmlns:in_scope"=>"http://example.com/in_scope"} + # doc.at_xpath("//root:third", "root" => "http://example.com/root").namespaces + # # => {"xmlns:foo"=>"http://example.com/foo", + # # "xmlns"=>"http://example.com/root", + # # "xmlns:in_scope"=>"http://example.com/in_scope"} + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1251 + def namespaces; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_content=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:589 + def next; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:591 + def next=(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def next_element; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def next_sibling; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def node_name; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def node_name=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def node_type; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def parent; end + + # Set the parent Node for this Node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:493 + def parent=(parent_node); end + + # Parse +string_or_io+ as a document fragment within the context of + # *this* node. Returns a XML::NodeSet containing the nodes parsed from + # +string_or_io+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1156 + def parse(string_or_io, options = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def path; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def pointer_id; end + + # Add +node_or_tags+ as the first child of this Node. + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns the reparented node (if +node_or_tags+ is a Node), or NodeSet (if +node_or_tags+ is + # a DocumentFragment, NodeSet, or String). + # + # Also see related method +add_child+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:204 + def prepend_child(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:590 + def previous; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:592 + def previous=(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def previous_element; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def previous_sibling; end + + # Returns true if this is a ProcessingInstruction node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1285 + def processing_instruction?; end + + # Is this a read only node? + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1310 + def read_only?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:593 + def remove; end + + # Remove the attribute named +name+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:769 + def remove_attribute(name); end + + # :call-seq: + # remove_class(css_classes) → self + # + # Remove HTML CSS classes from this node. Any CSS class names in +css_classes+ that exist in + # this node's "class" attribute are removed, including any multiple entries. + # + # If no CSS classes remain after this operation, or if +css_classes+ is +nil+, the "class" + # attribute is deleted from the node. + # + # This is a convenience function and is equivalent to: + # + # node.kwattr_remove("class", css_classes) + # + # Also see #kwattr_remove, #classes, #add_class, #append_class + # + # [Parameters] + # - +css_classes+ (String, Array) + # + # CSS class names to be removed from the Node's + # "class" attribute. May be a string containing whitespace-delimited names, or an Array of + # String names. Any class names already present will be removed. If no CSS classes remain, + # the "class" attribute is deleted. + # + # [Returns] +self+ (Nokogiri::XML::Node) for ease of chaining method calls. + # + # *Example*: Deleting a CSS class + # + # Note that all instances of the class "section" are removed from the "class" attribute. + # + # node # =>
    + # node.remove_class("section") # =>
    + # + # *Example*: Deleting the only remaining CSS class + # + # Note that the attribute is removed once there are no remaining classes. + # + # node # =>
    + # node.remove_class("section") # =>
    + # + # *Example*: Deleting multiple CSS classes + # + # Note that the "class" attribute is deleted once it's empty. + # + # node # =>
    + # node.remove_class(["section", "float"]) # =>
    + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:935 + def remove_class(names = T.unsafe(nil)); end + + # Replace this Node with +node_or_tags+. + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # containing markup. + # + # Returns the reparented node (if +node_or_tags+ is a Node), or NodeSet (if +node_or_tags+ is + # a DocumentFragment, NodeSet, or String). + # + # Also see related method +swap+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:405 + def replace(node_or_tags); end + + # Serialize Node using +options+. Save options can also be set using a block. + # + # See also Nokogiri::XML::Node::SaveOptions and Node@Serialization+and+Generating+Output. + # + # These two statements are equivalent: + # + # + # or + # + # config.format.as_xml + # end + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1415 + def serialize(*args, &block); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1134 + def set_attribute(name, value); end + + # Swap this Node for +node_or_tags+ + # + # +node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String + # Containing markup. + # + # Returns self, to support chaining of calls. + # + # Also see related method +replace+. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:439 + def swap(node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:600 + def text; end + + # Returns true if this is a Text node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1290 + def text?; end + + # Serialize this Node to HTML + # + # doc.to_html + # + # See Node#write_to for a list of +options+. For formatted output, + # use Node#to_xhtml instead. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1442 + def to_html(options = T.unsafe(nil)); end + + # Turn this node in to a string. If the document is HTML, this method + # returns html. If the document is XML, this method returns XML. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1325 + def to_s; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:601 + def to_str; end + + # Serialize this Node to XHTML using +options+ + # + # + # See Node#write_to for a list of +options+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1463 + def to_xhtml(options = T.unsafe(nil)); end + + # Serialize this Node to XML using +options+ + # + # + # See Node#write_to for a list of +options+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1452 + def to_xml(options = T.unsafe(nil)); end + + # Yields self and all children to +block+ recursively. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1368 + def traverse(&block); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:603 + def type; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def unlink; end + + # Does this Node's attributes include + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:749 + def value?(value); end + + # Get the attribute values for this Node. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:743 + def values; end + + # :call-seq: + # wrap(markup) -> self + # wrap(node) -> self + # + # Wrap this Node with the node parsed from +markup+ or a dup of the +node+. + # + # [Parameters] + # - *markup* (String) + # Markup that is parsed and used as the wrapper. This node's parent, if it exists, is used + # as the context node for parsing; otherwise the associated document is used. If the parsed + # fragment has multiple roots, the first root node is used as the wrapper. + # - *node* (Nokogiri::XML::Node) + # An element that is `#dup`ed and used as the wrapper. + # + # [Returns] +self+, to support chaining. + # + # Also see NodeSet#wrap + # + # *Example* with a +String+ argument: + # + # doc = Nokogiri::HTML5(<<~HTML) + # + # asdf + # + # HTML + # doc.at_css("a").wrap("
    ") + # doc.to_html + # # => + # # + # # + # + # *Example* with a +Node+ argument: + # + # doc = Nokogiri::HTML5(<<~HTML) + # + # asdf + # + # HTML + # doc.at_css("a").wrap(doc.create_element("div")) + # doc.to_html + # # + # # + # # + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:259 + def wrap(node_or_tags); end + + # Write Node as HTML to +io+ with +options+ + # + # See Node#write_to for a list of +options+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1520 + def write_html_to(io, options = T.unsafe(nil)); end + + # :call-seq: + # write_to(io, *options) + # + # Serialize this node or document to +io+. + # + # [Parameters] + # - +io+ (IO) An IO-like object to which the serialized content will be written. + # - +options+ (Hash) See below + # + # [Options] + # * +:encoding+ (String or Encoding) specify the encoding of the output (defaults to document encoding) + # * +:indent_text+ (String) the indentation text (defaults to " ") + # * +:indent+ (Integer) the number of +:indent_text+ to use (defaults to +2+) + # * +:save_with+ (Integer) a combination of SaveOptions constants + # + # To save with UTF-8 indented twice: + # + # + # To save indented with two dashes: + # + # node.write_to(io, indent_text: '-', indent: 2) + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1491 + def write_to(io, *options); end + + # Write Node as XHTML to +io+ with +options+ + # + # See Node#write_to for a list of +options+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1528 + def write_xhtml_to(io, options = T.unsafe(nil)); end + + # Write Node as XML to +io+ with +options+ + # + # doc.write_xml_to io, :encoding => 'UTF-8' + # + # See Node#write_to for a list of options + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1538 + def write_xml_to(io, options = T.unsafe(nil)); end + + # Returns true if this is an XML::Document node + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1270 + def xml?; end + + protected + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1618 + def coerce(data); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_copy_with_args(_arg0, _arg1, _arg2); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def safe_process_xinclude(_arg0); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def add_child_node(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1690 + def add_child_node_and_reparent_attrs(node); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def add_next_sibling_node(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def add_previous_sibling_node(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1652 + def add_sibling(next_or_previous, node_or_tags); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def compare(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def dump_html; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def get(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def html_standard_serialize(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def in_context(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1684 + def inspect_attributes; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1640 + def keywordify(keywords); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_write_to(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def prepend_newline?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def process_xincludes(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def replace_node(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def set(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def set_namespace(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1674 + def to_format(save_option, options); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1679 + def write_format_to(save_option, io, options); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# Attribute declaration type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:93 +Nokogiri::XML::Node::ATTRIBUTE_DECL = T.let(T.unsafe(nil), Integer) + +# Attribute node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:65 +Nokogiri::XML::Node::ATTRIBUTE_NODE = T.let(T.unsafe(nil), Integer) + +# CDATA node type, see Nokogiri::XML::Node#cdata? +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:69 +Nokogiri::XML::Node::CDATA_SECTION_NODE = T.let(T.unsafe(nil), Integer) + +# Comment node type, see Nokogiri::XML::Node#comment? +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:77 +Nokogiri::XML::Node::COMMENT_NODE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1551 +Nokogiri::XML::Node::DECONSTRUCT_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1552 +Nokogiri::XML::Node::DECONSTRUCT_METHODS = T.let(T.unsafe(nil), Hash) + +# DOCB document node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:103 +Nokogiri::XML::Node::DOCB_DOCUMENT_NODE = T.let(T.unsafe(nil), Integer) + +# Document fragment node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:83 +Nokogiri::XML::Node::DOCUMENT_FRAG_NODE = T.let(T.unsafe(nil), Integer) + +# Document node type, see Nokogiri::XML::Node#xml? +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:79 +Nokogiri::XML::Node::DOCUMENT_NODE = T.let(T.unsafe(nil), Integer) + +# Document type node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:81 +Nokogiri::XML::Node::DOCUMENT_TYPE_NODE = T.let(T.unsafe(nil), Integer) + +# DTD node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:89 +Nokogiri::XML::Node::DTD_NODE = T.let(T.unsafe(nil), Integer) + +# Element declaration type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:91 +Nokogiri::XML::Node::ELEMENT_DECL = T.let(T.unsafe(nil), Integer) + +# Element node type, see Nokogiri::XML::Node#element? +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:63 +Nokogiri::XML::Node::ELEMENT_NODE = T.let(T.unsafe(nil), Integer) + +# Entity declaration type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:95 +Nokogiri::XML::Node::ENTITY_DECL = T.let(T.unsafe(nil), Integer) + +# Entity node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:73 +Nokogiri::XML::Node::ENTITY_NODE = T.let(T.unsafe(nil), Integer) + +# Entity reference node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:71 +Nokogiri::XML::Node::ENTITY_REF_NODE = T.let(T.unsafe(nil), Integer) + +# HTML document node type, see Nokogiri::XML::Node#html? +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:87 +Nokogiri::XML::Node::HTML_DOCUMENT_NODE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:1688 +Nokogiri::XML::Node::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array) + +# Namespace declaration type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:97 +Nokogiri::XML::Node::NAMESPACE_DECL = T.let(T.unsafe(nil), Integer) + +# Notation node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:85 +Nokogiri::XML::Node::NOTATION_NODE = T.let(T.unsafe(nil), Integer) + +# PI node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:75 +Nokogiri::XML::Node::PI_NODE = T.let(T.unsafe(nil), Integer) + +# Save options for serializing nodes. +# See the method group entitled Node@Serialization+and+Generating+Output for usage. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:9 +class Nokogiri::XML::Node::SaveOptions + # Create a new SaveOptions object with +options+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:47 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def as_html; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def as_html?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def as_xhtml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def as_xhtml?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def as_xml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def as_xml?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def default_html; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def default_html?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def default_xhtml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def default_xhtml?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def default_xml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def default_xml?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def format; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def format?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:66 + def inspect; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def no_declaration; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def no_declaration?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def no_empty_tags; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def no_empty_tags?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def no_xhtml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:52 + def no_xhtml?; end + + # Integer representation of the SaveOptions + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:44 + def options; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:64 + def to_i; end +end + +# Save as HTML +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:23 +Nokogiri::XML::Node::SaveOptions::AS_HTML = T.let(T.unsafe(nil), Integer) + +# Save as XHTML +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:19 +Nokogiri::XML::Node::SaveOptions::AS_XHTML = T.let(T.unsafe(nil), Integer) + +# Save as XML +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:21 +Nokogiri::XML::Node::SaveOptions::AS_XML = T.let(T.unsafe(nil), Integer) + +# https://github.com/sparklemotion/nokogiri/issues/#issue/415 +# the default for HTML document +# the default for HTML document +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:38 +Nokogiri::XML::Node::SaveOptions::DEFAULT_HTML = T.let(T.unsafe(nil), Integer) + +# the default for XHTML document +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:40 +Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML = T.let(T.unsafe(nil), Integer) + +# the default for XML documents +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:36 +Nokogiri::XML::Node::SaveOptions::DEFAULT_XML = T.let(T.unsafe(nil), Integer) + +# Format serialized xml +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:11 +Nokogiri::XML::Node::SaveOptions::FORMAT = T.let(T.unsafe(nil), Integer) + +# Do not include declarations +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:13 +Nokogiri::XML::Node::SaveOptions::NO_DECLARATION = T.let(T.unsafe(nil), Integer) + +# Do not include empty tags +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:15 +Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS = T.let(T.unsafe(nil), Integer) + +# Do not save XHTML +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node/save_options.rb:17 +Nokogiri::XML::Node::SaveOptions::NO_XHTML = T.let(T.unsafe(nil), Integer) + +# Text node type, see Nokogiri::XML::Node#text? +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:67 +Nokogiri::XML::Node::TEXT_NODE = T.let(T.unsafe(nil), Integer) + +# XInclude end type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:101 +Nokogiri::XML::Node::XINCLUDE_END = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:526 +Nokogiri::XML::Node::XINCLUDE_NAMESPACES = T.let(T.unsafe(nil), Hash) + +# Every top-level in the subtree, in either XInclude namespace, excluding +# includes nested inside another include's fallback (libxml2 only expands those if the +# parent include fails). +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:535 +Nokogiri::XML::Node::XINCLUDE_QUERY = T.let(T.unsafe(nil), String) + +# XInclude start type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/node.rb:99 +Nokogiri::XML::Node::XINCLUDE_START = T.let(T.unsafe(nil), Integer) + +# A NodeSet is an Enumerable that contains a list of Nokogiri::XML::Node objects. +# +# Typically a NodeSet is returned as a result of searching a Document via +# Nokogiri::XML::Searchable#css or Nokogiri::XML::Searchable#xpath. +# +# Note that the `#dup` and `#clone` methods perform shallow copies; these methods do not copy +# the Nodes contained in the NodeSet (similar to how Array and other Enumerable classes work). +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::NodeSet + include ::Nokogiri::XML::Searchable + include ::Enumerable + + # Create a NodeSet with +document+ defaulting to +list+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:22 + def initialize(document, list = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:128 + def %(*args); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def &(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:433 + def +(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def -(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:75 + def <<(_arg0); end + + # Equality -- Two NodeSets are equal if the contain the same number + # of elements and if each element is equal to the corresponding + # element in the other NodeSet + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:395 + def ==(other); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def [](*_arg0); end + + # Add the class attribute +name+ to all Node objects in the + # NodeSet. + # + # See Nokogiri::XML::Node#add_class for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:141 + def add_class(name); end + + # Insert +datum+ after the last Node in this NodeSet + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:71 + def after(datum); end + + # Append the class attribute +name+ to all Node objects in the + # NodeSet. + # + # See Nokogiri::XML::Node#append_class for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:153 + def append_class(name); end + + # call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class] + # + # Search this object for +paths+, and return only the first + # result. +paths+ must be one or more XPath or CSS queries. + # + # See Searchable#search for more information. + # + # Or, if passed an integer, index into the NodeSet: + # + # node_set.at(3) # same as node_set[3] + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:121 + def at(*args); end + + # Set attributes on each Node in the NodeSet, or get an + # attribute from the first Node in the NodeSet. + # + # To get an attribute from the first Node in a NodeSet: + # + # node_set.attr("href") # => "https://www.nokogiri.org" + # + # Note that an empty NodeSet will return nil when +#attr+ is called as a getter. + # + # To set an attribute on each node, +key+ can either be an + # attribute name, or a Hash of attribute names and values. When + # called as a setter, +#attr+ returns the NodeSet. + # + # If +key+ is an attribute name, then either +value+ or +block+ + # must be passed. + # + # If +key+ is a Hash then attributes will be set for each + # key/value pair: + # + # node_set.attr("href" => "https://www.nokogiri.org", "class" => "member") + # + # If +value+ is passed, it will be used as the attribute value + # for all nodes: + # + # node_set.attr("href", "https://www.nokogiri.org") + # + # If +block+ is passed, it will be called on each Node object in + # the NodeSet and the return value used as the attribute value + # for that node: + # + # node_set.attr("class") { |node| node.name } + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:205 + def attr(key, value = T.unsafe(nil), &block); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:221 + def attribute(key, value = T.unsafe(nil), &block); end + + # Insert +datum+ before the first Node in this NodeSet + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:65 + def before(datum); end + + # Returns a new NodeSet containing all the children of all the nodes in + # the NodeSet + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:408 + def children; end + + # call-seq: css *rules, [namespace-bindings, custom-pseudo-class] + # + # Search this node set for CSS +rules+. +rules+ must be one or more CSS + # selectors. For example: + # + # For more information see Nokogiri::XML::Searchable#css + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:85 + def css(*args); end + + # :call-seq: deconstruct() → Array + # + # Returns the members of this NodeSet as an array, to use in pattern matching. + # + # Since v1.14.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:442 + def deconstruct; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def delete(_arg0); end + + # The Document this NodeSet is associated with + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:19 + def document; end + + # The Document this NodeSet is associated with + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:19 + def document=(_arg0); end + + # Iterate over each node, yielding to +block+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:233 + def each; end + + # Is this NodeSet empty? + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:47 + def empty?; end + + # Filter this list for nodes that match +expr+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:132 + def filter(expr); end + + # Get the first element of the NodeSet. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:31 + def first(n = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def include?(_arg0); end + + # Returns the index of the first node in self that is == to +node+ or meets the given block. Returns nil if no match is found. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:53 + def index(node = T.unsafe(nil)); end + + # Get the inner html of all contained Node objects + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:262 + def inner_html(*args); end + + # Get the inner text of all contained Node objects + # + # Note: This joins the text of all Node objects in the NodeSet: + # + # doc = Nokogiri::XML('foobar') + # doc.css('d').text # => "foobar" + # + # Instead, if you want to return the text of all nodes in the NodeSet: + # + # doc.css('d').map(&:text) # => ["foo", "bar"] + # + # See Nokogiri::XML::Node#content for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:255 + def inner_text; end + + # Return a nicely formatted string representation + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:429 + def inspect; end + + # Get the last element of the NodeSet. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:41 + def last; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def length; end + + # Removes the last element from set and returns it, or +nil+ if + # the set is empty + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:376 + def pop; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def push(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:76 + def remove; end + + # Remove the attributed named +name+ from all Node objects in the NodeSet + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:225 + def remove_attr(name); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:229 + def remove_attribute(name); end + + # Remove the class attribute +name+ from all Node objects in the + # NodeSet. + # + # See Nokogiri::XML::Node#remove_class for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:165 + def remove_class(name = T.unsafe(nil)); end + + # Returns a new NodeSet containing all the nodes in the NodeSet + # in reverse order + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:419 + def reverse; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:220 + def set(key, value = T.unsafe(nil), &block); end + + # Returns the first element of the NodeSet and removes it. Returns + # +nil+ if the set is empty. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:385 + def shift; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:370 + def size; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def slice(*_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:258 + def text; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def to_a; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:371 + def to_ary; end + + # Convert this NodeSet to HTML + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:343 + def to_html(*args); end + + # Convert this NodeSet to a string. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:337 + def to_s; end + + # Convert this NodeSet to XHTML + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:360 + def to_xhtml(*args); end + + # Convert this NodeSet to XML + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:366 + def to_xml(*args); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def unlink; end + + # :call-seq: + # wrap(markup) -> self + # wrap(node) -> self + # + # Wrap each member of this NodeSet with the node parsed from +markup+ or a dup of the +node+. + # + # [Parameters] + # - *markup* (String) + # Markup that is parsed, once per member of the NodeSet, and used as the wrapper. Each + # node's parent, if it exists, is used as the context node for parsing; otherwise the + # associated document is used. If the parsed fragment has multiple roots, the first root + # node is used as the wrapper. + # - *node* (Nokogiri::XML::Node) + # An element that is `#dup`ed and used as the wrapper. + # + # [Returns] +self+, to support chaining. + # + # ⚠ Note that if a +String+ is passed, the markup will be parsed once per node in the + # NodeSet. You can avoid this overhead in cases where you know exactly the wrapper you wish to + # use by passing a +Node+ instead. + # + # Also see Node#wrap + # + # *Example* with a +String+ argument: + # + # doc = Nokogiri::HTML5(<<~HTML) + # + # a + # b + # c + # d + # + # HTML + # doc.css("a").wrap("
    ") + # doc.to_html + # # => + # # + # # + # # + # # + # # + # + # *Example* with a +Node+ argument + # + # 💡 Note that this is faster than the equivalent call passing a +String+ because it avoids + # having to reparse the wrapper markup for each node. + # + # doc = Nokogiri::HTML5(<<~HTML) + # + # a + # b + # c + # d + # + # HTML + # doc.css("a").wrap(doc.create_element("div")) + # doc.to_html + # # => + # # + # # + # # + # # + # # + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:330 + def wrap(node_or_tags); end + + # call-seq: xpath *paths, [namespace-bindings, variable-bindings, custom-handler-class] + # + # Search this node set for XPath +paths+. +paths+ must be one or more XPath + # queries. + # + # For more information see Nokogiri::XML::Searchable#xpath + # + # pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:101 + def xpath(*args); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def |(_arg0); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_copy(_arg0); end +end + +# pkg:gem/nokogiri#lib/nokogiri/xml/node_set.rb:446 +Nokogiri::XML::NodeSet::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array) + +# Struct representing an {XML Schema Notation}[https://www.w3.org/TR/xml/#Notations] +# +# pkg:gem/nokogiri#lib/nokogiri/xml/notation.rb:6 +class Nokogiri::XML::Notation < ::Struct; end + +# pkg:gem/nokogiri#lib/nokogiri/xml/pp/node.rb:6 +module Nokogiri::XML::PP; end + +# pkg:gem/nokogiri#lib/nokogiri/xml/pp/character_data.rb:7 +module Nokogiri::XML::PP::CharacterData + # pkg:gem/nokogiri#lib/nokogiri/xml/pp/character_data.rb:15 + def inspect; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/pp/character_data.rb:8 + def pretty_print(pp); end +end + +# pkg:gem/nokogiri#lib/nokogiri/xml/pp/node.rb:7 +module Nokogiri::XML::PP::Node + # pkg:gem/nokogiri#lib/nokogiri/xml/pp/node.rb:10 + def inspect; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/pp/node.rb:32 + def pretty_print(pp); end +end + +# pkg:gem/nokogiri#lib/nokogiri/xml/pp/node.rb:8 +Nokogiri::XML::PP::Node::COLLECTIONS = T.let(T.unsafe(nil), Array) + +# Options that control the parsing behavior for XML::Document, XML::DocumentFragment, +# HTML4::Document, HTML4::DocumentFragment, XSLT::Stylesheet, and XML::Schema. +# +# These options directly expose libxml2's parse options, which are all boolean in the sense that +# an option is "on" or "off". +# +# 💡 Note that HTML5 parsing has a separate, orthogonal set of options due to the nature of the +# HTML5 specification. See Nokogiri::HTML5. +# +# ⚠ Not all parse options are supported on JRuby. Nokogiri will attempt to invoke the equivalent +# behavior in Xerces/NekoHTML on JRuby when it's possible. +# +# == Setting and unsetting parse options +# +# You can build your own combinations of parse options by using any of the following methods: +# +# [ParseOptions method chaining] +# +# Every option has an equivalent method in lowercase. You can chain these methods together to +# set various combinations. +# +# # Set the HUGE & PEDANTIC options +# po = Nokogiri::XML::ParseOptions.new.huge.pedantic +# doc = Nokogiri::XML::Document.parse(xml, nil, nil, po) +# +# Every option has an equivalent no{option} method in lowercase. You can call these +# methods on an instance of ParseOptions to unset the option. +# +# # Set the HUGE & PEDANTIC options +# po = Nokogiri::XML::ParseOptions.new.huge.pedantic +# +# # later we want to modify the options +# po.nohuge # Unset the HUGE option +# po.nopedantic # Unset the PEDANTIC option +# +# 💡 Note that some options begin with "no" leading to the logical but perhaps unintuitive +# double negative: +# +# po.nocdata # Set the NOCDATA parse option +# po.nonocdata # Unset the NOCDATA parse option +# +# 💡 Note that negation is not available for STRICT, which is itself a negation of all other +# features. +# +# +# [Using Ruby Blocks] +# +# Most parsing methods will accept a block for configuration of parse options, and we +# recommend chaining the setter methods: +# +# doc = Nokogiri::XML::Document.parse(xml) { |config| config.huge.pedantic } +# +# +# [ParseOptions constants] +# +# You can also use the constants declared under Nokogiri::XML::ParseOptions to set various +# combinations. They are bits in a bitmask, and so can be combined with bitwise operators: +# +# po = Nokogiri::XML::ParseOptions.new(Nokogiri::XML::ParseOptions::HUGE | Nokogiri::XML::ParseOptions::PEDANTIC) +# doc = Nokogiri::XML::Document.parse(xml, nil, nil, po) +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:67 +class Nokogiri::XML::ParseOptions + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:169 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:202 + def ==(other); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def big_lines; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def big_lines?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def compact; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def compact?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_html; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_html?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_schema; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_schema?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_xml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_xml?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_xslt; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def default_xslt?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def dtdattr; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def dtdattr?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def dtdload; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def dtdload?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def dtdvalid; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def dtdvalid?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def huge; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def huge?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:208 + def inspect; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nobasefix; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nobasefix?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nobig_lines; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noblanks; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noblanks?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nocdata; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nocdata?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nocompact; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodefault_html; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodefault_schema; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodefault_xml; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodefault_xslt; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodict; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodict?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodtdattr; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodtdload; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nodtdvalid; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noent; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noent?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noerror; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noerror?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nohuge; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonet; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonet?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonobasefix; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonoblanks; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonocdata; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonodict; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonoent; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonoerror; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nononet; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonowarning; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonoxincnode; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nonsclean; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noold10; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nopedantic; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def norecover; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nosax1; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nowarning; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nowarning?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noxinclude; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noxincnode; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def noxincnode?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nsclean; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def nsclean?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def old10; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def old10?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:167 + def options; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:167 + def options=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def pedantic; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def pedantic?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def recover; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def recover?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def sax1; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def sax1?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:193 + def strict; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:198 + def strict?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:206 + def to_i; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def xinclude; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:176 + def xinclude?; end +end + +# Support line numbers up to long int (default is a short int). On +# by default for for XML::Document, XML::DocumentFragment, HTML4::Document, +# HTML4::DocumentFragment, XSLT::Stylesheet, and XML::Schema. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:148 +Nokogiri::XML::ParseOptions::BIG_LINES = T.let(T.unsafe(nil), Integer) + +# Compact small text nodes. Off by default. +# +# ⚠ No modification of the DOM tree is allowed after parsing. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:132 +Nokogiri::XML::ParseOptions::COMPACT = T.let(T.unsafe(nil), Integer) + +# The options mask used by default used for parsing HTML4::Document and HTML4::DocumentFragment +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:162 +Nokogiri::XML::ParseOptions::DEFAULT_HTML = T.let(T.unsafe(nil), Integer) + +# The options mask used by default used for parsing XML::Schema +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:165 +Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA = T.let(T.unsafe(nil), Integer) + +# The options mask used by default for parsing XML::Document and XML::DocumentFragment +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:151 +Nokogiri::XML::ParseOptions::DEFAULT_XML = T.let(T.unsafe(nil), Integer) + +# Shorthand options mask useful for parsing XSLT stylesheets: +# sets RECOVER, NONET, NOENT, DTDLOAD, DTDATTR, NOCDATA, BIG_LINES. +# +# 🛡 This option set includes `NOENT` and `DTDLOAD` which are unsafe for untrusted +# documents. Do not parse untrusted XSLT stylesheets. See Nokogiri::XSLT for more +# information. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:159 +Nokogiri::XML::ParseOptions::DEFAULT_XSLT = T.let(T.unsafe(nil), Integer) + +# Default DTD attributes. On by default for XSLT::Stylesheet. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:88 +Nokogiri::XML::ParseOptions::DTDATTR = T.let(T.unsafe(nil), Integer) + +# Load external subsets. On by default for XSLT::Stylesheet. +# +# 🛡 It is UNSAFE to set this option when parsing untrusted documents. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:85 +Nokogiri::XML::ParseOptions::DTDLOAD = T.let(T.unsafe(nil), Integer) + +# Validate with the DTD. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:91 +Nokogiri::XML::ParseOptions::DTDVALID = T.let(T.unsafe(nil), Integer) + +# Relax any hardcoded limit from the parser. Off by default. +# +# 🛡 It is UNSAFE to set this option when parsing untrusted documents. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:143 +Nokogiri::XML::ParseOptions::HUGE = T.let(T.unsafe(nil), Integer) + +# Do not fixup XInclude xml:base uris. Off by default +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:138 +Nokogiri::XML::ParseOptions::NOBASEFIX = T.let(T.unsafe(nil), Integer) + +# Remove blank nodes. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:103 +Nokogiri::XML::ParseOptions::NOBLANKS = T.let(T.unsafe(nil), Integer) + +# Merge CDATA as text nodes. On by default for XSLT::Stylesheet. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:124 +Nokogiri::XML::ParseOptions::NOCDATA = T.let(T.unsafe(nil), Integer) + +# Do not reuse the context dictionary. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:118 +Nokogiri::XML::ParseOptions::NODICT = T.let(T.unsafe(nil), Integer) + +# Substitute entities. Off by default. +# +# ⚠ This option enables entity substitution, contrary to what the name implies. +# +# 🛡 It is UNSAFE to set this option when parsing untrusted documents. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:80 +Nokogiri::XML::ParseOptions::NOENT = T.let(T.unsafe(nil), Integer) + +# Suppress error reports. On by default for HTML4::Document and HTML4::DocumentFragment +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:94 +Nokogiri::XML::ParseOptions::NOERROR = T.let(T.unsafe(nil), Integer) + +# Forbid network access. On by default for XML::Document, XML::DocumentFragment, +# HTML4::Document, HTML4::DocumentFragment, XSLT::Stylesheet, and XML::Schema. +# +# 🛡 It is UNSAFE to unset this option when parsing untrusted documents. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:115 +Nokogiri::XML::ParseOptions::NONET = T.let(T.unsafe(nil), Integer) + +# Suppress warning reports. On by default for HTML4::Document and HTML4::DocumentFragment +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:97 +Nokogiri::XML::ParseOptions::NOWARNING = T.let(T.unsafe(nil), Integer) + +# Do not generate XInclude START/END nodes. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:127 +Nokogiri::XML::ParseOptions::NOXINCNODE = T.let(T.unsafe(nil), Integer) + +# Remove redundant namespaces declarations. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:121 +Nokogiri::XML::ParseOptions::NSCLEAN = T.let(T.unsafe(nil), Integer) + +# Parse using XML-1.0 before update 5. Off by default +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:135 +Nokogiri::XML::ParseOptions::OLD10 = T.let(T.unsafe(nil), Integer) + +# Enable pedantic error reporting. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:100 +Nokogiri::XML::ParseOptions::PEDANTIC = T.let(T.unsafe(nil), Integer) + +# Recover from errors. On by default for XML::Document, XML::DocumentFragment, +# HTML4::Document, HTML4::DocumentFragment, XSLT::Stylesheet, and XML::Schema. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:73 +Nokogiri::XML::ParseOptions::RECOVER = T.let(T.unsafe(nil), Integer) + +# Use the SAX1 interface internally. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:106 +Nokogiri::XML::ParseOptions::SAX1 = T.let(T.unsafe(nil), Integer) + +# Strict parsing +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:69 +Nokogiri::XML::ParseOptions::STRICT = T.let(T.unsafe(nil), Integer) + +# Implement XInclude substitution. Off by default. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/parse_options.rb:109 +Nokogiri::XML::ParseOptions::XINCLUDE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::ProcessingInstruction < ::Nokogiri::XML::Node + # pkg:gem/nokogiri#lib/nokogiri/xml/processing_instruction.rb:6 + def initialize(document, name, content); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# The Reader parser allows you to effectively pull parse an \XML document. Once instantiated, +# call Nokogiri::XML::Reader#each to iterate over each node. +# +# Nokogiri::XML::Reader parses an \XML document similar to the way a cursor would move. The +# Reader is given an \XML document, and yields nodes to an each block. +# +# The Reader parser might be good for when you need the speed and low memory usage of a \SAX +# parser, but do not want to write a SAX::Document handler. +# +# Here is an example of usage: +# +# reader = Nokogiri::XML::Reader.new <<~XML +# +# snuggles! +# +# XML +# +# reader.each do |node| +# # node is an instance of Nokogiri::XML::Reader +# puts node.name +# end +# +# ⚠ Nokogiri::XML::Reader#each can only be called once! Once the cursor moves through the entire +# document, you must parse the document again. It may be better to capture all information you +# need during a single iteration. +# +# ⚠ libxml2 does not support error recovery in the Reader parser. The +RECOVER+ ParseOption is +# ignored. If a syntax error is encountered during parsing, an exception will be raised. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Reader + include ::Enumerable + + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:114 + def initialize(source, url = T.unsafe(nil), encoding = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute_at(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute_count; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attribute_hash; end + + # Get the attributes and namespaces of the current node as a Hash. + # + # This is the union of Reader#attribute_hash and Reader#namespaces + # + # [Returns] + # (Hash) Attribute names and values, and namespace prefixes and hrefs. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:126 + def attributes; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def attributes?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def base_uri; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def default?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def depth; end + + # Move the cursor through the document yielding the cursor to the block + # + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:132 + def each; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def empty_element?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def encoding; end + + # A list of errors encountered while parsing + # + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:74 + def errors; end + + # A list of errors encountered while parsing + # + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:74 + def errors=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def inner_xml; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def lang; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def local_name; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def name; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def namespace_uri; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def namespaces; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def node_type; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def outer_xml; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def prefix; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def read; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:79 + def self_closing?; end + + # The \XML source + # + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:77 + def source; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def state; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def value; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def value?; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def xml_version; end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def from_io(*_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def from_memory(*_arg0); end + + # :call-seq: + # Reader.new(input) { |options| ... } → Reader + # + # Create a new Reader to parse an \XML document. + # + # [Required Parameters] + # - +input+ (String | IO): The \XML document to parse. + # + # [Optional Parameters] + # - +url:+ (String) The base URL of the document. + # - +options:+ (Integer | ParseOptions) Options to control the parser behavior. + # Defaults to +ParseOptions::STRICT+. + # + # [Yields] + # If present, the block will be passed a Nokogiri::XML::ParseOptions object to modify before + # the fragment is parsed. See Nokogiri::XML::ParseOptions for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:99 + def new(string_or_io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil)); end + end +end + +# Attribute node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:41 +Nokogiri::XML::Reader::TYPE_ATTRIBUTE = T.let(T.unsafe(nil), Integer) + +# CDATA node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:45 +Nokogiri::XML::Reader::TYPE_CDATA = T.let(T.unsafe(nil), Integer) + +# Comment node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:53 +Nokogiri::XML::Reader::TYPE_COMMENT = T.let(T.unsafe(nil), Integer) + +# Document node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:55 +Nokogiri::XML::Reader::TYPE_DOCUMENT = T.let(T.unsafe(nil), Integer) + +# Document Fragment node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:59 +Nokogiri::XML::Reader::TYPE_DOCUMENT_FRAGMENT = T.let(T.unsafe(nil), Integer) + +# Document Type node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:57 +Nokogiri::XML::Reader::TYPE_DOCUMENT_TYPE = T.let(T.unsafe(nil), Integer) + +# Element node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:39 +Nokogiri::XML::Reader::TYPE_ELEMENT = T.let(T.unsafe(nil), Integer) + +# Element end node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:67 +Nokogiri::XML::Reader::TYPE_END_ELEMENT = T.let(T.unsafe(nil), Integer) + +# Entity end node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:69 +Nokogiri::XML::Reader::TYPE_END_ENTITY = T.let(T.unsafe(nil), Integer) + +# Entity node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:49 +Nokogiri::XML::Reader::TYPE_ENTITY = T.let(T.unsafe(nil), Integer) + +# Entity Reference node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:47 +Nokogiri::XML::Reader::TYPE_ENTITY_REFERENCE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:37 +Nokogiri::XML::Reader::TYPE_NONE = T.let(T.unsafe(nil), Integer) + +# Notation node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:61 +Nokogiri::XML::Reader::TYPE_NOTATION = T.let(T.unsafe(nil), Integer) + +# PI node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:51 +Nokogiri::XML::Reader::TYPE_PROCESSING_INSTRUCTION = T.let(T.unsafe(nil), Integer) + +# Significant Whitespace node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:65 +Nokogiri::XML::Reader::TYPE_SIGNIFICANT_WHITESPACE = T.let(T.unsafe(nil), Integer) + +# Text node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:43 +Nokogiri::XML::Reader::TYPE_TEXT = T.let(T.unsafe(nil), Integer) + +# Whitespace node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:63 +Nokogiri::XML::Reader::TYPE_WHITESPACE = T.let(T.unsafe(nil), Integer) + +# \XML Declaration node type +# +# pkg:gem/nokogiri#lib/nokogiri/xml/reader.rb:71 +Nokogiri::XML::Reader::TYPE_XML_DECLARATION = T.let(T.unsafe(nil), Integer) + +# Nokogiri::XML::RelaxNG is used for validating \XML against a RELAX NG schema definition. +# +# 🛡 Do not use this class for untrusted schema documents. RELAX NG input is always +# treated as *trusted*, meaning that the underlying parsing libraries will access network +# resources. This is counter to Nokogiri's "untrusted by default" security policy, but is an +# unfortunate limitation of the underlying libraries. +# +# *Example:* Determine whether an \XML document is valid. +# +# schema = Nokogiri::XML::RelaxNG.new(File.read(RELAX_NG_FILE)) +# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE)) +# schema.valid?(doc) # Boolean +# +# *Example:* Validate an \XML document against a \RelaxNG schema, and capture any errors that are found. +# +# schema = Nokogiri::XML::RelaxNG.new(File.open(RELAX_NG_FILE)) +# doc = Nokogiri::XML::Document.parse(File.open(XML_FILE)) +# errors = schema.validate(doc) # Array +# +# *Example:* Validate an \XML document using a Document containing a RELAX NG schema definition. +# +# schema_doc = Nokogiri::XML::Document.parse(File.read(RELAX_NG_FILE)) +# schema = Nokogiri::XML::RelaxNG.from_document(schema_doc) +# doc = Nokogiri::XML::Document.parse(File.open(XML_FILE)) +# schema.valid?(doc) # Boolean +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::RelaxNG < ::Nokogiri::XML::Schema + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def validate_document(_arg0); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def from_document(*_arg0); end + + # :call-seq: + # new(input) → Nokogiri::XML::RelaxNG + # new(input, options:) → Nokogiri::XML::RelaxNG + # + # Parse a RELAX NG schema definition from a String or IO to create a new Nokogiri::XML::RelaxNG. + # + # [Parameters] + # - +input+ (String | IO) RELAX NG schema definition + # - +options:+ (Nokogiri::XML::ParseOptions) + # Defaults to Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA ⚠ Unused + # + # [Returns] Nokogiri::XML::RelaxNG + # + # ⚠ +parse_options+ is currently unused by this method and is present only as a placeholder for + # future functionality. + # + # Also see convenience method Nokogiri::XML::RelaxNG() + # + # pkg:gem/nokogiri#lib/nokogiri/xml/relax_ng.rb:60 + def new(input, parse_options_ = T.unsafe(nil), options: T.unsafe(nil)); end + + # :call-seq: + # read_memory(input) → Nokogiri::XML::RelaxNG + # read_memory(input, options:) → Nokogiri::XML::RelaxNG + # + # Convenience method for Nokogiri::XML::RelaxNG.new. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/relax_ng.rb:69 + def read_memory(*, **, &); end + end +end + +# SAX Parsers are event-driven parsers. +# +# Two SAX parsers for XML are available, a parser that reads from a string or IO object as it +# feels necessary, and a parser that you explicitly feed XML in chunks. If you want to let +# Nokogiri deal with reading your XML, use the Nokogiri::XML::SAX::Parser. If you want to have +# fine grain control over the XML input, use the Nokogiri::XML::SAX::PushParser. +# +# If you want to do SAX style parsing of HTML, check out Nokogiri::HTML4::SAX. +# +# The basic way a SAX style parser works is by creating a parser, telling the parser about the +# events we're interested in, then giving the parser some XML to process. The parser will notify +# you when it encounters events you said you would like to know about. +# +# To register for events, subclass Nokogiri::XML::SAX::Document and implement the methods for +# which you would like notification. +# +# For example, if I want to be notified when a document ends, and when an element starts, I +# would write a class like this: +# +# class MyHandler < Nokogiri::XML::SAX::Document +# def end_document +# puts "the document has ended" +# end +# +# def start_element name, attributes = [] +# puts "#{name} started" +# end +# end +# +# Then I would instantiate a SAX parser with this document, and feed the parser some XML +# +# # Create a new parser +# parser = Nokogiri::XML::SAX::Parser.new(MyHandler.new) +# +# # Feed the parser some XML +# parser.parse(File.open(ARGV[0])) +# +# Now my document handler will be called when each node starts, and when then document ends. To +# see what kinds of events are available, take a look at Nokogiri::XML::SAX::Document. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::XML::SAX; end + +# :markup: markdown +# +# The SAX::Document class is used for registering types of events you are interested in +# handling. All of the methods on this class are available as possible events while parsing an +# \XML document. To register for any particular event, subclass this class and implement the +# methods you are interested in knowing about. +# +# To only be notified about start and end element events, write a class like this: +# +# class MyHandler < Nokogiri::XML::SAX::Document +# def start_element name, attrs = [] +# puts "#{name} started!" +# end +# +# def end_element name +# puts "#{name} ended" +# end +# end +# +# You can use this event handler for any SAX-style parser included with Nokogiri. +# +# See also: +# +# - Nokogiri::XML::SAX +# - Nokogiri::HTML4::SAX +# +# ### Entity Handling +# +# ⚠ Entity handling is complicated in a SAX parser! Please read this section carefully if +# you're not getting the behavior you expect. +# +# Entities will be reported to the user via callbacks to #characters, to #reference, or +# possibly to both. The behavior is determined by a combination of _entity type_ and the value +# of ParserContext#replace_entities. (Recall that the default value of +# ParserContext#replace_entities is `false`.) +# +# 🛡 It is UNSAFE to set ParserContext#replace_entities to `true` when parsing untrusted +# documents. +# +# 💡 For more information on entity types, see [Wikipedia's page on +# DTDs](https://en.wikipedia.org/wiki/Document_type_definition#Entity_declarations). +# +# |--------------------------------------|------------------------------------|-------------------------------------| +# +#   +# +# † In the case where the replacement text for the entity is unknown (e.g., an undeclared entity +# or an external entity that could not be resolved because of network issues), then the +# replacement text will not be reported. If ParserContext#replace_entities is `true`, this +# means the #characters callback will not be invoked. If ParserContext#replace_entities is +# `false`, then the #reference callback will be invoked, but with `nil` for the `content` +# argument. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:65 +class Nokogiri::XML::SAX::Document + # Called when cdata blocks are found + # [Parameters] + # - +string+ contains the cdata content + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:245 + def cdata_block(string); end + + # Called when character data is parsed, and for parsed entities when + # ParserContext#replace_entities is +true+. + # + # [Parameters] + # - +string+ contains the character data or entity replacement text + # + # ⚠ Please see Document@Entity+Handling for important information about how entities are handled. + # + # ⚠ This method might be called multiple times for a contiguous string of characters. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:201 + def characters(string); end + + # Called when comments are encountered + # [Parameters] + # - +string+ contains the comment data + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:224 + def comment(string); end + + # Called when document ends parsing. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:83 + def end_document; end + + # Called at the end of an element. + # + # [Parameters] + # - +name+ (String) the name of the element being closed + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:122 + def end_element(name); end + + # Called at the end of an element. + # + # [Parameters] + # - +name+ (String) is the name of the element + # - +prefix+ (String, nil) is the namespace prefix for the element + # - +uri+ (String, nil) is the associated URI for the element's namespace + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:185 + def end_element_namespace(name, prefix = T.unsafe(nil), uri = T.unsafe(nil)); end + + # Called on document errors + # [Parameters] + # - +string+ contains the error + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:238 + def error(string); end + + # Called when processing instructions are found + # [Parameters] + # - +name+ is the target of the instruction + # - +content+ is the value of the instruction + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:253 + def processing_instruction(name, content); end + + # Called when a parsed entity is referenced and not replaced. + # + # [Parameters] + # - +name+ (String) is the name of the entity + # - +content+ (String, nil) is the replacement text for the entity, if known + # + # ⚠ Please see Document@Entity+Handling for important information about how entities are handled. + # + # ⚠ An internal entity may result in a call to both #characters and #reference. + # + # Since v1.17.0 + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:217 + def reference(name, content); end + + # Called when document starts parsing. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:78 + def start_document; end + + # Called at the beginning of an element. + # + # [Parameters] + # - +name+ (String) the name of the element + # - +attrs+ (Array>) an assoc list of namespace declarations and attributes, e.g.: + # [ ["xmlns:foo", "http://sample.net"], ["size", "large"] ] + # + # 💡If you're dealing with XML and need to handle namespaces, use the + # #start_element_namespace method instead. + # + # Note that the element namespace and any attribute namespaces are not provided, and so any + # namespaced elements or attributes will be returned as strings including the prefix: + # + # parser.parse(<<~XML) + # + # hello world + # + # XML + # + # assert_pattern do + # parser.document.start_elements => [ + # ["root", [["xmlns:foo", "http://foo.example.com/"], ["xmlns", "http://example.com/"]]], + # ["foo:bar", [["foo:quux", "xxx"]]], + # ] + # end + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:113 + def start_element(name, attrs = T.unsafe(nil)); end + + # Called at the beginning of an element. + # + # [Parameters] + # - +name+ (String) is the name of the element + # - +attrs+ (Array) is an array of structs with the following properties: + # - +localname+ (String) the local name of the attribute + # - +value+ (String) the value of the attribute + # - +prefix+ (String, nil) the namespace prefix of the attribute + # - +uri+ (String, nil) the namespace URI of the attribute + # - +prefix+ (String, nil) is the namespace prefix for the element + # - +uri+ (String, nil) is the associated URI for the element's namespace + # - +ns+ (Array>) is an assoc list of namespace declarations on the element + # + # 💡If you're dealing with HTML or don't care about namespaces, try #start_element instead. + # + # [Example] + # it "start_elements_namespace is called with namespaced attributes" do + # parser.parse(<<~XML) + # + # + # + # XML + # + # assert_pattern do + # parser.document.start_elements_namespace => [ + # [ + # "root", + # [], + # nil, nil, + # [["foo", "http://foo.example.com/"]], # namespace declarations + # ], [ + # "a", + # [Nokogiri::XML::SAX::Parser::Attribute(localname: "bar", prefix: "foo", uri: "http://foo.example.com/", value: "hello")], # prefixed attribute + # "foo", "http://foo.example.com/", # prefix and uri for the "a" element + # [], + # ] + # ] + # end + # end + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:166 + def start_element_namespace(name, attrs = T.unsafe(nil), prefix = T.unsafe(nil), uri = T.unsafe(nil), ns = T.unsafe(nil)); end + + # Called on document warnings + # [Parameters] + # - +string+ contains the warning + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:231 + def warning(string); end + + # Called when an \XML declaration is parsed. + # + # [Parameters] + # - +version+ (String) the version attribute + # - +encoding+ (String, nil) the encoding of the document if present, else +nil+ + # - +standalone+ ("yes", "no", nil) the standalone attribute if present, else +nil+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/document.rb:73 + def xmldecl(version, encoding, standalone); end +end + +# This parser is a SAX style parser that reads its input as it deems necessary. The parser +# takes a Nokogiri::XML::SAX::Document, an optional encoding, then given an XML input, sends +# messages to the Nokogiri::XML::SAX::Document. +# +# Here is an example of using this parser: +# +# # Create a subclass of Nokogiri::XML::SAX::Document and implement +# # the events we care about: +# class MyHandler < Nokogiri::XML::SAX::Document +# def start_element name, attrs = [] +# puts "starting: #{name}" +# end +# +# def end_element name +# puts "ending: #{name}" +# end +# end +# +# parser = Nokogiri::XML::SAX::Parser.new(MyHandler.new) +# +# # Hand an IO object to the parser, which will read the XML from the IO. +# File.open(path_to_xml) do |f| +# parser.parse(f) +# end +# +# For more information about \SAX parsers, see Nokogiri::XML::SAX. +# +# Also see Nokogiri::XML::SAX::Document for the available events. +# +# For \HTML documents, use the subclass Nokogiri::HTML4::SAX::Parser. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::SAX::Parser + include ::Nokogiri::ClassResolver + + # :call-seq: + # new ⇒ SAX::Parser + # new(handler) ⇒ SAX::Parser + # new(handler, encoding) ⇒ SAX::Parser + # + # Create a new Parser. + # + # [Parameters] + # - +handler+ (optional Nokogiri::XML::SAX::Document) The document that will receive + # events. Will create a new Nokogiri::XML::SAX::Document if not given, which is accessible + # through the #document attribute. + # - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when + # parsing the input. (default +nil+ for auto-detection) + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:95 + def initialize(doc = T.unsafe(nil), encoding = T.unsafe(nil)); end + + # The Nokogiri::XML::SAX::Document where events will be sent. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:75 + def document; end + + # The Nokogiri::XML::SAX::Document where events will be sent. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:75 + def document=(_arg0); end + + # The encoding beings used for this document. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:78 + def encoding; end + + # The encoding beings used for this document. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:78 + def encoding=(_arg0); end + + # :call-seq: + # parse(input) { |parser_context| ... } + # + # Parse the input, sending events to the SAX::Document at #document. + # + # [Parameters] + # - +input+ (String, IO) The input to parse. + # + # If +input+ quacks like a readable IO object, this method forwards to Parser.parse_io, + # otherwise it forwards to Parser.parse_memory. + # + # [Yields] + # If a block is given, the underlying ParserContext object will be yielded. This can be used + # to set options on the parser context before parsing begins. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:119 + def parse(input, &block); end + + # :call-seq: + # parse_file(filename) { |parser_context| ... } + # parse_file(filename, encoding) { |parser_context| ... } + # + # Parse a file. + # + # [Parameters] + # - +filename+ (String) The path to the file to be parsed. + # - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when + # parsing the input, or +nil+ for auto-detection. (default #encoding) + # + # [Yields] + # If a block is given, the underlying ParserContext object will be yielded. This can be used + # to set options on the parser context before parsing begins. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:187 + def parse_file(filename, encoding = T.unsafe(nil)); end + + # :call-seq: + # parse_io(io) { |parser_context| ... } + # parse_io(io, encoding) { |parser_context| ... } + # + # Parse an input stream. + # + # [Parameters] + # - +io+ (IO) The readable IO object from which to read input + # - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when + # parsing the input, or +nil+ for auto-detection. (default #encoding) + # + # [Yields] + # If a block is given, the underlying ParserContext object will be yielded. This can be used + # to set options on the parser context before parsing begins. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:143 + def parse_io(io, encoding = T.unsafe(nil)); end + + # :call-seq: + # parse_memory(input) { |parser_context| ... } + # parse_memory(input, encoding) { |parser_context| ... } + # + # Parse an input string. + # + # [Parameters] + # - +input+ (String) The input string to be parsed. + # - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when + # parsing the input, or +nil+ for auto-detection. (default #encoding) + # + # [Yields] + # If a block is given, the underlying ParserContext object will be yielded. This can be used + # to set options on the parser context before parsing begins. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:165 + def parse_memory(input, encoding = T.unsafe(nil)); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_native; end +end + +# Structure used for marshalling attributes for some callbacks in XML::SAX::Document. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:43 +class Nokogiri::XML::SAX::Parser::Attribute < ::Struct; end + +# pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:46 +Nokogiri::XML::SAX::Parser::ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser.rb:71 +Nokogiri::XML::SAX::Parser::REVERSE_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# Context object to invoke the XML SAX parser on the SAX::Document handler. +# +# 💡 This class is usually not instantiated by the user. Use Nokogiri::XML::SAX::Parser +# instead. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::SAX::ParserContext + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def column; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def line; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def parse_with(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def recovery; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def recovery=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def replace_entities; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def replace_entities=(_arg0); end + + class << self + # :call-seq: + # file(path) + # file(path, encoding) + # + # Create a parser context for the file at +path+. + # + # [Parameters] + # - +path+ (String) The path to the input file + # - +encoding+ (optional) (Encoding, String) The +Encoding+ to use, or the name of an encoding to + # use (default +nil+, encoding will be autodetected) + # + # [Returns] Nokogiri::XML::SAX::ParserContext + # + # 💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser.parse_file which + # is more convenient for most use cases. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser_context.rb:97 + def file(input, encoding = T.unsafe(nil)); end + + # :call-seq: + # io(input) + # io(input, encoding) + # + # Create a parser context for an +input+ IO which will assume +encoding+ + # + # [Parameters] + # - +io+ (IO) The readable IO object from which to read input + # - +encoding+ (optional) (Encoding) The +Encoding+ to use, or the name of an + # encoding to use (default +nil+, encoding will be autodetected) + # + # [Returns] Nokogiri::XML::SAX::ParserContext + # + # 💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser parse + # methods which are more convenient for most use cases. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser_context.rb:56 + def io(input, encoding = T.unsafe(nil)); end + + # :call-seq: + # memory(input) + # memory(input, encoding) + # + # Create a parser context for the +input+ String. + # + # [Parameters] + # - +input+ (String) The input string to be parsed. + # - +encoding+ (optional) (Encoding, String) The +Encoding+ to use, or the name of an encoding to + # use (default +nil+, encoding will be autodetected) + # + # [Returns] Nokogiri::XML::SAX::ParserContext + # + # 💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser parse methods + # which are more convenient for most use cases. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser_context.rb:77 + def memory(input, encoding = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_file(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_io(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_memory(_arg0, _arg1); end + + # :call-seq: + # new(input) + # new(input, encoding) + # + # Create a parser context for an IO or a String. This is a shorthand method for + # ParserContext.io and ParserContext.memory. + # + # [Parameters] + # - +input+ (IO, String) A String or a readable IO object + # - +encoding+ (optional) (Encoding) The +Encoding+ to use, or the name of an + # encoding to use (default +nil+, encoding will be autodetected) + # + # If +input+ quacks like a readable IO object, this method forwards to ParserContext.io, + # otherwise it forwards to ParserContext.memory. + # + # [Returns] Nokogiri::XML::SAX::ParserContext + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser_context.rb:31 + def new(input, encoding = T.unsafe(nil)); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/parser_context.rb:101 + def resolve_encoding(encoding); end + end +end + +# PushParser can parse a document that is fed to it manually. It +# must be given a SAX::Document object which will be called with +# SAX events as the document is being parsed. +# +# Calling PushParser#<< writes XML to the parser, calling any SAX +# callbacks it can. +# +# PushParser#finish tells the parser that the document is finished +# and calls the end_document SAX method. +# +# Example: +# +# parser = PushParser.new(Class.new(XML::SAX::Document) { +# def start_document +# puts "start document called" +# end +# }.new) +# parser << "
    hello<" +# parser << "/div>" +# parser.finish +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::SAX::PushParser + # Create a new PushParser with +doc+ as the SAX Document, providing + # an optional +file_name+ and +encoding+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/push_parser.rb:35 + def initialize(doc = T.unsafe(nil), file_name = T.unsafe(nil), encoding = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/push_parser.rb:50 + def <<(chunk, last_chunk = T.unsafe(nil)); end + + # The Nokogiri::XML::SAX::Document on which the PushParser will be + # operating + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/push_parser.rb:30 + def document; end + + # The Nokogiri::XML::SAX::Document on which the PushParser will be + # operating + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/push_parser.rb:30 + def document=(_arg0); end + + # Finish the parsing. This method is only necessary for + # Nokogiri::XML::SAX::Document#end_document to be called. + # + # ⚠ Note that empty documents are treated as an error when using the libxml2-based + # implementation (CRuby), but are fine when using the Xerces-based implementation (JRuby). + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/push_parser.rb:58 + def finish; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def options; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def options=(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def replace_entities; end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def replace_entities=(_arg0); end + + # Write a +chunk+ of XML to the PushParser. Any callback methods + # that can be called will be called immediately. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/sax/push_parser.rb:47 + def write(chunk, last_chunk = T.unsafe(nil)); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def initialize_native(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def native_write(_arg0, _arg1); end +end + +# Nokogiri::XML::Schema is used for validating \XML against an \XSD schema definition. +# +# ⚠ Since v1.11.0, Schema treats inputs as *untrusted* by default, and so external entities are +# not resolved from the network (+http://+ or +ftp://+). When parsing a trusted document, the +# caller may turn off the +NONET+ option via the ParseOptions to (re-)enable external entity +# resolution over a network connection. +# +# 🛡 Before v1.11.0, documents were "trusted" by default during schema parsing which was counter +# to Nokogiri's "untrusted by default" security policy. +# +# *Example:* Determine whether an \XML document is valid. +# +# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE)) +# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE)) +# schema.valid?(doc) # Boolean +# +# *Example:* Validate an \XML document against an \XSD schema, and capture any errors that are found. +# +# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE)) +# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE)) +# errors = schema.validate(doc) # Array +# +# *Example:* Validate an \XML document using a Document containing an \XSD schema definition. +# +# schema_doc = Nokogiri::XML::Document.parse(File.read(RELAX_NG_FILE)) +# schema = Nokogiri::XML::Schema.from_document(schema_doc) +# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE)) +# schema.valid?(doc) # Boolean +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Schema + # The errors found while parsing the \XSD + # + # [Returns] Array + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:49 + def errors; end + + # The errors found while parsing the \XSD + # + # [Returns] Array + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:49 + def errors=(_arg0); end + + # The options used to parse the schema + # + # [Returns] Nokogiri::XML::ParseOptions + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:54 + def parse_options; end + + # The options used to parse the schema + # + # [Returns] Nokogiri::XML::ParseOptions + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:54 + def parse_options=(_arg0); end + + # :call-seq: valid?(input) → Boolean + # + # Validate +input+ and return a Boolean indicating whether the document is valid + # + # [Parameters] + # - +input+ (Nokogiri::XML::Document | String) + # A parsed document, or a string containing a local filename. + # + # [Returns] Boolean + # + # *Example:* Validate an existing XML::Document + # + # schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE)) + # return unless schema.valid?(document) + # + # *Example:* Validate an \XML document on disk + # + # schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE)) + # return unless schema.valid?("/path/to/file.xml") + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:135 + def valid?(input); end + + # :call-seq: validate(input) → Array + # + # Validate +input+ and return any errors that are found. + # + # [Parameters] + # - +input+ (Nokogiri::XML::Document | String) + # A parsed document, or a string containing a local filename. + # + # [Returns] Array + # + # *Example:* Validate an existing XML::Document, and capture any errors that are found. + # + # schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE)) + # errors = schema.validate(document) + # + # *Example:* Validate an \XML document on disk, and capture any errors that are found. + # + # schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE)) + # errors = schema.validate("/path/to/file.xml") + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:104 + def validate(input); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def validate_document(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def validate_file(_arg0); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def from_document(*_arg0); end + + # :call-seq: + # new(input) → Nokogiri::XML::Schema + # new(input, parse_options) → Nokogiri::XML::Schema + # + # Parse an \XSD schema definition from a String or IO to create a new Nokogiri::XML::Schema + # + # [Parameters] + # - +input+ (String | IO) \XSD schema definition + # - +parse_options+ (Nokogiri::XML::ParseOptions) + # Defaults to Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA + # + # [Returns] Nokogiri::XML::Schema + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:69 + def new(input, parse_options_ = T.unsafe(nil), parse_options: T.unsafe(nil)); end + + # :call-seq: + # read_memory(input) → Nokogiri::XML::Schema + # read_memory(input, parse_options) → Nokogiri::XML::Schema + # + # Convenience method for Nokogiri::XML::Schema.new + # + # pkg:gem/nokogiri#lib/nokogiri/xml/schema.rb:78 + def read_memory(*, **, &); end + end +end + +# The Searchable module declares the interface used for searching your DOM. +# +# It implements the public methods #search, #css, and #xpath, +# as well as allowing specific implementations to specialize some +# of the important behaviors. +# +# pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:13 +module Nokogiri::XML::Searchable + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:78 + def %(*args); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:64 + def /(*args); end + + # :call-seq: + # >(selector) → NodeSet + # + # Search this node's immediate children using CSS selector +selector+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:201 + def >(selector); end + + # call-seq: + # at(*paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]) + # + # Search this object for +paths+, and return only the first + # result. +paths+ must be one or more XPath or CSS queries. + # + # See Searchable#search for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:74 + def at(*args); end + + # call-seq: + # at_css(*rules, [namespace-bindings, custom-pseudo-class]) + # + # Search this object for CSS +rules+, and return only the first + # match. +rules+ must be one or more CSS selectors. + # + # See Searchable#css for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:143 + def at_css(*args); end + + # call-seq: + # at_xpath(*paths, [namespace-bindings, variable-bindings, custom-handler-class]) + # + # Search this node for XPath +paths+, and return only the first + # match. +paths+ must be one or more XPath queries. + # + # See Searchable#xpath for more information. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:193 + def at_xpath(*args); end + + # call-seq: + # css(*rules, [namespace-bindings, custom-pseudo-class]) + # + # Search this object for CSS +rules+. +rules+ must be one or more CSS + # selectors. For example: + # + # node.css('title') + # node.css('body h1.bold') + # node.css('div + p.green', 'div#one') + # + # A hash of namespace bindings may be appended. For example: + # + # node.css('bike|tire', {'bike' => 'http://schwinn.com/'}) + # + # 💡 Custom CSS pseudo classes may also be defined which are mapped to a custom XPath + # function. To define custom pseudo classes, create a class and implement the custom pseudo + # class you want defined. The first argument to the method will be the matching context + # NodeSet. Any other arguments are ones that you pass in. For example: + # + # handler = Class.new { + # def regex(node_set, regex) + # node_set.find_all { |node| node['some_attribute'] =~ /#{regex}/ } + # end + # }.new + # node.css('title:regex("\w+")', handler) + # + # 💡 Some XPath syntax is supported in CSS queries. For example, to query for an attribute: + # + # node.css('img > @href') # returns all +href+ attributes on an +img+ element + # node.css('img / @href') # same + # + # # ⚠ this returns +class+ attributes from all +div+ elements AND THEIR CHILDREN! + # node.css('div @class') + # + # node.css + # + # 💡 Array-like syntax is supported in CSS queries as an alternative to using +:nth-child()+. + # + # ⚠ NOTE that indices are 1-based like +:nth-child+ and not 0-based like Ruby Arrays. For + # example: + # + # # equivalent to 'li:nth-child(2)' + # node.css('li[2]') # retrieve the second li element in a list + # + # ⚠ NOTE that the CSS query string is case-sensitive with regards to your document type. HTML + # tags will match only lowercase CSS queries, so if you search for "H1" in an HTML document, + # you'll never find anything. However, "H1" might be found in an XML document, where tags + # names are case-sensitive (e.g., "H1" is distinct from "h1"). + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:129 + def css(*args); end + + # call-seq: + # search(*paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]) + # + # Search this object for +paths+. +paths+ must be one or more XPath or CSS queries: + # + # node.search("div.employee", ".//title") + # + # A hash of namespace bindings may be appended: + # + # node.search('.//bike:tire', {'bike' => 'http://schwinn.com/'}) + # node.search('bike|tire', {'bike' => 'http://schwinn.com/'}) + # + # For XPath queries, a hash of variable bindings may also be appended to the namespace + # bindings. For example: + # + # node.search('.//address[@domestic=$value]', nil, {:value => 'Yes'}) + # + # 💡 Custom XPath functions and CSS pseudo-selectors may also be defined. To define custom + # functions create a class and implement the function you want to define, which will be in the + # `nokogiri` namespace in XPath queries. + # + # The first argument to the method will be the current matching NodeSet. Any other arguments + # are ones that you pass in. Note that this class may appear anywhere in the argument + # list. For example: + # + # handler = Class.new { + # def regex node_set, regex + # node_set.find_all { |node| node['some_attribute'] =~ /#{regex}/ } + # end + # }.new + # node.search('.//title[nokogiri:regex(., "\w+")]', 'div.employee:regex("[0-9]+")', handler) + # + # See Searchable#xpath and Searchable#css for further usage help. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:54 + def search(*args); end + + # call-seq: + # xpath(*paths, [namespace-bindings, variable-bindings, custom-handler-class]) + # + # Search this node for XPath +paths+. +paths+ must be one or more XPath + # queries. + # + # node.xpath('.//title') + # + # A hash of namespace bindings may be appended. For example: + # + # node.xpath('.//foo:name', {'foo' => 'http://example.org/'}) + # node.xpath('.//xmlns:name', node.root.namespaces) + # + # A hash of variable bindings may also be appended to the namespace bindings. For example: + # + # node.xpath('.//address[@domestic=$value]', nil, {:value => 'Yes'}) + # + # 💡 Custom XPath functions may also be defined. To define custom functions create a class and + # implement the function you want to define, which will be in the `nokogiri` namespace. + # + # The first argument to the method will be the current matching NodeSet. Any other arguments + # are ones that you pass in. Note that this class may appear anywhere in the argument + # list. For example: + # + # handler = Class.new { + # def regex(node_set, regex) + # node_set.find_all { |node| node['some_attribute'] =~ /#{regex}/ } + # end + # }.new + # node.xpath('.//title[nokogiri:regex(., "\w+")]', handler) + # + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:179 + def xpath(*args); end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:228 + def css_internal(node, rules, handler, ns); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:232 + def css_rules_to_xpath(rules, ns); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:210 + def extract_params(params); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:263 + def xpath_impl(node, path, handler, ns, binds); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:248 + def xpath_internal(node, paths, handler, ns, binds); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:236 + def xpath_query_from_css_rule(rule, ns); end +end + +# Regular expression used by Searchable#search to determine if a query +# string is CSS or XPath +# +# pkg:gem/nokogiri#lib/nokogiri/xml/searchable.rb:16 +Nokogiri::XML::Searchable::LOOKS_LIKE_XPATH = T.let(T.unsafe(nil), Regexp) + +# This class provides information about XML SyntaxErrors. These +# exceptions are typically stored on Nokogiri::XML::Document#errors. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::SyntaxError < ::Nokogiri::SyntaxError + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:23 + def code; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:40 + def column; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:22 + def domain; end + + # return true if this is an error + # + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:56 + def error?; end + + # return true if this error is fatal + # + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:62 + def fatal?; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:25 + def file; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:39 + def int1; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:24 + def level; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:26 + def line; end + + # return true if this is a non error + # + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:44 + def none?; end + + # The XPath path of the node that caused the error when validating a `Nokogiri::XML::Document`. + # + # This attribute will only be non-nil when the error is emitted by `Schema#validate` on + # Document objects. It will return `nil` for DOM parsing errors and for errors emitted during + # Schema validation of files. + # + # ⚠ `#path` is not supported on JRuby, where it will always return `nil`. + # + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:35 + def path; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:36 + def str1; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:37 + def str2; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:38 + def str3; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:66 + def to_s; end + + # return true if this is a warning + # + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:50 + def warning?; end + + private + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:75 + def level_to_s; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:87 + def location_to_s; end + + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:83 + def nil_or_zero?(attribute); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/xml/syntax_error.rb:10 + def aggregate(errors); end + end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::Text < ::Nokogiri::XML::CharacterData + # pkg:gem/nokogiri#lib/nokogiri/xml/text.rb:6 + def content=(string); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(*_arg0); end + end +end + +# Original C14N 1.0 spec canonicalization +# +# pkg:gem/nokogiri#lib/nokogiri/xml.rb:13 +Nokogiri::XML::XML_C14N_1_0 = T.let(T.unsafe(nil), Integer) + +# C14N 1.1 spec canonicalization +# +# pkg:gem/nokogiri#lib/nokogiri/xml.rb:17 +Nokogiri::XML::XML_C14N_1_1 = T.let(T.unsafe(nil), Integer) + +# Exclusive C14N 1.0 spec canonicalization +# +# pkg:gem/nokogiri#lib/nokogiri/xml.rb:15 +Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 = T.let(T.unsafe(nil), Integer) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::XML::XPath; end + +# The XPath search prefix to search direct descendants of the current element, +./+ +# +# pkg:gem/nokogiri#lib/nokogiri/xml/xpath.rb:13 +Nokogiri::XML::XPath::CURRENT_SEARCH_PREFIX = T.let(T.unsafe(nil), String) + +# The XPath search prefix to search globally, +//+ +# +# pkg:gem/nokogiri#lib/nokogiri/xml/xpath.rb:7 +Nokogiri::XML::XPath::GLOBAL_SEARCH_PREFIX = T.let(T.unsafe(nil), String) + +# The XPath search prefix to search direct descendants of the root element, +/+ +# +# pkg:gem/nokogiri#lib/nokogiri/xml/xpath.rb:10 +Nokogiri::XML::XPath::ROOT_SEARCH_PREFIX = T.let(T.unsafe(nil), String) + +# The XPath search prefix to search anywhere in the current element's subtree, +.//+ +# +# pkg:gem/nokogiri#lib/nokogiri/xml/xpath.rb:16 +Nokogiri::XML::XPath::SUBTREE_SEARCH_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::XPath::SyntaxError < ::Nokogiri::XML::SyntaxError + # pkg:gem/nokogiri#lib/nokogiri/xml/xpath/syntax_error.rb:7 + def to_s; end +end + +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XML::XPathContext + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def evaluate(*_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def node=(_arg0); end + + # Register namespaces in +namespaces+ + # + # pkg:gem/nokogiri#lib/nokogiri/xml/xpath_context.rb:8 + def register_namespaces(namespaces); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def register_ns(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def register_variable(_arg0, _arg1); end + + # pkg:gem/nokogiri#lib/nokogiri/xml/xpath_context.rb:16 + def register_variables(binds); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def new(_arg0); end + end +end + +# See Nokogiri::XSLT::Stylesheet for creating and manipulating Stylesheet objects. +# +# 🛡 Do not use this module for untrusted stylesheet documents. libxslt does not support +# safely processing untrusted stylesheets. Untrusted stylesheets may access the file system and +# network, consume large amounts of CPU, memory, or other system resources, and IO and file +# access are not restricted. Additionally, the stylesheet is parsed by libxml2 with +NOENT+ and +# +DTDLOAD+ enabled (see ParseOptions::DEFAULT_XSLT), meaning that external entities will be +# resolved and external subsets will be loaded during parsing. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +module Nokogiri::XSLT + class << self + # :call-seq: + # parse(xsl) → Nokogiri::XSLT::Stylesheet + # parse(xsl, modules) → Nokogiri::XSLT::Stylesheet + # + # Parse the stylesheet in +xsl+, registering optional +modules+ as custom class handlers. + # + # 🛡 Do not pass untrusted stylesheet content to this method. See Nokogiri::XSLT for more + # information. + # + # [Parameters] + # - +xsl+ (String) XSL content to be parsed into a stylesheet + # - +modules+ (Hash) A hash of URI-to-handler relations for linking a + # namespace to a custom function handler. + # + # ⚠ The XSLT handler classes are registered *globally*. + # + # Also see Nokogiri::XSLT.register + # + # *Example* + # + # xml = Nokogiri.XML(<<~XML) + # + # Foo + # Bar + # + # XML + # + # handler = Class.new do + # def reverse(node) + # node.text.reverse + # end + # end + # + # xsl = <<~XSL + # + # + # + # + # + # + # + # + # + # XSL + # + # xsl = Nokogiri.XSLT(xsl, "http://nokogiri.org/xslt/myfuncs" => handler) + # xsl.transform(xml).to_xml + # # => "\n" + + # # "\n" + + # # " ooF\n" + + # # " raB\n" + + # # "\n" + # + # pkg:gem/nokogiri#lib/nokogiri/xslt.rb:79 + def parse(string, modules = T.unsafe(nil)); end + + # :call-seq: + # quote_params(params) → Array + # + # Quote parameters in +params+ for stylesheet safety. + # See Nokogiri::XSLT::Stylesheet.transform for example usage. + # + # [Parameters] + # - +params+ (Hash, Array) XSLT parameters (key->value, or tuples of [key, value]) + # + # [Returns] Array of string parameters, with quotes correctly escaped for use with XSLT::Stylesheet.transform + # + # pkg:gem/nokogiri#lib/nokogiri/xslt.rb:103 + def quote_params(params); end + + # call-seq: + # register(uri, custom_handler_class) + # + # Register a class that implements custom XSLT transformation functions. + # + # ⚠ The XSLT handler classes are registered *globally*. + # + # [Parameters} + # - +uri+ (String) The namespace for the custom handlers + # - +custom_handler_class+ (Class) A class with ruby methods that can be called during + # transformation + # + # See Nokogiri::XSLT.parse for usage. + # + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def register(_arg0, _arg1); end + end +end + +# A Stylesheet represents an XSLT Stylesheet object. Stylesheet creation is done through +# Nokogiri::XSLT.parse (or the convenience method Nokogiri.XSLT). Here is an example of +# transforming an XML::Document with a Stylesheet: +# +# doc = Nokogiri::XML(File.read('some_file.xml')) +# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt')) +# +# xslt.transform(doc) # => Nokogiri::XML::Document +# +# 🛡 This class does not support execution of untrusted stylesheets. An untrusted +# stylesheet may consume a large amount of CPU, memory, or other system resources during +# transformation, and IO and file access are not restricted. See Nokogiri::XSLT for more +# information about the security implications of untrusted stylesheets. +# +# Many XSLT transformations include serialization behavior to emit a non-XML document. For these +# cases, please take care to invoke the #serialize method on the result of the transformation: +# +# doc = Nokogiri::XML(File.read('some_file.xml')) +# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt')) +# xslt.serialize(xslt.transform(doc)) # => String +# +# or use the #apply_to method, which is a shortcut for `serialize(transform(document))`: +# +# doc = Nokogiri::XML(File.read('some_file.xml')) +# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt')) +# xslt.apply_to(doc) # => String +# +# See Nokogiri::XSLT::Stylesheet#transform for more information and examples. +# +# pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 +class Nokogiri::XSLT::Stylesheet + # :call-seq: + # apply_to(document, params = []) -> String + # + # Apply an XSLT stylesheet to an XML::Document and serialize it properly. This method is + # equivalent to calling #serialize on the result of #transform. + # + # [Parameters] + # - +document+ is an instance of XML::Document to transform + # - +params+ is an array of strings used as XSLT parameters, passed into #transform + # + # [Returns] + # A string containing the serialized result of the transformation. + # + # See Nokogiri::XSLT::Stylesheet#transform for more information and examples. + # + # pkg:gem/nokogiri#lib/nokogiri/xslt/stylesheet.rb:49 + def apply_to(document, params = T.unsafe(nil)); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def serialize(_arg0); end + + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def transform(*_arg0); end + + class << self + # pkg:gem/nokogiri#lib/nokogiri/extension.rb:7 + def parse_stylesheet_doc(_arg0); end + end +end + +class Object < ::BasicObject + include ::Kernel + include ::PP::ObjectMixin + + private + + # Parse a document contained in +args+. Nokogiri will try to guess what type of document you are + # attempting to parse. For more information, see Nokogiri.parse + # + # To specify the type of document, use {Nokogiri.XML}, {Nokogiri.HTML4}, or {Nokogiri.HTML5}. + # + # pkg:gem/nokogiri#lib/nokogiri.rb:108 + def Nokogiri(*args, &block); end +end diff --git a/sorbet/rbi/gems/parallel@2.1.0.rbi b/sorbet/rbi/gems/parallel@2.1.0.rbi new file mode 100644 index 0000000..85f0430 --- /dev/null +++ b/sorbet/rbi/gems/parallel@2.1.0.rbi @@ -0,0 +1,321 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `parallel` gem. +# Please instead update this file by running `bin/tapioca gem parallel`. + + +# pkg:gem/parallel#lib/parallel/version.rb:2 +module Parallel + class << self + # pkg:gem/parallel#lib/parallel.rb:256 + def all?(*args, &block); end + + # pkg:gem/parallel#lib/parallel.rb:251 + def any?(*args, &block); end + + # pkg:gem/parallel#lib/parallel.rb:247 + def each(array, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:261 + def each_with_index(array, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:320 + def filter_map(*, **, &); end + + # pkg:gem/parallel#lib/parallel.rb:316 + def flat_map(*, **, &); end + + # pkg:gem/parallel#lib/parallel.rb:241 + def in_processes(options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:225 + def in_threads(options = T.unsafe(nil)); end + + # pkg:gem/parallel#lib/parallel.rb:265 + def map(source, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:312 + def map_with_index(array, options = T.unsafe(nil), &block); end + + # Number of physical processor cores on the current system. + # + # pkg:gem/parallel#lib/parallel.rb:325 + def physical_processor_count; end + + # Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup, + # used for process scheduling + # + # pkg:gem/parallel#lib/parallel.rb:355 + def processor_count; end + + # pkg:gem/parallel#lib/parallel.rb:359 + def worker_number; end + + # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed + # + # pkg:gem/parallel#lib/parallel.rb:364 + def worker_number=(worker_num); end + + private + + # pkg:gem/parallel#lib/parallel.rb:397 + def add_progress_bar!(job_factory, options); end + + # pkg:gem/parallel#lib/parallel.rb:738 + def available_processor_count; end + + # pkg:gem/parallel#lib/parallel.rb:686 + def call_with_index(item, index, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:616 + def create_workers(job_factory, options, &block); end + + # options is either a Integer or a Hash with :count + # + # pkg:gem/parallel#lib/parallel.rb:676 + def extract_count_from_options(options); end + + # pkg:gem/parallel#lib/parallel.rb:704 + def instrument_finish(item, index, result, options); end + + # yield results in the order of the input items + # needs to use `options` to store state between executions + # needs to use `done` index since a nil result would also be valid + # + # pkg:gem/parallel#lib/parallel.rb:713 + def instrument_finish_in_order(item, index, result, options); end + + # pkg:gem/parallel#lib/parallel.rb:733 + def instrument_start(item, index, options); end + + # pkg:gem/parallel#lib/parallel.rb:370 + def physical_processor_count_windows; end + + # pkg:gem/parallel#lib/parallel.rb:651 + def process_incoming_jobs(read, write, job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:526 + def ractor_build(use_port); end + + # pkg:gem/parallel#lib/parallel.rb:547 + def ractor_result(item, index, result, results, results_mutex, options); end + + # pkg:gem/parallel#lib/parallel.rb:552 + def ractor_stop(ractor); end + + # pkg:gem/parallel#lib/parallel.rb:604 + def replace_worker(job_factory, workers, index, options, blk); end + + # pkg:gem/parallel#lib/parallel.rb:391 + def run(command); end + + # pkg:gem/parallel#lib/parallel.rb:697 + def with_instrumentation(item, index, options); end + + # pkg:gem/parallel#lib/parallel.rb:422 + def work_direct(job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:556 + def work_in_processes(job_factory, options, &blk); end + + # pkg:gem/parallel#lib/parallel.rb:466 + def work_in_ractors(job_factory, options); end + + # pkg:gem/parallel#lib/parallel.rb:441 + def work_in_threads(job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:624 + def worker(job_factory, options, &block); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:12 +class Parallel::Break < ::StandardError + # pkg:gem/parallel#lib/parallel.rb:15 + def initialize(value = T.unsafe(nil)); end + + # marshal_dump that is used for ruby exceptions + # avoid dumping the cause since nobody needs that and it can include undumpable exceptions + # + # pkg:gem/parallel#lib/parallel.rb:22 + def _dump(_depth); end + + # pkg:gem/parallel#lib/parallel.rb:13 + def value; end + + class << self + # marshal_load that is used for ruby exceptions + # + # pkg:gem/parallel#lib/parallel.rb:27 + def _load(data); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:9 +class Parallel::DeadWorker < ::StandardError; end + +# pkg:gem/parallel#lib/parallel.rb:44 +class Parallel::ExceptionWrapper + # pkg:gem/parallel#lib/parallel.rb:47 + def initialize(exception); end + + # pkg:gem/parallel#lib/parallel.rb:45 + def exception; end +end + +# pkg:gem/parallel#lib/parallel.rb:111 +class Parallel::JobFactory + # pkg:gem/parallel#lib/parallel.rb:112 + def initialize(source, mutex); end + + # pkg:gem/parallel#lib/parallel.rb:120 + def next; end + + # generate item that is sent to workers + # just index is faster + less likely to blow up with unserializable errors + # + # pkg:gem/parallel#lib/parallel.rb:149 + def pack(item, index); end + + # pkg:gem/parallel#lib/parallel.rb:139 + def size; end + + # unpack item that is sent to workers + # + # pkg:gem/parallel#lib/parallel.rb:154 + def unpack(data); end + + private + + # pkg:gem/parallel#lib/parallel.rb:160 + def producer?; end + + # pkg:gem/parallel#lib/parallel.rb:164 + def queue_wrapper(array); end +end + +# pkg:gem/parallel#lib/parallel.rb:32 +class Parallel::Kill < ::Parallel::Break; end + +# Pluggable wire serializers. Each must respond to `dump(data, io)` / +# `load(io)` (used directly by Worker) and `dump(data)` / `load(string)` +# (used by wrappers like Hmac). +# +# pkg:gem/parallel#lib/parallel/serializer.rb:9 +module Parallel::Serializer; end + +# Wraps any inner serializer with a length-prefixed HMAC-SHA256 frame keyed +# on a per-worker secret generated before fork. Forged frames from a +# pipe-injector fail verification. +# +# pkg:gem/parallel#lib/parallel/serializer.rb:17 +class Parallel::Serializer::Hmac + # SHA256 + # + # pkg:gem/parallel#lib/parallel/serializer.rb:22 + def initialize(inner: T.unsafe(nil), secret: T.unsafe(nil)); end + + # pkg:gem/parallel#lib/parallel/serializer.rb:27 + def dump(data, io); end + + # pkg:gem/parallel#lib/parallel/serializer.rb:33 + def load(io); end +end + +# 32-bit big-endian unsigned int +# +# pkg:gem/parallel#lib/parallel/serializer.rb:19 +Parallel::Serializer::Hmac::LENGTH_BYTES = T.let(T.unsafe(nil), Integer) + +# pkg:gem/parallel#lib/parallel/serializer.rb:18 +Parallel::Serializer::Hmac::LENGTH_FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/parallel#lib/parallel/serializer.rb:20 +Parallel::Serializer::Hmac::MAC_BYTES = T.let(T.unsafe(nil), Integer) + +# Raw Marshal. Fast but trusts anything written to the pipe — a same-UID +# attacker that reopens /proc//fd/ can inject Marshal gadgets (RCE). +# +# pkg:gem/parallel#lib/parallel/serializer.rb:12 +Parallel::Serializer::Marshal = Marshal + +# pkg:gem/parallel#lib/parallel.rb:7 +Parallel::Stop = T.let(T.unsafe(nil), Object) + +# pkg:gem/parallel#lib/parallel.rb:35 +class Parallel::UndumpableException < ::StandardError + # pkg:gem/parallel#lib/parallel.rb:38 + def initialize(original); end + + # pkg:gem/parallel#lib/parallel.rb:36 + def backtrace; end +end + +# pkg:gem/parallel#lib/parallel.rb:169 +class Parallel::UserInterruptHandler + class << self + # pkg:gem/parallel#lib/parallel.rb:194 + def kill(thing); end + + # kill all these pids or threads if user presses Ctrl+c + # + # pkg:gem/parallel#lib/parallel.rb:174 + def kill_on_ctrl_c(pids, options); end + + private + + # pkg:gem/parallel#lib/parallel.rb:218 + def restore_interrupt(old, signal); end + + # pkg:gem/parallel#lib/parallel.rb:203 + def trap_interrupt(signal); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:170 +Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parallel#lib/parallel/version.rb:3 +Parallel::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/parallel#lib/parallel/version.rb:3 +Parallel::Version = T.let(T.unsafe(nil), String) + +# pkg:gem/parallel#lib/parallel.rb:63 +class Parallel::Worker + # pkg:gem/parallel#lib/parallel.rb:67 + def initialize(read, write, pid, serializer); end + + # might be passed to started_processes and simultaneously closed by another thread + # when running in isolation mode, so we have to check if it is closed before closing + # + # pkg:gem/parallel#lib/parallel.rb:81 + def close_pipes; end + + # pkg:gem/parallel#lib/parallel.rb:64 + def pid; end + + # pkg:gem/parallel#lib/parallel.rb:64 + def read; end + + # pkg:gem/parallel#lib/parallel.rb:74 + def stop; end + + # pkg:gem/parallel#lib/parallel.rb:65 + def thread; end + + # pkg:gem/parallel#lib/parallel.rb:65 + def thread=(_arg0); end + + # pkg:gem/parallel#lib/parallel.rb:86 + def work(data); end + + # pkg:gem/parallel#lib/parallel.rb:64 + def write; end + + private + + # pkg:gem/parallel#lib/parallel.rb:104 + def wait; end +end diff --git a/sorbet/rbi/gems/parser@3.3.12.0.rbi b/sorbet/rbi/gems/parser@3.3.12.0.rbi new file mode 100644 index 0000000..3876382 --- /dev/null +++ b/sorbet/rbi/gems/parser@3.3.12.0.rbi @@ -0,0 +1,5146 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `parser` gem. +# Please instead update this file by running `bin/tapioca gem parser`. + + +# @api public +# +# pkg:gem/parser#lib/parser.rb:19 +module Parser; end + +# pkg:gem/parser#lib/parser.rb:24 +module Parser::AST; end + +# {Parser::AST::Node} contains information about a single AST node and its +# child nodes. It extends the basic [AST::Node](https://www.rubydoc.info/gems/ast/AST/Node) +# class provided by gem [ast](https://www.rubydoc.info/gems/ast). +# +# @api public +# +# @!attribute [r] location +# Source map for this Node. +# @return [Parser::Source::Map] +# +# pkg:gem/parser#lib/parser/ast/node.rb:17 +class Parser::AST::Node < ::AST::Node + # Assigns various properties to this AST node. Currently only the + # location can be set. + # + # @param [Hash] properties + # @option properties [Parser::Source::Map] :location Location information + # of the node. + # + # pkg:gem/parser#lib/parser/ast/node.rb:30 + def assign_properties(properties); end + + # pkg:gem/parser#lib/parser/ast/node.rb:20 + def loc; end + + # pkg:gem/parser#lib/parser/ast/node.rb:18 + def location; end +end + +# @api public +# +# pkg:gem/parser#lib/parser/ast/processor.rb:9 +class Parser::AST::Processor + include ::AST::Processor::Mixin + + # pkg:gem/parser#lib/parser/ast/processor.rb:179 + def on_alias(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:222 + def on_and(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:67 + def on_and_asgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:122 + def on_arg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:148 + def on_arg_expr(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:103 + def on_args(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:105 + def on_argument(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:22 + def on_array(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:258 + def on_array_pattern(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:259 + def on_array_pattern_with_tail(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:42 + def on_back_ref(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:240 + def on_begin(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:195 + def on_block(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:151 + def on_block_pass(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:125 + def on_blockarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:150 + def on_blockarg_expr(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:213 + def on_break(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:228 + def on_case(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:246 + def on_case_match(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:89 + def on_casgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:157 + def on_class(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:81 + def on_const(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:261 + def on_const_pattern(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:190 + def on_csend(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:41 + def on_cvar(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:65 + def on_cvasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:160 + def on_def(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:219 + def on_defined?(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:169 + def on_defs(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:16 + def on_dstr(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:17 + def on_dsym(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:231 + def on_eflipflop(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:288 + def on_empty_else(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:238 + def on_ensure(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:27 + def on_erange(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:262 + def on_find_pattern(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:210 + def on_for(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:130 + def on_forward_arg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:154 + def on_forwarded_kwrestarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:153 + def on_forwarded_restarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:40 + def on_gvar(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:64 + def on_gvasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:24 + def on_hash(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:260 + def on_hash_pattern(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:225 + def on_if(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:251 + def on_if_guard(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:230 + def on_iflipflop(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:247 + def on_in_match(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:250 + def on_in_pattern(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:192 + def on_index(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:193 + def on_indexasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:26 + def on_irange(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:39 + def on_ivar(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:63 + def on_ivasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:127 + def on_kwarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:25 + def on_kwargs(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:241 + def on_kwbegin(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:128 + def on_kwoptarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:129 + def on_kwrestarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:21 + def on_kwsplat(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:196 + def on_lambda(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:38 + def on_lvar(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:62 + def on_lvasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:79 + def on_masgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:256 + def on_match_alt(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:257 + def on_match_as(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:233 + def on_match_current_line(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:248 + def on_match_pattern(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:249 + def on_match_pattern_p(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:254 + def on_match_rest(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:253 + def on_match_var(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:234 + def on_match_with_lvasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:78 + def on_mlhs(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:156 + def on_module(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:214 + def on_next(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:221 + def on_not(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:43 + def on_nth_ref(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:198 + def on_numblock(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:70 + def on_op_asgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:123 + def on_optarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:223 + def on_or(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:68 + def on_or_asgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:23 + def on_pair(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:255 + def on_pin(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:244 + def on_postexe(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:243 + def on_preexe(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:132 + def on_procarg0(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:215 + def on_redo(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:18 + def on_regexp(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:236 + def on_resbody(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:237 + def on_rescue(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:124 + def on_restarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:149 + def on_restarg_expr(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:216 + def on_retry(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:212 + def on_return(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:158 + def on_sclass(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:181 + def on_send(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:126 + def on_shadowarg(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:20 + def on_splat(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:217 + def on_super(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:178 + def on_undef(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:252 + def on_unless_guard(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:208 + def on_until(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:209 + def on_until_post(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:29 + def on_var(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:45 + def on_vasgn(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:227 + def on_when(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:206 + def on_while(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:207 + def on_while_post(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:19 + def on_xstr(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:218 + def on_yield(node); end + + # @private + # + # pkg:gem/parser#lib/parser/ast/processor.rb:118 + def process_argument_node(node); end + + # pkg:gem/parser#lib/parser/ast/processor.rb:12 + def process_regular_node(node); end + + # @private + # + # pkg:gem/parser#lib/parser/ast/processor.rb:58 + def process_var_asgn_node(node); end + + # @private + # + # pkg:gem/parser#lib/parser/ast/processor.rb:34 + def process_variable_node(node); end +end + +# Base class for version-specific parsers. +# +# @api public +# +# @!attribute [r] diagnostics +# @return [Parser::Diagnostic::Engine] +# +# @!attribute [r] static_env +# @return [Parser::StaticEnvironment] +# +# @!attribute [r] version +# @return [Integer] +# +# pkg:gem/parser#lib/parser/base.rb:19 +class Parser::Base < ::Racc::Parser + # @param [Parser::Builders::Default] builder The AST builder to use. + # + # pkg:gem/parser#lib/parser/base.rb:129 + def initialize(builder = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/base.rb:117 + def builder; end + + # pkg:gem/parser#lib/parser/base.rb:120 + def context; end + + # pkg:gem/parser#lib/parser/base.rb:122 + def current_arg_stack; end + + # pkg:gem/parser#lib/parser/base.rb:116 + def diagnostics; end + + # pkg:gem/parser#lib/parser/base.rb:115 + def lexer; end + + # pkg:gem/parser#lib/parser/base.rb:121 + def max_numparam_stack; end + + # Parses a source buffer and returns the AST, or `nil` in case of a non fatal error. + # + # @param [Parser::Source::Buffer] source_buffer The source buffer to parse. + # @return [Parser::AST::Node, nil] + # + # pkg:gem/parser#lib/parser/base.rb:189 + def parse(source_buffer); end + + # Parses a source buffer and returns the AST and the source code comments. + # + # @see #parse + # @see Parser::Source::Comment#associate + # @return [Array] + # + # pkg:gem/parser#lib/parser/base.rb:207 + def parse_with_comments(source_buffer); end + + # pkg:gem/parser#lib/parser/base.rb:124 + def pattern_hash_keys; end + + # pkg:gem/parser#lib/parser/base.rb:123 + def pattern_variables; end + + # Resets the state of the parser. + # + # pkg:gem/parser#lib/parser/base.rb:170 + def reset; end + + # pkg:gem/parser#lib/parser/base.rb:119 + def source_buffer; end + + # pkg:gem/parser#lib/parser/base.rb:118 + def static_env; end + + # Parses a source buffer and returns the AST, the source code comments, + # and the tokens emitted by the lexer. In case of a fatal error, a {SyntaxError} + # is raised, unless `recover` is true. In case of an error + # (non-fatal or recovered), `nil` is returned instead of the AST, and + # comments as well as tokens are only returned up to the location of + # the error. + # + # Currently, token stream format returned by #tokenize is not documented, + # but is considered part of a public API and only changed according + # to Semantic Versioning. + # + # However, note that the exact token composition of various constructs + # might vary. For example, a string `"foo"` is represented equally well + # by `:tSTRING_BEG " :tSTRING_CONTENT foo :tSTRING_END "` and + # `:tSTRING "foo"`; such details must not be relied upon. + # + # @param [Parser::Source::Buffer] source_buffer + # @param [Boolean] recover If true, recover from syntax errors. False by default. + # @return [Array] + # + # pkg:gem/parser#lib/parser/base.rb:236 + def tokenize(source_buffer, recover = T.unsafe(nil)); end + + private + + # pkg:gem/parser#lib/parser/base.rb:260 + def check_kwarg_name(name_t); end + + # pkg:gem/parser#lib/parser/base.rb:269 + def diagnostic(level, reason, arguments, location_t, highlights_ts = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/base.rb:254 + def next_token; end + + # pkg:gem/parser#lib/parser/base.rb:285 + def on_error(error_token_id, error_value, value_stack); end + + class << self + # @return [Parser::Base] parser with the default options set. + # + # pkg:gem/parser#lib/parser/base.rb:87 + def default_parser; end + + # Parses a string of Ruby code and returns the AST. If the source + # cannot be parsed, {SyntaxError} is raised and a diagnostic is + # printed to `stderr`. + # + # @example + # Parser::Base.parse('puts "hello"') + # + # @param [String] string The block of code to parse. + # @param [String] file The name of the file the code originated from. + # @param [Numeric] line The initial line number. + # @return [Parser::AST::Node] + # + # pkg:gem/parser#lib/parser/base.rb:33 + def parse(string, file = T.unsafe(nil), line = T.unsafe(nil)); end + + # Parses Ruby source code by reading it from a file. If the source + # cannot be parsed, {SyntaxError} is raised and a diagnostic is + # printed to `stderr`. + # + # @param [String] filename Path to the file to parse. + # @return [Parser::AST::Node] + # @see #parse + # + # pkg:gem/parser#lib/parser/base.rb:67 + def parse_file(filename); end + + # Parses Ruby source code by reading it from a file and returns the AST and + # comments. If the source cannot be parsed, {SyntaxError} is raised and a + # diagnostic is printed to `stderr`. + # + # @param [String] filename Path to the file to parse. + # @return [Array] + # @see #parse + # + # pkg:gem/parser#lib/parser/base.rb:80 + def parse_file_with_comments(filename); end + + # Parses a string of Ruby code and returns the AST and comments. If the + # source cannot be parsed, {SyntaxError} is raised and a diagnostic is + # printed to `stderr`. + # + # @example + # Parser::Base.parse_with_comments('puts "hello"') + # + # @param [String] string The block of code to parse. + # @param [String] file The name of the file the code originated from. + # @param [Numeric] line The initial line number. + # @return [Array] + # + # pkg:gem/parser#lib/parser/base.rb:52 + def parse_with_comments(string, file = T.unsafe(nil), line = T.unsafe(nil)); end + + private + + # pkg:gem/parser#lib/parser/base.rb:100 + def setup_source_buffer(file, line, string, encoding); end + end +end + +# pkg:gem/parser#lib/parser.rb:78 +module Parser::Builders; end + +# Default AST builder. Uses {AST::Node}s. +# +# pkg:gem/parser#lib/parser/builders/default.rb:8 +class Parser::Builders::Default + # Initializes attributes: + # + # * `emit_file_line_as_literals`: `true` + # + # pkg:gem/parser#lib/parser/builders/default.rb:243 + def initialize; end + + # pkg:gem/parser#lib/parser/builders/default.rb:703 + def __ENCODING__(__ENCODING__t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:348 + def __FILE__(__FILE__t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:312 + def __LINE__(__LINE__t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:622 + def accessible(node); end + + # pkg:gem/parser#lib/parser/builders/default.rb:878 + def alias(alias_t, to, from); end + + # pkg:gem/parser#lib/parser/builders/default.rb:917 + def arg(name_t); end + + # Ruby 1.8 block arguments + # + # pkg:gem/parser#lib/parser/builders/default.rb:1007 + def arg_expr(expr); end + + # Formal arguments + # + # pkg:gem/parser#lib/parser/builders/default.rb:887 + def args(begin_t, args, end_t, check_args = T.unsafe(nil)); end + + # Arrays + # + # pkg:gem/parser#lib/parser/builders/default.rb:440 + def array(begin_t, elements, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1598 + def array_pattern(lbrack_t, elements, rbrack_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:767 + def assign(lhs, eql_t, rhs); end + + # Assignment + # + # pkg:gem/parser#lib/parser/builders/default.rb:712 + def assignable(node); end + + # pkg:gem/parser#lib/parser/builders/default.rb:540 + def associate(begin_t, pairs, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1175 + def attr_asgn(receiver, dot_t, selector_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:612 + def back_ref(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1443 + def begin(begin_t, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1385 + def begin_body(compound_stmt, rescue_bodies = T.unsafe(nil), else_t = T.unsafe(nil), else_ = T.unsafe(nil), ensure_t = T.unsafe(nil), ensure_ = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1461 + def begin_keyword(begin_t, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1213 + def binary_op(receiver, operator_t, arg); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1122 + def block(method_call, begin_t, args, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1161 + def block_pass(amper_t, arg); end + + # pkg:gem/parser#lib/parser/builders/default.rb:982 + def blockarg(amper_t, name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1027 + def blockarg_expr(amper_t, expr); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1113 + def call_lambda(lambda_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1096 + def call_method(receiver, dot_t, selector_t, lparen_t = T.unsafe(nil), args = T.unsafe(nil), rparen_t = T.unsafe(nil)); end + + # Method calls + # + # pkg:gem/parser#lib/parser/builders/default.rb:1068 + def call_type_for_dot(dot_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1318 + def case(case_t, expr, when_bodies, else_t, else_body, end_t); end + + # PATTERN MATCHING + # + # pkg:gem/parser#lib/parser/builders/default.rb:1481 + def case_match(case_t, expr, in_bodies, else_t, else_body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:343 + def character(char_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:284 + def complex(complex_t); end + + # Expression grouping + # + # pkg:gem/parser#lib/parser/builders/default.rb:1431 + def compstmt(statements); end + + # Conditionals + # + # pkg:gem/parser#lib/parser/builders/default.rb:1294 + def condition(cond_t, cond, then_t, if_true, else_t, if_false, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1300 + def condition_mod(if_true, if_false, cond_t, cond); end + + # pkg:gem/parser#lib/parser/builders/default.rb:686 + def const(name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:698 + def const_fetch(scope, t_colon2, name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:691 + def const_global(t_colon3, name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:763 + def const_op_assignable(node); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1628 + def const_pattern(const, ldelim_t, pattern, rdelim_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:607 + def cvar(token); end + + # Indented (interpolated, noninterpolated, executable) strings + # + # pkg:gem/parser#lib/parser/builders/default.rb:388 + def dedent_string(node, dedent_level); end + + # Class and module definition + # + # pkg:gem/parser#lib/parser/builders/default.rb:814 + def def_class(class_t, name, lt_t, superclass, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:845 + def def_endless_method(def_t, name_t, args, assignment_t, body); end + + # pkg:gem/parser#lib/parser/builders/default.rb:863 + def def_endless_singleton(def_t, definee, dot_t, name_t, args, assignment_t, body); end + + # Method (un)definition + # + # pkg:gem/parser#lib/parser/builders/default.rb:837 + def def_method(def_t, name_t, args, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:827 + def def_module(module_t, name, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:821 + def def_sclass(class_t, lshft_t, expr, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:853 + def def_singleton(def_t, definee, dot_t, name_t, args, body, end_t); end + + # If set to true (the default), `__FILE__` and `__LINE__` are transformed to + # literal nodes. For example, `s(:str, "lib/foo.rb")` and `s(:int, 10)`. + # + # If set to false, `__FILE__` and `__LINE__` are emitted as-is, + # i.e. as `s(:__FILE__)` and `s(:__LINE__)` nodes. + # + # Source maps are identical in both cases. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:237 + def emit_file_line_as_literals; end + + # If set to true (the default), `__FILE__` and `__LINE__` are transformed to + # literal nodes. For example, `s(:str, "lib/foo.rb")` and `s(:int, 10)`. + # + # If set to false, `__FILE__` and `__LINE__` are emitted as-is, + # i.e. as `s(:__FILE__)` and `s(:__LINE__)` nodes. + # + # Source maps are identical in both cases. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:237 + def emit_file_line_as_literals=(_arg0); end + + # pkg:gem/parser#lib/parser/builders/default.rb:265 + def false(false_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1619 + def find_pattern(lbrack_t, elements, rbrack_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:276 + def float(float_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1339 + def for(for_t, iterator, in_t, iteratee, do_t, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:913 + def forward_arg(dots_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:903 + def forward_only_args(begin_t, dots_t, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1084 + def forwarded_args(dots_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1092 + def forwarded_kwrestarg(dstar_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1088 + def forwarded_restarg(star_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:596 + def gvar(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1592 + def hash_pattern(lbrace_t, kwargs, rbrace_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:586 + def ident(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1508 + def if_guard(if_t, if_body); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1487 + def in_match(lhs, in_t, rhs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1502 + def in_pattern(in_t, pattern, guard, then_t, body); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1184 + def index(receiver, lbrack_t, indexes, rbrack_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1198 + def index_asgn(receiver, lbrack_t, indexes, rbrack_t); end + + # Numerics + # + # pkg:gem/parser#lib/parser/builders/default.rb:272 + def integer(integer_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:591 + def ivar(token); end + + # Keywords + # + # pkg:gem/parser#lib/parser/builders/default.rb:1347 + def keyword_cmd(type, keyword_t, lparen_t = T.unsafe(nil), args = T.unsafe(nil), rparen_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:944 + def kwarg(name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:970 + def kwnilarg(dstar_t, nil_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:951 + def kwoptarg(name_t, value); end + + # pkg:gem/parser#lib/parser/builders/default.rb:958 + def kwrestarg(dstar_t, name_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:535 + def kwsplat(dstar_t, arg); end + + # Logical operations: and, or + # + # pkg:gem/parser#lib/parser/builders/default.rb:1287 + def logical_op(type, lhs, op_t, rhs); end + + # Loops + # + # pkg:gem/parser#lib/parser/builders/default.rb:1325 + def loop(type, keyword_t, cond, do_t, body, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1330 + def loop_mod(type, body, keyword_t, cond); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1642 + def match_alt(left, pipe_t, right); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1649 + def match_as(value, assoc_t, as); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1528 + def match_hash_var(name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1542 + def match_hash_var_from_str(begin_t, strings, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1680 + def match_label(label_type, label); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1656 + def match_nil_pattern(dstar_t, nil_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1235 + def match_op(receiver, match_t, arg); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1661 + def match_pair(label_type, label, value); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1492 + def match_pattern(lhs, match_t, rhs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1497 + def match_pattern_p(lhs, match_t, rhs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1581 + def match_rest(star_t, name_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1516 + def match_var(name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1624 + def match_with_trailing_comma(match, comma_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:805 + def multi_assign(lhs, eql_t, rhs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:800 + def multi_lhs(begin_t, items, end_t); end + + # Singletons + # + # pkg:gem/parser#lib/parser/builders/default.rb:255 + def nil(nil_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1263 + def not_op(not_t, begin_t = T.unsafe(nil), receiver = T.unsafe(nil), end_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:617 + def nth_ref(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:899 + def numargs(max_numparam); end + + # MacRuby Objective-C arguments + # + # pkg:gem/parser#lib/parser/builders/default.rb:1038 + def objc_kwarg(kwname_t, assoc_t, name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1052 + def objc_restarg(star_t, name = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1166 + def objc_varargs(pair, rest_of_varargs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:774 + def op_assign(lhs, op_t, rhs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:924 + def optarg(name_t, eql_t, value); end + + # Hashes + # + # pkg:gem/parser#lib/parser/builders/default.rb:488 + def pair(key, assoc_t, value); end + + # pkg:gem/parser#lib/parser/builders/default.rb:505 + def pair_keyword(key_t, value); end + + # pkg:gem/parser#lib/parser/builders/default.rb:521 + def pair_label(key_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:493 + def pair_list_18(list); end + + # pkg:gem/parser#lib/parser/builders/default.rb:513 + def pair_quoted(begin_t, parts, end_t, value); end + + # @api private + # + # pkg:gem/parser#lib/parser/builders/default.rb:225 + def parser; end + + # @api private + # + # pkg:gem/parser#lib/parser/builders/default.rb:225 + def parser=(_arg0); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1637 + def pin(pin_t, var); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1370 + def postexe(postexe_t, lbrace_t, compstmt, rbrace_t); end + + # BEGIN, END + # + # pkg:gem/parser#lib/parser/builders/default.rb:1365 + def preexe(preexe_t, lbrace_t, compstmt, rbrace_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:992 + def procarg0(arg); end + + # pkg:gem/parser#lib/parser/builders/default.rb:572 + def range_exclusive(lhs, dot3_t, rhs); end + + # Ranges + # + # pkg:gem/parser#lib/parser/builders/default.rb:567 + def range_inclusive(lhs, dot2_t, rhs); end + + # pkg:gem/parser#lib/parser/builders/default.rb:280 + def rational(rational_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:426 + def regexp_compose(begin_t, parts, end_t, options); end + + # Regular expressions + # + # pkg:gem/parser#lib/parser/builders/default.rb:417 + def regexp_options(regopt_t); end + + # Exception handling + # + # pkg:gem/parser#lib/parser/builders/default.rb:1377 + def rescue_body(rescue_t, exc_list, assoc_t, exc_var, then_t, compound_stmt); end + + # pkg:gem/parser#lib/parser/builders/default.rb:933 + def restarg(star_t, name_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1016 + def restarg_expr(star_t, expr = T.unsafe(nil)); end + + # Access + # + # pkg:gem/parser#lib/parser/builders/default.rb:581 + def self(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:975 + def shadowarg(name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:445 + def splat(star_t, arg = T.unsafe(nil)); end + + # Strings + # + # pkg:gem/parser#lib/parser/builders/default.rb:319 + def string(string_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:329 + def string_compose(begin_t, parts, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:324 + def string_internal(string_t); end + + # Symbols + # + # pkg:gem/parser#lib/parser/builders/default.rb:355 + def symbol(symbol_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:365 + def symbol_compose(begin_t, parts, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:360 + def symbol_internal(symbol_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:469 + def symbols_compose(begin_t, parts, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1305 + def ternary(cond, question_t, if_true, colon_t, if_false); end + + # pkg:gem/parser#lib/parser/builders/default.rb:260 + def true(true_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:294 + def unary_num(unary_t, numeric); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1251 + def unary_op(op_t, receiver); end + + # pkg:gem/parser#lib/parser/builders/default.rb:873 + def undef_method(undef_t, names); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1512 + def unless_guard(unless_t, unless_body); end + + # Case matching + # + # pkg:gem/parser#lib/parser/builders/default.rb:1312 + def when(when_t, patterns, then_t, body); end + + # pkg:gem/parser#lib/parser/builders/default.rb:455 + def word(parts); end + + # pkg:gem/parser#lib/parser/builders/default.rb:464 + def words_compose(begin_t, parts, end_t); end + + # Executable strings + # + # pkg:gem/parser#lib/parser/builders/default.rb:381 + def xstring_compose(begin_t, parts, end_t); end + + private + + # pkg:gem/parser#lib/parser/builders/default.rb:1829 + def arg_name_collides?(this_name, that_name); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2025 + def arg_prefix_map(op_t, name_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1999 + def binary_op_map(left_e, op_t, right_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2127 + def block_map(receiver_l, begin_t, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1804 + def check_assignment_to_numparam(name, loc); end + + # VERIFICATION + # + # pkg:gem/parser#lib/parser/builders/default.rb:1696 + def check_condition(cond); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1775 + def check_duplicate_arg(this_arg, map = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1750 + def check_duplicate_args(args, map = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1862 + def check_duplicate_pattern_key(name, loc); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1852 + def check_duplicate_pattern_variable(name, loc); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1844 + def check_lvar_name(name, loc); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1819 + def check_reserved_for_numparam(name, loc); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2293 + def collapse_string_parts?(parts); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1950 + def collection_map(begin_t, parts, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2154 + def condition_map(keyword_t, cond_e, begin_t, body_e, else_t, else_e, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1985 + def constant_map(scope, colon2_t, name_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2058 + def definition_map(keyword_t, operator_t, name_t, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1891 + def delimited_string_map(string_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2315 + def diagnostic(type, reason, arguments, location, highlights = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2198 + def eh_keyword_map(compstmt_e, keyword_t, body_es, else_t, else_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2064 + def endless_definition_map(keyword_t, operator_t, name_t, assignment_t, body_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1946 + def expr_map(loc); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2179 + def for_map(keyword_t, in_t, begin_t, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2226 + def guard_map(keyword_t, guard_body_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2116 + def index_map(receiver_e, lbrack_t, rbrack_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1882 + def join_exprs(left_expr, right_expr); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2132 + def keyword_map(keyword_t, begin_t, args, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2149 + def keyword_mod_map(pre_e, keyword_t, post_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2035 + def kwarg_map(name_t, value_e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2346 + def kwargs?(node); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2310 + def loc(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2048 + def module_definition_map(keyword_t, name_e, operator_t, end_t); end + + # SOURCE MAPS + # + # pkg:gem/parser#lib/parser/builders/default.rb:1874 + def n(type, children, source_map); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1878 + def n0(type, source_map); end + + # pkg:gem/parser#lib/parser/builders/default.rb:288 + def numeric(kind, token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1916 + def pair_keyword_map(key_t, value_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1931 + def pair_quoted_map(begin_t, end_t, value_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1902 + def prefix_string_map(symbol); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2013 + def range_map(start_e, op_t, end_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1980 + def regexp_map(begin_t, end_t, options_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2185 + def rescue_body_map(keyword_t, exc_list_e, assoc_t, exc_var_e, then_t, compstmt_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2336 + def rewrite_hash_args_to_kwargs(args); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2098 + def send_binary_op_map(lhs_e, selector_t, rhs_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2121 + def send_index_map(receiver_e, lbrack_t, rbrack_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2072 + def send_map(receiver_e, dot_t, selector_t, begin_t = T.unsafe(nil), args = T.unsafe(nil), end_t = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2104 + def send_unary_op_map(selector_t, arg_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2257 + def static_regexp(parts, options); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2282 + def static_regexp_node(node); end + + # Extract a static string from e.g. a regular expression, + # honoring the fact that MRI expands interpolations like #{""} + # at parse time. + # + # pkg:gem/parser#lib/parser/builders/default.rb:2240 + def static_string(nodes); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1966 + def string_map(begin_t, parts, end_t); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2302 + def string_value(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2174 + def ternary_map(begin_e, question_t, mid_e, colon_t, end_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1887 + def token_map(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2003 + def unary_op_map(op_t, arg_e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1911 + def unquoted_map(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2324 + def validate_definee(definee); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1789 + def validate_no_forward_arg_after_restarg(args); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2298 + def value(token); end + + # pkg:gem/parser#lib/parser/builders/default.rb:2092 + def var_send_map(variable_e); end + + # pkg:gem/parser#lib/parser/builders/default.rb:1995 + def variable_map(name_t); end + + class << self + # AST compatibility attribute; causes a single non-mlhs + # block argument to be wrapped in s(:procarg0). + # + # If set to false (the default), block arguments `|a|` are emitted as + # `s(:args, s(:procarg0, :a))` + # + # If set to true, block arguments `|a|` are emitted as + # `s(:args, s(:procarg0, s(:arg, :a))` + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:97 + def emit_arg_inside_procarg0; end + + # AST compatibility attribute; causes a single non-mlhs + # block argument to be wrapped in s(:procarg0). + # + # If set to false (the default), block arguments `|a|` are emitted as + # `s(:args, s(:procarg0, :a))` + # + # If set to true, block arguments `|a|` are emitted as + # `s(:args, s(:procarg0, s(:arg, :a))` + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:97 + def emit_arg_inside_procarg0=(_arg0); end + + # AST compatibility attribute; locations of `__ENCODING__` are not the same + # as locations of `Encoding::UTF_8` causing problems during rewriting, + # all new code should set this attribute to true. + # + # If set to false (the default), `__ENCODING__` is emitted as + # ` s(:const, s(:const, nil, :Encoding), :UTF_8)`. + # + # If set to true, `__ENCODING__` is emitted as + # `s(:__ENCODING__)`. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:58 + def emit_encoding; end + + # AST compatibility attribute; locations of `__ENCODING__` are not the same + # as locations of `Encoding::UTF_8` causing problems during rewriting, + # all new code should set this attribute to true. + # + # If set to false (the default), `__ENCODING__` is emitted as + # ` s(:const, s(:const, nil, :Encoding), :UTF_8)`. + # + # If set to true, `__ENCODING__` is emitted as + # `s(:__ENCODING__)`. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:58 + def emit_encoding=(_arg0); end + + # AST compatibility attribute; arguments forwarding initially + # didn't have support for leading arguments + # (i.e. `def m(a, ...); end` was a syntax error). However, Ruby 3.0 + # added support for any number of arguments in front of the `...`. + # + # If set to false (the default): + # 1. `def m(...) end` is emitted as + # s(:def, :m, s(:forward_args), nil) + # 2. `def m(a, b, ...) end` is emitted as + # s(:def, :m, + # s(:args, s(:arg, :a), s(:arg, :b), s(:forward_arg))) + # + # If set to true it uses a single format: + # 1. `def m(...) end` is emitted as + # s(:def, :m, s(:args, s(:forward_arg))) + # 2. `def m(a, b, ...) end` is emitted as + # s(:def, :m, s(:args, s(:arg, :a), s(:arg, :b), s(:forward_arg))) + # + # It does't matter that much on 2.7 (because there can't be any leading arguments), + # but on 3.0 it should be better enabled to use a single AST format. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:126 + def emit_forward_arg; end + + # AST compatibility attribute; arguments forwarding initially + # didn't have support for leading arguments + # (i.e. `def m(a, ...); end` was a syntax error). However, Ruby 3.0 + # added support for any number of arguments in front of the `...`. + # + # If set to false (the default): + # 1. `def m(...) end` is emitted as + # s(:def, :m, s(:forward_args), nil) + # 2. `def m(a, b, ...) end` is emitted as + # s(:def, :m, + # s(:args, s(:arg, :a), s(:arg, :b), s(:forward_arg))) + # + # If set to true it uses a single format: + # 1. `def m(...) end` is emitted as + # s(:def, :m, s(:args, s(:forward_arg))) + # 2. `def m(a, b, ...) end` is emitted as + # s(:def, :m, s(:args, s(:arg, :a), s(:arg, :b), s(:forward_arg))) + # + # It does't matter that much on 2.7 (because there can't be any leading arguments), + # but on 3.0 it should be better enabled to use a single AST format. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:126 + def emit_forward_arg=(_arg0); end + + # AST compatibility attribute; indexed assignment, `x[] = 1`, is not + # semantically equivalent to calling the method directly, `x.[]=(1)`. + # Specifically, in the former case, the expression's value is always 1, + # and in the latter case, the expression's value is the return value + # of the `[]=` method. + # + # If set to false (the default), `self[1]` is emitted as + # `s(:send, s(:self), :[], s(:int, 1))`, and `self[1] = 2` is + # emitted as `s(:send, s(:self), :[]=, s(:int, 1), s(:int, 2))`. + # + # If set to true, `self[1]` is emitted as + # `s(:index, s(:self), s(:int, 1))`, and `self[1] = 2` is + # emitted as `s(:indexasgn, s(:self), s(:int, 1), s(:int, 2))`. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:80 + def emit_index; end + + # AST compatibility attribute; indexed assignment, `x[] = 1`, is not + # semantically equivalent to calling the method directly, `x.[]=(1)`. + # Specifically, in the former case, the expression's value is always 1, + # and in the latter case, the expression's value is the return value + # of the `[]=` method. + # + # If set to false (the default), `self[1]` is emitted as + # `s(:send, s(:self), :[], s(:int, 1))`, and `self[1] = 2` is + # emitted as `s(:send, s(:self), :[]=, s(:int, 1), s(:int, 2))`. + # + # If set to true, `self[1]` is emitted as + # `s(:index, s(:self), s(:int, 1))`, and `self[1] = 2` is + # emitted as `s(:indexasgn, s(:self), s(:int, 1), s(:int, 2))`. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:80 + def emit_index=(_arg0); end + + # AST compatibility attribute; Starting from Ruby 2.7 keyword arguments + # of method calls that are passed explicitly as a hash (i.e. with curly braces) + # are treated as positional arguments and Ruby 2.7 emits a warning on such method + # call. Ruby 3.0 given an ArgumentError. + # + # If set to false (the default) the last hash argument is emitted as `hash`: + # + # ``` + # (send nil :foo + # (hash + # (pair + # (sym :bar) + # (int 42)))) + # ``` + # + # If set to true it is emitted as `kwargs`: + # + # ``` + # (send nil :foo + # (kwargs + # (pair + # (sym :bar) + # (int 42)))) + # ``` + # + # Note that `kwargs` node is just a replacement for `hash` argument, + # so if there's are multiple arguments (or a `kwsplat`) all of them + # are wrapped into `kwargs` instead of `hash`: + # + # ``` + # (send nil :foo + # (kwargs + # (pair + # (sym :a) + # (int 42)) + # (kwsplat + # (send nil :b)) + # (pair + # (sym :c) + # (int 10)))) + # ``` + # + # pkg:gem/parser#lib/parser/builders/default.rb:174 + def emit_kwargs; end + + # AST compatibility attribute; Starting from Ruby 2.7 keyword arguments + # of method calls that are passed explicitly as a hash (i.e. with curly braces) + # are treated as positional arguments and Ruby 2.7 emits a warning on such method + # call. Ruby 3.0 given an ArgumentError. + # + # If set to false (the default) the last hash argument is emitted as `hash`: + # + # ``` + # (send nil :foo + # (hash + # (pair + # (sym :bar) + # (int 42)))) + # ``` + # + # If set to true it is emitted as `kwargs`: + # + # ``` + # (send nil :foo + # (kwargs + # (pair + # (sym :bar) + # (int 42)))) + # ``` + # + # Note that `kwargs` node is just a replacement for `hash` argument, + # so if there's are multiple arguments (or a `kwsplat`) all of them + # are wrapped into `kwargs` instead of `hash`: + # + # ``` + # (send nil :foo + # (kwargs + # (pair + # (sym :a) + # (int 42)) + # (kwsplat + # (send nil :b)) + # (pair + # (sym :c) + # (int 10)))) + # ``` + # + # pkg:gem/parser#lib/parser/builders/default.rb:174 + def emit_kwargs=(_arg0); end + + # AST compatibility attribute; since `-> {}` is not semantically + # equivalent to `lambda {}`, all new code should set this attribute + # to true. + # + # If set to false (the default), `-> {}` is emitted as + # `s(:block, s(:send, nil, :lambda), s(:args), nil)`. + # + # If set to true, `-> {}` is emitted as + # `s(:block, s(:lambda), s(:args), nil)`. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:22 + def emit_lambda; end + + # AST compatibility attribute; since `-> {}` is not semantically + # equivalent to `lambda {}`, all new code should set this attribute + # to true. + # + # If set to false (the default), `-> {}` is emitted as + # `s(:block, s(:send, nil, :lambda), s(:args), nil)`. + # + # If set to true, `-> {}` is emitted as + # `s(:block, s(:lambda), s(:args), nil)`. + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:22 + def emit_lambda=(_arg0); end + + # AST compatibility attribute; Starting from 3.0 Ruby returns + # true/false from single-line pattern matching with `in` keyword. + # + # Before 3.0 there was an exception if given value doesn't match pattern. + # + # NOTE: This attribute affects only Ruby 2.7 grammar. + # 3.0 grammar always emits `match_pattern`/`match_pattern_p` + # + # If compatibility attribute set to false `foo in bar` is emitted as `in_match`: + # + # ``` + # (in-match + # (send nil :foo) + # (match-var :bar)) + # ``` + # + # If set to true it's emitted as `match_pattern_p`: + # ``` + # (match-pattern-p + # (send nil :foo) + # (match-var :bar)) + # ``` + # + # pkg:gem/parser#lib/parser/builders/default.rb:203 + def emit_match_pattern; end + + # AST compatibility attribute; Starting from 3.0 Ruby returns + # true/false from single-line pattern matching with `in` keyword. + # + # Before 3.0 there was an exception if given value doesn't match pattern. + # + # NOTE: This attribute affects only Ruby 2.7 grammar. + # 3.0 grammar always emits `match_pattern`/`match_pattern_p` + # + # If compatibility attribute set to false `foo in bar` is emitted as `in_match`: + # + # ``` + # (in-match + # (send nil :foo) + # (match-var :bar)) + # ``` + # + # If set to true it's emitted as `match_pattern_p`: + # ``` + # (match-pattern-p + # (send nil :foo) + # (match-var :bar)) + # ``` + # + # pkg:gem/parser#lib/parser/builders/default.rb:203 + def emit_match_pattern=(_arg0); end + + # AST compatibility attribute; block arguments of `m { |a| }` are + # not semantically equivalent to block arguments of `m { |a,| }` or `m { |a, b| }`, + # all new code should set this attribute to true. + # + # If set to false (the default), arguments of `m { |a| }` are emitted as + # `s(:args, s(:arg, :a))`. + # + # If set to true, arguments of `m { |a| }` are emitted as + # `s(:args, s(:procarg0, :a)). + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:40 + def emit_procarg0; end + + # AST compatibility attribute; block arguments of `m { |a| }` are + # not semantically equivalent to block arguments of `m { |a,| }` or `m { |a, b| }`, + # all new code should set this attribute to true. + # + # If set to false (the default), arguments of `m { |a| }` are emitted as + # `s(:args, s(:arg, :a))`. + # + # If set to true, arguments of `m { |a| }` are emitted as + # `s(:args, s(:procarg0, :a)). + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/builders/default.rb:40 + def emit_procarg0=(_arg0); end + + # @api private + # + # pkg:gem/parser#lib/parser/builders/default.rb:211 + def modernize; end + end +end + +# {Parser::ClobberingError} is raised when {Parser::Source::Rewriter} +# detects a clobbering rewrite action. This class inherits {RuntimeError} +# rather than {StandardError} for backward compatibility. +# +# @api public +# +# pkg:gem/parser#lib/parser/clobbering_error.rb:11 +class Parser::ClobberingError < ::RuntimeError; end + +# Context of parsing that is represented by a stack of scopes. +# +# Supported states: +# + :class - in the class body (class A; end) +# + :module - in the module body (module M; end) +# + :sclass - in the singleton class body (class << obj; end) +# + :def - in the method body (def m; end) +# + :defs - in the singleton method body (def self.m; end) +# + :def_open_args - in the arglist of the method definition +# keep in mind that it's set **only** after reducing the first argument, +# if you need to handle the first argument check `lex_state == expr_fname` +# + :block - in the block body (tap {}) +# + :lambda - in the lambda body (-> {}) +# +# pkg:gem/parser#lib/parser/context.rb:18 +class Parser::Context + # pkg:gem/parser#lib/parser/context.rb:30 + def initialize; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def cant_return; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def cant_return=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_argdef; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_argdef=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_block; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_block=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_class; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_class=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_def; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_def=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_defined; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_defined=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:47 + def in_dynamic_block?; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_kwarg; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_kwarg=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_lambda; end + + # pkg:gem/parser#lib/parser/context.rb:45 + def in_lambda=(_arg0); end + + # pkg:gem/parser#lib/parser/context.rb:34 + def reset; end +end + +# pkg:gem/parser#lib/parser/context.rb:19 +Parser::Context::FLAGS = T.let(T.unsafe(nil), Array) + +# Stack that holds names of current arguments, +# i.e. while parsing +# def m1(a = (def m2(b = def m3(c = 1); end); end)); end +# ^ +# stack is [:a, :b, :c] +# +# Emulates `p->cur_arg` in MRI's parse.y +# +# @api private +# +# pkg:gem/parser#lib/parser/current_arg_stack.rb:14 +class Parser::CurrentArgStack + # pkg:gem/parser#lib/parser/current_arg_stack.rb:17 + def initialize; end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:22 + def empty?; end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:34 + def pop; end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:26 + def push(value); end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:38 + def reset; end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:30 + def set(value); end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:15 + def stack; end + + # pkg:gem/parser#lib/parser/current_arg_stack.rb:42 + def top; end +end + +# @api private +# +# pkg:gem/parser#lib/parser/deprecation.rb:7 +module Parser::Deprecation + # pkg:gem/parser#lib/parser/deprecation.rb:9 + def warn_of_deprecation; end + + # pkg:gem/parser#lib/parser/deprecation.rb:8 + def warned_of_deprecation=(_arg0); end +end + +# @api public +# +# @!attribute [r] level +# @see LEVELS +# @return [Symbol] diagnostic level +# +# @!attribute [r] reason +# @see Parser::MESSAGES +# @return [Symbol] reason for error +# +# @!attribute [r] arguments +# @see Parser::MESSAGES +# @return [Symbol] extended arguments that describe the error +# +# @!attribute [r] message +# @return [String] error message +# +# @!attribute [r] location +# Main error-related source range. +# @return [Parser::Source::Range] +# +# @!attribute [r] highlights +# Supplementary error-related source ranges. +# @return [Array] +# +# pkg:gem/parser#lib/parser/diagnostic.rb:31 +class Parser::Diagnostic + # @param [Symbol] level + # @param [Symbol] reason + # @param [Hash] arguments + # @param [Parser::Source::Range] location + # @param [Array] highlights + # + # pkg:gem/parser#lib/parser/diagnostic.rb:49 + def initialize(level, reason, arguments, location, highlights = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/diagnostic.rb:39 + def arguments; end + + # pkg:gem/parser#lib/parser/diagnostic.rb:40 + def highlights; end + + # pkg:gem/parser#lib/parser/diagnostic.rb:39 + def level; end + + # pkg:gem/parser#lib/parser/diagnostic.rb:40 + def location; end + + # @return [String] the rendered message. + # + # pkg:gem/parser#lib/parser/diagnostic.rb:69 + def message; end + + # pkg:gem/parser#lib/parser/diagnostic.rb:39 + def reason; end + + # Renders the diagnostic message as a clang-like diagnostic. + # + # @example + # diagnostic.render # => + # # [ + # # "(fragment:0):1:5: error: unexpected token $end", + # # "foo +", + # # " ^" + # # ] + # + # @return [Array] + # + # pkg:gem/parser#lib/parser/diagnostic.rb:86 + def render; end + + private + + # If necessary, shrink a `Range` so as to include only the first line. + # + # @return [Parser::Source::Range] + # + # pkg:gem/parser#lib/parser/diagnostic.rb:142 + def first_line_only(range); end + + # If necessary, shrink a `Range` so as to include only the last line. + # + # @return [Parser::Source::Range] + # + # pkg:gem/parser#lib/parser/diagnostic.rb:155 + def last_line_only(range); end + + # Renders one source line in clang diagnostic style, with highlights. + # + # @return [Array] + # + # pkg:gem/parser#lib/parser/diagnostic.rb:110 + def render_line(range, ellipsis = T.unsafe(nil), range_end = T.unsafe(nil)); end +end + +# {Parser::Diagnostic::Engine} provides a basic API for dealing with +# diagnostics by delegating them to registered consumers. +# +# @example +# buffer = Parser::Source::Buffer.new(__FILE__, source: 'foobar') +# +# consumer = lambda do |diagnostic| +# puts diagnostic.message +# end +# +# engine = Parser::Diagnostic::Engine.new(consumer) +# diagnostic = Parser::Diagnostic.new( +# :warning, :unexpected_token, { :token => 'abc' }, buffer, 1..2) +# +# engine.process(diagnostic) # => "unexpected token abc" +# +# @api public +# +# @!attribute [rw] consumer +# @return [#call(Diagnostic)] +# +# @!attribute [rw] all_errors_are_fatal +# When set to `true` any error that is encountered will result in +# {Parser::SyntaxError} being raised. +# @return [Boolean] +# +# @!attribute [rw] ignore_warnings +# When set to `true` warnings will be ignored. +# @return [Boolean] +# +# pkg:gem/parser#lib/parser/diagnostic/engine.rb:36 +class Parser::Diagnostic::Engine + # @param [#call(Diagnostic)] consumer + # + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:45 + def initialize(consumer = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:39 + def all_errors_are_fatal; end + + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:39 + def all_errors_are_fatal=(_arg0); end + + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:37 + def consumer; end + + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:37 + def consumer=(_arg0); end + + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:40 + def ignore_warnings; end + + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:40 + def ignore_warnings=(_arg0); end + + # Processes a `diagnostic`: + # * Passes the diagnostic to the consumer, if it's not a warning when + # `ignore_warnings` is set. + # * After that, raises {Parser::SyntaxError} when `all_errors_are_fatal` + # is set to true. + # + # @param [Parser::Diagnostic] diagnostic + # @return [Parser::Diagnostic::Engine] + # @see ignore? + # @see raise? + # + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:64 + def process(diagnostic); end + + protected + + # Checks whether `diagnostic` should be ignored. + # + # @param [Parser::Diagnostic] diagnostic + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:86 + def ignore?(diagnostic); end + + # Checks whether `diagnostic` should be raised as an exception. + # + # @param [Parser::Diagnostic] diagnostic + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/diagnostic/engine.rb:97 + def raise?(diagnostic); end +end + +# Collection of the available diagnostic levels. +# +# @return [Array] +# +# pkg:gem/parser#lib/parser/diagnostic.rb:37 +Parser::Diagnostic::LEVELS = T.let(T.unsafe(nil), Array) + +# line 3 "lib/parser/lexer.rl" +# +# === BEFORE YOU START === +# +# Read the Ruby Hacking Guide chapter 11, available in English at +# http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-11-finite-state-lexer/ +# +# Remember two things about Ragel scanners: +# +# 1) Longest match wins. +# +# 2) If two matches have the same length, the first +# in source code wins. +# +# General rules of making Ragel and Bison happy: +# +# * `p` (position) and `@te` contain the index of the character +# they're pointing to ("current"), plus one. `@ts` contains the index +# of the corresponding character. The code for extracting matched token is: +# +# @source_buffer.slice(@ts...@te) +# +# * If your input is `foooooooobar` and the rule is: +# +# 'f' 'o'+ +# +# the result will be: +# +# foooooooobar +# ^ ts=0 ^ p=te=9 +# +# * A Ragel lexer action should not emit more than one token, unless +# you know what you are doing. +# +# * All Ragel commands (fnext, fgoto, ...) end with a semicolon. +# +# * If an action emits the token and transitions to another state, use +# these Ragel commands: +# +# emit($whatever) +# fnext $next_state; fbreak; +# +# If you perform `fgoto` in an action which does not emit a token nor +# rewinds the stream pointer, the parser's side-effectful, +# context-sensitive lookahead actions will break in a hard to detect +# and debug way. +# +# * If an action does not emit a token: +# +# fgoto $next_state; +# +# * If an action features lookbehind, i.e. matches characters with the +# intent of passing them to another action: +# +# p = @ts - 1 +# fgoto $next_state; +# +# or, if the lookbehind consists of a single character: +# +# fhold; fgoto $next_state; +# +# * Ragel merges actions. So, if you have `e_lparen = '(' %act` and +# `c_lparen = '('` and a lexer action `e_lparen | c_lparen`, the result +# _will_ invoke the action `act`. +# +# e_something stands for "something with **e**mbedded action". +# +# * EOF is explicit and is matched by `c_eof`. If you want to introspect +# the state of the lexer, add this rule to the state: +# +# c_eof => do_eof; +# +# * If you proceed past EOF, the lexer will complain: +# +# NoMethodError: undefined method `ord' for nil:NilClass +# +# pkg:gem/parser#lib/parser/lexer-F1.rb:82 +class Parser::Lexer + # pkg:gem/parser#lib/parser/lexer-F1.rb:8250 + def initialize(version); end + + # Return next token: [type, value]. + # + # pkg:gem/parser#lib/parser/lexer-F1.rb:8419 + def advance; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def cmdarg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def cmdarg=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8248 + def cmdarg_stack; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def command_start; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def command_start=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8246 + def comments; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8246 + def comments=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def cond; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def cond=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8248 + def cond_stack; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8281 + def construct_float(chars); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def context; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8244 + def context=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8414 + def dedent_level; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8240 + def diagnostics; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8240 + def diagnostics=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8367 + def encoding; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8242 + def force_utf32; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8242 + def force_utf32=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8248 + def lambda_stack; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8248 + def paren_nest; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8401 + def pop_cmdarg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8410 + def pop_cond; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8396 + def push_cmdarg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8405 + def push_cond; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8290 + def reset(reset_state = T.unsafe(nil)); end + + # line 82 "lib/parser/lexer.rl" + # % + # + # pkg:gem/parser#lib/parser/lexer-F1.rb:8238 + def source_buffer; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8343 + def source_buffer=(source_buffer); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8388 + def state; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8392 + def state=(state); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8241 + def static_env; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8241 + def static_env=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8246 + def tokens; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8246 + def tokens=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8248 + def version; end + + protected + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14701 + def arg_or_cmdarg(cmd_state); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14763 + def check_ambiguous_slash(tm); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14725 + def diagnostic(type, reason, arguments = T.unsafe(nil), location = T.unsafe(nil), highlights = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14731 + def e_lbrace; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14675 + def emit(type, value = T.unsafe(nil), s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14784 + def emit_class_var(ts = T.unsafe(nil), te = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14812 + def emit_colon_with_digits(p, tm, diag_msg); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14709 + def emit_comment(s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14721 + def emit_comment_from_range(p, pe); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14691 + def emit_do(do_block = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14774 + def emit_global_var(ts = T.unsafe(nil), te = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14792 + def emit_instance_var(ts = T.unsafe(nil), te = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14800 + def emit_rbrace_rparen_rbrack; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14822 + def emit_singleton_class; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14685 + def emit_table(table, s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14740 + def numeric_literal_int; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14759 + def on_newline(p); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14671 + def range(s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14662 + def stack_pop; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14667 + def tok(s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:14658 + def version?(*versions); end + + class << self + # pkg:gem/parser#lib/parser/lexer-F1.rb:8186 + def lex_en_expr_arg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8186 + def lex_en_expr_arg=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8202 + def lex_en_expr_beg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8202 + def lex_en_expr_beg=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8190 + def lex_en_expr_cmdarg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8190 + def lex_en_expr_cmdarg=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8182 + def lex_en_expr_dot; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8182 + def lex_en_expr_dot=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8214 + def lex_en_expr_end; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8214 + def lex_en_expr_end=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8194 + def lex_en_expr_endarg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8194 + def lex_en_expr_endarg=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8178 + def lex_en_expr_endfn; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8178 + def lex_en_expr_endfn=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8174 + def lex_en_expr_fname; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8174 + def lex_en_expr_fname=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8206 + def lex_en_expr_labelarg; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8206 + def lex_en_expr_labelarg=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8198 + def lex_en_expr_mid; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8198 + def lex_en_expr_mid=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8210 + def lex_en_expr_value; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8210 + def lex_en_expr_value=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8170 + def lex_en_expr_variable; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8170 + def lex_en_expr_variable=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8230 + def lex_en_inside_string; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8230 + def lex_en_inside_string=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8218 + def lex_en_leading_dot; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8218 + def lex_en_leading_dot=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8226 + def lex_en_line_begin; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8226 + def lex_en_line_begin=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8222 + def lex_en_line_comment; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8222 + def lex_en_line_comment=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8165 + def lex_error; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8165 + def lex_error=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8161 + def lex_start; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8161 + def lex_start=(_arg0); end + + private + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8064 + def _lex_eof_trans; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:8064 + def _lex_eof_trans=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7967 + def _lex_from_state_actions; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7967 + def _lex_from_state_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:461 + def _lex_index_offsets; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:461 + def _lex_index_offsets=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:558 + def _lex_indicies; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:558 + def _lex_indicies=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:364 + def _lex_key_spans; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:364 + def _lex_key_spans=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7870 + def _lex_to_state_actions; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7870 + def _lex_to_state_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7722 + def _lex_trans_actions; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7722 + def _lex_trans_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:87 + def _lex_trans_keys; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:87 + def _lex_trans_keys=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7574 + def _lex_trans_targs; end + + # pkg:gem/parser#lib/parser/lexer-F1.rb:7574 + def _lex_trans_targs=(_arg0); end + end +end + +# pkg:gem/parser#lib/parser/lexer/dedenter.rb:5 +class Parser::Lexer::Dedenter + # pkg:gem/parser#lib/parser/lexer/dedenter.rb:9 + def initialize(dedent_level); end + + # For a heredoc like + # <<-HERE + # a + # b + # HERE + # this method gets called with " a\n" and " b\n" + # + # However, the following heredoc: + # + # <<-HERE + # a\ + # b + # HERE + # calls this method only once with a string " a\\\n b\n" + # + # This is important because technically it's a single line, + # but it has to be concatenated __after__ dedenting. + # + # It has no effect for non-squiggly heredocs, i.e. it simply removes "\\\n" + # Of course, lexer could do it but once again: it's all because of dedenting. + # + # pkg:gem/parser#lib/parser/lexer/dedenter.rb:36 + def dedent(string); end + + # pkg:gem/parser#lib/parser/lexer/dedenter.rb:83 + def interrupt; end +end + +# Tab (\t) counts as 8 spaces +# +# pkg:gem/parser#lib/parser/lexer/dedenter.rb:7 +Parser::Lexer::Dedenter::TAB_WIDTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/parser#lib/parser/lexer-F1.rb:14869 +Parser::Lexer::ESCAPE_WHITESPACE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-F1.rb:14855 +Parser::Lexer::KEYWORDS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-F1.rb:14862 +Parser::Lexer::KEYWORDS_BEGIN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-F1.rb:8371 +Parser::Lexer::LEX_STATES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer/literal.rb:6 +class Parser::Lexer::Literal + # pkg:gem/parser#lib/parser/lexer/literal.rb:42 + def initialize(lexer, str_type, delimiter, str_s, heredoc_e = T.unsafe(nil), indent = T.unsafe(nil), dedent_body = T.unsafe(nil), label_allowed = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:116 + def backslash_delimited?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:39 + def dedent_level; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:191 + def end_interp_brace_and_try_closing; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:218 + def extend_content; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:222 + def extend_space(ts, te); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:197 + def extend_string(string, ts, te); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:204 + def flush_string; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:104 + def heredoc?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:39 + def heredoc_e; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:168 + def infer_indent_level(line); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:91 + def interpolate?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:124 + def munge_escape?(character); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:134 + def nest_and_try_closing(delimiter, ts, te, lookahead = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:108 + def plain_heredoc?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:100 + def regexp?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:40 + def saved_herebody_s; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:40 + def saved_herebody_s=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:112 + def squiggly_heredoc?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:187 + def start_interp_brace; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:39 + def str_s; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:232 + def supports_line_continuation_via_slash?; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:120 + def type; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:95 + def words?; end + + protected + + # pkg:gem/parser#lib/parser/lexer/literal.rb:263 + def clear_buffer; end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:259 + def coerce_encoding(string); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:238 + def delimiter?(delimiter); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:279 + def emit(token, type, s, e); end + + # pkg:gem/parser#lib/parser/lexer/literal.rb:274 + def emit_start_tok; end +end + +# pkg:gem/parser#lib/parser/lexer/literal.rb:7 +Parser::Lexer::Literal::DELIMITERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer/literal.rb:8 +Parser::Lexer::Literal::SPACE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/parser#lib/parser/lexer/literal.rb:9 +Parser::Lexer::Literal::TAB = T.let(T.unsafe(nil), Integer) + +# pkg:gem/parser#lib/parser/lexer/literal.rb:11 +Parser::Lexer::Literal::TYPES = T.let(T.unsafe(nil), Hash) + +# Mapping of strings to parser tokens. +# +# pkg:gem/parser#lib/parser/lexer-F1.rb:14829 +Parser::Lexer::PUNCTUATION = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-F1.rb:14849 +Parser::Lexer::PUNCTUATION_BEGIN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer/stack_state.rb:5 +class Parser::Lexer::StackState + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:6 + def initialize(name); end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:34 + def active?; end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:11 + def clear; end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:38 + def empty?; end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:46 + def inspect; end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:29 + def lexpop; end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:22 + def pop; end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:15 + def push(bit); end + + # pkg:gem/parser#lib/parser/lexer/stack_state.rb:42 + def to_s; end +end + +# line 3 "lib/parser/lexer-strings.rl" +# +# pkg:gem/parser#lib/parser/lexer-strings.rb:6 +class Parser::LexerStrings + # pkg:gem/parser#lib/parser/lexer-strings.rb:3300 + def initialize(lexer, version); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3339 + def advance(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5069 + def close_interp_on_current_literal(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5043 + def continue_lexing(current_literal); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5092 + def dedent_level; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3295 + def herebody_s; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3295 + def herebody_s=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5047 + def literal; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5015 + def next_state_for_literal(literal); end + + # This hook is triggered by "main" lexer on every newline character + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:5100 + def on_newline(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5051 + def pop_literal; end + + # === LITERAL STACK === + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:5009 + def push_literal(*args); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:4999 + def read_character_constant(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3314 + def reset; end + + # Set by "main" lexer + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:3298 + def source_buffer; end + + # Set by "main" lexer + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:3298 + def source_buffer=(_arg0); end + + # Set by "main" lexer + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:3298 + def source_pts; end + + # Set by "main" lexer + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:3298 + def source_pts=(_arg0); end + + protected + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5406 + def check_ambiguous_slash(tm); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5417 + def check_invalid_escapes(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5136 + def cond; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5132 + def diagnostic(type, reason, arguments = T.unsafe(nil), location = T.unsafe(nil), highlights = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5128 + def emit(type, value = T.unsafe(nil), s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5396 + def emit_character_constant; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5373 + def emit_interp_var(interp_var_kind); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5140 + def emit_invalid_escapes?; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5291 + def encode_escape(ord); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5384 + def encode_escaped_char(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5112 + def eof_codepoint?(point); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5210 + def extend_interp_code(current_literal); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5225 + def extend_interp_digit_var; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5364 + def extend_interp_var(current_literal); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5234 + def extend_string_eol_check_eof(current_literal, pe); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5251 + def extend_string_eol_heredoc_intertwined(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5241 + def extend_string_eol_heredoc_line; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5267 + def extend_string_eol_words(current_literal, p); end + + # String escaping + # + # pkg:gem/parser#lib/parser/lexer-strings.rb:5154 + def extend_string_escaped; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5287 + def extend_string_for_token_range(current_literal, string); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5279 + def extend_string_slice_end(lookahead); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5124 + def range(s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5356 + def read_post_meta_or_ctrl_char(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5388 + def slash_c_char; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5392 + def slash_m_char; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5120 + def tok(s = T.unsafe(nil), e = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5295 + def unescape_char(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5307 + def unicode_points(p); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:5116 + def version?(*versions); end + + class << self + # pkg:gem/parser#lib/parser/lexer-strings.rb:3275 + def lex_en_character; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3275 + def lex_en_character=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3255 + def lex_en_interp_backslash_delimited; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3255 + def lex_en_interp_backslash_delimited=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3263 + def lex_en_interp_backslash_delimited_words; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3263 + def lex_en_interp_backslash_delimited_words=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3243 + def lex_en_interp_string; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3243 + def lex_en_interp_string=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3239 + def lex_en_interp_words; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3239 + def lex_en_interp_words=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3259 + def lex_en_plain_backslash_delimited; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3259 + def lex_en_plain_backslash_delimited=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3267 + def lex_en_plain_backslash_delimited_words; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3267 + def lex_en_plain_backslash_delimited_words=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3251 + def lex_en_plain_string; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3251 + def lex_en_plain_string=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3247 + def lex_en_plain_words; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3247 + def lex_en_plain_words=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3271 + def lex_en_regexp_modifiers; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3271 + def lex_en_regexp_modifiers=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3279 + def lex_en_unknown; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3279 + def lex_en_unknown=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3234 + def lex_error; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3234 + def lex_error=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3230 + def lex_start; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3230 + def lex_start=(_arg0); end + + private + + # pkg:gem/parser#lib/parser/lexer-strings.rb:11 + def _lex_actions; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:11 + def _lex_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3184 + def _lex_eof_trans; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3184 + def _lex_eof_trans=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3138 + def _lex_from_state_actions; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3138 + def _lex_from_state_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:244 + def _lex_index_offsets; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:244 + def _lex_index_offsets=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:290 + def _lex_indicies; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:290 + def _lex_indicies=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:198 + def _lex_key_spans; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:198 + def _lex_key_spans=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3092 + def _lex_to_state_actions; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3092 + def _lex_to_state_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3029 + def _lex_trans_actions; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:3029 + def _lex_trans_actions=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:76 + def _lex_trans_keys; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:76 + def _lex_trans_keys=(_arg0); end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:2966 + def _lex_trans_targs; end + + # pkg:gem/parser#lib/parser/lexer-strings.rb:2966 + def _lex_trans_targs=(_arg0); end + end +end + +# line 6 "lib/parser/lexer-strings.rl" +# % +# +# pkg:gem/parser#lib/parser/lexer-strings.rb:3287 +Parser::LexerStrings::ESCAPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-strings.rb:5423 +Parser::LexerStrings::ESCAPE_WHITESPACE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-strings.rb:3332 +Parser::LexerStrings::LEX_STATES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/lexer-strings.rb:3293 +Parser::LexerStrings::REGEXP_META_CHARACTERS = T.let(T.unsafe(nil), Regexp) + +# Diagnostic messages (errors, warnings and notices) that can be generated. +# +# @see Diagnostic +# +# @api public +# +# pkg:gem/parser#lib/parser/messages.rb:11 +Parser::MESSAGES = T.let(T.unsafe(nil), Hash) + +# Holds p->max_numparam from parse.y +# +# @api private +# +# pkg:gem/parser#lib/parser/max_numparam_stack.rb:8 +class Parser::MaxNumparamStack + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:13 + def initialize; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:17 + def empty?; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:29 + def has_numparams?; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:21 + def has_ordinary_params!; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:25 + def has_ordinary_params?; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:45 + def pop; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:41 + def push(static:); end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:33 + def register(numparam); end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:9 + def stack; end + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:37 + def top; end + + private + + # pkg:gem/parser#lib/parser/max_numparam_stack.rb:51 + def set(value); end +end + +# pkg:gem/parser#lib/parser/max_numparam_stack.rb:11 +Parser::MaxNumparamStack::ORDINARY_PARAMS = T.let(T.unsafe(nil), Integer) + +# @api private +# +# pkg:gem/parser#lib/parser/messages.rb:112 +module Parser::Messages + class << self + # Formats the message, returns a raw template if there's nothing to interpolate + # + # Code like `format("", {})` gives a warning, and so this method tries interpolating + # only if `arguments` hash is not empty. + # + # @api private + # + # pkg:gem/parser#lib/parser/messages.rb:119 + def compile(reason, arguments); end + end +end + +# Parser metadata +# +# pkg:gem/parser#lib/parser/meta.rb:5 +module Parser::Meta; end + +# All node types that parser can produce. Not all parser versions +# will be able to produce every possible node. +# Includes node types that are only emitted by the prism parser translator. +# +# pkg:gem/parser#lib/parser/meta.rb:17 +Parser::Meta::NODE_TYPES = T.let(T.unsafe(nil), Set) + +# These are node types required by `Prism::Translation::Parser`, +# which has advanced syntax support ahead of the Parser gem. +# +# pkg:gem/parser#lib/parser/meta.rb:9 +Parser::Meta::PRISM_TRANSLATION_PARSER_NODE_TYPES = T.let(T.unsafe(nil), Array) + +# {Parser::Rewriter} is deprecated. Use {Parser::TreeRewriter} instead. +# It has a backwards compatible API and uses {Parser::Source::TreeRewriter} +# instead of {Parser::Source::Rewriter}. +# Please check the documentation for {Parser::Source::Rewriter} for details. +# +# @api public +# @deprecated Use {Parser::TreeRewriter} +# +# pkg:gem/parser#lib/parser/rewriter.rb:14 +class Parser::Rewriter < ::Parser::AST::Processor + extend ::Parser::Deprecation + + # pkg:gem/parser#lib/parser/rewriter.rb:98 + def initialize(*); end + + # Returns `true` if the specified node is an assignment node, returns false + # otherwise. + # + # @param [Parser::AST::Node] node + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/rewriter.rb:38 + def assignment?(node); end + + # Inserts new code after the given source range. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/rewriter.rb:77 + def insert_after(range, content); end + + # Inserts new code before the given source range. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/rewriter.rb:67 + def insert_before(range, content); end + + # Removes the source range. + # + # @param [Parser::Source::Range] range + # + # pkg:gem/parser#lib/parser/rewriter.rb:47 + def remove(range); end + + # Replaces the code of the source range `range` with `content`. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/rewriter.rb:87 + def replace(range, content); end + + # Rewrites the AST/source buffer and returns a String containing the new + # version. + # + # @param [Parser::Source::Buffer] source_buffer + # @param [Parser::AST::Node] ast + # @return [String] + # + # pkg:gem/parser#lib/parser/rewriter.rb:23 + def rewrite(source_buffer, ast); end + + # Wraps the given source range with the given values. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/rewriter.rb:57 + def wrap(range, before, after); end +end + +# pkg:gem/parser#lib/parser/rewriter.rb:91 +Parser::Rewriter::DEPRECATION_WARNING = T.let(T.unsafe(nil), String) + +# pkg:gem/parser#lib/parser.rb:30 +module Parser::Source; end + +# A buffer with source code. {Buffer} contains the source code itself, +# associated location information (name and first line), and takes care +# of encoding. +# +# A source buffer is immutable once populated. +# +# @!attribute [r] name +# Buffer name. If the buffer was created from a file, the name corresponds +# to relative path to the file. +# @return [String] buffer name +# +# @!attribute [r] first_line +# First line of the buffer, 1 by default. +# @return [Integer] first line +# +# @api public +# +# pkg:gem/parser#lib/parser/source/buffer.rb:25 +class Parser::Source::Buffer + # pkg:gem/parser#lib/parser/source/buffer.rb:110 + def initialize(name, first_line = T.unsafe(nil), source: T.unsafe(nil)); end + + # Convert a character index into the source to a column number. + # + # @param [Integer] position + # @return [Integer] column + # @api private + # + # pkg:gem/parser#lib/parser/source/buffer.rb:247 + def column_for_position(position); end + + # Convert a character index into the source to a `[line, column]` tuple. + # + # @param [Integer] position + # @return [[Integer, Integer]] `[line, column]` + # + # pkg:gem/parser#lib/parser/source/buffer.rb:222 + def decompose_position(position); end + + # pkg:gem/parser#lib/parser/source/buffer.rb:26 + def first_line; end + + # pkg:gem/parser#lib/parser/source/buffer.rb:317 + def freeze; end + + # pkg:gem/parser#lib/parser/source/buffer.rb:323 + def inspect; end + + # Number of last line in the buffer + # + # @return [Integer] + # + # pkg:gem/parser#lib/parser/source/buffer.rb:312 + def last_line; end + + # Convert a character index into the source to a line number. + # + # @param [Integer] position + # @return [Integer] line + # @api private + # + # pkg:gem/parser#lib/parser/source/buffer.rb:236 + def line_for_position(position); end + + # Extract line `lineno` as a new `Range`, taking `first_line` into account. + # + # @param [Integer] lineno + # @return [Range] + # @raise [IndexError] if `lineno` is out of bounds + # + # pkg:gem/parser#lib/parser/source/buffer.rb:289 + def line_range(lineno); end + + # pkg:gem/parser#lib/parser/source/buffer.rb:26 + def name; end + + # Populate this buffer from a string without encoding autodetection. + # + # @param [String] input + # @raise [ArgumentError] if already populated + # @return [String] + # + # pkg:gem/parser#lib/parser/source/buffer.rb:185 + def raw_source=(input); end + + # Populate this buffer from correspondingly named file. + # + # @example + # Parser::Source::Buffer.new('foo/bar.rb').read + # + # @return [Buffer] self + # @raise [ArgumentError] if already populated + # + # pkg:gem/parser#lib/parser/source/buffer.rb:136 + def read; end + + # pkg:gem/parser#lib/parser/source/buffer.rb:199 + def slice(start, length = T.unsafe(nil)); end + + # Source code contained in this buffer. + # + # @return [String] source code + # @raise [RuntimeError] if buffer is not populated yet + # + # pkg:gem/parser#lib/parser/source/buffer.rb:150 + def source; end + + # Populate this buffer from a string with encoding autodetection. + # `input` is mutated if not frozen. + # + # @param [String] input + # @raise [ArgumentError] if already populated + # @raise [EncodingError] if `input` includes invalid byte sequence for the encoding + # @return [String] + # + # pkg:gem/parser#lib/parser/source/buffer.rb:167 + def source=(input); end + + # Extract line `lineno` from source, taking `first_line` into account. + # + # @param [Integer] lineno + # @return [String] + # @raise [IndexError] if `lineno` is out of bounds + # + # pkg:gem/parser#lib/parser/source/buffer.rb:278 + def source_line(lineno); end + + # Return an `Array` of source code lines. + # + # @return [Array] + # + # pkg:gem/parser#lib/parser/source/buffer.rb:257 + def source_lines; end + + # @return [Range] A range covering the whole source + # + # pkg:gem/parser#lib/parser/source/buffer.rb:303 + def source_range; end + + private + + # RUBY_VERSION >= 2.3 + # + # pkg:gem/parser#lib/parser/source/buffer.rb:353 + def bsearch(line_begins, position); end + + # @returns [0, line_begin_of_line_1, ..., source.size + 1] + # + # pkg:gem/parser#lib/parser/source/buffer.rb:330 + def line_begins; end + + # @returns 0-based line index of position + # + # pkg:gem/parser#lib/parser/source/buffer.rb:344 + def line_index_for_position(position); end + + class << self + # Try to recognize encoding of `string` as Ruby would, i.e. by looking for + # magic encoding comment or UTF-8 BOM. `string` can be in any encoding. + # + # @param [String] string + # @raise [Parser::UnknownEncodingInMagicComment] if the encoding is not recognized + # @return [String, nil] encoding name, if recognized + # + # pkg:gem/parser#lib/parser/source/buffer.rb:52 + def recognize_encoding(string); end + + # Recognize encoding of `input` and process it so it could be lexed. + # + # * If `input` does not contain BOM or magic encoding comment, it is + # kept in the original encoding. + # * If the detected encoding is binary, `input` is kept in binary. + # * Otherwise, `input` is re-encoded into UTF-8 and returned as a + # new string. + # + # This method mutates the encoding of `input`, but not its content. + # + # @param [String] input + # @return [String] + # @raise [EncodingError] + # + # pkg:gem/parser#lib/parser/source/buffer.rb:95 + def reencode_string(input); end + end +end + +# @api private +# +# pkg:gem/parser#lib/parser/source/buffer.rb:31 +Parser::Source::Buffer::ENCODING_RE = T.let(T.unsafe(nil), Regexp) + +# A comment in the source code. +# +# @!attribute [r] text +# @return [String] +# +# @!attribute [r] location +# @return [Parser::Source::Range] +# +# @api public +# +# pkg:gem/parser#lib/parser/source/comment.rb:17 +class Parser::Source::Comment + # @param [Parser::Source::Range] range + # + # pkg:gem/parser#lib/parser/source/comment.rb:67 + def initialize(range); end + + # Compares comments. Two comments are equal if they + # correspond to the same source range. + # + # @param [Object] other + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/comment.rb:120 + def ==(other); end + + # @see #type + # @return [Boolean] true if this is a block comment. + # + # pkg:gem/parser#lib/parser/source/comment.rb:109 + def document?; end + + # @see #type + # @return [Boolean] true if this is an inline comment. + # + # pkg:gem/parser#lib/parser/source/comment.rb:101 + def inline?; end + + # @return [String] a human-readable representation of this comment + # + # pkg:gem/parser#lib/parser/source/comment.rb:128 + def inspect; end + + # pkg:gem/parser#lib/parser/source/comment.rb:21 + def loc; end + + # pkg:gem/parser#lib/parser/source/comment.rb:20 + def location; end + + # pkg:gem/parser#lib/parser/source/comment.rb:18 + def text; end + + # Type of this comment. + # + # * Inline comments correspond to `:inline`: + # + # # whatever + # + # * Block comments correspond to `:document`: + # + # =begin + # hi i am a document + # =end + # + # @return [Symbol] + # + # pkg:gem/parser#lib/parser/source/comment.rb:89 + def type; end + + class << self + # Associate `comments` with `ast` nodes by their corresponding node. + # + # @param [Parser::AST::Node] ast + # @param [Array] comments + # @return [Hash>] + # @see Parser::Source::Comment::Associator#associate + # @deprecated Use {associate_locations}. + # + # pkg:gem/parser#lib/parser/source/comment.rb:32 + def associate(ast, comments); end + + # Associate `comments` with `ast` nodes using identity. + # + # @param [Parser::AST::Node] ast + # @param [Array] comments + # @return [Hash>] + # @see Parser::Source::Comment::Associator#associate_by_identity + # + # pkg:gem/parser#lib/parser/source/comment.rb:59 + def associate_by_identity(ast, comments); end + + # Associate `comments` with `ast` nodes by their location in the + # source. + # + # @param [Parser::AST::Node] ast + # @param [Array] comments + # @return [Hash>] + # @see Parser::Source::Comment::Associator#associate_locations + # + # pkg:gem/parser#lib/parser/source/comment.rb:46 + def associate_locations(ast, comments); end + end +end + +# A processor which associates AST nodes with comments based on their +# location in source code. It may be used, for example, to implement +# rdoc-style processing. +# +# @example +# require 'parser/current' +# +# ast, comments = Parser::CurrentRuby.parse_with_comments(<<-CODE) +# # Class stuff +# class Foo +# # Attr stuff +# # @see bar +# attr_accessor :foo +# end +# CODE +# +# p Parser::Source::Comment.associate(ast, comments) +# # => { +# # (class (const nil :Foo) ...) => +# # [#], +# # (send nil :attr_accessor (sym :foo)) => +# # [#, +# # #] +# # } +# +# @see {associate} +# +# @!attribute skip_directives +# Skip file processing directives disguised as comments. +# Namely: +# +# * Shebang line, +# * Magic encoding comment. +# +# @return [Boolean] +# +# @api public +# +# pkg:gem/parser#lib/parser/source/comment/associator.rb:45 +class Parser::Source::Comment::Associator + # @param [Parser::AST::Node] ast + # @param [Array] comments + # + # pkg:gem/parser#lib/parser/source/comment/associator.rb:51 + def initialize(ast, comments); end + + # Compute a mapping between AST nodes and comments. Comment is + # associated with the node, if it is one of the following types: + # + # - preceding comment, it ends before the node start + # - sparse comment, it is located inside the node, after all child nodes + # - decorating comment, it starts at the same line, where the node ends + # + # This rule is unambiguous and produces the result + # one could reasonably expect; for example, this code + # + # # foo + # hoge # bar + # + fuga + # + # will result in the following association: + # + # { + # (send (lvar :hoge) :+ (lvar :fuga)) => + # [#], + # (lvar :fuga) => + # [#] + # } + # + # Note that comments after the end of the end of a passed tree range are + # ignored (except root decorating comment). + # + # Note that {associate} produces unexpected result for nodes which are + # equal but have distinct locations; comments for these nodes are merged. + # You may prefer using {associate_by_identity} or {associate_locations}. + # + # @return [Hash>] + # @deprecated Use {associate_locations}. + # + # pkg:gem/parser#lib/parser/source/comment/associator.rb:92 + def associate; end + + # Same as {associate}, but compares by identity, thus producing an unambiguous + # result even in presence of equal nodes. + # + # @return [Hash>] + # + # pkg:gem/parser#lib/parser/source/comment/associator.rb:115 + def associate_by_identity; end + + # Same as {associate}, but uses `node.loc` instead of `node` as + # the hash key, thus producing an unambiguous result even in presence + # of equal nodes. + # + # @return [Hash>] + # + # pkg:gem/parser#lib/parser/source/comment/associator.rb:104 + def associate_locations; end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:46 + def skip_directives; end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:46 + def skip_directives=(_arg0); end + + private + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:182 + def advance_comment; end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:214 + def advance_through_directives; end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:206 + def associate_and_advance_comment(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:123 + def children_in_source_order(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:187 + def current_comment_before?(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:194 + def current_comment_before_end?(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:201 + def current_comment_decorates?(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:135 + def do_associate; end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:166 + def process_leading_comments(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:173 + def process_trailing_comments(node); end + + # pkg:gem/parser#lib/parser/source/comment/associator.rb:148 + def visit(node); end +end + +# pkg:gem/parser#lib/parser/source/comment/associator.rb:212 +Parser::Source::Comment::Associator::MAGIC_COMMENT_RE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/parser#lib/parser/source/comment/associator.rb:122 +Parser::Source::Comment::Associator::POSTFIX_TYPES = T.let(T.unsafe(nil), Set) + +# {Map} relates AST nodes to the source code they were parsed from. +# More specifically, a {Map} or its subclass contains a set of ranges: +# +# * `expression`: smallest range which includes all source corresponding +# to the node and all `expression` ranges of its children. +# * other ranges (`begin`, `end`, `operator`, ...): node-specific ranges +# pointing to various interesting tokens corresponding to the node. +# +# Note that the {Map::Heredoc} map is the only one whose `expression` does +# not include other ranges. It only covers the heredoc marker (`< 2]').children[0].loc +# # => > +# +# The {file:doc/AST_FORMAT.md} document describes how ranges associated to source +# code tokens. For example, the entry +# +# (array (int 1) (int 2)) +# +# "[1, 2]" +# ^ begin +# ^ end +# ~~~~~~ expression +# +# means that if `node` is an {Parser::AST::Node} `(array (int 1) (int 2))`, +# then `node.loc` responds to `begin`, `end` and `expression`, and +# `node.loc.begin` returns a range pointing at the opening bracket, and so on. +# +# If you want to write code polymorphic by the source map (i.e. accepting +# several subclasses of {Map}), use `respond_to?` instead of `is_a?` to +# check whether the map features the range you need. Concrete {Map} +# subclasses may not be preserved between versions, but their interfaces +# will be kept compatible. +# +# You can visualize the source maps with `ruby-parse -E` command-line tool. +# +# @example +# require 'parser/current' +# +# p Parser::CurrentRuby.parse('[1, 2]').loc +# # => #, +# # @begin=#, +# # @expression=#> +# +# @!attribute [r] node +# The node that is described by this map. Nodes and maps have 1:1 correspondence. +# @return [Parser::AST::Node] +# +# @!attribute [r] expression +# @return [Range] +# +# @api public +# +# pkg:gem/parser#lib/parser/source/map.rb:70 +class Parser::Source::Map + # @param [Range] expression + # + # pkg:gem/parser#lib/parser/source/map.rb:76 + def initialize(expression); end + + # Compares source maps. + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/map.rb:140 + def ==(other); end + + # A shortcut for `self.expression.column`. + # @return [Integer] + # + # pkg:gem/parser#lib/parser/source/map.rb:109 + def column; end + + # pkg:gem/parser#lib/parser/source/map.rb:72 + def expression; end + + # pkg:gem/parser#lib/parser/source/map.rb:103 + def first_line; end + + # A shortcut for `self.expression.last_column`. + # @return [Integer] + # + # pkg:gem/parser#lib/parser/source/map.rb:125 + def last_column; end + + # A shortcut for `self.expression.last_line`. + # @return [Integer] + # + # pkg:gem/parser#lib/parser/source/map.rb:117 + def last_line; end + + # A shortcut for `self.expression.line`. + # @return [Integer] + # + # pkg:gem/parser#lib/parser/source/map.rb:99 + def line; end + + # pkg:gem/parser#lib/parser/source/map.rb:71 + def node; end + + # @api private + # + # pkg:gem/parser#lib/parser/source/map.rb:89 + def node=(node); end + + # Converts this source map to a hash with keys corresponding to + # ranges. For example, if called on an instance of {Collection}, + # which adds the `begin` and `end` ranges, the resulting hash + # will contain keys `:expression`, `:begin` and `:end`. + # + # @example + # require 'parser/current' + # + # p Parser::CurrentRuby.parse('[1, 2]').loc.to_hash + # # => { + # # :begin => #, + # # :end => #, + # # :expression => # + # # } + # + # @return [Hash] + # + # pkg:gem/parser#lib/parser/source/map.rb:166 + def to_hash; end + + # @api private + # + # pkg:gem/parser#lib/parser/source/map.rb:132 + def with_expression(expression_l); end + + protected + + # pkg:gem/parser#lib/parser/source/map.rb:180 + def update_expression(expression_l); end + + # pkg:gem/parser#lib/parser/source/map.rb:176 + def with(&block); end + + private + + # @api private + # + # pkg:gem/parser#lib/parser/source/map.rb:82 + def initialize_copy(other); end +end + +# pkg:gem/parser#lib/parser/source/map/collection.rb:6 +class Parser::Source::Map::Collection < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/collection.rb:10 + def initialize(begin_l, end_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/collection.rb:7 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/collection.rb:8 + def end; end +end + +# pkg:gem/parser#lib/parser/source/map/condition.rb:6 +class Parser::Source::Map::Condition < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/condition.rb:12 + def initialize(keyword_l, begin_l, else_l, end_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/condition.rb:8 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/condition.rb:9 + def else; end + + # pkg:gem/parser#lib/parser/source/map/condition.rb:10 + def end; end + + # pkg:gem/parser#lib/parser/source/map/condition.rb:7 + def keyword; end +end + +# pkg:gem/parser#lib/parser/source/map/constant.rb:6 +class Parser::Source::Map::Constant < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/constant.rb:11 + def initialize(double_colon, name, expression); end + + # pkg:gem/parser#lib/parser/source/map/constant.rb:7 + def double_colon; end + + # pkg:gem/parser#lib/parser/source/map/constant.rb:8 + def name; end + + # pkg:gem/parser#lib/parser/source/map/constant.rb:9 + def operator; end + + # @api private + # + # pkg:gem/parser#lib/parser/source/map/constant.rb:20 + def with_operator(operator_l); end + + protected + + # pkg:gem/parser#lib/parser/source/map/constant.rb:26 + def update_operator(operator_l); end +end + +# pkg:gem/parser#lib/parser/source/map/definition.rb:6 +class Parser::Source::Map::Definition < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/definition.rb:12 + def initialize(keyword_l, operator_l, name_l, end_l); end + + # pkg:gem/parser#lib/parser/source/map/definition.rb:10 + def end; end + + # pkg:gem/parser#lib/parser/source/map/definition.rb:7 + def keyword; end + + # pkg:gem/parser#lib/parser/source/map/definition.rb:9 + def name; end + + # pkg:gem/parser#lib/parser/source/map/definition.rb:8 + def operator; end +end + +# pkg:gem/parser#lib/parser/source/map/for.rb:6 +class Parser::Source::Map::For < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/for.rb:10 + def initialize(keyword_l, in_l, begin_l, end_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/for.rb:8 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/for.rb:8 + def end; end + + # pkg:gem/parser#lib/parser/source/map/for.rb:7 + def in; end + + # pkg:gem/parser#lib/parser/source/map/for.rb:7 + def keyword; end +end + +# pkg:gem/parser#lib/parser/source/map/heredoc.rb:6 +class Parser::Source::Map::Heredoc < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/heredoc.rb:10 + def initialize(begin_l, body_l, end_l); end + + # pkg:gem/parser#lib/parser/source/map/heredoc.rb:7 + def heredoc_body; end + + # pkg:gem/parser#lib/parser/source/map/heredoc.rb:8 + def heredoc_end; end +end + +# pkg:gem/parser#lib/parser/source/map/index.rb:6 +class Parser::Source::Map::Index < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/index.rb:11 + def initialize(begin_l, end_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/index.rb:7 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/index.rb:8 + def end; end + + # pkg:gem/parser#lib/parser/source/map/index.rb:9 + def operator; end + + # @api private + # + # pkg:gem/parser#lib/parser/source/map/index.rb:21 + def with_operator(operator_l); end + + protected + + # pkg:gem/parser#lib/parser/source/map/index.rb:27 + def update_operator(operator_l); end +end + +# pkg:gem/parser#lib/parser/source/map/keyword.rb:6 +class Parser::Source::Map::Keyword < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/keyword.rb:11 + def initialize(keyword_l, begin_l, end_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/keyword.rb:8 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/keyword.rb:9 + def end; end + + # pkg:gem/parser#lib/parser/source/map/keyword.rb:7 + def keyword; end +end + +# pkg:gem/parser#lib/parser/source/map/method_definition.rb:6 +class Parser::Source::Map::MethodDefinition < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/method_definition.rb:13 + def initialize(keyword_l, operator_l, name_l, end_l, assignment_l, body_l); end + + # pkg:gem/parser#lib/parser/source/map/method_definition.rb:11 + def assignment; end + + # pkg:gem/parser#lib/parser/source/map/method_definition.rb:10 + def end; end + + # pkg:gem/parser#lib/parser/source/map/method_definition.rb:7 + def keyword; end + + # pkg:gem/parser#lib/parser/source/map/method_definition.rb:9 + def name; end + + # pkg:gem/parser#lib/parser/source/map/method_definition.rb:8 + def operator; end +end + +# pkg:gem/parser#lib/parser/source/map/objc_kwarg.rb:6 +class Parser::Source::Map::ObjcKwarg < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/objc_kwarg.rb:11 + def initialize(keyword_l, operator_l, argument_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/objc_kwarg.rb:9 + def argument; end + + # pkg:gem/parser#lib/parser/source/map/objc_kwarg.rb:7 + def keyword; end + + # pkg:gem/parser#lib/parser/source/map/objc_kwarg.rb:8 + def operator; end +end + +# pkg:gem/parser#lib/parser/source/map/operator.rb:6 +class Parser::Source::Map::Operator < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/operator.rb:9 + def initialize(operator, expression); end + + # pkg:gem/parser#lib/parser/source/map/operator.rb:7 + def operator; end +end + +# pkg:gem/parser#lib/parser/source/map/rescue_body.rb:6 +class Parser::Source::Map::RescueBody < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/rescue_body.rb:11 + def initialize(keyword_l, assoc_l, begin_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/rescue_body.rb:8 + def assoc; end + + # pkg:gem/parser#lib/parser/source/map/rescue_body.rb:9 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/rescue_body.rb:7 + def keyword; end +end + +# pkg:gem/parser#lib/parser/source/map/send.rb:6 +class Parser::Source::Map::Send < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/send.rb:13 + def initialize(dot_l, selector_l, begin_l, end_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/send.rb:10 + def begin; end + + # pkg:gem/parser#lib/parser/source/map/send.rb:7 + def dot; end + + # pkg:gem/parser#lib/parser/source/map/send.rb:11 + def end; end + + # pkg:gem/parser#lib/parser/source/map/send.rb:9 + def operator; end + + # pkg:gem/parser#lib/parser/source/map/send.rb:8 + def selector; end + + # @api private + # + # pkg:gem/parser#lib/parser/source/map/send.rb:24 + def with_operator(operator_l); end + + protected + + # pkg:gem/parser#lib/parser/source/map/send.rb:30 + def update_operator(operator_l); end +end + +# pkg:gem/parser#lib/parser/source/map/ternary.rb:6 +class Parser::Source::Map::Ternary < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/ternary.rb:10 + def initialize(question_l, colon_l, expression_l); end + + # pkg:gem/parser#lib/parser/source/map/ternary.rb:8 + def colon; end + + # pkg:gem/parser#lib/parser/source/map/ternary.rb:7 + def question; end +end + +# pkg:gem/parser#lib/parser/source/map/variable.rb:6 +class Parser::Source::Map::Variable < ::Parser::Source::Map + # pkg:gem/parser#lib/parser/source/map/variable.rb:10 + def initialize(name_l, expression_l = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/source/map/variable.rb:7 + def name; end + + # pkg:gem/parser#lib/parser/source/map/variable.rb:8 + def operator; end + + # @api private + # + # pkg:gem/parser#lib/parser/source/map/variable.rb:19 + def with_operator(operator_l); end + + protected + + # pkg:gem/parser#lib/parser/source/map/variable.rb:25 + def update_operator(operator_l); end +end + +# A range of characters in a particular source buffer. +# +# The range is always exclusive, i.e. a range with `begin_pos` of 3 and +# `end_pos` of 5 will contain the following characters: +# +# example +# ^^ +# +# @!attribute [r] source_buffer +# @return [Parser::Source::Buffer] +# +# @!attribute [r] begin_pos +# @return [Integer] index of the first character in the range +# +# @!attribute [r] end_pos +# @return [Integer] index of the character after the last character in the range +# +# @api public +# +# pkg:gem/parser#lib/parser/source/range.rb:26 +class Parser::Source::Range + include ::Comparable + + # @param [Buffer] source_buffer + # @param [Integer] begin_pos + # @param [Integer] end_pos + # + # pkg:gem/parser#lib/parser/source/range.rb:37 + def initialize(source_buffer, begin_pos, end_pos); end + + # Compare ranges, first by begin_pos, then by end_pos. + # + # pkg:gem/parser#lib/parser/source/range.rb:301 + def <=>(other); end + + # @param [Hash] Endpoint(s) to change, any combination of :begin_pos or :end_pos + # @return [Range] the same range as this range but with the given end point(s) adjusted + # by the given amount(s) + # + # pkg:gem/parser#lib/parser/source/range.rb:193 + def adjust(begin_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end + + # @return [Range] a zero-length range located just before the beginning + # of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:55 + def begin; end + + # pkg:gem/parser#lib/parser/source/range.rb:30 + def begin_pos; end + + # @return [Integer] zero-based column number of the beginning of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:92 + def column; end + + # @return [::Range] a range of columns spanned by this range. + # @raise RangeError + # + # pkg:gem/parser#lib/parser/source/range.rb:114 + def column_range; end + + # Return `other.contains?(self)` + # + # Two ranges must be one and only one of ==, disjoint?, contains?, contained? or crossing? + # + # @param [Range] other + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/range.rb:274 + def contained?(other); end + + # Returns true iff this range contains (strictly) `other`. + # + # Two ranges must be one and only one of ==, disjoint?, contains?, contained? or crossing? + # + # @param [Range] other + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/range.rb:262 + def contains?(other); end + + # Returns true iff both ranges intersect and also have different elements from one another. + # + # Two ranges must be one and only one of ==, disjoint?, contains?, contained? or crossing? + # + # @param [Range] other + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/range.rb:286 + def crossing?(other); end + + # Return `true` iff this range and `other` are disjoint. + # + # Two ranges must be one and only one of ==, disjoint?, contains?, contained? or crossing? + # + # @param [Range] other + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/range.rb:236 + def disjoint?(other); end + + # Checks if a range is empty; if it contains no characters + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/range.rb:294 + def empty?; end + + # @return [Range] a zero-length range located just after the end + # of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:63 + def end; end + + # pkg:gem/parser#lib/parser/source/range.rb:30 + def end_pos; end + + # pkg:gem/parser#lib/parser/source/range.rb:308 + def eql?(_arg0); end + + # pkg:gem/parser#lib/parser/source/range.rb:87 + def first_line; end + + # Support for Ranges be used in as Hash indices and in Sets. + # + # pkg:gem/parser#lib/parser/source/range.rb:313 + def hash; end + + # @return [String] a human-readable representation of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:320 + def inspect; end + + # @param [Range] other + # @return [Range] overlapping region of this range and `other`, or `nil` + # if they do not overlap + # + # pkg:gem/parser#lib/parser/source/range.rb:220 + def intersect(other); end + + # `is?` provides a concise way to compare the source corresponding to this range. + # For example, `r.source == '(' || r.source == 'begin'` is equivalent to + # `r.is?('(', 'begin')`. + # + # pkg:gem/parser#lib/parser/source/range.rb:141 + def is?(*what); end + + # @param [Range] other + # @return [Range] smallest possible range spanning both this range and `other`. + # + # pkg:gem/parser#lib/parser/source/range.rb:209 + def join(other); end + + # @return [Integer] zero-based column number of the end of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:106 + def last_column; end + + # @return [Integer] line number of the end of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:99 + def last_line; end + + # pkg:gem/parser#lib/parser/source/range.rb:74 + def length; end + + # Line number of the beginning of this range. By default, the first line + # of a buffer is 1; as such, line numbers are most commonly one-based. + # + # @see Buffer + # @return [Integer] line number of the beginning of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:83 + def line; end + + # Return `true` iff this range is not disjoint from `other`. + # + # @param [Range] other + # @return [Boolean] `true` if this range and `other` overlap + # + # pkg:gem/parser#lib/parser/source/range.rb:250 + def overlaps?(other); end + + # @param [Integer] new_size + # @return [Range] a range beginning at the same point as this range and length `new_size`. + # + # pkg:gem/parser#lib/parser/source/range.rb:201 + def resize(new_size); end + + # @return [Integer] amount of characters included in this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:70 + def size; end + + # @return [String] all source code covered by this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:132 + def source; end + + # pkg:gem/parser#lib/parser/source/range.rb:29 + def source_buffer; end + + # @return [String] a line of source code containing the beginning of this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:125 + def source_line; end + + # @return [Array] a set of character indexes contained in this range. + # + # pkg:gem/parser#lib/parser/source/range.rb:148 + def to_a; end + + # @return [Range] a Ruby range with the same `begin_pos` and `end_pos` + # + # pkg:gem/parser#lib/parser/source/range.rb:155 + def to_range; end + + # Composes a GNU/Clang-style string representation of the beginning of this + # range. + # + # For example, for the following range in file `foo.rb`, + # + # def foo + # ^^^ + # + # `to_s` will return `foo.rb:1:5`. + # Note that the column index is one-based. + # + # @return [String] + # + # pkg:gem/parser#lib/parser/source/range.rb:173 + def to_s; end + + # @param [Hash] Endpoint(s) to change, any combination of :begin_pos or :end_pos + # @return [Range] the same range as this range but with the given end point(s) changed + # to the given value(s). + # + # pkg:gem/parser#lib/parser/source/range.rb:184 + def with(begin_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end +end + +# {Rewriter} is deprecated. Use {TreeRewriter} instead. +# +# TreeRewriter has simplified semantics, and customizable policies +# with regards to clobbering. Please read the documentation. +# +# Keep in mind: +# - Rewriter was discarding the `end_pos` of the given range for `insert_before`, +# and the `begin_pos` for `insert_after`. These are meaningful in TreeRewriter. +# - TreeRewriter's wrap/insert_before/insert_after are multiple by default, while +# Rewriter would raise clobbering errors if the non '_multi' version was called. +# - The TreeRewriter policy closest to Rewriter's behavior is: +# different_replacements: :raise, +# swallowed_insertions: :raise, +# crossing_deletions: :accept +# +# @!attribute [r] source_buffer +# @return [Source::Buffer] +# +# @!attribute [r] diagnostics +# @return [Diagnostic::Engine] +# +# @api public +# @deprecated Use {TreeRewriter} +# +# pkg:gem/parser#lib/parser/source/rewriter.rb:31 +class Parser::Source::Rewriter + extend ::Parser::Deprecation + + # @param [Source::Buffer] source_buffer + # @deprecated Use {TreeRewriter} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:39 + def initialize(source_buffer); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:33 + def diagnostics; end + + # Inserts new code after the given source range. + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#insert_after} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:131 + def insert_after(range, content); end + + # Inserts new code after the given source range by allowing other + # insertions at the same position. + # Note that an insertion with latter invocation comes _after_ earlier + # insertion at the same position in the rewritten source. + # + # @example Inserting ')]' + # rewriter. + # insert_after_multi(range, ')'). + # insert_after_multi(range, ']'). + # process + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#insert_after} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:153 + def insert_after_multi(range, content); end + + # Inserts new code before the given source range. + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#insert_before} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:80 + def insert_before(range, content); end + + # Inserts new code before the given source range by allowing other + # insertions at the same position. + # Note that an insertion with latter invocation comes _before_ earlier + # insertion at the same position in the rewritten source. + # + # @example Inserting '[(' + # rewriter. + # insert_before_multi(range, '('). + # insert_before_multi(range, '['). + # process + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#insert_before} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:117 + def insert_before_multi(range, content); end + + # Applies all scheduled changes to the `source_buffer` and returns + # modified source as a new string. + # + # @return [String] + # @deprecated Use {TreeRewriter#process} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:178 + def process; end + + # Removes the source range. + # + # @param [Range] range + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#remove} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:67 + def remove(range); end + + # Replaces the code of the source range `range` with `content`. + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#replace} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:167 + def replace(range, content); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:32 + def source_buffer; end + + # Provides a protected block where a sequence of multiple rewrite actions + # are handled atomically. If any of the actions failed by clobbering, + # all the actions are rolled back. + # + # @example + # begin + # rewriter.transaction do + # rewriter.insert_before(range_of_something, '(') + # rewriter.insert_after(range_of_something, ')') + # end + # rescue Parser::ClobberingError + # end + # + # @raise [RuntimeError] when no block is passed + # @raise [RuntimeError] when already in a transaction + # @deprecated Use {TreeRewriter#transaction} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:216 + def transaction; end + + # Inserts new code before and after the given source range. + # + # @param [Range] range + # @param [String] before + # @param [String] after + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # @deprecated Use {TreeRewriter#wrap} + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:94 + def wrap(range, before, after); end + + private + + # pkg:gem/parser#lib/parser/source/rewriter.rb:476 + def active_clobber; end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:484 + def active_clobber=(value); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:480 + def active_insertions; end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:492 + def active_insertions=(value); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:472 + def active_queue; end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:500 + def adjacent?(range1, range2); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:351 + def adjacent_insertion_mask(range); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:366 + def adjacent_insertions?(range); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:347 + def adjacent_position_mask(range); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:377 + def adjacent_updates?(range); end + + # Schedule a code update. If it overlaps with another update, check + # whether they conflict, and raise a clobbering error if they do. + # (As a special case, zero-length ranges at the same position are + # considered to "overlap".) Otherwise, merge them. + # + # Updates which are adjacent to each other, but do not overlap, are also + # merged. + # + # RULES: + # + # - Insertion ("replacing" a zero-length range): + # - Two insertions at the same point conflict. This is true even + # if the earlier insertion has already been merged with an adjacent + # update, and even if they are both inserting the same text. + # - An insertion never conflicts with a replace or remove operation + # on its right or left side, which does not overlap it (in other + # words, which does not update BOTH its right and left sides). + # - An insertion always conflicts with a remove operation which spans + # both its sides. + # - An insertion conflicts with a replace operation which spans both its + # sides, unless the replacement text is longer than the replaced text + # by the size of the insertion (or more), and the portion of + # replacement text immediately after the insertion position is + # identical to the inserted text. + # + # - Removal operations never conflict with each other. + # + # - Replacement operations: + # - Take the portion of each replacement text which falls within: + # - The other operation's replaced region + # - The other operation's replacement text, if it extends past the + # end of its own replaced region (in other words, if the replacement + # text is longer than the text it replaces) + # - If and only if the taken texts are identical for both operations, + # they do not conflict. + # + # pkg:gem/parser#lib/parser/source/rewriter.rb:280 + def append(action); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:389 + def can_merge?(action, existing); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:355 + def clobbered_insertion?(insertion); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:343 + def clobbered_position_mask(range); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:468 + def in_transaction?; end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:410 + def merge_actions(action, existing); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:419 + def merge_actions!(action, existing); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:425 + def merge_replacements(actions); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:450 + def raise_clobber_error(action, existing); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:335 + def record_insertion(range); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:339 + def record_replace(range); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:445 + def replace_actions(old, updated); end + + # pkg:gem/parser#lib/parser/source/rewriter.rb:383 + def replace_compatible_with_insertion?(replace, insertion); end +end + +# @api private +# +# pkg:gem/parser#lib/parser/source/rewriter/action.rb:9 +class Parser::Source::Rewriter::Action + include ::Comparable + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:15 + def initialize(range, replacement = T.unsafe(nil), allow_multiple_insertions = T.unsafe(nil), order = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:24 + def <=>(other); end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:12 + def allow_multiple_insertions; end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:13 + def allow_multiple_insertions?; end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:12 + def order; end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:12 + def range; end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:12 + def replacement; end + + # pkg:gem/parser#lib/parser/source/rewriter/action.rb:30 + def to_s; end +end + +# pkg:gem/parser#lib/parser/source/rewriter.rb:504 +Parser::Source::Rewriter::DEPRECATION_WARNING = T.let(T.unsafe(nil), String) + +# {TreeRewriter} performs the heavy lifting in the source rewriting process. +# It schedules code updates to be performed in the correct order. +# +# For simple cases, the resulting source will be obvious. +# +# Examples for more complex cases follow. Assume these examples are acting on +# the source `'puts(:hello, :world)`. The methods #wrap, #remove, etc. +# receive a Range as first argument; for clarity, examples below use english +# sentences and a string of raw code instead. +# +# ## Overlapping ranges: +# +# Any two rewriting actions on overlapping ranges will fail and raise +# a `ClobberingError`, unless they are both deletions (covered next). +# +# * wrap ':hello, ' with '(' and ')' +# * wrap ', :world' with '(' and ')' +# => CloberringError +# +# ## Overlapping deletions: +# +# * remove ':hello, ' +# * remove ', :world' +# +# The overlapping ranges are merged and `':hello, :world'` will be removed. +# This policy can be changed. `:crossing_deletions` defaults to `:accept` +# but can be set to `:warn` or `:raise`. +# +# ## Multiple actions at the same end points: +# +# Results will always be independent on the order they were given. +# Exception: rewriting actions done on exactly the same range (covered next). +# +# Example: +# * replace ', ' by ' => ' +# * wrap ':hello, :world' with '{' and '}' +# * replace ':world' with ':everybody' +# * wrap ':world' with '[', ']' +# +# The resulting string will be `'puts({:hello => [:everybody]})'` +# and this result is independent on the order the instructions were given in. +# +# Note that if the two "replace" were given as a single replacement of ', :world' +# for ' => :everybody', the result would be a `ClobberingError` because of the wrap +# in square brackets. +# +# ## Multiple wraps on same range: +# * wrap ':hello' with '(' and ')' +# * wrap ':hello' with '[' and ']' +# +# The wraps are combined in order given and results would be `'puts([(:hello)], :world)'`. +# +# ## Multiple replacements on same range: +# * replace ':hello' by ':hi', then +# * replace ':hello' by ':hey' +# +# The replacements are made in the order given, so the latter replacement +# supersedes the former and ':hello' will be replaced by ':hey'. +# +# This policy can be changed. `:different_replacements` defaults to `:accept` +# but can be set to `:warn` or `:raise`. +# +# ## Swallowed insertions: +# wrap 'world' by '__', '__' +# replace ':hello, :world' with ':hi' +# +# A containing replacement will swallow the contained rewriting actions +# and `':hello, :world'` will be replaced by `':hi'`. +# +# This policy can be changed for swallowed insertions. `:swallowed_insertions` +# defaults to `:accept` but can be set to `:warn` or `:raise` +# +# ## Implementation +# The updates are organized in a tree, according to the ranges they act on +# (where children are strictly contained by their parent), hence the name. +# +# @!attribute [r] source_buffer +# @return [Source::Buffer] +# +# @!attribute [r] diagnostics +# @return [Diagnostic::Engine] +# +# @api public +# +# pkg:gem/parser#lib/parser/source/tree_rewriter.rb:91 +class Parser::Source::TreeRewriter + extend ::Parser::Deprecation + + # @param [Source::Buffer] source_buffer + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:98 + def initialize(source_buffer, crossing_deletions: T.unsafe(nil), different_replacements: T.unsafe(nil), swallowed_insertions: T.unsafe(nil)); end + + # Returns a representation of the rewriter as nested insertions (:wrap) and replacements. + # + # rewriter.as_actions # =>[ [:wrap, 1...10, '(', ')'], + # [:wrap, 2...6, '', '!'], # aka "insert_after" + # [:replace, 2...4, 'foo'], + # [:replace, 5...6, ''], # aka "removal" + # ], + # + # Contrary to `as_replacements`, this representation is sufficient to recreate exactly + # the rewriter. + # + # @return [Array<(Symbol, Range, String{, String})>] + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:299 + def as_nested_actions; end + + # Returns a representation of the rewriter as an ordered list of replacements. + # + # rewriter.as_replacements # => [ [1...1, '('], + # [2...4, 'foo'], + # [5...6, ''], + # [6...6, '!'], + # [10...10, ')'], + # ] + # + # This representation is sufficient to recreate the result of `process` but it is + # not sufficient to recreate completely the rewriter for further merging/actions. + # See `as_nested_actions` + # + # @return [Array] an ordered list of pairs of range & replacement + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:281 + def as_replacements; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:93 + def diagnostics; end + + # Returns true iff no (non trivial) update has been recorded + # + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:125 + def empty?; end + + # For special cases where one needs to merge a rewriter attached to a different source_buffer + # or that needs to be offset. Policies of the receiver are used. + # + # @param [TreeRewriter] rewriter from different source_buffer + # @param [Integer] offset + # @return [Rewriter] self + # @raise [IndexError] if action ranges (once offset) don't fit the current buffer + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:168 + def import!(foreign_rewriter, offset: T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:329 + def in_transaction?; end + + # Shortcut for `wrap(range, nil, content)` + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:242 + def insert_after(range, content); end + + # @api private + # @deprecated Use insert_after or wrap + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:351 + def insert_after_multi(range, text); end + + # Shortcut for `wrap(range, content, nil)` + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:230 + def insert_before(range, content); end + + # @api private + # @deprecated Use insert_after or wrap + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:342 + def insert_before_multi(range, text); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:334 + def inspect; end + + # Returns a new rewriter that consists of the updates of the received + # and the given argument. Policies of the receiver are used. + # + # @param [Rewriter] with + # @return [Rewriter] merge of receiver and argument + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:155 + def merge(with); end + + # Merges the updates of argument with the receiver. + # Policies of the receiver are used. + # This action is atomic in that it won't change the receiver + # unless it succeeds. + # + # @param [Rewriter] with + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:139 + def merge!(with); end + + # Applies all scheduled changes to the `source_buffer` and returns + # modified source as a new string. + # + # @return [String] + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:252 + def process; end + + # Shortcut for `replace(range, '')` + # + # @param [Range] range + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:217 + def remove(range); end + + # Replaces the code of the source range `range` with `content`. + # + # @param [Range] range + # @param [String] content + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:193 + def replace(range, content); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:92 + def source_buffer; end + + # Provides a protected block where a sequence of multiple rewrite actions + # are handled atomically. If any of the actions failed by clobbering, + # all the actions are rolled back. Transactions can be nested. + # + # @raise [RuntimeError] when no block is passed + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:310 + def transaction; end + + # Inserts the given strings before and after the given range. + # + # @param [Range] range + # @param [String, nil] insert_before + # @param [String, nil] insert_after + # @return [Rewriter] self + # @raise [ClobberingError] when clobbering is detected + # + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:206 + def wrap(range, insert_before, insert_after); end + + protected + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:365 + def action_root; end + + private + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:369 + def action_summary; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:392 + def check_policy_validity; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:404 + def check_range_validity(range); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:397 + def combine(range, attributes); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:411 + def enforce_policy(event); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter.rb:418 + def trigger_policy(event, range: T.unsafe(nil), conflict: T.unsafe(nil), **arguments); end +end + +# pkg:gem/parser#lib/parser/source/tree_rewriter.rb:391 +Parser::Source::TreeRewriter::ACTIONS = T.let(T.unsafe(nil), Array) + +# @api private +# +# Actions are arranged in a tree and get combined so that: +# +# * Children are strictly contained by their parent +# * Siblings are all disjointed from one another and ordered +# * Only actions with `replacement == nil` may have children +# +# pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:14 +class Parser::Source::TreeRewriter::Action + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:17 + def initialize(range, enforcer, insert_before: T.unsafe(nil), replacement: T.unsafe(nil), insert_after: T.unsafe(nil), children: T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:29 + def combine(action); end + + # A root action has its range set to the whole source range, even + # though it typically does not act on that range. + # This method returns the action as if it was a child action with + # its range contracted. + # @return [Action] + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:68 + def contract; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:34 + def empty?; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:15 + def insert_after; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:15 + def insert_before; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:58 + def insertion?; end + + # @return [Action] that has been moved to the given source_buffer and with the given offset + # No check is done on validity of resulting range. + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:81 + def moved(source_buffer, offset); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:50 + def nested_actions; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:41 + def ordered_replacements; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:15 + def range; end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:15 + def replacement; end + + protected + + # Returns the children in a hierarchy with respect to `action`: + # :sibbling_left, sibbling_right (for those that are disjoint from `action`) + # :parent (in case one of our children contains `action`) + # :child (in case `action` strictly contains some of our children) + # :fusible (in case `action` overlaps some children but they can be fused in one deletion) + # or raises a `CloberingError` + # In case a child has equal range to `action`, it is returned as `:parent` + # Reminder: an empty range 1...1 is considered disjoint from 1...10 + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:159 + def analyse_hierarchy(action); end + + # Similar to @children.bsearch_index || size + # except allows for a starting point + # and `bsearch_index` is only Ruby 2.3+ + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:146 + def bsearch_child_index(from = T.unsafe(nil)); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:225 + def call_enforcer_for_merge(action); end + + # @param [Array(Action | nil)] fusible + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:205 + def check_fusible(action, *fusible); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:95 + def children; end + + # Assumes `more_children` all contained within `@range` + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:130 + def combine_children(more_children); end + + # Assumes range.contains?(action.range) && action.children.empty? + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:103 + def do_combine(action); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:136 + def fuse_deletions(action, fusible, other_sibblings); end + + # Assumes action.range == range && action.children.empty? + # + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:216 + def merge(action); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:111 + def place_in_hierarchy(action); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:233 + def swallow(children); end + + # pkg:gem/parser#lib/parser/source/tree_rewriter/action.rb:97 + def with(range: T.unsafe(nil), enforcer: T.unsafe(nil), children: T.unsafe(nil), insert_before: T.unsafe(nil), replacement: T.unsafe(nil), insert_after: T.unsafe(nil)); end +end + +# pkg:gem/parser#lib/parser/source/tree_rewriter.rb:356 +Parser::Source::TreeRewriter::DEPRECATION_WARNING = T.let(T.unsafe(nil), String) + +# pkg:gem/parser#lib/parser/source/tree_rewriter.rb:417 +Parser::Source::TreeRewriter::POLICY_TO_LEVEL = T.let(T.unsafe(nil), Hash) + +# pkg:gem/parser#lib/parser/static_environment.rb:5 +class Parser::StaticEnvironment + # pkg:gem/parser#lib/parser/static_environment.rb:17 + def initialize; end + + # pkg:gem/parser#lib/parser/static_environment.rb:55 + def declare(name); end + + # Anonymous blockarg + # + # pkg:gem/parser#lib/parser/static_environment.rb:77 + def declare_anonymous_blockarg; end + + # Anonymous kwresarg + # + # pkg:gem/parser#lib/parser/static_environment.rb:113 + def declare_anonymous_kwrestarg; end + + # Anonymous restarg + # + # pkg:gem/parser#lib/parser/static_environment.rb:95 + def declare_anonymous_restarg; end + + # Forward args + # + # pkg:gem/parser#lib/parser/static_environment.rb:67 + def declare_forward_args; end + + # pkg:gem/parser#lib/parser/static_environment.rb:61 + def declared?(name); end + + # pkg:gem/parser#lib/parser/static_environment.rb:81 + def declared_anonymous_blockarg?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:85 + def declared_anonymous_blockarg_in_current_scpe?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:117 + def declared_anonymous_kwrestarg?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:121 + def declared_anonymous_kwrestarg_in_current_scope?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:99 + def declared_anonymous_restarg?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:103 + def declared_anonymous_restarg_in_current_scope?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:71 + def declared_forward_args?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:129 + def empty?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:33 + def extend_dynamic; end + + # pkg:gem/parser#lib/parser/static_environment.rb:26 + def extend_static; end + + # pkg:gem/parser#lib/parser/static_environment.rb:89 + def parent_has_anonymous_blockarg?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:125 + def parent_has_anonymous_kwrestarg?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:107 + def parent_has_anonymous_restarg?; end + + # pkg:gem/parser#lib/parser/static_environment.rb:21 + def reset; end + + # pkg:gem/parser#lib/parser/static_environment.rb:49 + def unextend; end +end + +# pkg:gem/parser#lib/parser/static_environment.rb:15 +Parser::StaticEnvironment::ANONYMOUS_BLOCKARG_INHERITED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parser#lib/parser/static_environment.rb:14 +Parser::StaticEnvironment::ANONYMOUS_BLOCKARG_IN_CURRENT_SCOPE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parser#lib/parser/static_environment.rb:12 +Parser::StaticEnvironment::ANONYMOUS_KWRESTARG_INHERITED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parser#lib/parser/static_environment.rb:11 +Parser::StaticEnvironment::ANONYMOUS_KWRESTARG_IN_CURRENT_SCOPE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parser#lib/parser/static_environment.rb:9 +Parser::StaticEnvironment::ANONYMOUS_RESTARG_INHERITED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parser#lib/parser/static_environment.rb:8 +Parser::StaticEnvironment::ANONYMOUS_RESTARG_IN_CURRENT_SCOPE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/parser#lib/parser/static_environment.rb:6 +Parser::StaticEnvironment::FORWARD_ARGS = T.let(T.unsafe(nil), Symbol) + +# {Parser::SyntaxError} is raised whenever parser detects a syntax error, +# similar to the standard SyntaxError class. +# +# @api public +# +# @!attribute [r] diagnostic +# @return [Parser::Diagnostic] +# +# pkg:gem/parser#lib/parser/syntax_error.rb:13 +class Parser::SyntaxError < ::StandardError + # pkg:gem/parser#lib/parser/syntax_error.rb:16 + def initialize(diagnostic); end + + # pkg:gem/parser#lib/parser/syntax_error.rb:14 + def diagnostic; end +end + +# {Parser::TreeRewriter} offers a basic API that makes it easy to rewrite +# existing ASTs. It's built on top of {Parser::AST::Processor} and +# {Parser::Source::TreeRewriter} +# +# For example, assume you want to remove `do` tokens from a while statement. +# You can do this as following: +# +# require 'parser/current' +# +# class RemoveDo < Parser::TreeRewriter +# def on_while(node) +# # Check if the statement starts with "do" +# if node.location.begin.is?('do') +# remove(node.location.begin) +# end +# end +# end +# +# code = <<-EOF +# while true do +# puts 'hello' +# end +# EOF +# +# ast = Parser::CurrentRuby.parse code +# buffer = Parser::Source::Buffer.new('(example)', source: code) +# rewriter = RemoveDo.new +# +# # Rewrite the AST, returns a String with the new form. +# puts rewriter.rewrite(buffer, ast) +# +# This would result in the following Ruby code: +# +# while true +# puts 'hello' +# end +# +# Keep in mind that {Parser::TreeRewriter} does not take care of indentation when +# inserting/replacing code so you'll have to do this yourself. +# +# See also [a blog entry](http://whitequark.org/blog/2013/04/26/lets-play-with-ruby-code/) +# describing rewriters in greater detail. +# +# @api public +# +# pkg:gem/parser#lib/parser/tree_rewriter.rb:51 +class Parser::TreeRewriter < ::Parser::AST::Processor + # Returns `true` if the specified node is an assignment node, returns false + # otherwise. + # + # @param [Parser::AST::Node] node + # @return [Boolean] + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:79 + def assignment?(node); end + + # Inserts new code after the given source range. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:118 + def insert_after(range, content); end + + # Inserts new code before the given source range. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:108 + def insert_before(range, content); end + + # Removes the source range. + # + # @param [Parser::Source::Range] range + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:88 + def remove(range); end + + # Replaces the code of the source range `range` with `content`. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:128 + def replace(range, content); end + + # Rewrites the AST/source buffer and returns a String containing the new + # version. + # + # @param [Parser::Source::Buffer] source_buffer + # @param [Parser::AST::Node] ast + # @param [Symbol] crossing_deletions:, different_replacements:, swallowed_insertions: + # policy arguments for TreeRewriter (optional) + # @return [String] + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:62 + def rewrite(source_buffer, ast, **policy); end + + # Wraps the given source range with the given values. + # + # @param [Parser::Source::Range] range + # @param [String] content + # + # pkg:gem/parser#lib/parser/tree_rewriter.rb:98 + def wrap(range, before, after); end +end + +# {Parser::UnknownEncodingInMagicComment} is raised when a magic encoding +# comment is encountered that the currently running Ruby version doesn't +# recognize. It inherits from {ArgumentError} since that is the exception +# Ruby itself raises when trying to execute a file with an unknown encoding. +# As such, it is also not a {Parser::SyntaxError}. +# +# @api public +# +# pkg:gem/parser#lib/parser/unknown_encoding_in_magic_comment_error.rb:13 +class Parser::UnknownEncodingInMagicComment < ::ArgumentError; end + +# pkg:gem/parser#lib/parser/version.rb:4 +Parser::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/parser#lib/parser/variables_stack.rb:5 +class Parser::VariablesStack + # pkg:gem/parser#lib/parser/variables_stack.rb:6 + def initialize; end + + # pkg:gem/parser#lib/parser/variables_stack.rb:27 + def declare(name); end + + # pkg:gem/parser#lib/parser/variables_stack.rb:31 + def declared?(name); end + + # pkg:gem/parser#lib/parser/variables_stack.rb:11 + def empty?; end + + # pkg:gem/parser#lib/parser/variables_stack.rb:19 + def pop; end + + # pkg:gem/parser#lib/parser/variables_stack.rb:15 + def push; end + + # pkg:gem/parser#lib/parser/variables_stack.rb:23 + def reset; end +end diff --git a/sorbet/rbi/gems/prism@1.9.0.rbi b/sorbet/rbi/gems/prism@1.9.0.rbi new file mode 100644 index 0000000..5b67e31 --- /dev/null +++ b/sorbet/rbi/gems/prism@1.9.0.rbi @@ -0,0 +1,42213 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `prism` gem. +# Please instead update this file by running `bin/tapioca gem prism`. + + +# typed: strict + +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/dsl.rbi.erb +# if you are looking to modify the template +# =end +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/node.rbi.erb +# if you are looking to modify the template +# =end +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/visitor.rbi.erb +# if you are looking to modify the template +# =end + +# We keep these shims in here because our client libraries might not have parser +# in their bundle. +module Parser; end + +class Parser::Base; end + +# pkg:gem/prism#lib/prism/translation/parser.rb:30 +class Parser::Diagnostic; end + +# The Prism Ruby parser. +# +# "Parsing Ruby is suddenly manageable!" +# - You, hopefully +# +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/compiler.rb.erb +# if you are looking to modify the template +# ++ +# =end +# :markup: markdown +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/dispatcher.rb.erb +# if you are looking to modify the template +# ++ +# =end +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/dsl.rb.erb +# if you are looking to modify the template +# ++ +# =end +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/inspect_visitor.rb.erb +# if you are looking to modify the template +# ++ +# =end +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/mutation_compiler.rb.erb +# if you are looking to modify the template +# ++ +# =end +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/node.rb.erb +# if you are looking to modify the template +# ++ +# =end +# -- +# Here we are reopening the prism module to provide methods on nodes that aren't +# templated and are meant as convenience methods. +# ++ +# +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/reflection.rb.erb +# if you are looking to modify the template +# ++ +# =end +# =begin +# -- +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/lib/prism/visitor.rb.erb +# if you are looking to modify the template +# ++ +# =end +# +# pkg:gem/prism#lib/prism.rb:9 +module Prism + class << self + # Mirror the Prism.dump API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def dump(*_arg0); end + + # Mirror the Prism.dump_file API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def dump_file(*_arg0); end + + # Mirror the Prism.lex API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def lex(*_arg0); end + + # :call-seq: + # Prism::lex_compat(source, **options) -> LexCompat::Result + # + # Returns a parse result whose value is an array of tokens that closely + # resembles the return value of Ripper::lex. + # + # For supported options, see Prism::parse. + # + # pkg:gem/prism#lib/prism.rb:65 + sig { params(source: String, options: T::Hash[Symbol, T.untyped]).returns(Prism::LexCompat::Result) } + def lex_compat(source, **options); end + + # Mirror the Prism.lex_file API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def lex_file(*_arg0); end + + # :call-seq: + # Prism::load(source, serialized, freeze) -> ParseResult + # + # Load the serialized AST using the source as a reference into a tree. + # + # pkg:gem/prism#lib/prism.rb:73 + sig { params(source: String, serialized: String, freeze: T.nilable(T::Boolean)).returns(Prism::ParseResult) } + def load(source, serialized, freeze = false); end + + # Mirror the Prism.parse API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse(*_arg0); end + + # Mirror the Prism.parse_comments API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_comments(*_arg0); end + + # Mirror the Prism.parse_failure? API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_failure?(*_arg0); end + + # Mirror the Prism.parse_file API by using the serialization API. This uses + # native strings instead of Ruby strings because it allows us to use mmap + # when it is available. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_file(*_arg0); end + + # Mirror the Prism.parse_file_comments API by using the serialization + # API. This uses native strings instead of Ruby strings because it allows us + # to use mmap when it is available. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_file_comments(*_arg0); end + + # Mirror the Prism.parse_file_failure? API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_file_failure?(*_arg0); end + + # Mirror the Prism.parse_file_success? API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_file_success?(*_arg0); end + + # Mirror the Prism.parse_lex API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_lex(*_arg0); end + + # Mirror the Prism.parse_lex_file API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_lex_file(*_arg0); end + + # Mirror the Prism.parse_stream API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_stream(*_arg0); end + + # Mirror the Prism.parse_success? API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def parse_success?(*_arg0); end + + # Mirror the Prism.profile API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def profile(*_arg0); end + + # Mirror the Prism.profile_file API by using the serialization API. + # + # pkg:gem/prism#lib/prism.rb:92 + def profile_file(*_arg0); end + + # Create a new scope with the given locals and forwarding options that is + # suitable for passing into one of the Prism.* methods that accepts the + # `scopes` option. + # + # pkg:gem/prism#lib/prism/parse_result.rb:904 + sig { params(locals: T::Array[Symbol], forwarding: T::Array[Symbol]).returns(Prism::Scope) } + def scope(locals: [], forwarding: []); end + end +end + +# Specialized version of Prism::Source for source code that includes ASCII +# characters only. This class is used to apply performance optimizations that +# cannot be applied to sources that include multibyte characters. +# +# In the extremely rare case that a source includes multi-byte characters but +# is marked as binary because of a magic encoding comment and it cannot be +# eagerly converted to UTF-8, this class will be used as well. This is because +# at that point we will treat everything as single-byte characters. +# +# pkg:gem/prism#lib/prism/parse_result.rb:250 +class Prism::ASCIISource < ::Prism::Source + # Return the column number in characters for the given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:257 + sig { params(byte_offset: Integer).returns(Integer) } + def character_column(byte_offset); end + + # Return the character offset for the given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:252 + sig { params(byte_offset: Integer).returns(Integer) } + def character_offset(byte_offset); end + + # Returns a cache that is the identity function in order to maintain the + # same interface. We can do this because code units are always equivalent to + # byte offsets for ASCII-only sources. + # + # pkg:gem/prism#lib/prism/parse_result.rb:274 + sig do + params( + encoding: Encoding + ).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))) + end + def code_units_cache(encoding); end + + # Specialized version of `code_units_column` that does not depend on + # `code_units_offset`, which is a more expensive operation. This is + # essentially the same as `Prism::Source#column`. + # + # pkg:gem/prism#lib/prism/parse_result.rb:281 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_column(byte_offset, encoding); end + + # Returns the offset from the start of the file for the given byte offset + # counting in code units for the given encoding. + # + # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the + # concept of code units that differs from the number of characters in other + # encodings, it is not captured here. + # + # pkg:gem/prism#lib/prism/parse_result.rb:267 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_offset(byte_offset, encoding); end +end + +# Represents the use of the `alias` keyword to alias a global variable. +# +# alias $foo $bar +# ^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:334 +class Prism::AliasGlobalVariableNode < ::Prism::Node + # Initialize a new AliasGlobalVariableNode node. + # + # pkg:gem/prism#lib/prism/node.rb:336 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode), + old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:437 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:347 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:352 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:370 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:365 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, ?keyword_loc: Location) -> AliasGlobalVariableNode + # + # pkg:gem/prism#lib/prism/node.rb:375 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode), + old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).returns(Prism::AliasGlobalVariableNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, new_name: self.new_name, old_name: self.old_name, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:380 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:383 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:357 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:421 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:416 + sig { returns(String) } + def keyword; end + + # The location of the `alias` keyword. + # + # alias $foo $bar + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:403 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Represents the new name of the global variable that can be used after aliasing. + # + # alias $foo $bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:391 + sig { returns(T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)) } + def new_name; end + + # Represents the old name of the global variable that can be used before aliasing. + # + # alias $foo $bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:397 + sig do + returns(T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode)) + end + def old_name; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:411 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:426 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:431 + def type; end + end +end + +# Represents the use of the `alias` keyword to alias a method. +# +# alias foo bar +# ^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:449 +class Prism::AliasMethodNode < ::Prism::Node + # Initialize a new AliasMethodNode node. + # + # pkg:gem/prism#lib/prism/node.rb:451 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode), + old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:564 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:462 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:467 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:485 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:480 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: SymbolNode | InterpolatedSymbolNode, ?old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, ?keyword_loc: Location) -> AliasMethodNode + # + # pkg:gem/prism#lib/prism/node.rb:490 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode), + old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).returns(Prism::AliasMethodNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, new_name: self.new_name, old_name: self.old_name, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:495 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: SymbolNode | InterpolatedSymbolNode, old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:498 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:472 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:548 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:543 + sig { returns(String) } + def keyword; end + + # Represents the location of the `alias` keyword. + # + # alias foo bar + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:530 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Represents the new name of the method that will be aliased. + # + # alias foo bar + # ^^^ + # + # alias :foo :bar + # ^^^^ + # + # alias :"#{foo}" :"#{bar}" + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:512 + sig { returns(T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)) } + def new_name; end + + # Represents the old name of the method that will be aliased. + # + # alias foo bar + # ^^^ + # + # alias :foo :bar + # ^^^^ + # + # alias :"#{foo}" :"#{bar}" + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:524 + sig do + returns(T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode)) + end + def old_name; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:538 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:553 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:558 + def type; end + end +end + +# Represents an alternation pattern in pattern matching. +# +# foo => bar | baz +# ^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:576 +class Prism::AlternationPatternNode < ::Prism::Node + # Initialize a new AlternationPatternNode node. + # + # pkg:gem/prism#lib/prism/node.rb:578 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, left, right, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:679 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:589 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:594 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:612 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:607 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode + # + # pkg:gem/prism#lib/prism/node.rb:617 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::AlternationPatternNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, left: self.left, right: self.right, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:622 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:625 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:599 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:663 + sig { override.returns(String) } + def inspect; end + + # Represents the left side of the expression. + # + # foo => bar | baz + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:633 + sig { returns(Prism::Node) } + def left; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:658 + sig { returns(String) } + def operator; end + + # Represents the alternation operator location. + # + # foo => bar | baz + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:645 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the right side of the expression. + # + # foo => bar | baz + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:639 + sig { returns(Prism::Node) } + def right; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:653 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:668 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:673 + def type; end + end +end + +# Represents the use of the `&&` operator or the `and` keyword. +# +# left and right +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:691 +class Prism::AndNode < ::Prism::Node + # Initialize a new AndNode node. + # + # pkg:gem/prism#lib/prism/node.rb:693 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, left, right, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:800 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:704 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:709 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:727 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:722 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode + # + # pkg:gem/prism#lib/prism/node.rb:732 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::AndNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, left: self.left, right: self.right, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:737 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:740 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:714 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:784 + sig { override.returns(String) } + def inspect; end + + # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # left and right + # ^^^^ + # + # 1 && 2 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:751 + sig { returns(Prism::Node) } + def left; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:779 + sig { returns(String) } + def operator; end + + # The location of the `and` keyword or the `&&` operator. + # + # left and right + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:766 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the right side of the expression. + # + # left && right + # ^^^^^ + # + # 1 and 2 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:760 + sig { returns(Prism::Node) } + def right; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:774 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:789 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:794 + def type; end + end +end + +# Represents a set of arguments to a method or a keyword. +# +# return foo, bar, baz +# ^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:812 +class Prism::ArgumentsNode < ::Prism::Node + # Initialize a new ArgumentsNode node. + # + # pkg:gem/prism#lib/prism/node.rb:814 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T::Array[Prism::Node] + ).void + end + def initialize(source, node_id, location, flags, arguments); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:910 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:823 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # The list of arguments, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo(bar, baz) + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:891 + sig { returns(T::Array[Prism::Node]) } + def arguments; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:828 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:845 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:840 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def contains_forwarding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:863 + sig { returns(T::Boolean) } + def contains_forwarding?; end + + # def contains_keyword_splat?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:873 + sig { returns(T::Boolean) } + def contains_keyword_splat?; end + + # def contains_keywords?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:868 + sig { returns(T::Boolean) } + def contains_keywords?; end + + # def contains_multiple_splats?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:883 + sig { returns(T::Boolean) } + def contains_multiple_splats?; end + + # def contains_splat?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:878 + sig { returns(T::Boolean) } + def contains_splat?; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode + # + # pkg:gem/prism#lib/prism/node.rb:850 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T::Array[Prism::Node] + ).returns(Prism::ArgumentsNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, arguments: self.arguments); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:855 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: Array[Prism::node] } + # + # pkg:gem/prism#lib/prism/node.rb:858 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:833 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:894 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:899 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:904 + def type; end + end +end + +# Flags for arguments nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19780 +module Prism::ArgumentsNodeFlags; end + +# if the arguments contain forwarding +# +# pkg:gem/prism#lib/prism/node.rb:19782 +Prism::ArgumentsNodeFlags::CONTAINS_FORWARDING = T.let(T.unsafe(nil), Integer) + +# if the arguments contain keywords +# +# pkg:gem/prism#lib/prism/node.rb:19785 +Prism::ArgumentsNodeFlags::CONTAINS_KEYWORDS = T.let(T.unsafe(nil), Integer) + +# if the arguments contain a keyword splat +# +# pkg:gem/prism#lib/prism/node.rb:19788 +Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer) + +# if the arguments contain multiple splats +# +# pkg:gem/prism#lib/prism/node.rb:19794 +Prism::ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS = T.let(T.unsafe(nil), Integer) + +# if the arguments contain a splat +# +# pkg:gem/prism#lib/prism/node.rb:19791 +Prism::ArgumentsNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) + +# Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i. +# +# [1, 2, 3] +# ^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:922 +class Prism::ArrayNode < ::Prism::Node + # Initialize a new ArrayNode node. + # + # pkg:gem/prism#lib/prism/node.rb:924 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, elements, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1057 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:935 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:940 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1036 + sig { returns(T.nilable(String)) } + def closing; end + + # Represents the optional source location for the closing token. + # + # [1,2,3] # "]" + # %w[foo bar baz] # "]" + # %I(apple orange banana) # ")" + # foo = 1, 2, 3 # nil + # + # pkg:gem/prism#lib/prism/node.rb:1012 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:957 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:952 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def contains_splat?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:975 + sig { returns(T::Boolean) } + def contains_splat?; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode + # + # pkg:gem/prism#lib/prism/node.rb:962 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::ArrayNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, elements: self.elements, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:967 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:970 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:945 + def each_child_node; end + + # Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array. + # + # pkg:gem/prism#lib/prism/node.rb:980 + sig { returns(T::Array[Prism::Node]) } + def elements; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1041 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1031 + sig { returns(T.nilable(String)) } + def opening; end + + # Represents the optional source location for the opening token. + # + # [1,2,3] # "[" + # %w[foo bar baz] # "%w[" + # %I(apple orange banana) # "%I(" + # foo = 1, 2, 3 # nil + # + # pkg:gem/prism#lib/prism/node.rb:988 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1026 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1002 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1046 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1051 + def type; end + end +end + +# Flags for array nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19798 +module Prism::ArrayNodeFlags; end + +# if array contains splat nodes +# +# pkg:gem/prism#lib/prism/node.rb:19800 +Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) + +# Represents an array pattern in pattern matching. +# +# foo in 1, 2 +# ^^^^^^^^^^^ +# +# foo in [1, 2] +# ^^^^^^^^^^^^^ +# +# foo in *bar +# ^^^^^^^^^^^ +# +# foo in Bar[] +# ^^^^^^^^^^^^ +# +# foo in Bar[1, 2, 3] +# ^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:1083 +class Prism::ArrayPatternNode < ::Prism::Node + # Initialize a new ArrayPatternNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1085 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + requireds: T::Array[Prism::Node], + rest: T.nilable(Prism::Node), + posts: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1247 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1099 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1104 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1226 + sig { returns(T.nilable(String)) } + def closing; end + + # Represents the closing location of the array pattern. + # + # foo in [1, 2] + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:1202 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1129 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1119 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Represents the optional constant preceding the Array + # + # foo in Bar[] + # ^^^ + # + # foo in Bar[1, 2, 3] + # ^^^ + # + # foo in Bar::Baz[1, 2, 3] + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1156 + sig { returns(T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode))) } + def constant; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantPathNode | ConstantReadNode | nil, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode + # + # pkg:gem/prism#lib/prism/node.rb:1134 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + requireds: T::Array[Prism::Node], + rest: T.nilable(Prism::Node), + posts: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::ArrayPatternNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, constant: self.constant, requireds: self.requireds, rest: self.rest, posts: self.posts, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1139 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantPathNode | ConstantReadNode | nil, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:1142 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1109 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1231 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1221 + sig { returns(T.nilable(String)) } + def opening; end + + # Represents the opening location of the array pattern. + # + # foo in [1, 2] + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:1180 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Represents the elements after the rest element of the array pattern. + # + # foo in *bar, baz + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1174 + sig { returns(T::Array[Prism::Node]) } + def posts; end + + # Represents the required elements of the array pattern. + # + # foo in [1, 2] + # ^ ^ + # + # pkg:gem/prism#lib/prism/node.rb:1162 + sig { returns(T::Array[Prism::Node]) } + def requireds; end + + # Represents the rest element of the array pattern. + # + # foo in *bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1168 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1216 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1194 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1236 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1241 + def type; end + end +end + +# Represents a hash key/value pair. +# +# { a => b } +# ^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:1264 +class Prism::AssocNode < ::Prism::Node + # Initialize a new AssocNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1266 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, key, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1382 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1277 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1282 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1300 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1295 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode + # + # pkg:gem/prism#lib/prism/node.rb:1305 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location) + ).returns(Prism::AssocNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, key: self.key, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1310 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, key: Prism::node, value: Prism::node, operator_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:1313 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1287 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1366 + sig { override.returns(String) } + def inspect; end + + # The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # { a: b } + # ^ + # + # { foo => bar } + # ^^^ + # + # { def a; end => 1 } + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1327 + sig { returns(Prism::Node) } + def key; end + + # def operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1361 + sig { returns(T.nilable(String)) } + def operator; end + + # The location of the `=>` operator, if present. + # + # { foo => bar } + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:1342 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1356 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1371 + sig { override.returns(Symbol) } + def type; end + + # The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # { foo => bar } + # ^^^ + # + # { x: 1 } + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:1336 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1376 + def type; end + end +end + +# Represents a splat in a hash literal. +# +# { **foo } +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:1394 +class Prism::AssocSplatNode < ::Prism::Node + # Initialize a new AssocSplatNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1396 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1491 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1406 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1411 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1430 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1423 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode + # + # pkg:gem/prism#lib/prism/node.rb:1435 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::AssocSplatNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1440 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:1443 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1416 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1475 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:1470 + sig { returns(String) } + def operator; end + + # The location of the `**` operator. + # + # { **x } + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:1457 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1465 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1480 + sig { override.returns(Symbol) } + def type; end + + # The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. + # + # { **foo } + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1451 + sig { returns(T.nilable(Prism::Node)) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1485 + def type; end + end +end + +# pkg:gem/prism#lib/prism.rb:90 +Prism::BACKEND = T.let(T.unsafe(nil), Symbol) + +# Represents reading a reference to a field in the previous match. +# +# $' +# ^^ +# +# pkg:gem/prism#lib/prism/node.rb:1502 +class Prism::BackReferenceReadNode < ::Prism::Node + # Initialize a new BackReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1504 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1575 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1513 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1518 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1534 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1529 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode + # + # pkg:gem/prism#lib/prism/node.rb:1539 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BackReferenceReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1544 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:1547 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1523 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1559 + sig { override.returns(String) } + def inspect; end + + # The name of the back-reference variable, including the leading `$`. + # + # $& # name `:$&` + # + # $+ # name `:$+` + # + # pkg:gem/prism#lib/prism/node.rb:1556 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1564 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1569 + def type; end + end +end + +# A class that knows how to walk down the tree. None of the individual visit +# methods are implemented on this visitor, so it forces the consumer to +# implement each one that they need. For a default implementation that +# continues walking the tree, see the Visitor class. +# +# pkg:gem/prism#lib/prism/visitor.rb:17 +class Prism::BasicVisitor + # Calls `accept` on the given node if it is not `nil`, which in turn should + # call back into this visitor by calling the appropriate `visit_*` method. + # + # pkg:gem/prism#lib/prism/visitor.rb:20 + sig { params(node: T.nilable(Prism::Node)).void } + def visit(node); end + + # Visits each node in `nodes` by calling `accept` on each one. + # + # pkg:gem/prism#lib/prism/visitor.rb:26 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).void } + def visit_all(nodes); end + + # Visits the child nodes of `node` by calling `accept` on each one. + # + # pkg:gem/prism#lib/prism/visitor.rb:32 + sig { params(node: Prism::Node).void } + def visit_child_nodes(node); end +end + +# Represents a begin statement. +# +# begin +# foo +# end +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:1587 +class Prism::BeginNode < ::Prism::Node + # Initialize a new BeginNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1589 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + begin_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + rescue_clause: T.nilable(Prism::RescueNode), + else_clause: T.nilable(Prism::ElseNode), + ensure_clause: T.nilable(Prism::EnsureNode), + end_keyword_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1745 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1603 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def begin_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1719 + sig { returns(T.nilable(String)) } + def begin_keyword; end + + # Represents the location of the `begin` keyword. + # + # begin x end + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1654 + sig { returns(T.nilable(Prism::Location)) } + def begin_keyword_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1608 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1633 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1623 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode + # + # pkg:gem/prism#lib/prism/node.rb:1638 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + begin_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + rescue_clause: T.nilable(Prism::RescueNode), + else_clause: T.nilable(Prism::ElseNode), + ensure_clause: T.nilable(Prism::EnsureNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::BeginNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, begin_keyword_loc: self.begin_keyword_loc, statements: self.statements, rescue_clause: self.rescue_clause, else_clause: self.else_clause, ensure_clause: self.ensure_clause, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1643 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:1646 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1613 + def each_child_node; end + + # Represents the else clause within the begin block. + # + # begin x; rescue y; else z; end + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1688 + sig { returns(T.nilable(Prism::ElseNode)) } + def else_clause; end + + # def end_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:1724 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # Represents the location of the `end` keyword. + # + # begin x end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1700 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + # Represents the ensure clause within the begin block. + # + # begin x; ensure y; end + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1694 + sig { returns(T.nilable(Prism::EnsureNode)) } + def ensure_clause; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1729 + sig { override.returns(String) } + def inspect; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:80 + def newline_flag!(lines); end + + # Represents the rescue clause within the begin block. + # + # begin x; rescue y; end + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1682 + sig { returns(T.nilable(Prism::RescueNode)) } + def rescue_clause; end + + # Save the begin_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1668 + def save_begin_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1714 + def save_end_keyword_loc(repository); end + + # Represents the statements within the begin block. + # + # begin x end + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:1676 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1734 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1739 + def type; end + end +end + +# Represents a block argument using `&`. +# +# bar(&args) +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:1760 +class Prism::BlockArgumentNode < ::Prism::Node + # Initialize a new BlockArgumentNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1762 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, expression, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1857 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1772 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1777 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1796 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1789 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode + # + # pkg:gem/prism#lib/prism/node.rb:1801 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::BlockArgumentNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, expression: self.expression, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1806 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:1809 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1782 + def each_child_node; end + + # The expression that is being passed as a block argument. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo(&args) + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:1817 + sig { returns(T.nilable(Prism::Node)) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1841 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:1836 + sig { returns(String) } + def operator; end + + # Represents the location of the `&` operator. + # + # foo(&args) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:1823 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:1831 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1846 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1851 + def type; end + end +end + +# Represents a block local variable. +# +# a { |; b| } +# ^ +# +# pkg:gem/prism#lib/prism/node.rb:1868 +class Prism::BlockLocalVariableNode < ::Prism::Node + # Initialize a new BlockLocalVariableNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1870 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:1945 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1879 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1884 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1900 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1895 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode + # + # pkg:gem/prism#lib/prism/node.rb:1905 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BlockLocalVariableNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1910 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:1913 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1889 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:1929 + sig { override.returns(String) } + def inspect; end + + # The name of the block local variable. + # + # a { |; b| } # name `:b` + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:1926 + sig { returns(Symbol) } + def name; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:1918 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:1934 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:1939 + def type; end + end +end + +# Represents a block of ruby code. +# +# [1, 2, 3].each { |i| puts x } +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:1956 +class Prism::BlockNode < ::Prism::Node + # Initialize a new BlockNode node. + # + # pkg:gem/prism#lib/prism/node.rb:1958 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:2095 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:1971 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # The body of the block. + # + # [1, 2, 3].each { |i| puts x } + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2034 + sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:1976 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:2074 + sig { returns(String) } + def closing; end + + # Represents the location of the closing `}` or `end`. + # + # [1, 2, 3].each { |i| puts x } + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2056 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:1997 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:1989 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode + # + # pkg:gem/prism#lib/prism/node.rb:2002 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::BlockNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, locals: self.locals, parameters: self.parameters, body: self.body, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2007 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil, opening_loc: Location, closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:2010 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:1981 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:2079 + sig { override.returns(String) } + def inspect; end + + # The local variables declared in the block. + # + # [1, 2, 3].each { |i| puts x } # locals: [:i] + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2018 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:2069 + sig { returns(String) } + def opening; end + + # Represents the location of the opening `{` or `do`. + # + # [1, 2, 3].each { |i| puts x } + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2040 + sig { returns(Prism::Location) } + def opening_loc; end + + # The parameters of the block. + # + # [1, 2, 3].each { |i| puts x } + # ^^^ + # [1, 2, 3].each { puts _1 } + # ^^^^^^^^^^^ + # [1, 2, 3].each { puts it } + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2028 + sig { returns(T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode))) } + def parameters; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2064 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2048 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:2084 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:2089 + def type; end + end +end + +# Represents a block parameter of a method, block, or lambda definition. +# +# def a(&b) +# ^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:2111 +class Prism::BlockParameterNode < ::Prism::Node + # Initialize a new BlockParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:2113 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:2235 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:2124 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2129 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:2145 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:2140 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:2150 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::BlockParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2155 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:2158 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:2134 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:2219 + sig { override.returns(String) } + def inspect; end + + # The name of the block parameter. + # + # def a(&b) # name `:b` + # ^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:2172 + sig { returns(T.nilable(Symbol)) } + def name; end + + # Represents the location of the block parameter name. + # + # def a(&b) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2178 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:2214 + sig { returns(String) } + def operator; end + + # Represents the location of the `&` operator. + # + # def a(&b) + # ^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:2201 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2163 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2192 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2209 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:2224 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:2229 + def type; end + end +end + +# Represents a block's parameters declaration. +# +# -> (a, b = 1; local) { } +# ^^^^^^^^^^^^^^^^^ +# +# foo do |a, b = 1; local| +# ^^^^^^^^^^^^^^^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:2252 +class Prism::BlockParametersNode < ::Prism::Node + # Initialize a new BlockParametersNode node. + # + # pkg:gem/prism#lib/prism/node.rb:2254 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:2408 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:2266 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2271 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2387 + sig { returns(T.nilable(String)) } + def closing; end + + # Represents the closing location of the block parameters. + # + # -> (a, b = 1; local) { } + # ^ + # + # foo do |a, b = 1; local| + # ^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:2363 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:2292 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:2284 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode + # + # pkg:gem/prism#lib/prism/node.rb:2297 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::BlockParametersNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, parameters: self.parameters, locals: self.locals, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2302 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:2305 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:2276 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:2392 + sig { override.returns(String) } + def inspect; end + + # Represents the local variables of the block. + # + # -> (a, b = 1; local) { } + # ^^^^^ + # + # foo do |a, b = 1; local| + # ^^^^^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:2327 + sig { returns(T::Array[Prism::BlockLocalVariableNode]) } + def locals; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2382 + sig { returns(T.nilable(String)) } + def opening; end + + # Represents the opening location of the block parameters. + # + # -> (a, b = 1; local) { } + # ^ + # + # foo do |a, b = 1; local| + # ^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:2337 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Represents the parameters of the block. + # + # -> (a, b = 1; local) { } + # ^^^^^^^^ + # + # foo do |a, b = 1; local| + # ^^^^^^^^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:2317 + sig { returns(T.nilable(Prism::ParametersNode)) } + def parameters; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2377 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2351 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:2397 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:2402 + def type; end + end +end + +# Represents the use of the `break` keyword. +# +# break foo +# ^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:2422 +class Prism::BreakNode < ::Prism::Node + # Initialize a new BreakNode node. + # + # pkg:gem/prism#lib/prism/node.rb:2424 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, arguments, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:2519 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:2434 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # break foo + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2479 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2439 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:2458 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:2451 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode + # + # pkg:gem/prism#lib/prism/node.rb:2463 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).returns(Prism::BreakNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, arguments: self.arguments, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2468 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:2471 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:2444 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:2503 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:2498 + sig { returns(String) } + def keyword; end + + # The location of the `break` keyword. + # + # break foo + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2485 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2493 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:2508 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:2513 + def type; end + end +end + +# Represents the use of the `&&=` operator on a call. +# +# foo.bar &&= value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:2530 +class Prism::CallAndWriteNode < ::Prism::Node + # Initialize a new CallAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:2532 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:2726 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:2547 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2601 + sig { returns(T::Boolean) } + def attribute_write?; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2695 + sig { returns(T.nilable(String)) } + def call_operator; end + + # Represents the location of the call operator. + # + # foo.bar &&= value + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2620 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2552 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:2573 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:2565 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:2578 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, message_loc: self.message_loc, read_name: self.read_name, write_name: self.write_name, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2583 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:2586 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:2557 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2606 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:2710 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2700 + sig { returns(T.nilable(String)) } + def message; end + + # Represents the location of the message. + # + # foo.bar &&= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2642 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:2705 + sig { returns(String) } + def operator; end + + # Represents the location of the operator. + # + # foo.bar &&= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2676 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the name of the method being called. + # + # foo.bar &&= value # read_name `:bar` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2664 + sig { returns(Symbol) } + def read_name; end + + # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo.bar &&= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2614 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2591 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2634 + def save_call_operator_loc(repository); end + + # Save the message_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2656 + def save_message_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2684 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:2715 + sig { override.returns(Symbol) } + def type; end + + # Represents the value being assigned. + # + # foo.bar &&= value + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2692 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2596 + sig { returns(T::Boolean) } + def variable_call?; end + + # Represents the name of the method being written to. + # + # foo.bar &&= value # write_name `:bar=` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2670 + sig { returns(Symbol) } + def write_name; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:2720 + def type; end + end +end + +# Represents a method call, in all of the various forms that can take. +# +# foo +# ^^^ +# +# foo() +# ^^^^^ +# +# +foo +# ^^^^ +# +# foo + bar +# ^^^^^^^^^ +# +# foo.bar +# ^^^^^^^ +# +# foo&.bar +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:2758 +class Prism::CallNode < ::Prism::Node + # Initialize a new CallNode node. + # + # pkg:gem/prism#lib/prism/node.rb:2760 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + name: Symbol, + message_loc: T.nilable(Prism::Location), + opening_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode)) + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, equal_loc, block); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:3029 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:2777 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Represents the arguments to the method call. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo(bar) + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2932 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2833 + sig { returns(T::Boolean) } + def attribute_write?; end + + # Represents the block that is being passed to the method. + # + # foo { |a| a } + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2985 + sig { returns(T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))) } + def block; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2988 + sig { returns(T.nilable(String)) } + def call_operator; end + + # Represents the location of the call operator. + # + # foo.bar + # ^ + # + # foo&.bar + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:2861 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2782 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:3003 + sig { returns(T.nilable(String)) } + def closing; end + + # Represents the location of the right parenthesis. + # + # foo(bar) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2938 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:2805 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:2796 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?equal_loc: Location?, ?block: BlockNode | BlockArgumentNode | nil) -> CallNode + # + # pkg:gem/prism#lib/prism/node.rb:2810 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + name: Symbol, + message_loc: T.nilable(Prism::Location), + opening_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode)) + ).returns(Prism::CallNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, name: self.name, message_loc: self.message_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, equal_loc: self.equal_loc, block: self.block); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:2815 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, equal_loc: Location?, block: BlockNode | BlockArgumentNode | nil } + # + # pkg:gem/prism#lib/prism/node.rb:2818 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:2787 + def each_child_node; end + + # def equal: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:3008 + sig { returns(T.nilable(String)) } + def equal; end + + # Represents the location of the equal sign, in the case that this is an attribute write. + # + # foo.bar = value + # ^ + # + # foo[bar] = value + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2963 + sig { returns(T.nilable(Prism::Location)) } + def equal_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # When a call node has the attribute_write flag set, it means that the call + # is using the attribute write syntax. This is either a method call to []= + # or a method call to a method that ends with =. Either way, the = sign is + # present in the source. + # + # Prism returns the message_loc _without_ the = sign attached, because there + # can be any amount of space between the message and the = sign. However, + # sometimes you want the location of the full message including the inner + # space and the = sign. This method provides that. + # + # pkg:gem/prism#lib/prism/node_ext.rb:334 + sig { returns(T.nilable(Prism::Location)) } + def full_message_loc; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2838 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:3013 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2993 + sig { returns(T.nilable(String)) } + def message; end + + # Represents the location of the message. + # + # foo.bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2889 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # Represents the name of the method being called. + # + # foo.bar # name `:foo` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2883 + sig { returns(Symbol) } + def name; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:2998 + sig { returns(T.nilable(String)) } + def opening; end + + # Represents the location of the left parenthesis. + # foo(bar) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:2910 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo.bar + # ^^^ + # + # +foo + # ^^^ + # + # foo + bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:2852 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2823 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2875 + def save_call_operator_loc(repository); end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2952 + def save_closing_loc(repository); end + + # Save the equal_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2977 + def save_equal_loc(repository); end + + # Save the message_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2903 + def save_message_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:2924 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:3018 + sig { override.returns(Symbol) } + def type; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:2828 + sig { returns(T::Boolean) } + def variable_call?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:3023 + def type; end + end +end + +# Flags for call nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19804 +module Prism::CallNodeFlags; end + +# a call that is an attribute write, so the value being written should be returned +# +# pkg:gem/prism#lib/prism/node.rb:19812 +Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer) + +# a call that ignores method visibility +# +# pkg:gem/prism#lib/prism/node.rb:19815 +Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer) + +# &. operator +# +# pkg:gem/prism#lib/prism/node.rb:19806 +Prism::CallNodeFlags::SAFE_NAVIGATION = T.let(T.unsafe(nil), Integer) + +# a call that could have been a local variable +# +# pkg:gem/prism#lib/prism/node.rb:19809 +Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) + +# Represents the use of an assignment operator on a call. +# +# foo.bar += baz +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:3048 +class Prism::CallOperatorWriteNode < ::Prism::Node + # Initialize a new CallOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:3050 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:3246 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:3066 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3120 + sig { returns(T::Boolean) } + def attribute_write?; end + + # Represents the binary operator being used. + # + # foo.bar += value # binary_operator `:+` + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:3195 + sig { returns(Symbol) } + def binary_operator; end + + # Represents the location of the binary operator. + # + # foo.bar += value + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:3201 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:3220 + sig { returns(T.nilable(String)) } + def call_operator; end + + # Represents the location of the call operator. + # + # foo.bar += value + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:3139 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3071 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:3092 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:3084 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:3097 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, message_loc: self.message_loc, read_name: self.read_name, write_name: self.write_name, binary_operator: self.binary_operator, binary_operator_loc: self.binary_operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3102 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:3105 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:3076 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3125 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:3230 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:3225 + sig { returns(T.nilable(String)) } + def message; end + + # Represents the location of the message. + # + # foo.bar += value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3161 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:342 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:349 + def operator_loc; end + + # Represents the name of the method being called. + # + # foo.bar += value # read_name `:bar` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3183 + sig { returns(Symbol) } + def read_name; end + + # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo.bar += value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3133 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3110 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3209 + def save_binary_operator_loc(repository); end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3153 + def save_call_operator_loc(repository); end + + # Save the message_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3175 + def save_message_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:3235 + sig { override.returns(Symbol) } + def type; end + + # Represents the value being assigned. + # + # foo.bar += value + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3217 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3115 + sig { returns(T::Boolean) } + def variable_call?; end + + # Represents the name of the method being written to. + # + # foo.bar += value # write_name `:bar=` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3189 + sig { returns(Symbol) } + def write_name; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:3240 + def type; end + end +end + +# Represents the use of the `||=` operator on a call. +# +# foo.bar ||= value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:3264 +class Prism::CallOrWriteNode < ::Prism::Node + # Initialize a new CallOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:3266 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:3460 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:3281 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3335 + sig { returns(T::Boolean) } + def attribute_write?; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:3429 + sig { returns(T.nilable(String)) } + def call_operator; end + + # Represents the location of the call operator. + # + # foo.bar ||= value + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:3354 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3286 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:3307 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:3299 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:3312 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, message_loc: self.message_loc, read_name: self.read_name, write_name: self.write_name, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3317 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:3320 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:3291 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3340 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:3444 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:3434 + sig { returns(T.nilable(String)) } + def message; end + + # Represents the location of the message. + # + # foo.bar ||= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3376 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:3439 + sig { returns(String) } + def operator; end + + # Represents the location of the operator. + # + # foo.bar ||= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3410 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the name of the method being called. + # + # foo.bar ||= value # read_name `:bar` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3398 + sig { returns(Symbol) } + def read_name; end + + # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo.bar ||= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3348 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3325 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3368 + def save_call_operator_loc(repository); end + + # Save the message_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3390 + def save_message_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3418 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:3449 + sig { override.returns(Symbol) } + def type; end + + # Represents the value being assigned. + # + # foo.bar ||= value + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3426 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3330 + sig { returns(T::Boolean) } + def variable_call?; end + + # Represents the name of the method being written to. + # + # foo.bar ||= value # write_name `:bar=` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3404 + sig { returns(Symbol) } + def write_name; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:3454 + def type; end + end +end + +# Represents assigning to a method call. +# +# foo.bar, = 1 +# ^^^^^^^ +# +# begin +# rescue => foo.bar +# ^^^^^^^ +# end +# +# for foo.bar in baz do end +# ^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:3485 +class Prism::CallTargetNode < ::Prism::Node + # Initialize a new CallTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:3487 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:3629 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:3499 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3549 + sig { returns(T::Boolean) } + def attribute_write?; end + + # def call_operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:3603 + sig { returns(String) } + def call_operator; end + + # Represents the location of the call operator. + # + # foo.bar = 1 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:3568 + sig { returns(Prism::Location) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3504 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:3521 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:3516 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:3526 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location + ).returns(Prism::CallTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, name: self.name, message_loc: self.message_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3531 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:3534 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:3509 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3554 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:3613 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:3608 + sig { returns(String) } + def message; end + + # Represents the location of the message. + # + # foo.bar = 1 + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3590 + sig { returns(Prism::Location) } + def message_loc; end + + # Represents the name of the method being called. + # + # foo.bar = 1 # name `:foo` + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3584 + sig { returns(Symbol) } + def name; end + + # The object that the method is being called on. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo.bar = 1 + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3562 + sig { returns(Prism::Node) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3539 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3576 + def save_call_operator_loc(repository); end + + # Save the message_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3598 + def save_message_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:3618 + sig { override.returns(Symbol) } + def type; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:3544 + sig { returns(T::Boolean) } + def variable_call?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:3623 + def type; end + end +end + +# Represents assigning to a local variable in pattern matching. +# +# foo => [bar => baz] +# ^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:3643 +class Prism::CapturePatternNode < ::Prism::Node + # Initialize a new CapturePatternNode node. + # + # pkg:gem/prism#lib/prism/node.rb:3645 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + target: Prism::LocalVariableTargetNode, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, value, target, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:3746 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:3656 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3661 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:3679 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:3674 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode + # + # pkg:gem/prism#lib/prism/node.rb:3684 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + target: Prism::LocalVariableTargetNode, + operator_loc: Prism::Location + ).returns(Prism::CapturePatternNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value, target: self.target, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3689 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, target: LocalVariableTargetNode, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:3692 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:3666 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:3730 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:3725 + sig { returns(String) } + def operator; end + + # Represents the location of the `=>` operator. + # + # foo => bar + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:3712 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3720 + def save_operator_loc(repository); end + + # Represents the target of the capture. + # + # foo => bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3706 + sig { returns(Prism::LocalVariableTargetNode) } + def target; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:3735 + sig { override.returns(Symbol) } + def type; end + + # Represents the value to capture. + # + # foo => bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3700 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:3740 + def type; end + end +end + +# Represents the use of a case statement for pattern matching. +# +# case true +# in false +# end +# ^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:3760 +class Prism::CaseMatchNode < ::Prism::Node + # Initialize a new CaseMatchNode node. + # + # pkg:gem/prism#lib/prism/node.rb:3762 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::InNode], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:3897 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:3775 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def case_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:3871 + sig { returns(String) } + def case_keyword; end + + # Represents the location of the `case` keyword. + # + # case true; in false; end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3842 + sig { returns(Prism::Location) } + def case_keyword_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3780 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:3803 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:3794 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Represents the conditions of the case match. + # + # case true; in false; end + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3830 + sig { returns(T::Array[Prism::InNode]) } + def conditions; end + + # Returns the else clause of the case match node. This method is deprecated + # in favor of #else_clause. + # + # pkg:gem/prism#lib/prism/node_ext.rb:470 + def consequent; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode + # + # pkg:gem/prism#lib/prism/node.rb:3808 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::InNode], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).returns(Prism::CaseMatchNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, predicate: self.predicate, conditions: self.conditions, else_clause: self.else_clause, case_keyword_loc: self.case_keyword_loc, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3813 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[InNode], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:3816 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:3785 + def each_child_node; end + + # Represents the else clause of the case match. + # + # case true; in false; else; end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3836 + sig { returns(T.nilable(Prism::ElseNode)) } + def else_clause; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:3876 + sig { returns(String) } + def end_keyword; end + + # Represents the location of the `end` keyword. + # + # case true; in false; end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3858 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:3881 + sig { override.returns(String) } + def inspect; end + + # Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # case true; in false; end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3824 + sig { returns(T.nilable(Prism::Node)) } + def predicate; end + + # Save the case_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3850 + def save_case_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:3866 + def save_end_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:3886 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:3891 + def type; end + end +end + +# Represents the use of a case statement. +# +# case true +# when false +# end +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:3914 +class Prism::CaseNode < ::Prism::Node + # Initialize a new CaseNode node. + # + # pkg:gem/prism#lib/prism/node.rb:3916 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::WhenNode], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4051 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:3929 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def case_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4025 + sig { returns(String) } + def case_keyword; end + + # Represents the location of the `case` keyword. + # + # case true; when false; end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3996 + sig { returns(Prism::Location) } + def case_keyword_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3934 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:3957 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:3948 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Represents the conditions of the case statement. + # + # case true; when false; end + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3984 + sig { returns(T::Array[Prism::WhenNode]) } + def conditions; end + + # Returns the else clause of the case node. This method is deprecated in + # favor of #else_clause. + # + # pkg:gem/prism#lib/prism/node_ext.rb:479 + def consequent; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode + # + # pkg:gem/prism#lib/prism/node.rb:3962 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::WhenNode], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).returns(Prism::CaseNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, predicate: self.predicate, conditions: self.conditions, else_clause: self.else_clause, case_keyword_loc: self.case_keyword_loc, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:3967 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[WhenNode], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:3970 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:3939 + def each_child_node; end + + # Represents the else clause of the case statement. + # + # case true; when false; else; end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3990 + sig { returns(T.nilable(Prism::ElseNode)) } + def else_clause; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4030 + sig { returns(String) } + def end_keyword; end + + # Represents the location of the `end` keyword. + # + # case true; when false; end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4012 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4035 + sig { override.returns(String) } + def inspect; end + + # Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # case true; when false; end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:3978 + sig { returns(T.nilable(Prism::Node)) } + def predicate; end + + # Save the case_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4004 + def save_case_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4020 + def save_end_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4040 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4045 + def type; end + end +end + +# Represents a class declaration involving the `class` keyword. +# +# class Foo end +# ^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4066 +class Prism::ClassNode < ::Prism::Node + # Initialize a new ClassNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4068 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode), + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location, + name: Symbol + ).void + end + def initialize(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4239 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4084 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Represents the body of the class. + # + # class Foo + # foo + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4184 + sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4089 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def class_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4208 + sig { returns(String) } + def class_keyword; end + + # Represents the location of the `class` keyword. + # + # class Foo end + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4136 + sig { returns(Prism::Location) } + def class_keyword_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4112 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4103 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant_path: ConstantReadNode | ConstantPathNode | CallNode + # + # pkg:gem/prism#lib/prism/node.rb:4149 + sig { returns(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode)) } + def constant_path; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | CallNode, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode + # + # pkg:gem/prism#lib/prism/node.rb:4117 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode), + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location, + name: Symbol + ).returns(Prism::ClassNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, locals: self.locals, class_keyword_loc: self.class_keyword_loc, constant_path: self.constant_path, inheritance_operator_loc: self.inheritance_operator_loc, superclass: self.superclass, body: self.body, end_keyword_loc: self.end_keyword_loc, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4122 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, constant_path: ConstantReadNode | ConstantPathNode | CallNode, inheritance_operator_loc: Location?, superclass: Prism::node?, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:4125 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4094 + def each_child_node; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4218 + sig { returns(String) } + def end_keyword; end + + # Represents the location of the `end` keyword. + # + # class Foo end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4190 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inheritance_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:4213 + sig { returns(T.nilable(String)) } + def inheritance_operator; end + + # Represents the location of the `<` operator. + # + # class Foo < Bar + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:4155 + sig { returns(T.nilable(Prism::Location)) } + def inheritance_operator_loc; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4223 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # pkg:gem/prism#lib/prism/node.rb:4130 + sig { returns(T::Array[Symbol]) } + def locals; end + + # The name of the class. + # + # class Foo end # name `:Foo` + # + # pkg:gem/prism#lib/prism/node.rb:4205 + sig { returns(Symbol) } + def name; end + + # Save the class_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4144 + def save_class_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4198 + def save_end_keyword_loc(repository); end + + # Save the inheritance_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4169 + def save_inheritance_operator_loc(repository); end + + # Represents the superclass of the class. + # + # class Foo < Bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4177 + sig { returns(T.nilable(Prism::Node)) } + def superclass; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4228 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4233 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a class variable. +# +# @@target &&= value +# ^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4257 +class Prism::ClassVariableAndWriteNode < ::Prism::Node + # Initialize a new ClassVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4259 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4376 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4271 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4276 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4293 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4288 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:4298 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ClassVariableAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4303 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:4306 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:165 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4281 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4360 + sig { override.returns(String) } + def inspect; end + + # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @@target &&= value # name `:@@target` + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4314 + sig { returns(Symbol) } + def name; end + + # Represents the location of the variable name. + # + # @@target &&= value + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4320 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4355 + sig { returns(String) } + def operator; end + + # Represents the location of the `&&=` operator. + # + # @@target &&= value + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4336 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4328 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4344 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4365 + sig { override.returns(Symbol) } + def type; end + + # Represents the value being assigned. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # @@target &&= value + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4352 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4370 + def type; end + end +end + +# Represents assigning to a class variable using an operator that isn't `=`. +# +# @@target += value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4389 +class Prism::ClassVariableOperatorWriteNode < ::Prism::Node + # Initialize a new ClassVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4391 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4495 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4404 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:4476 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:4460 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4426 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4421 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:4431 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ClassVariableOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4436 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:4439 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:177 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4414 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4479 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:4444 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:4447 + sig { returns(Prism::Location) } + def name_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:358 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:365 + def operator_loc; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4468 + def save_binary_operator_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4455 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4484 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:4473 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4489 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a class variable. +# +# @@target ||= value +# ^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4509 +class Prism::ClassVariableOrWriteNode < ::Prism::Node + # Initialize a new ClassVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4511 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4616 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4523 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4528 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4545 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4540 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:4550 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ClassVariableOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4555 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:4558 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:171 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4533 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4600 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:4563 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:4566 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4595 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:4579 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4574 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4587 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4605 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:4592 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4610 + def type; end + end +end + +# Represents referencing a class variable. +# +# @@foo +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4629 +class Prism::ClassVariableReadNode < ::Prism::Node + # Initialize a new ClassVariableReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4631 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4702 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4640 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4645 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4661 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4656 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode + # + # pkg:gem/prism#lib/prism/node.rb:4666 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ClassVariableReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4671 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:4674 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4650 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4686 + sig { override.returns(String) } + def inspect; end + + # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @@abc # name `:@@abc` + # + # @@_test # name `:@@_test` + # + # pkg:gem/prism#lib/prism/node.rb:4683 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4691 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4696 + def type; end + end +end + +# Represents writing to a class variable in a context that doesn't have an explicit value. +# +# @@foo, @@bar = baz +# ^^^^^ ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4712 +class Prism::ClassVariableTargetNode < ::Prism::Node + # Initialize a new ClassVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4714 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4781 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4723 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4728 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4744 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4739 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:4749 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ClassVariableTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4754 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:4757 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4733 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4765 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:4762 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4770 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4775 + def type; end + end +end + +# Represents writing to a class variable. +# +# @@foo = 1 +# ^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4791 +class Prism::ClassVariableWriteNode < ::Prism::Node + # Initialize a new ClassVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4793 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:4914 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4805 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4810 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4827 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4822 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:4832 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::ClassVariableWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4837 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:4840 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4815 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:4898 + sig { override.returns(String) } + def inspect; end + + # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @@abc = 123 # name `@@abc` + # + # @@_test = :test # name `@@_test` + # + # pkg:gem/prism#lib/prism/node.rb:4849 + sig { returns(Symbol) } + def name; end + + # The location of the variable name. + # + # @@foo = :bar + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4855 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:4893 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # @@foo = :bar + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:4880 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4863 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4888 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:4903 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # @@foo = :bar + # ^^^^ + # + # @@_xyz = 123 + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:4874 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:4908 + def type; end + end +end + +# A cache that can be used to quickly compute code unit offsets from byte +# offsets. It purposefully provides only a single #[] method to access the +# cache in order to minimize surface area. +# +# Note that there are some known issues here that may or may not be addressed +# in the future: +# +# * The first is that there are issues when the cache computes values that are +# not on character boundaries. This can result in subsequent computations +# being off by one or more code units. +# * The second is that this cache is currently unbounded. In theory we could +# introduce some kind of LRU cache to limit the number of entries, but this +# has not yet been implemented. +# +# pkg:gem/prism#lib/prism/parse_result.rb:186 +class Prism::CodeUnitsCache + # Initialize a new cache with the given source and encoding. + # + # pkg:gem/prism#lib/prism/parse_result.rb:212 + sig { params(source: String, encoding: Encoding).void } + def initialize(source, encoding); end + + # Retrieve the code units offset from the given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:226 + sig { params(byte_offset: Integer).returns(Integer) } + def [](byte_offset); end +end + +# pkg:gem/prism#lib/prism/parse_result.rb:198 +class Prism::CodeUnitsCache::LengthCounter + # pkg:gem/prism#lib/prism/parse_result.rb:199 + def initialize(source, encoding); end + + # pkg:gem/prism#lib/prism/parse_result.rb:204 + def count(byte_offset, byte_length); end +end + +# pkg:gem/prism#lib/prism/parse_result.rb:187 +class Prism::CodeUnitsCache::UTF16Counter + # pkg:gem/prism#lib/prism/parse_result.rb:188 + def initialize(source, encoding); end + + # pkg:gem/prism#lib/prism/parse_result.rb:193 + def count(byte_offset, byte_length); end +end + +# This represents a comment that was encountered during parsing. It is the +# base class for all comment types. +# +# pkg:gem/prism#lib/prism/parse_result.rb:521 +class Prism::Comment + abstract! + + # Create a new comment object with the given location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:526 + sig { params(location: Prism::Location).void } + def initialize(location); end + + # Implement the hash pattern matching interface for Comment. + # + # pkg:gem/prism#lib/prism/parse_result.rb:531 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The location of this comment in the source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:523 + sig { returns(Prism::Location) } + def location; end + + # Returns the content of the comment by slicing it from the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:536 + sig { returns(String) } + def slice; end + + sig { abstract.returns(T::Boolean) } + def trailing?; end +end + +# A compiler is a visitor that returns the value of each node as it visits. +# This is as opposed to a visitor which will only walk the tree. This can be +# useful when you are trying to compile a tree into a different format. +# +# For example, to build a representation of the tree as s-expressions, you +# could write: +# +# class SExpressions < Prism::Compiler +# def visit_arguments_node(node) = [:arguments, super] +# def visit_call_node(node) = [:call, super] +# def visit_integer_node(node) = [:integer] +# def visit_program_node(node) = [:program, super] +# end +# +# Prism.parse("1 + 2").value.accept(SExpressions.new) +# # => [:program, [[[:call, [[:integer], [:arguments, [[:integer]]]]]]]] +# +# pkg:gem/prism#lib/prism/compiler.rb:30 +class Prism::Compiler < ::Prism::Visitor + # Visit an individual node. + # + # pkg:gem/prism#lib/prism/compiler.rb:32 + sig { params(node: T.nilable(Prism::Node)).returns(T.untyped) } + def visit(node); end + + # Compile a AliasGlobalVariableNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:47 + def visit_alias_global_variable_node(node); end + + # Compile a AliasMethodNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:52 + def visit_alias_method_node(node); end + + # Visit a list of nodes. + # + # pkg:gem/prism#lib/prism/compiler.rb:37 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).returns(T::Array[T.untyped]) } + def visit_all(nodes); end + + # Compile a AlternationPatternNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:57 + def visit_alternation_pattern_node(node); end + + # Compile a AndNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:62 + def visit_and_node(node); end + + # Compile a ArgumentsNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:67 + def visit_arguments_node(node); end + + # Compile a ArrayNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:72 + def visit_array_node(node); end + + # Compile a ArrayPatternNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:77 + def visit_array_pattern_node(node); end + + # Compile a AssocNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:82 + def visit_assoc_node(node); end + + # Compile a AssocSplatNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:87 + def visit_assoc_splat_node(node); end + + # Compile a BackReferenceReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:92 + def visit_back_reference_read_node(node); end + + # Compile a BeginNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:97 + def visit_begin_node(node); end + + # Compile a BlockArgumentNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:102 + def visit_block_argument_node(node); end + + # Compile a BlockLocalVariableNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:107 + def visit_block_local_variable_node(node); end + + # Compile a BlockNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:112 + def visit_block_node(node); end + + # Compile a BlockParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:117 + def visit_block_parameter_node(node); end + + # Compile a BlockParametersNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:122 + def visit_block_parameters_node(node); end + + # Compile a BreakNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:127 + def visit_break_node(node); end + + # Compile a CallAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:132 + def visit_call_and_write_node(node); end + + # Compile a CallNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:137 + def visit_call_node(node); end + + # Compile a CallOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:142 + def visit_call_operator_write_node(node); end + + # Compile a CallOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:147 + def visit_call_or_write_node(node); end + + # Compile a CallTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:152 + def visit_call_target_node(node); end + + # Compile a CapturePatternNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:157 + def visit_capture_pattern_node(node); end + + # Compile a CaseMatchNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:162 + def visit_case_match_node(node); end + + # Compile a CaseNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:167 + def visit_case_node(node); end + + # Visit the child nodes of the given node. + # + # pkg:gem/prism#lib/prism/compiler.rb:42 + sig { params(node: Prism::Node).returns(T::Array[T.untyped]) } + def visit_child_nodes(node); end + + # Compile a ClassNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:172 + def visit_class_node(node); end + + # Compile a ClassVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:177 + def visit_class_variable_and_write_node(node); end + + # Compile a ClassVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:182 + def visit_class_variable_operator_write_node(node); end + + # Compile a ClassVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:187 + def visit_class_variable_or_write_node(node); end + + # Compile a ClassVariableReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:192 + def visit_class_variable_read_node(node); end + + # Compile a ClassVariableTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:197 + def visit_class_variable_target_node(node); end + + # Compile a ClassVariableWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:202 + def visit_class_variable_write_node(node); end + + # Compile a ConstantAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:207 + def visit_constant_and_write_node(node); end + + # Compile a ConstantOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:212 + def visit_constant_operator_write_node(node); end + + # Compile a ConstantOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:217 + def visit_constant_or_write_node(node); end + + # Compile a ConstantPathAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:222 + def visit_constant_path_and_write_node(node); end + + # Compile a ConstantPathNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:227 + def visit_constant_path_node(node); end + + # Compile a ConstantPathOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:232 + def visit_constant_path_operator_write_node(node); end + + # Compile a ConstantPathOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:237 + def visit_constant_path_or_write_node(node); end + + # Compile a ConstantPathTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:242 + def visit_constant_path_target_node(node); end + + # Compile a ConstantPathWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:247 + def visit_constant_path_write_node(node); end + + # Compile a ConstantReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:252 + def visit_constant_read_node(node); end + + # Compile a ConstantTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:257 + def visit_constant_target_node(node); end + + # Compile a ConstantWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:262 + def visit_constant_write_node(node); end + + # Compile a DefNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:267 + def visit_def_node(node); end + + # Compile a DefinedNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:272 + def visit_defined_node(node); end + + # Compile a ElseNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:277 + def visit_else_node(node); end + + # Compile a EmbeddedStatementsNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:282 + def visit_embedded_statements_node(node); end + + # Compile a EmbeddedVariableNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:287 + def visit_embedded_variable_node(node); end + + # Compile a EnsureNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:292 + def visit_ensure_node(node); end + + # Compile a FalseNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:297 + def visit_false_node(node); end + + # Compile a FindPatternNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:302 + def visit_find_pattern_node(node); end + + # Compile a FlipFlopNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:307 + def visit_flip_flop_node(node); end + + # Compile a FloatNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:312 + def visit_float_node(node); end + + # Compile a ForNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:317 + def visit_for_node(node); end + + # Compile a ForwardingArgumentsNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:322 + def visit_forwarding_arguments_node(node); end + + # Compile a ForwardingParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:327 + def visit_forwarding_parameter_node(node); end + + # Compile a ForwardingSuperNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:332 + def visit_forwarding_super_node(node); end + + # Compile a GlobalVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:337 + def visit_global_variable_and_write_node(node); end + + # Compile a GlobalVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:342 + def visit_global_variable_operator_write_node(node); end + + # Compile a GlobalVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:347 + def visit_global_variable_or_write_node(node); end + + # Compile a GlobalVariableReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:352 + def visit_global_variable_read_node(node); end + + # Compile a GlobalVariableTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:357 + def visit_global_variable_target_node(node); end + + # Compile a GlobalVariableWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:362 + def visit_global_variable_write_node(node); end + + # Compile a HashNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:367 + def visit_hash_node(node); end + + # Compile a HashPatternNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:372 + def visit_hash_pattern_node(node); end + + # Compile a IfNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:377 + def visit_if_node(node); end + + # Compile a ImaginaryNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:382 + def visit_imaginary_node(node); end + + # Compile a ImplicitNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:387 + def visit_implicit_node(node); end + + # Compile a ImplicitRestNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:392 + def visit_implicit_rest_node(node); end + + # Compile a InNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:397 + def visit_in_node(node); end + + # Compile a IndexAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:402 + def visit_index_and_write_node(node); end + + # Compile a IndexOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:407 + def visit_index_operator_write_node(node); end + + # Compile a IndexOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:412 + def visit_index_or_write_node(node); end + + # Compile a IndexTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:417 + def visit_index_target_node(node); end + + # Compile a InstanceVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:422 + def visit_instance_variable_and_write_node(node); end + + # Compile a InstanceVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:427 + def visit_instance_variable_operator_write_node(node); end + + # Compile a InstanceVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:432 + def visit_instance_variable_or_write_node(node); end + + # Compile a InstanceVariableReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:437 + def visit_instance_variable_read_node(node); end + + # Compile a InstanceVariableTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:442 + def visit_instance_variable_target_node(node); end + + # Compile a InstanceVariableWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:447 + def visit_instance_variable_write_node(node); end + + # Compile a IntegerNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:452 + def visit_integer_node(node); end + + # Compile a InterpolatedMatchLastLineNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:457 + def visit_interpolated_match_last_line_node(node); end + + # Compile a InterpolatedRegularExpressionNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:462 + def visit_interpolated_regular_expression_node(node); end + + # Compile a InterpolatedStringNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:467 + def visit_interpolated_string_node(node); end + + # Compile a InterpolatedSymbolNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:472 + def visit_interpolated_symbol_node(node); end + + # Compile a InterpolatedXStringNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:477 + def visit_interpolated_x_string_node(node); end + + # Compile a ItLocalVariableReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:482 + def visit_it_local_variable_read_node(node); end + + # Compile a ItParametersNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:487 + def visit_it_parameters_node(node); end + + # Compile a KeywordHashNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:492 + def visit_keyword_hash_node(node); end + + # Compile a KeywordRestParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:497 + def visit_keyword_rest_parameter_node(node); end + + # Compile a LambdaNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:502 + def visit_lambda_node(node); end + + # Compile a LocalVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:507 + def visit_local_variable_and_write_node(node); end + + # Compile a LocalVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:512 + def visit_local_variable_operator_write_node(node); end + + # Compile a LocalVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:517 + def visit_local_variable_or_write_node(node); end + + # Compile a LocalVariableReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:522 + def visit_local_variable_read_node(node); end + + # Compile a LocalVariableTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:527 + def visit_local_variable_target_node(node); end + + # Compile a LocalVariableWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:532 + def visit_local_variable_write_node(node); end + + # Compile a MatchLastLineNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:537 + def visit_match_last_line_node(node); end + + # Compile a MatchPredicateNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:542 + def visit_match_predicate_node(node); end + + # Compile a MatchRequiredNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:547 + def visit_match_required_node(node); end + + # Compile a MatchWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:552 + def visit_match_write_node(node); end + + # Compile a MissingNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:557 + def visit_missing_node(node); end + + # Compile a ModuleNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:562 + def visit_module_node(node); end + + # Compile a MultiTargetNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:567 + def visit_multi_target_node(node); end + + # Compile a MultiWriteNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:572 + def visit_multi_write_node(node); end + + # Compile a NextNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:577 + def visit_next_node(node); end + + # Compile a NilNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:582 + def visit_nil_node(node); end + + # Compile a NoKeywordsParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:587 + def visit_no_keywords_parameter_node(node); end + + # Compile a NumberedParametersNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:592 + def visit_numbered_parameters_node(node); end + + # Compile a NumberedReferenceReadNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:597 + def visit_numbered_reference_read_node(node); end + + # Compile a OptionalKeywordParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:602 + def visit_optional_keyword_parameter_node(node); end + + # Compile a OptionalParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:607 + def visit_optional_parameter_node(node); end + + # Compile a OrNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:612 + def visit_or_node(node); end + + # Compile a ParametersNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:617 + def visit_parameters_node(node); end + + # Compile a ParenthesesNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:622 + def visit_parentheses_node(node); end + + # Compile a PinnedExpressionNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:627 + def visit_pinned_expression_node(node); end + + # Compile a PinnedVariableNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:632 + def visit_pinned_variable_node(node); end + + # Compile a PostExecutionNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:637 + def visit_post_execution_node(node); end + + # Compile a PreExecutionNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:642 + def visit_pre_execution_node(node); end + + # Compile a ProgramNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:647 + def visit_program_node(node); end + + # Compile a RangeNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:652 + def visit_range_node(node); end + + # Compile a RationalNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:657 + def visit_rational_node(node); end + + # Compile a RedoNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:662 + def visit_redo_node(node); end + + # Compile a RegularExpressionNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:667 + def visit_regular_expression_node(node); end + + # Compile a RequiredKeywordParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:672 + def visit_required_keyword_parameter_node(node); end + + # Compile a RequiredParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:677 + def visit_required_parameter_node(node); end + + # Compile a RescueModifierNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:682 + def visit_rescue_modifier_node(node); end + + # Compile a RescueNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:687 + def visit_rescue_node(node); end + + # Compile a RestParameterNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:692 + def visit_rest_parameter_node(node); end + + # Compile a RetryNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:697 + def visit_retry_node(node); end + + # Compile a ReturnNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:702 + def visit_return_node(node); end + + # Compile a SelfNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:707 + def visit_self_node(node); end + + # Compile a ShareableConstantNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:712 + def visit_shareable_constant_node(node); end + + # Compile a SingletonClassNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:717 + def visit_singleton_class_node(node); end + + # Compile a SourceEncodingNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:722 + def visit_source_encoding_node(node); end + + # Compile a SourceFileNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:727 + def visit_source_file_node(node); end + + # Compile a SourceLineNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:732 + def visit_source_line_node(node); end + + # Compile a SplatNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:737 + def visit_splat_node(node); end + + # Compile a StatementsNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:742 + def visit_statements_node(node); end + + # Compile a StringNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:747 + def visit_string_node(node); end + + # Compile a SuperNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:752 + def visit_super_node(node); end + + # Compile a SymbolNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:757 + def visit_symbol_node(node); end + + # Compile a TrueNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:762 + def visit_true_node(node); end + + # Compile a UndefNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:767 + def visit_undef_node(node); end + + # Compile a UnlessNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:772 + def visit_unless_node(node); end + + # Compile a UntilNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:777 + def visit_until_node(node); end + + # Compile a WhenNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:782 + def visit_when_node(node); end + + # Compile a WhileNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:787 + def visit_while_node(node); end + + # Compile a XStringNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:792 + def visit_x_string_node(node); end + + # Compile a YieldNode node + # + # pkg:gem/prism#lib/prism/compiler.rb:797 + def visit_yield_node(node); end +end + +# Represents the use of the `&&=` operator for assignment to a constant. +# +# Target &&= value +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:4927 +class Prism::ConstantAndWriteNode < ::Prism::Node + # Initialize a new ConstantAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:4929 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5034 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:4941 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4946 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:4963 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:4958 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:4968 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:4973 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:4976 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:183 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:4951 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5018 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:4981 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:4984 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5013 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:4997 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:4992 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5005 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5023 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:5010 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5028 + def type; end + end +end + +# Represents assigning to a constant using an operator that isn't `=`. +# +# Target += value +# ^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5047 +class Prism::ConstantOperatorWriteNode < ::Prism::Node + # Initialize a new ConstantOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5049 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5153 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5062 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:5134 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5118 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5067 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5084 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5079 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:5089 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ConstantOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:5097 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:195 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5072 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5137 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:5102 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5105 + sig { returns(Prism::Location) } + def name_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:374 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:381 + def operator_loc; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5126 + def save_binary_operator_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5113 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5142 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:5131 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5147 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a constant. +# +# Target ||= value +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5167 +class Prism::ConstantOrWriteNode < ::Prism::Node + # Initialize a new ConstantOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5169 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5274 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5181 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5186 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5203 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5198 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:5208 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5213 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:5216 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:189 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5191 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5258 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:5221 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5224 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5253 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5237 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5232 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5245 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5263 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:5250 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5268 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a constant path. +# +# Parent::Child &&= value +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5287 +class Prism::ConstantPathAndWriteNode < ::Prism::Node + # Initialize a new ConstantPathAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5289 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, target, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5381 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5300 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5305 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5323 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5318 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:5328 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, target: self.target, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5333 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:5336 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5310 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5365 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5360 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5344 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5352 + def save_operator_loc(repository); end + + # attr_reader target: ConstantPathNode + # + # pkg:gem/prism#lib/prism/node.rb:5341 + sig { returns(Prism::ConstantPathNode) } + def target; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5370 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:5357 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5375 + def type; end + end +end + +# Represents accessing a constant through a path of `::` operators. +# +# Foo::Bar +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5393 +class Prism::ConstantPathNode < ::Prism::Node + # Initialize a new ConstantPathNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5395 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5523 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5407 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Previously, we had a child node on this class that contained either a + # constant read or a missing node. To not cause a breaking change, we + # continue to supply that API. + # + # pkg:gem/prism#lib/prism/node_ext.rb:205 + def child; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5412 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5431 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5424 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode + # + # pkg:gem/prism#lib/prism/node.rb:5436 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).returns(Prism::ConstantPathNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, parent: self.parent, name: self.name, delimiter_loc: self.delimiter_loc, name_loc: self.name_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5441 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:5444 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def delimiter: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5502 + sig { returns(String) } + def delimiter; end + + # The location of the `::` delimiter. + # + # ::Foo + # ^^ + # + # One::Two + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:5470 + sig { returns(Prism::Location) } + def delimiter_loc; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5417 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant path. For example: "Foo::Bar" + # + # pkg:gem/prism#lib/prism/node_ext.rb:198 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant path. + # For example: [:Foo, :Bar] + # + # pkg:gem/prism#lib/prism/node_ext.rb:176 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5507 + sig { override.returns(String) } + def inspect; end + + # The name of the constant being accessed. This could be `nil` in the event of a syntax error. + # + # pkg:gem/prism#lib/prism/node.rb:5461 + sig { returns(T.nilable(Symbol)) } + def name; end + + # The location of the name of the constant. + # + # ::Foo + # ^^^ + # + # One::Two + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:5489 + sig { returns(Prism::Location) } + def name_loc; end + + # The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. + # + # Foo::Bar + # ^^^ + # + # self::Test + # ^^^^ + # + # a.b::C + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:5458 + sig { returns(T.nilable(Prism::Node)) } + def parent; end + + # Save the delimiter_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5478 + def save_delimiter_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5497 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5512 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5517 + def type; end + end +end + +# An error class raised when dynamic parts are found while computing a +# constant path's full name. For example: +# Foo::Bar::Baz -> does not raise because all parts of the constant path are +# simple constants +# var::Bar::Baz -> raises because the first part of the constant path is a +# local variable +# +# pkg:gem/prism#lib/prism/node_ext.rb:167 +class Prism::ConstantPathNode::DynamicPartsInConstantPathError < ::StandardError; end + +# An error class raised when missing nodes are found while computing a +# constant path's full name. For example: +# Foo:: -> raises because the constant path is missing the last part +# +# pkg:gem/prism#lib/prism/node_ext.rb:172 +class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError; end + +# Represents assigning to a constant path using an operator that isn't `=`. +# +# Parent::Child += value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5536 +class Prism::ConstantPathOperatorWriteNode < ::Prism::Node + # Initialize a new ConstantPathOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5538 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).void + end + def initialize(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5629 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5550 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:5610 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5594 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5555 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5573 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5568 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:5578 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ConstantPathOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, target: self.target, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5583 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:5586 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5560 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5613 + sig { override.returns(String) } + def inspect; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:390 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:397 + def operator_loc; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5602 + def save_binary_operator_loc(repository); end + + # attr_reader target: ConstantPathNode + # + # pkg:gem/prism#lib/prism/node.rb:5591 + sig { returns(Prism::ConstantPathNode) } + def target; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5618 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:5607 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5623 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a constant path. +# +# Parent::Child ||= value +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5642 +class Prism::ConstantPathOrWriteNode < ::Prism::Node + # Initialize a new ConstantPathOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5644 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, target, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5736 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5655 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5660 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5678 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5673 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:5683 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, target: self.target, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5688 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:5691 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5665 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5720 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5715 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5699 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5707 + def save_operator_loc(repository); end + + # attr_reader target: ConstantPathNode + # + # pkg:gem/prism#lib/prism/node.rb:5696 + sig { returns(Prism::ConstantPathNode) } + def target; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5725 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:5712 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5730 + def type; end + end +end + +# Represents writing to a constant path in a context that doesn't have an explicit value. +# +# Foo::Foo, Bar::Bar = baz +# ^^^^^^^^ ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5748 +class Prism::ConstantPathTargetNode < ::Prism::Node + # Initialize a new ConstantPathTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5750 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5857 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5762 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Previously, we had a child node on this class that contained either a + # constant read or a missing node. To not cause a breaking change, we + # continue to supply that API. + # + # pkg:gem/prism#lib/prism/node_ext.rb:246 + def child; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5767 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5786 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5779 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:5791 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).returns(Prism::ConstantPathTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, parent: self.parent, name: self.name, delimiter_loc: self.delimiter_loc, name_loc: self.name_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5796 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:5799 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def delimiter: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5836 + sig { returns(String) } + def delimiter; end + + # attr_reader delimiter_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5810 + sig { returns(Prism::Location) } + def delimiter_loc; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5772 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant path. For example: "Foo::Bar" + # + # pkg:gem/prism#lib/prism/node_ext.rb:239 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant path. + # For example: [:Foo, :Bar] + # + # pkg:gem/prism#lib/prism/node_ext.rb:219 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5841 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # pkg:gem/prism#lib/prism/node.rb:5807 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:5823 + sig { returns(Prism::Location) } + def name_loc; end + + # attr_reader parent: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:5804 + sig { returns(T.nilable(Prism::Node)) } + def parent; end + + # Save the delimiter_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5818 + def save_delimiter_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5831 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5846 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5851 + def type; end + end +end + +# Represents writing to a constant path. +# +# ::Foo = 1 +# ^^^^^^^^^ +# +# Foo::Bar = 1 +# ^^^^^^^^^^^^ +# +# ::Foo::Bar = 1 +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5876 +class Prism::ConstantPathWriteNode < ::Prism::Node + # Initialize a new ConstantPathWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5878 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, target, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:5982 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:5889 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5894 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:5912 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:5907 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:5917 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, target: self.target, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:5922 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:5925 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:5899 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:5966 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:5961 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # ::ABC = 123 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:5942 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:5950 + def save_operator_loc(repository); end + + # A node representing the constant path being written to. + # + # Foo::Bar = 1 + # ^^^^^^^^ + # + # ::Foo = :abc + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:5936 + sig { returns(Prism::ConstantPathNode) } + def target; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:5971 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # FOO::BAR = :abc + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:5958 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:5976 + def type; end + end +end + +# Represents referencing a constant. +# +# Foo +# ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:5994 +class Prism::ConstantReadNode < ::Prism::Node + # Initialize a new ConstantReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:5996 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6067 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6005 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6010 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6026 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6021 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode + # + # pkg:gem/prism#lib/prism/node.rb:6031 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ConstantReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6036 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:6039 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6015 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" + # + # pkg:gem/prism#lib/prism/node_ext.rb:142 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # pkg:gem/prism#lib/prism/node_ext.rb:137 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6051 + sig { override.returns(String) } + def inspect; end + + # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). + # + # X # name `:X` + # + # SOME_CONSTANT # name `:SOME_CONSTANT` + # + # pkg:gem/prism#lib/prism/node.rb:6048 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6056 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6061 + def type; end + end +end + +# Represents writing to a constant in a context that doesn't have an explicit value. +# +# Foo, Bar = baz +# ^^^ ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6077 +class Prism::ConstantTargetNode < ::Prism::Node + # Initialize a new ConstantTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6079 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6146 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6088 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6093 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6109 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6104 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:6114 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ConstantTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6119 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:6122 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6098 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" + # + # pkg:gem/prism#lib/prism/node_ext.rb:265 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # pkg:gem/prism#lib/prism/node_ext.rb:260 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6130 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:6127 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6135 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6140 + def type; end + end +end + +# Represents writing to a constant. +# +# Foo = 1 +# ^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6156 +class Prism::ConstantWriteNode < ::Prism::Node + # Initialize a new ConstantWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6158 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6279 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6170 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6175 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6192 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6187 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:6197 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::ConstantWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6202 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:6205 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6180 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" + # + # pkg:gem/prism#lib/prism/node_ext.rb:155 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # pkg:gem/prism#lib/prism/node_ext.rb:150 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6263 + sig { override.returns(String) } + def inspect; end + + # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). + # + # Foo = :bar # name `:Foo` + # + # XYZ = 1 # name `:XYZ` + # + # pkg:gem/prism#lib/prism/node.rb:6214 + sig { returns(Symbol) } + def name; end + + # The location of the constant name. + # + # FOO = 1 + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:6220 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:6258 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # FOO = :bar + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:6245 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6228 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6253 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6268 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # FOO = :bar + # ^^^^ + # + # MyClass = Class.new + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:6239 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6273 + def type; end + end +end + +# Raised when requested to parse as the currently running Ruby version but Prism has no support for it. +# +# pkg:gem/prism#lib/prism.rb:39 +class Prism::CurrentVersionError < ::ArgumentError + # Initialize a new exception for the given ruby version string. + # + # pkg:gem/prism#lib/prism.rb:41 + def initialize(version); end +end + +# The DSL module provides a set of methods that can be used to create prism +# nodes in a more concise manner. For example, instead of writing: +# +# source = Prism::Source.for("[1]") +# +# Prism::ArrayNode.new( +# source, +# 0, +# Prism::Location.new(source, 0, 3), +# 0, +# [ +# Prism::IntegerNode.new( +# source, +# 0, +# Prism::Location.new(source, 1, 1), +# Prism::IntegerBaseFlags::DECIMAL, +# 1 +# ) +# ], +# Prism::Location.new(source, 0, 1), +# Prism::Location.new(source, 2, 1) +# ) +# +# you could instead write: +# +# class Builder +# include Prism::DSL +# +# attr_reader :default_source +# +# def initialize +# @default_source = source("[1]") +# end +# +# def build +# array_node( +# location: location(start_offset: 0, length: 3), +# elements: [ +# integer_node( +# location: location(start_offset: 1, length: 1), +# flags: integer_base_flag(:decimal), +# value: 1 +# ) +# ], +# opening_loc: location(start_offset: 0, length: 1), +# closing_loc: location(start_offset: 2, length: 1) +# ) +# end +# end +# +# This is mostly helpful in the context of generating trees programmatically. +# +# pkg:gem/prism#lib/prism/dsl.rb:64 +module Prism::DSL + extend ::Prism::DSL + + # Create a new AliasGlobalVariableNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:80 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode), + old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).returns(Prism::AliasGlobalVariableNode) + end + def alias_global_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: global_variable_read_node(source: source), old_name: global_variable_read_node(source: source), keyword_loc: location); end + + # Create a new AliasMethodNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:85 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode), + old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode), + keyword_loc: Prism::Location + ).returns(Prism::AliasMethodNode) + end + def alias_method_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: symbol_node(source: source), old_name: symbol_node(source: source), keyword_loc: location); end + + # Create a new AlternationPatternNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:90 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::AlternationPatternNode) + end + def alternation_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location); end + + # Create a new AndNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:95 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::AndNode) + end + def and_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location); end + + # Create a new ArgumentsNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:100 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T::Array[Prism::Node] + ).returns(Prism::ArgumentsNode) + end + def arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: []); end + + # Retrieve the value of one of the ArgumentsNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:835 + sig { params(name: Symbol).returns(Integer) } + def arguments_node_flag(name); end + + # Create a new ArrayNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:105 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::ArrayNode) + end + def array_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [], opening_loc: nil, closing_loc: nil); end + + # Retrieve the value of one of the ArrayNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:847 + sig { params(name: Symbol).returns(Integer) } + def array_node_flag(name); end + + # Create a new ArrayPatternNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:110 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + requireds: T::Array[Prism::Node], + rest: T.nilable(Prism::Node), + posts: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::ArrayPatternNode) + end + def array_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, requireds: [], rest: nil, posts: [], opening_loc: nil, closing_loc: nil); end + + # Create a new AssocNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:115 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location) + ).returns(Prism::AssocNode) + end + def assoc_node(source: default_source, node_id: 0, location: default_location, flags: 0, key: default_node(source, location), value: default_node(source, location), operator_loc: nil); end + + # Create a new AssocSplatNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:120 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::AssocSplatNode) + end + def assoc_splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: nil, operator_loc: location); end + + # Create a new BackReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:125 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BackReferenceReadNode) + end + def back_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new BeginNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:130 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + begin_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + rescue_clause: T.nilable(Prism::RescueNode), + else_clause: T.nilable(Prism::ElseNode), + ensure_clause: T.nilable(Prism::EnsureNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::BeginNode) + end + def begin_node(source: default_source, node_id: 0, location: default_location, flags: 0, begin_keyword_loc: nil, statements: nil, rescue_clause: nil, else_clause: nil, ensure_clause: nil, end_keyword_loc: nil); end + + # Create a new BlockArgumentNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:135 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::BlockArgumentNode) + end + def block_argument_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: nil, operator_loc: location); end + + # Create a new BlockLocalVariableNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:140 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::BlockLocalVariableNode) + end + def block_local_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new BlockNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:145 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::BlockNode) + end + def block_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], parameters: nil, body: nil, opening_loc: location, closing_loc: location); end + + # Create a new BlockParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:150 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::BlockParameterNode) + end + def block_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location); end + + # Create a new BlockParametersNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:155 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::BlockParametersNode) + end + def block_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, parameters: nil, locals: [], opening_loc: nil, closing_loc: nil); end + + # Create a new BreakNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:160 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).returns(Prism::BreakNode) + end + def break_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location); end + + # Create a new CallAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:165 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallAndWriteNode) + end + def call_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location)); end + + # Create a new CallNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:170 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + name: Symbol, + message_loc: T.nilable(Prism::Location), + opening_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode)) + ).returns(Prism::CallNode) + end + def call_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, name: :"", message_loc: nil, opening_loc: nil, arguments: nil, closing_loc: nil, equal_loc: nil, block: nil); end + + # Retrieve the value of one of the CallNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:855 + sig { params(name: Symbol).returns(Integer) } + def call_node_flag(name); end + + # Create a new CallOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:175 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallOperatorWriteNode) + end + def call_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", binary_operator: :"", binary_operator_loc: location, value: default_node(source, location)); end + + # Create a new CallOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:180 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::CallOrWriteNode) + end + def call_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location)); end + + # Create a new CallTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:185 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location + ).returns(Prism::CallTargetNode) + end + def call_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), call_operator_loc: location, name: :"", message_loc: location); end + + # Create a new CapturePatternNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:190 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + target: Prism::LocalVariableTargetNode, + operator_loc: Prism::Location + ).returns(Prism::CapturePatternNode) + end + def capture_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), target: local_variable_target_node(source: source), operator_loc: location); end + + # Create a new CaseMatchNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:195 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::InNode], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).returns(Prism::CaseMatchNode) + end + def case_match_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location); end + + # Create a new CaseNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:200 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::WhenNode], + else_clause: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location + ).returns(Prism::CaseNode) + end + def case_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location); end + + # Create a new ClassNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:205 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode), + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location, + name: Symbol + ).returns(Prism::ClassNode) + end + def class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, constant_path: constant_read_node(source: source), inheritance_operator_loc: nil, superclass: nil, body: nil, end_keyword_loc: location, name: :""); end + + # Create a new ClassVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:210 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ClassVariableAndWriteNode) + end + def class_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new ClassVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:215 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ClassVariableOperatorWriteNode) + end + def class_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :""); end + + # Create a new ClassVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:220 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ClassVariableOrWriteNode) + end + def class_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new ClassVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:225 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ClassVariableReadNode) + end + def class_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new ClassVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:230 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ClassVariableTargetNode) + end + def class_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new ClassVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:235 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::ClassVariableWriteNode) + end + def class_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location); end + + # Create a new ConstantAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:240 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantAndWriteNode) + end + def constant_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new ConstantOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:245 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ConstantOperatorWriteNode) + end + def constant_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :""); end + + # Create a new ConstantOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:250 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantOrWriteNode) + end + def constant_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new ConstantPathAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:255 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathAndWriteNode) + end + def constant_path_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location)); end + + # Create a new ConstantPathNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:260 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).returns(Prism::ConstantPathNode) + end + def constant_path_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location); end + + # Create a new ConstantPathOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:265 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::ConstantPathOperatorWriteNode) + end + def constant_path_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), binary_operator_loc: location, value: default_node(source, location), binary_operator: :""); end + + # Create a new ConstantPathOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:270 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathOrWriteNode) + end + def constant_path_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location)); end + + # Create a new ConstantPathTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:275 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location + ).returns(Prism::ConstantPathTargetNode) + end + def constant_path_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location); end + + # Create a new ConstantPathWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:280 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::ConstantPathWriteNode) + end + def constant_path_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location)); end + + # Create a new ConstantReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:285 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ConstantReadNode) + end + def constant_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new ConstantTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:290 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::ConstantTargetNode) + end + def constant_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new ConstantWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:295 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::ConstantWriteNode) + end + def constant_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location); end + + # Create a new DefNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:300 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + locals: T::Array[Symbol], + def_keyword_loc: Prism::Location, + operator_loc: T.nilable(Prism::Location), + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::DefNode) + end + def def_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, receiver: nil, parameters: nil, body: nil, locals: [], def_keyword_loc: location, operator_loc: nil, lparen_loc: nil, rparen_loc: nil, equal_loc: nil, end_keyword_loc: nil); end + + # Create a new DefinedNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:305 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location + ).returns(Prism::DefinedNode) + end + def defined_node(source: default_source, node_id: 0, location: default_location, flags: 0, lparen_loc: nil, value: default_node(source, location), rparen_loc: nil, keyword_loc: location); end + + # Create a new ElseNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:310 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::ElseNode) + end + def else_node(source: default_source, node_id: 0, location: default_location, flags: 0, else_keyword_loc: location, statements: nil, end_keyword_loc: nil); end + + # Create a new EmbeddedStatementsNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:315 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location + ).returns(Prism::EmbeddedStatementsNode) + end + def embedded_statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, statements: nil, closing_loc: location); end + + # Create a new EmbeddedVariableNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:320 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + variable: T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode) + ).returns(Prism::EmbeddedVariableNode) + end + def embedded_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, variable: instance_variable_read_node(source: source)); end + + # Retrieve the value of one of the EncodingFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:866 + sig { params(name: Symbol).returns(Integer) } + def encoding_flag(name); end + + # Create a new EnsureNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:325 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location + ).returns(Prism::EnsureNode) + end + def ensure_node(source: default_source, node_id: 0, location: default_location, flags: 0, ensure_keyword_loc: location, statements: nil, end_keyword_loc: location); end + + # Create a new FalseNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:330 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::FalseNode) + end + def false_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new FindPatternNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:335 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + left: Prism::SplatNode, + requireds: T::Array[Prism::Node], + right: T.any(Prism::SplatNode, Prism::MissingNode), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::FindPatternNode) + end + def find_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, left: splat_node(source: source), requireds: [], right: splat_node(source: source), opening_loc: nil, closing_loc: nil); end + + # Create a new FlipFlopNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:340 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::FlipFlopNode) + end + def flip_flop_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location); end + + # Create a new FloatNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:345 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Float + ).returns(Prism::FloatNode) + end + def float_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0.0); end + + # Create a new ForNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:350 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + index: T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode), + collection: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + for_keyword_loc: Prism::Location, + in_keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + end_keyword_loc: Prism::Location + ).returns(Prism::ForNode) + end + def for_node(source: default_source, node_id: 0, location: default_location, flags: 0, index: local_variable_target_node(source: source), collection: default_node(source, location), statements: nil, for_keyword_loc: location, in_keyword_loc: location, do_keyword_loc: nil, end_keyword_loc: location); end + + # Create a new ForwardingArgumentsNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:355 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ForwardingArgumentsNode) + end + def forwarding_arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new ForwardingParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:360 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ForwardingParameterNode) + end + def forwarding_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new ForwardingSuperNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:365 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + block: T.nilable(Prism::BlockNode) + ).returns(Prism::ForwardingSuperNode) + end + def forwarding_super_node(source: default_source, node_id: 0, location: default_location, flags: 0, block: nil); end + + # Create a new GlobalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:370 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::GlobalVariableAndWriteNode) + end + def global_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new GlobalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:375 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::GlobalVariableOperatorWriteNode) + end + def global_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :""); end + + # Create a new GlobalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:380 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::GlobalVariableOrWriteNode) + end + def global_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new GlobalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:385 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::GlobalVariableReadNode) + end + def global_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new GlobalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:390 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::GlobalVariableTargetNode) + end + def global_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new GlobalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:395 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::GlobalVariableWriteNode) + end + def global_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location); end + + # Create a new HashNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:400 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location + ).returns(Prism::HashNode) + end + def hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, elements: [], closing_loc: location); end + + # Create a new HashPatternNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:405 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + elements: T::Array[Prism::AssocNode], + rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::HashPatternNode) + end + def hash_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, elements: [], rest: nil, opening_loc: nil, closing_loc: nil); end + + # Create a new IfNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:410 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::IfNode) + end + def if_node(source: default_source, node_id: 0, location: default_location, flags: 0, if_keyword_loc: nil, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, subsequent: nil, end_keyword_loc: nil); end + + # Create a new ImaginaryNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:415 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode) + ).returns(Prism::ImaginaryNode) + end + def imaginary_node(source: default_source, node_id: 0, location: default_location, flags: 0, numeric: float_node(source: source)); end + + # Create a new ImplicitNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:420 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode) + ).returns(Prism::ImplicitNode) + end + def implicit_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: local_variable_read_node(source: source)); end + + # Create a new ImplicitRestNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:425 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ImplicitRestNode) + end + def implicit_rest_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new InNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:430 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location) + ).returns(Prism::InNode) + end + def in_node(source: default_source, node_id: 0, location: default_location, flags: 0, pattern: default_node(source, location), statements: nil, in_loc: location, then_loc: nil); end + + # Create a new IndexAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:435 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexAndWriteNode) + end + def index_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location)); end + + # Create a new IndexOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:440 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexOperatorWriteNode) + end + def index_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, binary_operator: :"", binary_operator_loc: location, value: default_node(source, location)); end + + # Create a new IndexOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:445 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexOrWriteNode) + end + def index_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location)); end + + # Create a new IndexTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:450 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode) + ).returns(Prism::IndexTargetNode) + end + def index_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), opening_loc: location, arguments: nil, closing_loc: location, block: nil); end + + # Create a new InstanceVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:455 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::InstanceVariableAndWriteNode) + end + def instance_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new InstanceVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:460 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::InstanceVariableOperatorWriteNode) + end + def instance_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :""); end + + # Create a new InstanceVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:465 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::InstanceVariableOrWriteNode) + end + def instance_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new InstanceVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:470 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::InstanceVariableReadNode) + end + def instance_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new InstanceVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:475 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::InstanceVariableTargetNode) + end + def instance_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new InstanceVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:480 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::InstanceVariableWriteNode) + end + def instance_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location); end + + # Retrieve the value of one of the IntegerBaseFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:875 + sig { params(name: Symbol).returns(Integer) } + def integer_base_flag(name); end + + # Create a new IntegerNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:485 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Integer + ).returns(Prism::IntegerNode) + end + def integer_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0); end + + # Create a new InterpolatedMatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:490 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedMatchLastLineNode) + end + def interpolated_match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location); end + + # Create a new InterpolatedRegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:495 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedRegularExpressionNode) + end + def interpolated_regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location); end + + # Create a new InterpolatedStringNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:500 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode, Prism::XStringNode, Prism::InterpolatedXStringNode, Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::InterpolatedStringNode) + end + def interpolated_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil); end + + # Retrieve the value of one of the InterpolatedStringNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:886 + sig { params(name: Symbol).returns(Integer) } + def interpolated_string_node_flag(name); end + + # Create a new InterpolatedSymbolNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:505 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::InterpolatedSymbolNode) + end + def interpolated_symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil); end + + # Create a new InterpolatedXStringNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:510 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedXStringNode) + end + def interpolated_x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location); end + + # Create a new ItLocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:515 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ItLocalVariableReadNode) + end + def it_local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new ItParametersNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:520 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::ItParametersNode) + end + def it_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new KeywordHashNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:525 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)] + ).returns(Prism::KeywordHashNode) + end + def keyword_hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: []); end + + # Retrieve the value of one of the KeywordHashNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:895 + sig { params(name: Symbol).returns(Integer) } + def keyword_hash_node_flag(name); end + + # Create a new KeywordRestParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:530 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::KeywordRestParameterNode) + end + def keyword_rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location); end + + # Create a new LambdaNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:535 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)) + ).returns(Prism::LambdaNode) + end + def lambda_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], operator_loc: location, opening_loc: location, closing_loc: location, parameters: nil, body: nil); end + + # Create a new LocalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:540 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableAndWriteNode) + end + def local_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0); end + + # Create a new LocalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:545 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer + ).returns(Prism::LocalVariableOperatorWriteNode) + end + def local_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, binary_operator_loc: location, value: default_node(source, location), name: :"", binary_operator: :"", depth: 0); end + + # Create a new LocalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:550 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableOrWriteNode) + end + def local_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0); end + + # Create a new LocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:555 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableReadNode) + end + def local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0); end + + # Create a new LocalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:560 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableTargetNode) + end + def local_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0); end + + # Create a new LocalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:565 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::LocalVariableWriteNode) + end + def local_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0, name_loc: location, value: default_node(source, location), operator_loc: location); end + + # Create a new Location object. + # + # pkg:gem/prism#lib/prism/dsl.rb:75 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) } + def location(source: default_source, start_offset: 0, length: 0); end + + # Retrieve the value of one of the LoopFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:903 + sig { params(name: Symbol).returns(Integer) } + def loop_flag(name); end + + # Create a new MatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:570 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::MatchLastLineNode) + end + def match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: ""); end + + # Create a new MatchPredicateNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:575 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::MatchPredicateNode) + end + def match_predicate_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location); end + + # Create a new MatchRequiredNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:580 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::MatchRequiredNode) + end + def match_required_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location); end + + # Create a new MatchWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:585 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode] + ).returns(Prism::MatchWriteNode) + end + def match_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, call: call_node(source: source), targets: []); end + + # Create a new MissingNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:590 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::MissingNode) + end + def missing_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new ModuleNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:595 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location, + name: Symbol + ).returns(Prism::ModuleNode) + end + def module_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], module_keyword_loc: location, constant_path: constant_read_node(source: source), body: nil, end_keyword_loc: location, name: :""); end + + # Create a new MultiTargetNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:600 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location) + ).returns(Prism::MultiTargetNode) + end + def multi_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil); end + + # Create a new MultiWriteNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:605 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::MultiWriteNode) + end + def multi_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil, operator_loc: location, value: default_node(source, location)); end + + # Create a new NextNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:610 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).returns(Prism::NextNode) + end + def next_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location); end + + # Create a new NilNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:615 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::NilNode) + end + def nil_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new NoKeywordsParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:620 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + keyword_loc: Prism::Location + ).returns(Prism::NoKeywordsParameterNode) + end + def no_keywords_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, keyword_loc: location); end + + # Create a new NumberedParametersNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:625 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + maximum: Integer + ).returns(Prism::NumberedParametersNode) + end + def numbered_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, maximum: 0); end + + # Create a new NumberedReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:630 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + number: Integer + ).returns(Prism::NumberedReferenceReadNode) + end + def numbered_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, number: 0); end + + # Create a new OptionalKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:635 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::OptionalKeywordParameterNode) + end + def optional_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location)); end + + # Create a new OptionalParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:640 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::OptionalParameterNode) + end + def optional_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)); end + + # Create a new OrNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:645 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::OrNode) + end + def or_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location); end + + # Retrieve the value of one of the ParameterFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:911 + sig { params(name: Symbol).returns(Integer) } + def parameter_flag(name); end + + # Create a new ParametersNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:650 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], + optionals: T::Array[Prism::OptionalParameterNode], + rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), + posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)], + keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], + keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), + block: T.nilable(Prism::BlockParameterNode) + ).returns(Prism::ParametersNode) + end + def parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, requireds: [], optionals: [], rest: nil, posts: [], keywords: [], keyword_rest: nil, block: nil); end + + # Create a new ParenthesesNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:655 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::ParenthesesNode) + end + def parentheses_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: nil, opening_loc: location, closing_loc: location); end + + # Retrieve the value of one of the ParenthesesNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:919 + sig { params(name: Symbol).returns(Integer) } + def parentheses_node_flag(name); end + + # Create a new PinnedExpressionNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:660 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location + ).returns(Prism::PinnedExpressionNode) + end + def pinned_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), operator_loc: location, lparen_loc: location, rparen_loc: location); end + + # Create a new PinnedVariableNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:665 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + variable: T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode), + operator_loc: Prism::Location + ).returns(Prism::PinnedVariableNode) + end + def pinned_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, variable: local_variable_read_node(source: source), operator_loc: location); end + + # Create a new PostExecutionNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:670 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::PostExecutionNode) + end + def post_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location); end + + # Create a new PreExecutionNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:675 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::PreExecutionNode) + end + def pre_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location); end + + # Create a new ProgramNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:680 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + statements: Prism::StatementsNode + ).returns(Prism::ProgramNode) + end + def program_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], statements: statements_node(source: source)); end + + # Retrieve the value of one of the RangeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:927 + sig { params(name: Symbol).returns(Integer) } + def range_flag(name); end + + # Create a new RangeNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:685 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::RangeNode) + end + def range_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location); end + + # Create a new RationalNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:690 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + numerator: Integer, + denominator: Integer + ).returns(Prism::RationalNode) + end + def rational_node(source: default_source, node_id: 0, location: default_location, flags: 0, numerator: 0, denominator: 0); end + + # Create a new RedoNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:695 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::RedoNode) + end + def redo_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Retrieve the value of one of the RegularExpressionFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:935 + sig { params(name: Symbol).returns(Integer) } + def regular_expression_flag(name); end + + # Create a new RegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:700 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::RegularExpressionNode) + end + def regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: ""); end + + # Create a new RequiredKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:705 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location + ).returns(Prism::RequiredKeywordParameterNode) + end + def required_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location); end + + # Create a new RequiredParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:710 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::RequiredParameterNode) + end + def required_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :""); end + + # Create a new RescueModifierNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:715 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node + ).returns(Prism::RescueModifierNode) + end + def rescue_modifier_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), keyword_loc: location, rescue_expression: default_node(source, location)); end + + # Create a new RescueNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:720 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)), + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(Prism::RescueNode) + ).returns(Prism::RescueNode) + end + def rescue_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, exceptions: [], operator_loc: nil, reference: nil, then_keyword_loc: nil, statements: nil, subsequent: nil); end + + # Create a new RestParameterNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:725 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::RestParameterNode) + end + def rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location); end + + # Create a new RetryNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:730 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::RetryNode) + end + def retry_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new ReturnNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:735 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode) + ).returns(Prism::ReturnNode) + end + def return_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, arguments: nil); end + + # Create a new SelfNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:740 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::SelfNode) + end + def self_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new ShareableConstantNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:745 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode) + ).returns(Prism::ShareableConstantNode) + end + def shareable_constant_node(source: default_source, node_id: 0, location: default_location, flags: 0, write: constant_write_node(source: source)); end + + # Retrieve the value of one of the ShareableConstantNodeFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:953 + sig { params(name: Symbol).returns(Integer) } + def shareable_constant_node_flag(name); end + + # Create a new SingletonClassNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:750 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location + ).returns(Prism::SingletonClassNode) + end + def singleton_class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, operator_loc: location, expression: default_node(source, location), body: nil, end_keyword_loc: location); end + + # Create a new Source object. + # + # pkg:gem/prism#lib/prism/dsl.rb:70 + sig { params(string: String).returns(Prism::Source) } + def source(string); end + + # Create a new SourceEncodingNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:755 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::SourceEncodingNode) + end + def source_encoding_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new SourceFileNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:760 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + filepath: String + ).returns(Prism::SourceFileNode) + end + def source_file_node(source: default_source, node_id: 0, location: default_location, flags: 0, filepath: ""); end + + # Create a new SourceLineNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:765 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::SourceLineNode) + end + def source_line_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new SplatNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:770 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node) + ).returns(Prism::SplatNode) + end + def splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, expression: nil); end + + # Create a new StatementsNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:775 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T::Array[Prism::Node] + ).returns(Prism::StatementsNode) + end + def statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: []); end + + # Retrieve the value of one of the StringFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:963 + sig { params(name: Symbol).returns(Integer) } + def string_flag(name); end + + # Create a new StringNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:780 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).returns(Prism::StringNode) + end + def string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, content_loc: location, closing_loc: nil, unescaped: ""); end + + # Create a new SuperNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:785 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode)) + ).returns(Prism::SuperNode) + end + def super_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil, block: nil); end + + # Retrieve the value of one of the SymbolFlags flags. + # + # pkg:gem/prism#lib/prism/dsl.rb:974 + sig { params(name: Symbol).returns(Integer) } + def symbol_flag(name); end + + # Create a new SymbolNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:790 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).returns(Prism::SymbolNode) + end + def symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, value_loc: nil, closing_loc: nil, unescaped: ""); end + + # Create a new TrueNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:795 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer + ).returns(Prism::TrueNode) + end + def true_node(source: default_source, node_id: 0, location: default_location, flags: 0); end + + # Create a new UndefNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:800 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location + ).returns(Prism::UndefNode) + end + def undef_node(source: default_source, node_id: 0, location: default_location, flags: 0, names: [], keyword_loc: location); end + + # Create a new UnlessNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:805 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + else_clause: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::UnlessNode) + end + def unless_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, else_clause: nil, end_keyword_loc: nil); end + + # Create a new UntilNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:810 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::UntilNode) + end + def until_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil); end + + # Create a new WhenNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:815 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::WhenNode) + end + def when_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, conditions: [], then_keyword_loc: nil, statements: nil); end + + # Create a new WhileNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:820 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::WhileNode) + end + def while_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil); end + + # Create a new XStringNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:825 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::XStringNode) + end + def x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: ""); end + + # Create a new YieldNode node. + # + # pkg:gem/prism#lib/prism/dsl.rb:830 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location) + ).returns(Prism::YieldNode) + end + def yield_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil); end + + private + + # The default location object that gets attached to nodes if no location is + # specified, which uses the given source. + # + # pkg:gem/prism#lib/prism/dsl.rb:993 + sig { returns(Prism::Location) } + def default_location; end + + # The default node that gets attached to nodes if no node is specified for a + # required node field. + # + # pkg:gem/prism#lib/prism/dsl.rb:999 + sig { params(source: Prism::Source, location: Prism::Location).returns(Prism::Node) } + def default_node(source, location); end + + # The default source object that gets attached to nodes and locations if no + # source is specified. + # + # pkg:gem/prism#lib/prism/dsl.rb:987 + sig { returns(Prism::Source) } + def default_source; end +end + +# Represents a method definition. +# +# def method +# end +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6293 +class Prism::DefNode < ::Prism::Node + # Initialize a new DefNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6295 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + locals: T::Array[Symbol], + def_keyword_loc: Prism::Location, + operator_loc: T.nilable(Prism::Location), + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + end_keyword_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6543 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6315 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: StatementsNode | BeginNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:6383 + sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6320 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6343 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6334 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: StatementsNode | BeginNode | nil, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode + # + # pkg:gem/prism#lib/prism/node.rb:6348 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + locals: T::Array[Symbol], + def_keyword_loc: Prism::Location, + operator_loc: T.nilable(Prism::Location), + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::DefNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, receiver: self.receiver, parameters: self.parameters, body: self.body, locals: self.locals, def_keyword_loc: self.def_keyword_loc, operator_loc: self.operator_loc, lparen_loc: self.lparen_loc, rparen_loc: self.rparen_loc, equal_loc: self.equal_loc, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6353 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, receiver: Prism::node?, parameters: ParametersNode?, body: StatementsNode | BeginNode | nil, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:6356 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def def_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:6497 + sig { returns(String) } + def def_keyword; end + + # attr_reader def_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:6389 + sig { returns(Prism::Location) } + def def_keyword_loc; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6325 + def each_child_node; end + + # def end_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6522 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6478 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + # def equal: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6517 + sig { returns(T.nilable(String)) } + def equal; end + + # attr_reader equal_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6459 + sig { returns(T.nilable(Prism::Location)) } + def equal_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6527 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # pkg:gem/prism#lib/prism/node.rb:6386 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def lparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6507 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6421 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:6361 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:6364 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6502 + sig { returns(T.nilable(String)) } + def operator; end + + # attr_reader operator_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6402 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; end + + # attr_reader parameters: ParametersNode? + # + # pkg:gem/prism#lib/prism/node.rb:6380 + sig { returns(T.nilable(Prism::ParametersNode)) } + def parameters; end + + # attr_reader receiver: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:6377 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def rparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6512 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6440 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Save the def_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6397 + def save_def_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6492 + def save_end_keyword_loc(repository); end + + # Save the equal_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6473 + def save_equal_loc(repository); end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6435 + def save_lparen_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6372 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6416 + def save_operator_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6454 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6532 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6537 + def type; end + end +end + +# Represents the use of the `defined?` keyword. +# +# defined?(a) +# ^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6565 +class Prism::DefinedNode < ::Prism::Node + # Initialize a new DefinedNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6567 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6704 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6579 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6601 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6596 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode + # + # pkg:gem/prism#lib/prism/node.rb:6606 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location + ).returns(Prism::DefinedNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, lparen_loc: self.lparen_loc, value: self.value, rparen_loc: self.rparen_loc, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6611 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:6614 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6589 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6688 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:6683 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:6660 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6673 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6619 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6678 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6641 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6668 + def save_keyword_loc(repository); end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6633 + def save_lparen_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6655 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6693 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:6638 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6698 + def type; end + end +end + +# pkg:gem/prism#lib/prism/desugar_compiler.rb:5 +class Prism::DesugarAndWriteNode + include ::Prism::DSL + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:10 + def initialize(node, default_source, read_class, write_class, **arguments); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:8 + def arguments; end + + # Desugar `x &&= y` to `x && x = y` + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:19 + def compile; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:8 + def default_source; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:8 + def node; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:8 + def read_class; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:8 + def write_class; end +end + +# DesugarCompiler is a compiler that desugars Ruby code into a more primitive +# form. This is useful for consumers that want to deal with fewer node types. +# +# pkg:gem/prism#lib/prism/desugar_compiler.rb:256 +class Prism::DesugarCompiler < ::Prism::MutationCompiler + # @@foo &&= bar + # + # becomes + # + # @@foo && @@foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:262 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # + # becomes + # + # @@foo = @@foo + bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:280 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # + # becomes + # + # defined?(@@foo) ? @@foo : @@foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:271 + def visit_class_variable_or_write_node(node); end + + # Foo &&= bar + # + # becomes + # + # Foo && Foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:289 + def visit_constant_and_write_node(node); end + + # Foo += bar + # + # becomes + # + # Foo = Foo + bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:307 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # + # becomes + # + # defined?(Foo) ? Foo : Foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:298 + def visit_constant_or_write_node(node); end + + # $foo &&= bar + # + # becomes + # + # $foo && $foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:316 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # + # becomes + # + # $foo = $foo + bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:334 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # + # becomes + # + # defined?($foo) ? $foo : $foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:325 + def visit_global_variable_or_write_node(node); end + + # @foo &&= bar + # + # becomes + # + # @foo && @foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:343 + def visit_instance_variable_and_write_node(node); end + + # @foo += bar + # + # becomes + # + # @foo = @foo + bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:361 + def visit_instance_variable_operator_write_node(node); end + + # @foo ||= bar + # + # becomes + # + # @foo || @foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:352 + def visit_instance_variable_or_write_node(node); end + + # foo &&= bar + # + # becomes + # + # foo && foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:370 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # + # becomes + # + # foo = foo + bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:388 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # + # becomes + # + # foo || foo = bar + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:379 + def visit_local_variable_or_write_node(node); end +end + +# pkg:gem/prism#lib/prism/desugar_compiler.rb:87 +class Prism::DesugarOperatorWriteNode + include ::Prism::DSL + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:92 + def initialize(node, default_source, read_class, write_class, **arguments); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:90 + def arguments; end + + # Desugar `x += y` to `x = x + y` + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:101 + def compile; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:90 + def default_source; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:90 + def node; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:90 + def read_class; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:90 + def write_class; end +end + +# pkg:gem/prism#lib/prism/desugar_compiler.rb:36 +class Prism::DesugarOrWriteDefinedNode + include ::Prism::DSL + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:41 + def initialize(node, default_source, read_class, write_class, **arguments); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:39 + def arguments; end + + # Desugar `x ||= y` to `defined?(x) ? x : x = y` + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:50 + def compile; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:39 + def default_source; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:39 + def node; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:39 + def read_class; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:39 + def write_class; end +end + +# pkg:gem/prism#lib/prism/desugar_compiler.rb:131 +class Prism::DesugarOrWriteNode + include ::Prism::DSL + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:136 + def initialize(node, default_source, read_class, write_class, **arguments); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:134 + def arguments; end + + # Desugar `x ||= y` to `x || x = y` + # + # pkg:gem/prism#lib/prism/desugar_compiler.rb:145 + def compile; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:134 + def default_source; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:134 + def node; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:134 + def read_class; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:134 + def write_class; end +end + +# The dispatcher class fires events for nodes that are found while walking an +# AST to all registered listeners. It's useful for performing different types +# of analysis on the AST while only having to walk the tree once. +# +# To use the dispatcher, you would first instantiate it and register listeners +# for the events you're interested in: +# +# class OctalListener +# def on_integer_node_enter(node) +# if node.octal? && !node.slice.start_with?("0o") +# warn("Octal integers should be written with the 0o prefix") +# end +# end +# end +# +# listener = OctalListener.new +# dispatcher = Prism::Dispatcher.new +# dispatcher.register(listener, :on_integer_node_enter) +# +# Then, you can walk any number of trees and dispatch events to the listeners: +# +# result = Prism.parse("001 + 002 + 003") +# dispatcher.dispatch(result.value) +# +# Optionally, you can also use `#dispatch_once` to dispatch enter and leave +# events for a single node without recursing further down the tree. This can +# be useful in circumstances where you want to reuse the listeners you already +# have registers but want to stop walking the tree at a certain point. +# +# integer = result.value.statements.body.first.receiver.receiver +# dispatcher.dispatch_once(integer) +# +# pkg:gem/prism#lib/prism/dispatcher.rb:45 +class Prism::Dispatcher < ::Prism::Visitor + # Initialize a new dispatcher. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:50 + def initialize; end + + # Walks `root` dispatching events to all registered listeners. + # + # def dispatch: (Node) -> void + # + # pkg:gem/prism#lib/prism/dispatcher.rb:77 + def dispatch(node); end + + # Dispatches a single event for `node` to all registered listeners. + # + # def dispatch_once: (Node) -> void + # + # pkg:gem/prism#lib/prism/dispatcher.rb:82 + def dispatch_once(node); end + + # attr_reader listeners: Hash[Symbol, Array[Listener]] + # + # pkg:gem/prism#lib/prism/dispatcher.rb:47 + def listeners; end + + # Register a listener for one or more events. + # + # def register: (Listener, *Symbol) -> void + # + # pkg:gem/prism#lib/prism/dispatcher.rb:57 + def register(listener, *events); end + + # Register all public methods of a listener that match the pattern + # `on__(enter|leave)`. + # + # def register_public_methods: (Listener) -> void + # + # pkg:gem/prism#lib/prism/dispatcher.rb:65 + def register_public_methods(listener); end + + # Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:88 + def visit_alias_global_variable_node(node); end + + # Dispatch enter and leave events for AliasMethodNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:96 + def visit_alias_method_node(node); end + + # Dispatch enter and leave events for AlternationPatternNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:104 + def visit_alternation_pattern_node(node); end + + # Dispatch enter and leave events for AndNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:112 + def visit_and_node(node); end + + # Dispatch enter and leave events for ArgumentsNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:120 + def visit_arguments_node(node); end + + # Dispatch enter and leave events for ArrayNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:128 + def visit_array_node(node); end + + # Dispatch enter and leave events for ArrayPatternNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:136 + def visit_array_pattern_node(node); end + + # Dispatch enter and leave events for AssocNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:144 + def visit_assoc_node(node); end + + # Dispatch enter and leave events for AssocSplatNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:152 + def visit_assoc_splat_node(node); end + + # Dispatch enter and leave events for BackReferenceReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:160 + def visit_back_reference_read_node(node); end + + # Dispatch enter and leave events for BeginNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:168 + def visit_begin_node(node); end + + # Dispatch enter and leave events for BlockArgumentNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:176 + def visit_block_argument_node(node); end + + # Dispatch enter and leave events for BlockLocalVariableNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:184 + def visit_block_local_variable_node(node); end + + # Dispatch enter and leave events for BlockNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:192 + def visit_block_node(node); end + + # Dispatch enter and leave events for BlockParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:200 + def visit_block_parameter_node(node); end + + # Dispatch enter and leave events for BlockParametersNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:208 + def visit_block_parameters_node(node); end + + # Dispatch enter and leave events for BreakNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:216 + def visit_break_node(node); end + + # Dispatch enter and leave events for CallAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:224 + def visit_call_and_write_node(node); end + + # Dispatch enter and leave events for CallNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:232 + def visit_call_node(node); end + + # Dispatch enter and leave events for CallOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:240 + def visit_call_operator_write_node(node); end + + # Dispatch enter and leave events for CallOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:248 + def visit_call_or_write_node(node); end + + # Dispatch enter and leave events for CallTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:256 + def visit_call_target_node(node); end + + # Dispatch enter and leave events for CapturePatternNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:264 + def visit_capture_pattern_node(node); end + + # Dispatch enter and leave events for CaseMatchNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:272 + def visit_case_match_node(node); end + + # Dispatch enter and leave events for CaseNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:280 + def visit_case_node(node); end + + # Dispatch enter and leave events for ClassNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:288 + def visit_class_node(node); end + + # Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:296 + def visit_class_variable_and_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:304 + def visit_class_variable_operator_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:312 + def visit_class_variable_or_write_node(node); end + + # Dispatch enter and leave events for ClassVariableReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:320 + def visit_class_variable_read_node(node); end + + # Dispatch enter and leave events for ClassVariableTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:328 + def visit_class_variable_target_node(node); end + + # Dispatch enter and leave events for ClassVariableWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:336 + def visit_class_variable_write_node(node); end + + # Dispatch enter and leave events for ConstantAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:344 + def visit_constant_and_write_node(node); end + + # Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:352 + def visit_constant_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:360 + def visit_constant_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:368 + def visit_constant_path_and_write_node(node); end + + # Dispatch enter and leave events for ConstantPathNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:376 + def visit_constant_path_node(node); end + + # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:384 + def visit_constant_path_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:392 + def visit_constant_path_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:400 + def visit_constant_path_target_node(node); end + + # Dispatch enter and leave events for ConstantPathWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:408 + def visit_constant_path_write_node(node); end + + # Dispatch enter and leave events for ConstantReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:416 + def visit_constant_read_node(node); end + + # Dispatch enter and leave events for ConstantTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:424 + def visit_constant_target_node(node); end + + # Dispatch enter and leave events for ConstantWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:432 + def visit_constant_write_node(node); end + + # Dispatch enter and leave events for DefNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:440 + def visit_def_node(node); end + + # Dispatch enter and leave events for DefinedNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:448 + def visit_defined_node(node); end + + # Dispatch enter and leave events for ElseNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:456 + def visit_else_node(node); end + + # Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:464 + def visit_embedded_statements_node(node); end + + # Dispatch enter and leave events for EmbeddedVariableNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:472 + def visit_embedded_variable_node(node); end + + # Dispatch enter and leave events for EnsureNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:480 + def visit_ensure_node(node); end + + # Dispatch enter and leave events for FalseNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:488 + def visit_false_node(node); end + + # Dispatch enter and leave events for FindPatternNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:496 + def visit_find_pattern_node(node); end + + # Dispatch enter and leave events for FlipFlopNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:504 + def visit_flip_flop_node(node); end + + # Dispatch enter and leave events for FloatNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:512 + def visit_float_node(node); end + + # Dispatch enter and leave events for ForNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:520 + def visit_for_node(node); end + + # Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:528 + def visit_forwarding_arguments_node(node); end + + # Dispatch enter and leave events for ForwardingParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:536 + def visit_forwarding_parameter_node(node); end + + # Dispatch enter and leave events for ForwardingSuperNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:544 + def visit_forwarding_super_node(node); end + + # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:552 + def visit_global_variable_and_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:560 + def visit_global_variable_operator_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:568 + def visit_global_variable_or_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:576 + def visit_global_variable_read_node(node); end + + # Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:584 + def visit_global_variable_target_node(node); end + + # Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:592 + def visit_global_variable_write_node(node); end + + # Dispatch enter and leave events for HashNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:600 + def visit_hash_node(node); end + + # Dispatch enter and leave events for HashPatternNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:608 + def visit_hash_pattern_node(node); end + + # Dispatch enter and leave events for IfNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:616 + def visit_if_node(node); end + + # Dispatch enter and leave events for ImaginaryNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:624 + def visit_imaginary_node(node); end + + # Dispatch enter and leave events for ImplicitNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:632 + def visit_implicit_node(node); end + + # Dispatch enter and leave events for ImplicitRestNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:640 + def visit_implicit_rest_node(node); end + + # Dispatch enter and leave events for InNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:648 + def visit_in_node(node); end + + # Dispatch enter and leave events for IndexAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:656 + def visit_index_and_write_node(node); end + + # Dispatch enter and leave events for IndexOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:664 + def visit_index_operator_write_node(node); end + + # Dispatch enter and leave events for IndexOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:672 + def visit_index_or_write_node(node); end + + # Dispatch enter and leave events for IndexTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:680 + def visit_index_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:688 + def visit_instance_variable_and_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:696 + def visit_instance_variable_operator_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:704 + def visit_instance_variable_or_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:712 + def visit_instance_variable_read_node(node); end + + # Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:720 + def visit_instance_variable_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:728 + def visit_instance_variable_write_node(node); end + + # Dispatch enter and leave events for IntegerNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:736 + def visit_integer_node(node); end + + # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:744 + def visit_interpolated_match_last_line_node(node); end + + # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:752 + def visit_interpolated_regular_expression_node(node); end + + # Dispatch enter and leave events for InterpolatedStringNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:760 + def visit_interpolated_string_node(node); end + + # Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:768 + def visit_interpolated_symbol_node(node); end + + # Dispatch enter and leave events for InterpolatedXStringNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:776 + def visit_interpolated_x_string_node(node); end + + # Dispatch enter and leave events for ItLocalVariableReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:784 + def visit_it_local_variable_read_node(node); end + + # Dispatch enter and leave events for ItParametersNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:792 + def visit_it_parameters_node(node); end + + # Dispatch enter and leave events for KeywordHashNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:800 + def visit_keyword_hash_node(node); end + + # Dispatch enter and leave events for KeywordRestParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:808 + def visit_keyword_rest_parameter_node(node); end + + # Dispatch enter and leave events for LambdaNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:816 + def visit_lambda_node(node); end + + # Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:824 + def visit_local_variable_and_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:832 + def visit_local_variable_operator_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:840 + def visit_local_variable_or_write_node(node); end + + # Dispatch enter and leave events for LocalVariableReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:848 + def visit_local_variable_read_node(node); end + + # Dispatch enter and leave events for LocalVariableTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:856 + def visit_local_variable_target_node(node); end + + # Dispatch enter and leave events for LocalVariableWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:864 + def visit_local_variable_write_node(node); end + + # Dispatch enter and leave events for MatchLastLineNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:872 + def visit_match_last_line_node(node); end + + # Dispatch enter and leave events for MatchPredicateNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:880 + def visit_match_predicate_node(node); end + + # Dispatch enter and leave events for MatchRequiredNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:888 + def visit_match_required_node(node); end + + # Dispatch enter and leave events for MatchWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:896 + def visit_match_write_node(node); end + + # Dispatch enter and leave events for MissingNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:904 + def visit_missing_node(node); end + + # Dispatch enter and leave events for ModuleNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:912 + def visit_module_node(node); end + + # Dispatch enter and leave events for MultiTargetNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:920 + def visit_multi_target_node(node); end + + # Dispatch enter and leave events for MultiWriteNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:928 + def visit_multi_write_node(node); end + + # Dispatch enter and leave events for NextNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:936 + def visit_next_node(node); end + + # Dispatch enter and leave events for NilNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:944 + def visit_nil_node(node); end + + # Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:952 + def visit_no_keywords_parameter_node(node); end + + # Dispatch enter and leave events for NumberedParametersNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:960 + def visit_numbered_parameters_node(node); end + + # Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:968 + def visit_numbered_reference_read_node(node); end + + # Dispatch enter and leave events for OptionalKeywordParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:976 + def visit_optional_keyword_parameter_node(node); end + + # Dispatch enter and leave events for OptionalParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:984 + def visit_optional_parameter_node(node); end + + # Dispatch enter and leave events for OrNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:992 + def visit_or_node(node); end + + # Dispatch enter and leave events for ParametersNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1000 + def visit_parameters_node(node); end + + # Dispatch enter and leave events for ParenthesesNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1008 + def visit_parentheses_node(node); end + + # Dispatch enter and leave events for PinnedExpressionNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1016 + def visit_pinned_expression_node(node); end + + # Dispatch enter and leave events for PinnedVariableNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1024 + def visit_pinned_variable_node(node); end + + # Dispatch enter and leave events for PostExecutionNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1032 + def visit_post_execution_node(node); end + + # Dispatch enter and leave events for PreExecutionNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1040 + def visit_pre_execution_node(node); end + + # Dispatch enter and leave events for ProgramNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1048 + def visit_program_node(node); end + + # Dispatch enter and leave events for RangeNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1056 + def visit_range_node(node); end + + # Dispatch enter and leave events for RationalNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1064 + def visit_rational_node(node); end + + # Dispatch enter and leave events for RedoNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1072 + def visit_redo_node(node); end + + # Dispatch enter and leave events for RegularExpressionNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1080 + def visit_regular_expression_node(node); end + + # Dispatch enter and leave events for RequiredKeywordParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1088 + def visit_required_keyword_parameter_node(node); end + + # Dispatch enter and leave events for RequiredParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1096 + def visit_required_parameter_node(node); end + + # Dispatch enter and leave events for RescueModifierNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1104 + def visit_rescue_modifier_node(node); end + + # Dispatch enter and leave events for RescueNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1112 + def visit_rescue_node(node); end + + # Dispatch enter and leave events for RestParameterNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1120 + def visit_rest_parameter_node(node); end + + # Dispatch enter and leave events for RetryNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1128 + def visit_retry_node(node); end + + # Dispatch enter and leave events for ReturnNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1136 + def visit_return_node(node); end + + # Dispatch enter and leave events for SelfNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1144 + def visit_self_node(node); end + + # Dispatch enter and leave events for ShareableConstantNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1152 + def visit_shareable_constant_node(node); end + + # Dispatch enter and leave events for SingletonClassNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1160 + def visit_singleton_class_node(node); end + + # Dispatch enter and leave events for SourceEncodingNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1168 + def visit_source_encoding_node(node); end + + # Dispatch enter and leave events for SourceFileNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1176 + def visit_source_file_node(node); end + + # Dispatch enter and leave events for SourceLineNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1184 + def visit_source_line_node(node); end + + # Dispatch enter and leave events for SplatNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1192 + def visit_splat_node(node); end + + # Dispatch enter and leave events for StatementsNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1200 + def visit_statements_node(node); end + + # Dispatch enter and leave events for StringNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1208 + def visit_string_node(node); end + + # Dispatch enter and leave events for SuperNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1216 + def visit_super_node(node); end + + # Dispatch enter and leave events for SymbolNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1224 + def visit_symbol_node(node); end + + # Dispatch enter and leave events for TrueNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1232 + def visit_true_node(node); end + + # Dispatch enter and leave events for UndefNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1240 + def visit_undef_node(node); end + + # Dispatch enter and leave events for UnlessNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1248 + def visit_unless_node(node); end + + # Dispatch enter and leave events for UntilNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1256 + def visit_until_node(node); end + + # Dispatch enter and leave events for WhenNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1264 + def visit_when_node(node); end + + # Dispatch enter and leave events for WhileNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1272 + def visit_while_node(node); end + + # Dispatch enter and leave events for XStringNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1280 + def visit_x_string_node(node); end + + # Dispatch enter and leave events for YieldNode nodes and continue + # walking the tree. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1288 + def visit_yield_node(node); end + + private + + # Register a listener for the given events. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:70 + def register_events(listener, events); end +end + +# pkg:gem/prism#lib/prism/dispatcher.rb:1294 +class Prism::Dispatcher::DispatchOnce < ::Prism::Visitor + # pkg:gem/prism#lib/prism/dispatcher.rb:1297 + def initialize(listeners); end + + # pkg:gem/prism#lib/prism/dispatcher.rb:1295 + def listeners; end + + # Dispatch enter and leave events for AliasGlobalVariableNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1302 + def visit_alias_global_variable_node(node); end + + # Dispatch enter and leave events for AliasMethodNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1308 + def visit_alias_method_node(node); end + + # Dispatch enter and leave events for AlternationPatternNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1314 + def visit_alternation_pattern_node(node); end + + # Dispatch enter and leave events for AndNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1320 + def visit_and_node(node); end + + # Dispatch enter and leave events for ArgumentsNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1326 + def visit_arguments_node(node); end + + # Dispatch enter and leave events for ArrayNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1332 + def visit_array_node(node); end + + # Dispatch enter and leave events for ArrayPatternNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1338 + def visit_array_pattern_node(node); end + + # Dispatch enter and leave events for AssocNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1344 + def visit_assoc_node(node); end + + # Dispatch enter and leave events for AssocSplatNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1350 + def visit_assoc_splat_node(node); end + + # Dispatch enter and leave events for BackReferenceReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1356 + def visit_back_reference_read_node(node); end + + # Dispatch enter and leave events for BeginNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1362 + def visit_begin_node(node); end + + # Dispatch enter and leave events for BlockArgumentNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1368 + def visit_block_argument_node(node); end + + # Dispatch enter and leave events for BlockLocalVariableNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1374 + def visit_block_local_variable_node(node); end + + # Dispatch enter and leave events for BlockNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1380 + def visit_block_node(node); end + + # Dispatch enter and leave events for BlockParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1386 + def visit_block_parameter_node(node); end + + # Dispatch enter and leave events for BlockParametersNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1392 + def visit_block_parameters_node(node); end + + # Dispatch enter and leave events for BreakNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1398 + def visit_break_node(node); end + + # Dispatch enter and leave events for CallAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1404 + def visit_call_and_write_node(node); end + + # Dispatch enter and leave events for CallNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1410 + def visit_call_node(node); end + + # Dispatch enter and leave events for CallOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1416 + def visit_call_operator_write_node(node); end + + # Dispatch enter and leave events for CallOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1422 + def visit_call_or_write_node(node); end + + # Dispatch enter and leave events for CallTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1428 + def visit_call_target_node(node); end + + # Dispatch enter and leave events for CapturePatternNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1434 + def visit_capture_pattern_node(node); end + + # Dispatch enter and leave events for CaseMatchNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1440 + def visit_case_match_node(node); end + + # Dispatch enter and leave events for CaseNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1446 + def visit_case_node(node); end + + # Dispatch enter and leave events for ClassNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1452 + def visit_class_node(node); end + + # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1458 + def visit_class_variable_and_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1464 + def visit_class_variable_operator_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1470 + def visit_class_variable_or_write_node(node); end + + # Dispatch enter and leave events for ClassVariableReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1476 + def visit_class_variable_read_node(node); end + + # Dispatch enter and leave events for ClassVariableTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1482 + def visit_class_variable_target_node(node); end + + # Dispatch enter and leave events for ClassVariableWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1488 + def visit_class_variable_write_node(node); end + + # Dispatch enter and leave events for ConstantAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1494 + def visit_constant_and_write_node(node); end + + # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1500 + def visit_constant_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1506 + def visit_constant_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1512 + def visit_constant_path_and_write_node(node); end + + # Dispatch enter and leave events for ConstantPathNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1518 + def visit_constant_path_node(node); end + + # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1524 + def visit_constant_path_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1530 + def visit_constant_path_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1536 + def visit_constant_path_target_node(node); end + + # Dispatch enter and leave events for ConstantPathWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1542 + def visit_constant_path_write_node(node); end + + # Dispatch enter and leave events for ConstantReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1548 + def visit_constant_read_node(node); end + + # Dispatch enter and leave events for ConstantTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1554 + def visit_constant_target_node(node); end + + # Dispatch enter and leave events for ConstantWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1560 + def visit_constant_write_node(node); end + + # Dispatch enter and leave events for DefNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1566 + def visit_def_node(node); end + + # Dispatch enter and leave events for DefinedNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1572 + def visit_defined_node(node); end + + # Dispatch enter and leave events for ElseNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1578 + def visit_else_node(node); end + + # Dispatch enter and leave events for EmbeddedStatementsNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1584 + def visit_embedded_statements_node(node); end + + # Dispatch enter and leave events for EmbeddedVariableNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1590 + def visit_embedded_variable_node(node); end + + # Dispatch enter and leave events for EnsureNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1596 + def visit_ensure_node(node); end + + # Dispatch enter and leave events for FalseNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1602 + def visit_false_node(node); end + + # Dispatch enter and leave events for FindPatternNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1608 + def visit_find_pattern_node(node); end + + # Dispatch enter and leave events for FlipFlopNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1614 + def visit_flip_flop_node(node); end + + # Dispatch enter and leave events for FloatNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1620 + def visit_float_node(node); end + + # Dispatch enter and leave events for ForNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1626 + def visit_for_node(node); end + + # Dispatch enter and leave events for ForwardingArgumentsNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1632 + def visit_forwarding_arguments_node(node); end + + # Dispatch enter and leave events for ForwardingParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1638 + def visit_forwarding_parameter_node(node); end + + # Dispatch enter and leave events for ForwardingSuperNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1644 + def visit_forwarding_super_node(node); end + + # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1650 + def visit_global_variable_and_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1656 + def visit_global_variable_operator_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1662 + def visit_global_variable_or_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1668 + def visit_global_variable_read_node(node); end + + # Dispatch enter and leave events for GlobalVariableTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1674 + def visit_global_variable_target_node(node); end + + # Dispatch enter and leave events for GlobalVariableWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1680 + def visit_global_variable_write_node(node); end + + # Dispatch enter and leave events for HashNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1686 + def visit_hash_node(node); end + + # Dispatch enter and leave events for HashPatternNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1692 + def visit_hash_pattern_node(node); end + + # Dispatch enter and leave events for IfNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1698 + def visit_if_node(node); end + + # Dispatch enter and leave events for ImaginaryNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1704 + def visit_imaginary_node(node); end + + # Dispatch enter and leave events for ImplicitNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1710 + def visit_implicit_node(node); end + + # Dispatch enter and leave events for ImplicitRestNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1716 + def visit_implicit_rest_node(node); end + + # Dispatch enter and leave events for InNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1722 + def visit_in_node(node); end + + # Dispatch enter and leave events for IndexAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1728 + def visit_index_and_write_node(node); end + + # Dispatch enter and leave events for IndexOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1734 + def visit_index_operator_write_node(node); end + + # Dispatch enter and leave events for IndexOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1740 + def visit_index_or_write_node(node); end + + # Dispatch enter and leave events for IndexTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1746 + def visit_index_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1752 + def visit_instance_variable_and_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1758 + def visit_instance_variable_operator_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1764 + def visit_instance_variable_or_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1770 + def visit_instance_variable_read_node(node); end + + # Dispatch enter and leave events for InstanceVariableTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1776 + def visit_instance_variable_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1782 + def visit_instance_variable_write_node(node); end + + # Dispatch enter and leave events for IntegerNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1788 + def visit_integer_node(node); end + + # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1794 + def visit_interpolated_match_last_line_node(node); end + + # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1800 + def visit_interpolated_regular_expression_node(node); end + + # Dispatch enter and leave events for InterpolatedStringNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1806 + def visit_interpolated_string_node(node); end + + # Dispatch enter and leave events for InterpolatedSymbolNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1812 + def visit_interpolated_symbol_node(node); end + + # Dispatch enter and leave events for InterpolatedXStringNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1818 + def visit_interpolated_x_string_node(node); end + + # Dispatch enter and leave events for ItLocalVariableReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1824 + def visit_it_local_variable_read_node(node); end + + # Dispatch enter and leave events for ItParametersNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1830 + def visit_it_parameters_node(node); end + + # Dispatch enter and leave events for KeywordHashNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1836 + def visit_keyword_hash_node(node); end + + # Dispatch enter and leave events for KeywordRestParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1842 + def visit_keyword_rest_parameter_node(node); end + + # Dispatch enter and leave events for LambdaNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1848 + def visit_lambda_node(node); end + + # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1854 + def visit_local_variable_and_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1860 + def visit_local_variable_operator_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1866 + def visit_local_variable_or_write_node(node); end + + # Dispatch enter and leave events for LocalVariableReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1872 + def visit_local_variable_read_node(node); end + + # Dispatch enter and leave events for LocalVariableTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1878 + def visit_local_variable_target_node(node); end + + # Dispatch enter and leave events for LocalVariableWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1884 + def visit_local_variable_write_node(node); end + + # Dispatch enter and leave events for MatchLastLineNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1890 + def visit_match_last_line_node(node); end + + # Dispatch enter and leave events for MatchPredicateNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1896 + def visit_match_predicate_node(node); end + + # Dispatch enter and leave events for MatchRequiredNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1902 + def visit_match_required_node(node); end + + # Dispatch enter and leave events for MatchWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1908 + def visit_match_write_node(node); end + + # Dispatch enter and leave events for MissingNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1914 + def visit_missing_node(node); end + + # Dispatch enter and leave events for ModuleNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1920 + def visit_module_node(node); end + + # Dispatch enter and leave events for MultiTargetNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1926 + def visit_multi_target_node(node); end + + # Dispatch enter and leave events for MultiWriteNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1932 + def visit_multi_write_node(node); end + + # Dispatch enter and leave events for NextNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1938 + def visit_next_node(node); end + + # Dispatch enter and leave events for NilNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1944 + def visit_nil_node(node); end + + # Dispatch enter and leave events for NoKeywordsParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1950 + def visit_no_keywords_parameter_node(node); end + + # Dispatch enter and leave events for NumberedParametersNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1956 + def visit_numbered_parameters_node(node); end + + # Dispatch enter and leave events for NumberedReferenceReadNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1962 + def visit_numbered_reference_read_node(node); end + + # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1968 + def visit_optional_keyword_parameter_node(node); end + + # Dispatch enter and leave events for OptionalParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1974 + def visit_optional_parameter_node(node); end + + # Dispatch enter and leave events for OrNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1980 + def visit_or_node(node); end + + # Dispatch enter and leave events for ParametersNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1986 + def visit_parameters_node(node); end + + # Dispatch enter and leave events for ParenthesesNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1992 + def visit_parentheses_node(node); end + + # Dispatch enter and leave events for PinnedExpressionNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:1998 + def visit_pinned_expression_node(node); end + + # Dispatch enter and leave events for PinnedVariableNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2004 + def visit_pinned_variable_node(node); end + + # Dispatch enter and leave events for PostExecutionNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2010 + def visit_post_execution_node(node); end + + # Dispatch enter and leave events for PreExecutionNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2016 + def visit_pre_execution_node(node); end + + # Dispatch enter and leave events for ProgramNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2022 + def visit_program_node(node); end + + # Dispatch enter and leave events for RangeNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2028 + def visit_range_node(node); end + + # Dispatch enter and leave events for RationalNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2034 + def visit_rational_node(node); end + + # Dispatch enter and leave events for RedoNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2040 + def visit_redo_node(node); end + + # Dispatch enter and leave events for RegularExpressionNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2046 + def visit_regular_expression_node(node); end + + # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2052 + def visit_required_keyword_parameter_node(node); end + + # Dispatch enter and leave events for RequiredParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2058 + def visit_required_parameter_node(node); end + + # Dispatch enter and leave events for RescueModifierNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2064 + def visit_rescue_modifier_node(node); end + + # Dispatch enter and leave events for RescueNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2070 + def visit_rescue_node(node); end + + # Dispatch enter and leave events for RestParameterNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2076 + def visit_rest_parameter_node(node); end + + # Dispatch enter and leave events for RetryNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2082 + def visit_retry_node(node); end + + # Dispatch enter and leave events for ReturnNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2088 + def visit_return_node(node); end + + # Dispatch enter and leave events for SelfNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2094 + def visit_self_node(node); end + + # Dispatch enter and leave events for ShareableConstantNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2100 + def visit_shareable_constant_node(node); end + + # Dispatch enter and leave events for SingletonClassNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2106 + def visit_singleton_class_node(node); end + + # Dispatch enter and leave events for SourceEncodingNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2112 + def visit_source_encoding_node(node); end + + # Dispatch enter and leave events for SourceFileNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2118 + def visit_source_file_node(node); end + + # Dispatch enter and leave events for SourceLineNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2124 + def visit_source_line_node(node); end + + # Dispatch enter and leave events for SplatNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2130 + def visit_splat_node(node); end + + # Dispatch enter and leave events for StatementsNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2136 + def visit_statements_node(node); end + + # Dispatch enter and leave events for StringNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2142 + def visit_string_node(node); end + + # Dispatch enter and leave events for SuperNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2148 + def visit_super_node(node); end + + # Dispatch enter and leave events for SymbolNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2154 + def visit_symbol_node(node); end + + # Dispatch enter and leave events for TrueNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2160 + def visit_true_node(node); end + + # Dispatch enter and leave events for UndefNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2166 + def visit_undef_node(node); end + + # Dispatch enter and leave events for UnlessNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2172 + def visit_unless_node(node); end + + # Dispatch enter and leave events for UntilNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2178 + def visit_until_node(node); end + + # Dispatch enter and leave events for WhenNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2184 + def visit_when_node(node); end + + # Dispatch enter and leave events for WhileNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2190 + def visit_while_node(node); end + + # Dispatch enter and leave events for XStringNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2196 + def visit_x_string_node(node); end + + # Dispatch enter and leave events for YieldNode nodes. + # + # pkg:gem/prism#lib/prism/dispatcher.rb:2202 + def visit_yield_node(node); end +end + +# This visitor provides the ability to call Node#to_dot, which converts a +# subtree into a graphviz dot graph. +# +# pkg:gem/prism#lib/prism/dot_visitor.rb:18 +class Prism::DotVisitor < ::Prism::Visitor + # Initialize a new dot visitor. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:110 + def initialize; end + + # The digraph that is being built. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:107 + def digraph; end + + # Convert this visitor into a graphviz dot graph string. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:115 + def to_dot; end + + # Visit a AliasGlobalVariableNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:120 + def visit_alias_global_variable_node(node); end + + # Visit a AliasMethodNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:145 + def visit_alias_method_node(node); end + + # Visit a AlternationPatternNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:170 + def visit_alternation_pattern_node(node); end + + # Visit a AndNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:195 + def visit_and_node(node); end + + # Visit a ArgumentsNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:220 + def visit_arguments_node(node); end + + # Visit a ArrayNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:250 + def visit_array_node(node); end + + # Visit a ArrayPatternNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:290 + def visit_array_pattern_node(node); end + + # Visit a AssocNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:352 + def visit_assoc_node(node); end + + # Visit a AssocSplatNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:379 + def visit_assoc_splat_node(node); end + + # Visit a BackReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:402 + def visit_back_reference_read_node(node); end + + # Visit a BeginNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:419 + def visit_begin_node(node); end + + # Visit a BlockArgumentNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:467 + def visit_block_argument_node(node); end + + # Visit a BlockLocalVariableNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:490 + def visit_block_local_variable_node(node); end + + # Visit a BlockNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:510 + def visit_block_node(node); end + + # Visit a BlockParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:545 + def visit_block_parameter_node(node); end + + # Visit a BlockParametersNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:573 + def visit_block_parameters_node(node); end + + # Visit a BreakNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:616 + def visit_break_node(node); end + + # Visit a CallAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:639 + def visit_call_and_write_node(node); end + + # Visit a CallNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:685 + def visit_call_node(node); end + + # Visit a CallOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:748 + def visit_call_operator_write_node(node); end + + # Visit a CallOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:797 + def visit_call_or_write_node(node); end + + # Visit a CallTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:843 + def visit_call_target_node(node); end + + # Visit a CapturePatternNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:873 + def visit_capture_pattern_node(node); end + + # Visit a CaseMatchNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:898 + def visit_case_match_node(node); end + + # Visit a CaseNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:943 + def visit_case_node(node); end + + # Visit a ClassNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:988 + def visit_class_node(node); end + + # Visit a ClassVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1035 + def visit_class_variable_and_write_node(node); end + + # Visit a ClassVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1062 + def visit_class_variable_operator_write_node(node); end + + # Visit a ClassVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1092 + def visit_class_variable_or_write_node(node); end + + # Visit a ClassVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1119 + def visit_class_variable_read_node(node); end + + # Visit a ClassVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1136 + def visit_class_variable_target_node(node); end + + # Visit a ClassVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1153 + def visit_class_variable_write_node(node); end + + # Visit a ConstantAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1180 + def visit_constant_and_write_node(node); end + + # Visit a ConstantOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1207 + def visit_constant_operator_write_node(node); end + + # Visit a ConstantOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1237 + def visit_constant_or_write_node(node); end + + # Visit a ConstantPathAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1264 + def visit_constant_path_and_write_node(node); end + + # Visit a ConstantPathNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1289 + def visit_constant_path_node(node); end + + # Visit a ConstantPathOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1318 + def visit_constant_path_operator_write_node(node); end + + # Visit a ConstantPathOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1346 + def visit_constant_path_or_write_node(node); end + + # Visit a ConstantPathTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1371 + def visit_constant_path_target_node(node); end + + # Visit a ConstantPathWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1400 + def visit_constant_path_write_node(node); end + + # Visit a ConstantReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1425 + def visit_constant_read_node(node); end + + # Visit a ConstantTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1442 + def visit_constant_target_node(node); end + + # Visit a ConstantWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1459 + def visit_constant_write_node(node); end + + # Visit a DefNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1486 + def visit_def_node(node); end + + # Visit a DefinedNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1555 + def visit_defined_node(node); end + + # Visit a ElseNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1586 + def visit_else_node(node); end + + # Visit a EmbeddedStatementsNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1614 + def visit_embedded_statements_node(node); end + + # Visit a EmbeddedVariableNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1640 + def visit_embedded_variable_node(node); end + + # Visit a EnsureNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1661 + def visit_ensure_node(node); end + + # Visit a FalseNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1687 + def visit_false_node(node); end + + # Visit a FindPatternNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1701 + def visit_find_pattern_node(node); end + + # Visit a FlipFlopNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1752 + def visit_flip_flop_node(node); end + + # Visit a FloatNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1784 + def visit_float_node(node); end + + # Visit a ForNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1801 + def visit_for_node(node); end + + # Visit a ForwardingArgumentsNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1843 + def visit_forwarding_arguments_node(node); end + + # Visit a ForwardingParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1857 + def visit_forwarding_parameter_node(node); end + + # Visit a ForwardingSuperNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1871 + def visit_forwarding_super_node(node); end + + # Visit a GlobalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1891 + def visit_global_variable_and_write_node(node); end + + # Visit a GlobalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1918 + def visit_global_variable_operator_write_node(node); end + + # Visit a GlobalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1948 + def visit_global_variable_or_write_node(node); end + + # Visit a GlobalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1975 + def visit_global_variable_read_node(node); end + + # Visit a GlobalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:1992 + def visit_global_variable_target_node(node); end + + # Visit a GlobalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2009 + def visit_global_variable_write_node(node); end + + # Visit a HashNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2036 + def visit_hash_node(node); end + + # Visit a HashPatternNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2069 + def visit_hash_pattern_node(node); end + + # Visit a IfNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2118 + def visit_if_node(node); end + + # Visit a ImaginaryNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2163 + def visit_imaginary_node(node); end + + # Visit a ImplicitNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2181 + def visit_implicit_node(node); end + + # Visit a ImplicitRestNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2199 + def visit_implicit_rest_node(node); end + + # Visit a InNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2213 + def visit_in_node(node); end + + # Visit a IndexAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2245 + def visit_index_and_write_node(node); end + + # Visit a IndexOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2298 + def visit_index_operator_write_node(node); end + + # Visit a IndexOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2354 + def visit_index_or_write_node(node); end + + # Visit a IndexTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2407 + def visit_index_target_node(node); end + + # Visit a InstanceVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2446 + def visit_instance_variable_and_write_node(node); end + + # Visit a InstanceVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2473 + def visit_instance_variable_operator_write_node(node); end + + # Visit a InstanceVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2503 + def visit_instance_variable_or_write_node(node); end + + # Visit a InstanceVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2530 + def visit_instance_variable_read_node(node); end + + # Visit a InstanceVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2547 + def visit_instance_variable_target_node(node); end + + # Visit a InstanceVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2564 + def visit_instance_variable_write_node(node); end + + # Visit a IntegerNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2591 + def visit_integer_node(node); end + + # Visit a InterpolatedMatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2611 + def visit_interpolated_match_last_line_node(node); end + + # Visit a InterpolatedRegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2647 + def visit_interpolated_regular_expression_node(node); end + + # Visit a InterpolatedStringNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2683 + def visit_interpolated_string_node(node); end + + # Visit a InterpolatedSymbolNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2723 + def visit_interpolated_symbol_node(node); end + + # Visit a InterpolatedXStringNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2760 + def visit_interpolated_x_string_node(node); end + + # Visit a ItLocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2793 + def visit_it_local_variable_read_node(node); end + + # Visit a ItParametersNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2807 + def visit_it_parameters_node(node); end + + # Visit a KeywordHashNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2821 + def visit_keyword_hash_node(node); end + + # Visit a KeywordRestParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2851 + def visit_keyword_rest_parameter_node(node); end + + # Visit a LambdaNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2879 + def visit_lambda_node(node); end + + # Visit a LocalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2917 + def visit_local_variable_and_write_node(node); end + + # Visit a LocalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2947 + def visit_local_variable_operator_write_node(node); end + + # Visit a LocalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:2980 + def visit_local_variable_or_write_node(node); end + + # Visit a LocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3010 + def visit_local_variable_read_node(node); end + + # Visit a LocalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3030 + def visit_local_variable_target_node(node); end + + # Visit a LocalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3050 + def visit_local_variable_write_node(node); end + + # Visit a MatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3080 + def visit_match_last_line_node(node); end + + # Visit a MatchPredicateNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3109 + def visit_match_predicate_node(node); end + + # Visit a MatchRequiredNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3134 + def visit_match_required_node(node); end + + # Visit a MatchWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3159 + def visit_match_write_node(node); end + + # Visit a MissingNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3190 + def visit_missing_node(node); end + + # Visit a ModuleNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3204 + def visit_module_node(node); end + + # Visit a MultiTargetNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3240 + def visit_multi_target_node(node); end + + # Visit a MultiWriteNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3296 + def visit_multi_write_node(node); end + + # Visit a NextNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3359 + def visit_next_node(node); end + + # Visit a NilNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3382 + def visit_nil_node(node); end + + # Visit a NoKeywordsParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3396 + def visit_no_keywords_parameter_node(node); end + + # Visit a NumberedParametersNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3416 + def visit_numbered_parameters_node(node); end + + # Visit a NumberedReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3433 + def visit_numbered_reference_read_node(node); end + + # Visit a OptionalKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3450 + def visit_optional_keyword_parameter_node(node); end + + # Visit a OptionalParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3477 + def visit_optional_parameter_node(node); end + + # Visit a OrNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3507 + def visit_or_node(node); end + + # Visit a ParametersNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3532 + def visit_parameters_node(node); end + + # Visit a ParenthesesNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3616 + def visit_parentheses_node(node); end + + # Visit a PinnedExpressionNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3645 + def visit_pinned_expression_node(node); end + + # Visit a PinnedVariableNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3672 + def visit_pinned_variable_node(node); end + + # Visit a PostExecutionNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3693 + def visit_post_execution_node(node); end + + # Visit a PreExecutionNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3722 + def visit_pre_execution_node(node); end + + # Visit a ProgramNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3751 + def visit_program_node(node); end + + # Visit a RangeNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3772 + def visit_range_node(node); end + + # Visit a RationalNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3804 + def visit_rational_node(node); end + + # Visit a RedoNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3827 + def visit_redo_node(node); end + + # Visit a RegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3841 + def visit_regular_expression_node(node); end + + # Visit a RequiredKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3870 + def visit_required_keyword_parameter_node(node); end + + # Visit a RequiredParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3893 + def visit_required_parameter_node(node); end + + # Visit a RescueModifierNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3913 + def visit_rescue_modifier_node(node); end + + # Visit a RescueNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3938 + def visit_rescue_node(node); end + + # Visit a RestParameterNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:3996 + def visit_rest_parameter_node(node); end + + # Visit a RetryNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4024 + def visit_retry_node(node); end + + # Visit a ReturnNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4038 + def visit_return_node(node); end + + # Visit a SelfNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4061 + def visit_self_node(node); end + + # Visit a ShareableConstantNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4075 + def visit_shareable_constant_node(node); end + + # Visit a SingletonClassNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4096 + def visit_singleton_class_node(node); end + + # Visit a SourceEncodingNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4132 + def visit_source_encoding_node(node); end + + # Visit a SourceFileNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4146 + def visit_source_file_node(node); end + + # Visit a SourceLineNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4166 + def visit_source_line_node(node); end + + # Visit a SplatNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4180 + def visit_splat_node(node); end + + # Visit a StatementsNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4203 + def visit_statements_node(node); end + + # Visit a StringNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4230 + def visit_string_node(node); end + + # Visit a SuperNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4263 + def visit_super_node(node); end + + # Visit a SymbolNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4302 + def visit_symbol_node(node); end + + # Visit a TrueNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4337 + def visit_true_node(node); end + + # Visit a UndefNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4351 + def visit_undef_node(node); end + + # Visit a UnlessNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4381 + def visit_unless_node(node); end + + # Visit a UntilNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4424 + def visit_until_node(node); end + + # Visit a WhenNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4464 + def visit_when_node(node); end + + # Visit a WhileNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4505 + def visit_while_node(node); end + + # Visit a XStringNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4545 + def visit_x_string_node(node); end + + # Visit a YieldNode node. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4574 + def visit_yield_node(node); end + + private + + # Inspect a node that has arguments_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4620 + def arguments_node_flags_inspect(node); end + + # Inspect a node that has array_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4632 + def array_node_flags_inspect(node); end + + # Inspect a node that has call_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4640 + def call_node_flags_inspect(node); end + + # Inspect a node that has encoding_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4651 + def encoding_flags_inspect(node); end + + # Inspect a node that has integer_base_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4660 + def integer_base_flags_inspect(node); end + + # Inspect a node that has interpolated_string_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4671 + def interpolated_string_node_flags_inspect(node); end + + # Inspect a node that has keyword_hash_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4680 + def keyword_hash_node_flags_inspect(node); end + + # Inspect a location to display the start and end line and column numbers. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4614 + def location_inspect(location); end + + # Inspect a node that has loop_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4688 + def loop_flags_inspect(node); end + + # Generate a unique node ID for a node throughout the digraph. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4609 + def node_id(node); end + + # Inspect a node that has parameter_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4696 + def parameter_flags_inspect(node); end + + # Inspect a node that has parentheses_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4704 + def parentheses_node_flags_inspect(node); end + + # Inspect a node that has range_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4712 + def range_flags_inspect(node); end + + # Inspect a node that has regular_expression_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4720 + def regular_expression_flags_inspect(node); end + + # Inspect a node that has shareable_constant_node_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4738 + def shareable_constant_node_flags_inspect(node); end + + # Inspect a node that has string_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4748 + def string_flags_inspect(node); end + + # Inspect a node that has symbol_flags flags to display the flags as a + # comma-separated list. + # + # pkg:gem/prism#lib/prism/dot_visitor.rb:4759 + def symbol_flags_inspect(node); end +end + +# pkg:gem/prism#lib/prism/dot_visitor.rb:63 +class Prism::DotVisitor::Digraph + # pkg:gem/prism#lib/prism/dot_visitor.rb:66 + def initialize; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:80 + def edge(value); end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:64 + def edges; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:72 + def node(value); end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:64 + def nodes; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:84 + def to_dot; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:76 + def waypoint(value); end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:64 + def waypoints; end +end + +# pkg:gem/prism#lib/prism/dot_visitor.rb:19 +class Prism::DotVisitor::Field + # pkg:gem/prism#lib/prism/dot_visitor.rb:22 + def initialize(name, value, port); end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:20 + def name; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:20 + def port; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:28 + def to_dot; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:20 + def value; end +end + +# pkg:gem/prism#lib/prism/dot_visitor.rb:37 +class Prism::DotVisitor::Table + # pkg:gem/prism#lib/prism/dot_visitor.rb:40 + def initialize(name); end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:45 + def field(name, value = T.unsafe(nil), port: T.unsafe(nil)); end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:38 + def fields; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:38 + def name; end + + # pkg:gem/prism#lib/prism/dot_visitor.rb:49 + def to_dot; end +end + +# Represents an `else` clause in a `case`, `if`, or `unless` statement. +# +# if a then b else c end +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6717 +class Prism::ElseNode < ::Prism::Node + # Initialize a new ElseNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6719 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6833 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6730 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6735 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6754 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6747 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode + # + # pkg:gem/prism#lib/prism/node.rb:6759 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::ElseNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, else_keyword_loc: self.else_keyword_loc, statements: self.statements, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6764 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:6767 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6740 + def each_child_node; end + + # def else_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:6807 + sig { returns(String) } + def else_keyword; end + + # attr_reader else_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:6772 + sig { returns(Prism::Location) } + def else_keyword_loc; end + + # def end_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:6812 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:6788 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6817 + sig { override.returns(String) } + def inspect; end + + # Save the else_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6780 + def save_else_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6802 + def save_end_keyword_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:6785 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6822 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6827 + def type; end + end +end + +# EmbDocComment objects correspond to comments that are surrounded by =begin +# and =end. +# +# pkg:gem/prism#lib/prism/parse_result.rb:558 +class Prism::EmbDocComment < ::Prism::Comment + # Returns a string representation of this comment. + # + # pkg:gem/prism#lib/prism/parse_result.rb:565 + sig { returns(String) } + def inspect; end + + # This can only be true for inline comments. + # + # pkg:gem/prism#lib/prism/parse_result.rb:560 + sig { override.returns(T::Boolean) } + def trailing?; end +end + +# Represents an interpolated set of statements. +# +# "foo #{bar}" +# ^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6845 +class Prism::EmbeddedStatementsNode < ::Prism::Node + # Initialize a new EmbeddedStatementsNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6847 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, opening_loc, statements, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:6955 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6858 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6863 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:6934 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:6916 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:6882 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6875 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode + # + # pkg:gem/prism#lib/prism/node.rb:6887 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location + ).returns(Prism::EmbeddedStatementsNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, statements: self.statements, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6892 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, statements: StatementsNode?, closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:6895 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6868 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:6939 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:6929 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:6900 + sig { returns(Prism::Location) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6924 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:6908 + def save_opening_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:6913 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:6944 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:6949 + def type; end + end +end + +# Represents an interpolated variable. +# +# "foo #@bar" +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:6967 +class Prism::EmbeddedVariableNode < ::Prism::Node + # Initialize a new EmbeddedVariableNode node. + # + # pkg:gem/prism#lib/prism/node.rb:6969 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + variable: T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode) + ).void + end + def initialize(source, node_id, location, flags, operator_loc, variable); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7056 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:6979 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:6984 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7001 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:6996 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) -> EmbeddedVariableNode + # + # pkg:gem/prism#lib/prism/node.rb:7006 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + variable: T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode) + ).returns(Prism::EmbeddedVariableNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, operator_loc: self.operator_loc, variable: self.variable); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7011 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode } + # + # pkg:gem/prism#lib/prism/node.rb:7014 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:6989 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7040 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7035 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:7019 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7027 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7045 + sig { override.returns(Symbol) } + def type; end + + # attr_reader variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode + # + # pkg:gem/prism#lib/prism/node.rb:7032 + sig do + returns(T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)) + end + def variable; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7050 + def type; end + end +end + +# Flags for nodes that have unescaped content. +# +# pkg:gem/prism#lib/prism/node.rb:19819 +module Prism::EncodingFlags; end + +# internal bytes forced the encoding to binary +# +# pkg:gem/prism#lib/prism/node.rb:19824 +Prism::EncodingFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# pkg:gem/prism#lib/prism/node.rb:19821 +Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# Represents an `ensure` clause in a `begin` statement. +# +# begin +# foo +# ensure +# ^^^^^^ +# bar +# end +# +# pkg:gem/prism#lib/prism/node.rb:7071 +class Prism::EnsureNode < ::Prism::Node + # Initialize a new EnsureNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7073 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7181 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7084 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7089 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7108 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7101 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode + # + # pkg:gem/prism#lib/prism/node.rb:7113 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location + ).returns(Prism::EnsureNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, ensure_keyword_loc: self.ensure_keyword_loc, statements: self.statements, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7118 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:7121 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7094 + def each_child_node; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7160 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:7142 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + # def ensure_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7155 + sig { returns(String) } + def ensure_keyword; end + + # attr_reader ensure_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:7126 + sig { returns(Prism::Location) } + def ensure_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7165 + sig { override.returns(String) } + def inspect; end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7150 + def save_end_keyword_loc(repository); end + + # Save the ensure_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7134 + def save_ensure_keyword_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:7139 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7170 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7175 + def type; end + end +end + +# Represents the use of the literal `false` keyword. +# +# false +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:7193 +class Prism::FalseNode < ::Prism::Node + # Initialize a new FalseNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7195 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7258 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7203 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7208 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7224 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7219 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode + # + # pkg:gem/prism#lib/prism/node.rb:7229 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::FalseNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7234 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:7237 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7213 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7242 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7247 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7252 + def type; end + end +end + +# Represents a find pattern in pattern matching. +# +# foo in *bar, baz, *qux +# ^^^^^^^^^^^^^^^ +# +# foo in [*bar, baz, *qux] +# ^^^^^^^^^^^^^^^^^ +# +# foo in Foo(*bar, baz, *qux) +# ^^^^^^^^^^^^^^^^^^^^ +# +# foo => *bar, baz, *qux +# ^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:7276 +class Prism::FindPatternNode < ::Prism::Node + # Initialize a new FindPatternNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7278 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + left: Prism::SplatNode, + requireds: T::Array[Prism::Node], + right: T.any(Prism::SplatNode, Prism::MissingNode), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7449 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7292 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:7428 + sig { returns(T.nilable(String)) } + def closing; end + + # The location of the closing brace. + # + # foo in [*bar, baz, *qux] + # ^ + # + # foo in Foo(*bar, baz, *qux) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:7404 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7322 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7312 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Represents the optional constant preceding the pattern + # + # foo in Foo(*bar, baz, *qux) + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:7343 + sig { returns(T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode))) } + def constant; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantPathNode | ConstantReadNode | nil, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: SplatNode | MissingNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode + # + # pkg:gem/prism#lib/prism/node.rb:7327 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + left: Prism::SplatNode, + requireds: T::Array[Prism::Node], + right: T.any(Prism::SplatNode, Prism::MissingNode), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::FindPatternNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, constant: self.constant, left: self.left, requireds: self.requireds, right: self.right, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7332 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantPathNode | ConstantReadNode | nil, left: SplatNode, requireds: Array[Prism::node], right: SplatNode | MissingNode, opening_loc: Location?, closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:7335 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7302 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7433 + sig { override.returns(String) } + def inspect; end + + # Represents the first wildcard node in the pattern. + # + # foo in *bar, baz, *qux + # ^^^^ + # + # foo in Foo(*bar, baz, *qux) + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:7352 + sig { returns(Prism::SplatNode) } + def left; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:7423 + sig { returns(T.nilable(String)) } + def opening; end + + # The location of the opening brace. + # + # foo in [*bar, baz, *qux] + # ^ + # + # foo in Foo(*bar, baz, *qux) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:7379 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Represents the nodes in between the wildcards. + # + # foo in *bar, baz, *qux + # ^^^ + # + # foo in Foo(*bar, baz, 1, *qux) + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:7361 + sig { returns(T::Array[Prism::Node]) } + def requireds; end + + # Represents the second wildcard node in the pattern. + # + # foo in *bar, baz, *qux + # ^^^^ + # + # foo in Foo(*bar, baz, *qux) + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:7370 + sig { returns(T.any(Prism::SplatNode, Prism::MissingNode)) } + def right; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7418 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7393 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7438 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7443 + def type; end + end +end + +# Represents the use of the `..` or `...` operators to create flip flops. +# +# baz if foo .. bar +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:7465 +class Prism::FlipFlopNode < ::Prism::Node + # Initialize a new FlipFlopNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7467 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, left, right, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7567 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7478 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7483 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7504 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7496 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode + # + # pkg:gem/prism#lib/prism/node.rb:7509 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::FlipFlopNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, left: self.left, right: self.right, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7514 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:7517 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7488 + def each_child_node; end + + # def exclude_end?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:7522 + sig { returns(T::Boolean) } + def exclude_end?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7551 + sig { override.returns(String) } + def inspect; end + + # attr_reader left: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:7527 + sig { returns(T.nilable(Prism::Node)) } + def left; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7546 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:7533 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader right: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:7530 + sig { returns(T.nilable(Prism::Node)) } + def right; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7541 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7556 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7561 + def type; end + end +end + +# Represents a floating point number literal. +# +# 1.0 +# ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:7580 +class Prism::FloatNode < ::Prism::Node + # Initialize a new FloatNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7582 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, value: Float).void } + def initialize(source, node_id, location, flags, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7649 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7591 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7596 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7612 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7607 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode + # + # pkg:gem/prism#lib/prism/node.rb:7617 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer, value: Float).returns(Prism::FloatNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7622 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Float } + # + # pkg:gem/prism#lib/prism/node.rb:7625 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7601 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7633 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7638 + sig { override.returns(Symbol) } + def type; end + + # The value of the floating point number as a Float. + # + # pkg:gem/prism#lib/prism/node.rb:7630 + sig { returns(Float) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7643 + def type; end + end +end + +# Represents the use of the `for` keyword. +# +# for i in a end +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:7659 +class Prism::ForNode < ::Prism::Node + # Initialize a new ForNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7661 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + index: T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode), + collection: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + for_keyword_loc: Prism::Location, + in_keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + end_keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7848 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7676 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7681 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # The collection to iterate over. + # + # for i in a end + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:7731 + sig { returns(Prism::Node) } + def collection; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7704 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7695 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode + # + # pkg:gem/prism#lib/prism/node.rb:7709 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + index: T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode), + collection: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + for_keyword_loc: Prism::Location, + in_keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + end_keyword_loc: Prism::Location + ).returns(Prism::ForNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, index: self.index, collection: self.collection, statements: self.statements, for_keyword_loc: self.for_keyword_loc, in_keyword_loc: self.in_keyword_loc, do_keyword_loc: self.do_keyword_loc, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:7717 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def do_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:7822 + sig { returns(T.nilable(String)) } + def do_keyword; end + + # The location of the `do` keyword, if present. + # + # for i in a do end + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:7777 + sig { returns(T.nilable(Prism::Location)) } + def do_keyword_loc; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7686 + def each_child_node; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7827 + sig { returns(String) } + def end_keyword; end + + # The location of the `end` keyword. + # + # for i in a end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:7799 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def for_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7812 + sig { returns(String) } + def for_keyword; end + + # The location of the `for` keyword. + # + # for i in a end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:7745 + sig { returns(Prism::Location) } + def for_keyword_loc; end + + # def in_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:7817 + sig { returns(String) } + def in_keyword; end + + # The location of the `in` keyword. + # + # for i in a end + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:7761 + sig { returns(Prism::Location) } + def in_keyword_loc; end + + # The index expression for `for` loops. + # + # for i in a end + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:7725 + sig do + returns(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)) + end + def index; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7832 + sig { override.returns(String) } + def inspect; end + + # Save the do_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7791 + def save_do_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7807 + def save_end_keyword_loc(repository); end + + # Save the for_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7753 + def save_for_keyword_loc(repository); end + + # Save the in_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:7769 + def save_in_keyword_loc(repository); end + + # Represents the body of statements to execute for each iteration of the loop. + # + # for i in a + # foo(i) + # ^^^^^^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:7739 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7837 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7842 + def type; end + end +end + +# Represents forwarding all arguments to this method to another method. +# +# def foo(...) +# bar(...) +# ^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:7866 +class Prism::ForwardingArgumentsNode < ::Prism::Node + # Initialize a new ForwardingArgumentsNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7868 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:7931 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7876 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7881 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7897 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7892 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode + # + # pkg:gem/prism#lib/prism/node.rb:7902 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ForwardingArgumentsNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7907 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:7910 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7886 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7915 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7920 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:7925 + def type; end + end +end + +# Represents the use of the forwarding parameter in a method, block, or lambda declaration. +# +# def foo(...) +# ^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:7941 +class Prism::ForwardingParameterNode < ::Prism::Node + # Initialize a new ForwardingParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:7943 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8006 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:7951 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7956 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:7972 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:7967 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:7977 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ForwardingParameterNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:7982 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:7985 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:7961 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:7990 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:7995 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8000 + def type; end + end +end + +# Represents the use of the `super` keyword without parentheses or arguments, but which might have a block. +# +# super +# ^^^^^ +# +# super { 123 } +# ^^^^^^^^^^^^^ +# +# If it has any other arguments, it would be a `SuperNode` instead. +# +# pkg:gem/prism#lib/prism/node.rb:8020 +class Prism::ForwardingSuperNode < ::Prism::Node + # Initialize a new ForwardingSuperNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8022 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + block: T.nilable(Prism::BlockNode) + ).void + end + def initialize(source, node_id, location, flags, block); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8092 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8031 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # All other arguments are forwarded as normal, except the original block is replaced with the new block. + # + # pkg:gem/prism#lib/prism/node.rb:8073 + sig { returns(T.nilable(Prism::BlockNode)) } + def block; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8036 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8055 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8048 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode + # + # pkg:gem/prism#lib/prism/node.rb:8060 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + block: T.nilable(Prism::BlockNode) + ).returns(Prism::ForwardingSuperNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, block: self.block); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8065 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, block: BlockNode? } + # + # pkg:gem/prism#lib/prism/node.rb:8068 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8041 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8076 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8081 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8086 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a global variable. +# +# $target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8102 +class Prism::GlobalVariableAndWriteNode < ::Prism::Node + # Initialize a new GlobalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8104 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8209 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8116 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8121 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8138 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8133 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:8143 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::GlobalVariableAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8148 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:8151 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:201 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8126 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8193 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:8156 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:8159 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:8188 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:8172 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8167 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8180 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8198 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:8185 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8203 + def type; end + end +end + +# Represents assigning to a global variable using an operator that isn't `=`. +# +# $target += value +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8222 +class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node + # Initialize a new GlobalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8224 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8328 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8237 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:8309 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:8293 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8242 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8259 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8254 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:8264 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::GlobalVariableOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8269 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:8272 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:213 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8247 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8312 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:8277 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:8280 + sig { returns(Prism::Location) } + def name_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:406 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:413 + def operator_loc; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8301 + def save_binary_operator_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8288 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8317 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:8306 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8322 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a global variable. +# +# $target ||= value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8342 +class Prism::GlobalVariableOrWriteNode < ::Prism::Node + # Initialize a new GlobalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8344 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8449 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8356 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8361 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8378 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8373 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:8383 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::GlobalVariableOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8388 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:8391 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:207 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8366 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8433 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:8396 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:8399 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:8428 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:8412 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8407 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8420 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8438 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:8425 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8443 + def type; end + end +end + +# Represents referencing a global variable. +# +# $foo +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8462 +class Prism::GlobalVariableReadNode < ::Prism::Node + # Initialize a new GlobalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8464 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8535 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8473 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8478 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8494 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8489 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode + # + # pkg:gem/prism#lib/prism/node.rb:8499 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::GlobalVariableReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8504 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:8507 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8483 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8519 + sig { override.returns(String) } + def inspect; end + + # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. + # + # $foo # name `:$foo` + # + # $_Test # name `:$_Test` + # + # pkg:gem/prism#lib/prism/node.rb:8516 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8524 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8529 + def type; end + end +end + +# Represents writing to a global variable in a context that doesn't have an explicit value. +# +# $foo, $bar = baz +# ^^^^ ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8545 +class Prism::GlobalVariableTargetNode < ::Prism::Node + # Initialize a new GlobalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8547 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8614 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8556 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8561 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8577 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8572 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:8582 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::GlobalVariableTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8587 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:8590 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8566 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8598 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:8595 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8603 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8608 + def type; end + end +end + +# Represents writing to a global variable. +# +# $foo = 1 +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8624 +class Prism::GlobalVariableWriteNode < ::Prism::Node + # Initialize a new GlobalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8626 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8747 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8638 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8643 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8660 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8655 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:8665 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::GlobalVariableWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8670 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:8673 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8648 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8731 + sig { override.returns(String) } + def inspect; end + + # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. + # + # $foo = :bar # name `:$foo` + # + # $_Test = 123 # name `:$_Test` + # + # pkg:gem/prism#lib/prism/node.rb:8682 + sig { returns(Symbol) } + def name; end + + # The location of the global variable's name. + # + # $foo = :bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:8688 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:8726 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # $foo = :bar + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:8713 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8696 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8721 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8736 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # $foo = :bar + # ^^^^ + # + # $-xyz = 123 + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:8707 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8741 + def type; end + end +end + +# Represents a hash literal. +# +# { a => b } +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8760 +class Prism::HashNode < ::Prism::Node + # Initialize a new HashNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8762 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, opening_loc, elements, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:8880 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8773 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8778 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:8859 + sig { returns(String) } + def closing; end + + # The location of the closing brace. + # + # { a => b } + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:8841 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8795 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8790 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode + # + # pkg:gem/prism#lib/prism/node.rb:8800 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location + ).returns(Prism::HashNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, elements: self.elements, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8805 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:8808 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8783 + def each_child_node; end + + # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. + # + # { a: b } + # ^^^^ + # + # { **foo } + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:8835 + sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } + def elements; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:8864 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:8854 + sig { returns(String) } + def opening; end + + # The location of the opening brace. + # + # { a => b } + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:8816 + sig { returns(Prism::Location) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8849 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:8824 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:8869 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:8874 + def type; end + end +end + +# Represents a hash pattern in pattern matching. +# +# foo => { a: 1, b: 2 } +# ^^^^^^^^^^^^^^ +# +# foo => { a: 1, b: 2, **c } +# ^^^^^^^^^^^^^^^^^^^ +# +# foo => Bar[a: 1, b: 2] +# ^^^^^^^^^^^^^^^ +# +# foo in { a: 1, b: 2 } +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:8902 +class Prism::HashPatternNode < ::Prism::Node + # Initialize a new HashPatternNode node. + # + # pkg:gem/prism#lib/prism/node.rb:8904 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + elements: T::Array[Prism::AssocNode], + rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9066 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:8917 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8922 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9045 + sig { returns(T.nilable(String)) } + def closing; end + + # The location of the closing brace. + # + # foo => { a: 1 } + # ^ + # + # foo => Bar[a: 1] + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:9021 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:8945 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:8936 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Represents the optional constant preceding the Hash. + # + # foo => Bar[a: 1, b: 2] + # ^^^ + # + # foo => Bar::Baz[a: 1, b: 2] + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:8969 + sig { returns(T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode))) } + def constant; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantPathNode | ConstantReadNode | nil, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode + # + # pkg:gem/prism#lib/prism/node.rb:8950 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + constant: T.nilable(T.any(Prism::ConstantPathNode, Prism::ConstantReadNode)), + elements: T::Array[Prism::AssocNode], + rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::HashPatternNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, constant: self.constant, elements: self.elements, rest: self.rest, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:8955 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantPathNode | ConstantReadNode | nil, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:8958 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:8927 + def each_child_node; end + + # Represents the explicit named hash keys and values. + # + # foo => { a: 1, b:, ** } + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:8975 + sig { returns(T::Array[Prism::AssocNode]) } + def elements; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9050 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9040 + sig { returns(T.nilable(String)) } + def opening; end + + # The location of the opening brace. + # + # foo => { a: 1 } + # ^ + # + # foo => Bar[a: 1] + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:8996 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`. + # + # foo => { a: 1, b:, **c } + # ^^^ + # + # foo => { a: 1, b:, ** } + # ^^ + # + # foo => { a: 1, b:, **nil } + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:8987 + sig { returns(T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode))) } + def rest; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9035 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9010 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9055 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9060 + def type; end + end +end + +# pkg:gem/prism#lib/prism/node_ext.rb:55 +module Prism::HeredocQuery + # Returns true if this node was represented as a heredoc in the source code. + # + # pkg:gem/prism#lib/prism/node_ext.rb:57 + def heredoc?; end +end + +# Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression. +# +# bar if foo +# ^^^^^^^^^^ +# +# if foo then bar end +# ^^^^^^^^^^^^^^^^^^^ +# +# foo ? bar : baz +# ^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:9087 +class Prism::IfNode < ::Prism::Node + # Initialize a new IfNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9089 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)), + end_keyword_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9292 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9103 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9108 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9131 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9122 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Returns the subsequent if/elsif/else clause of the if node. This method is + # deprecated in favor of #subsequent. + # + # pkg:gem/prism#lib/prism/node_ext.rb:488 + def consequent; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: ElseNode | IfNode | nil, ?end_keyword_loc: Location?) -> IfNode + # + # pkg:gem/prism#lib/prism/node.rb:9136 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::IfNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, if_keyword_loc: self.if_keyword_loc, predicate: self.predicate, then_keyword_loc: self.then_keyword_loc, statements: self.statements, subsequent: self.subsequent, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9141 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, subsequent: ElseNode | IfNode | nil, end_keyword_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:9144 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9113 + def each_child_node; end + + # def end_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9271 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # The location of the `end` keyword if present, `nil` otherwise. + # + # if foo + # bar + # end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:9242 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def if_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9261 + sig { returns(T.nilable(String)) } + def if_keyword; end + + # The location of the `if` keyword if present. + # + # bar if foo + # ^^ + # + # The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. + # + # pkg:gem/prism#lib/prism/node.rb:9154 + sig { returns(T.nilable(Prism::Location)) } + def if_keyword_loc; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9276 + sig { override.returns(String) } + def inspect; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:92 + def newline_flag!(lines); end + + # The node for the condition the `IfNode` is testing. + # + # if foo + # ^^^ + # bar + # end + # + # bar if foo + # ^^^ + # + # foo ? bar : baz + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:9184 + sig { returns(Prism::Node) } + def predicate; end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9256 + def save_end_keyword_loc(repository); end + + # Save the if_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9168 + def save_if_keyword_loc(repository); end + + # Save the then_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9207 + def save_then_keyword_loc(repository); end + + # Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. + # + # if foo + # bar + # ^^^ + # baz + # ^^^ + # end + # + # pkg:gem/prism#lib/prism/node.rb:9219 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. + # + # if foo + # bar + # elsif baz + # ^^^^^^^^^ + # qux + # ^^^ + # end + # ^^^ + # + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:9234 + sig { returns(T.nilable(T.any(Prism::ElseNode, Prism::IfNode))) } + def subsequent; end + + # def then_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9266 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. + # + # if foo then bar end + # ^^^^ + # + # a ? b : c + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:9193 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9281 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9286 + def type; end + end +end + +# Represents an imaginary number literal. +# +# 1.0i +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:9307 +class Prism::ImaginaryNode < ::Prism::Node + # Initialize a new ImaginaryNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9309 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode) + ).void + end + def initialize(source, node_id, location, flags, numeric); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9377 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9318 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9323 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9340 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9335 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode + # + # pkg:gem/prism#lib/prism/node.rb:9345 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode) + ).returns(Prism::ImaginaryNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, numeric: self.numeric); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9350 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numeric: FloatNode | IntegerNode | RationalNode } + # + # pkg:gem/prism#lib/prism/node.rb:9353 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9328 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9361 + sig { override.returns(String) } + def inspect; end + + # attr_reader numeric: FloatNode | IntegerNode | RationalNode + # + # pkg:gem/prism#lib/prism/node.rb:9358 + sig { returns(T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)) } + def numeric; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9366 + sig { override.returns(Symbol) } + def type; end + + # Returns the value of the node as a Ruby Complex. + # + # pkg:gem/prism#lib/prism/node_ext.rb:110 + sig { returns(Complex) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9371 + def type; end + end +end + +# Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source. +# +# { foo: } +# ^^^^ +# +# { Foo: } +# ^^^^ +# +# foo in { bar: } +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:9393 +class Prism::ImplicitNode < ::Prism::Node + # Initialize a new ImplicitNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9395 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode) + ).void + end + def initialize(source, node_id, location, flags, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9463 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9404 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9426 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9421 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) -> ImplicitNode + # + # pkg:gem/prism#lib/prism/node.rb:9431 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode) + ).returns(Prism::ImplicitNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9436 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode } + # + # pkg:gem/prism#lib/prism/node.rb:9439 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9414 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9447 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9452 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:9444 + sig do + returns(T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode)) + end + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9457 + def type; end + end +end + +# Represents using a trailing comma to indicate an implicit rest parameter. +# +# foo { |bar,| } +# ^ +# +# foo in [bar,] +# ^ +# +# for foo, in bar do end +# ^ +# +# foo, = bar +# ^ +# +# pkg:gem/prism#lib/prism/node.rb:9482 +class Prism::ImplicitRestNode < ::Prism::Node + # Initialize a new ImplicitRestNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9484 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9547 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9492 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9497 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9513 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9508 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode + # + # pkg:gem/prism#lib/prism/node.rb:9518 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ImplicitRestNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9523 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:9526 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9502 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9531 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9536 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9541 + def type; end + end +end + +# Represents the use of the `in` keyword in a case statement. +# +# case a; in b then c end +# ^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:9556 +class Prism::InNode < ::Prism::Node + # Initialize a new InNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9558 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, pattern, statements, in_loc, then_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9678 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9570 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9575 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9596 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9588 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode + # + # pkg:gem/prism#lib/prism/node.rb:9601 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location) + ).returns(Prism::InNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, pattern: self.pattern, statements: self.statements, in_loc: self.in_loc, then_loc: self.then_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9606 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:9609 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9580 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def in: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:9652 + sig { returns(String) } + def in; end + + # attr_reader in_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:9620 + sig { returns(Prism::Location) } + def in_loc; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9662 + sig { override.returns(String) } + def inspect; end + + # attr_reader pattern: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:9614 + sig { returns(Prism::Node) } + def pattern; end + + # Save the in_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9628 + def save_in_loc(repository); end + + # Save the then_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9647 + def save_then_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:9617 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9657 + sig { returns(T.nilable(String)) } + def then; end + + # attr_reader then_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:9633 + sig { returns(T.nilable(Prism::Location)) } + def then_loc; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9667 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9672 + def type; end + end +end + +# Represents the use of the `&&=` operator on a call to the `[]` method. +# +# foo.bar[baz] &&= value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:9691 +class Prism::IndexAndWriteNode < ::Prism::Node + # Initialize a new IndexAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9693 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:9883 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9709 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:9812 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9767 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: BlockArgumentNode? + # + # pkg:gem/prism#lib/prism/node.rb:9828 + sig { returns(T.nilable(Prism::BlockArgumentNode)) } + def block; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:9847 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:9780 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:9857 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:9815 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9739 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9729 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:9744 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9749 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:9752 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9719 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9772 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:9867 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:9852 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:9799 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:9862 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:9831 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader receiver: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:9777 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9757 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9794 + def save_call_operator_loc(repository); end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9823 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9807 + def save_opening_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:9839 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:9872 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:9844 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9762 + sig { returns(T::Boolean) } + def variable_call?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:9877 + def type; end + end +end + +# Represents the use of an assignment operator on a call to `[]`. +# +# foo.bar[baz] += value +# ^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:9901 +class Prism::IndexOperatorWriteNode < ::Prism::Node + # Initialize a new IndexOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:9903 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10092 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:9920 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:10023 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9978 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:10042 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10045 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # attr_reader block: BlockArgumentNode? + # + # pkg:gem/prism#lib/prism/node.rb:10039 + sig { returns(T.nilable(Prism::BlockArgumentNode)) } + def block; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:10061 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:9991 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9925 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10071 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10026 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:9950 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:9940 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:9955 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block, binary_operator: self.binary_operator, binary_operator_loc: self.binary_operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:9960 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:9963 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:9930 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9983 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10076 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10066 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10010 + sig { returns(Prism::Location) } + def opening_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:422 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:429 + def operator_loc; end + + # attr_reader receiver: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:9988 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9968 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10053 + def save_binary_operator_loc(repository); end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10005 + def save_call_operator_loc(repository); end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10034 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10018 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10081 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:10058 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:9973 + sig { returns(T::Boolean) } + def variable_call?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10086 + def type; end + end +end + +# Represents the use of the `||=` operator on a call to `[]`. +# +# foo.bar[baz] ||= value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10111 +class Prism::IndexOrWriteNode < ::Prism::Node + # Initialize a new IndexOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10113 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10303 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10129 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:10232 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10187 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: BlockArgumentNode? + # + # pkg:gem/prism#lib/prism/node.rb:10248 + sig { returns(T.nilable(Prism::BlockArgumentNode)) } + def block; end + + # def call_operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:10267 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:10200 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10134 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10277 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10235 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10159 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10149 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:10164 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode), + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::IndexOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10169 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:10172 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10139 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10192 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10287 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10272 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10219 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10282 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10251 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader receiver: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:10197 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10177 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the call_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10214 + def save_call_operator_loc(repository); end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10243 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10227 + def save_opening_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10259 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10292 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:10264 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10182 + sig { returns(T::Boolean) } + def variable_call?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10297 + def type; end + end +end + +# Represents assigning to an index. +# +# foo[bar], = 1 +# ^^^^^^^^ +# +# begin +# rescue => foo[bar] +# ^^^^^^^^ +# end +# +# for foo[bar] in baz do end +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10329 +class Prism::IndexTargetNode < ::Prism::Node + # Initialize a new IndexTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10331 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode) + ).void + end + def initialize(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10471 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10344 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:10426 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10400 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: BlockArgumentNode? + # + # pkg:gem/prism#lib/prism/node.rb:10442 + sig { returns(T.nilable(Prism::BlockArgumentNode)) } + def block; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10349 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10450 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10429 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10372 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10363 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:10377 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::BlockArgumentNode) + ).returns(Prism::IndexTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10382 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode? } + # + # pkg:gem/prism#lib/prism/node.rb:10385 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10354 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10405 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10455 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10445 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10413 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader receiver: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:10410 + sig { returns(Prism::Node) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10390 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10437 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10421 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10460 + sig { override.returns(Symbol) } + def type; end + + # def variable_call?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:10395 + sig { returns(T::Boolean) } + def variable_call?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10465 + def type; end + end +end + +# InlineComment objects are the most common. They correspond to comments in +# the source file like this one that start with #. +# +# pkg:gem/prism#lib/prism/parse_result.rb:543 +class Prism::InlineComment < ::Prism::Comment + # Returns a string representation of this comment. + # + # pkg:gem/prism#lib/prism/parse_result.rb:551 + sig { returns(String) } + def inspect; end + + # Returns true if this comment happens on the same line as other code and + # false if the comment is by itself. + # + # pkg:gem/prism#lib/prism/parse_result.rb:546 + sig { override.returns(T::Boolean) } + def trailing?; end +end + +# This visitor is responsible for composing the strings that get returned by +# the various #inspect methods defined on each of the nodes. +# +# pkg:gem/prism#lib/prism/inspect_visitor.rb:15 +class Prism::InspectVisitor < ::Prism::Visitor + # Initializes a new instance of the InspectVisitor. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:38 + sig { params(indent: String).void } + def initialize(indent = ""); end + + # The list of commands that we need to execute in order to compose the + # final string. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:35 + def commands; end + + # Compose the final string. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:51 + sig { returns(String) } + def compose; end + + # The current prefix string. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:31 + def indent; end + + # Inspect a AliasGlobalVariableNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:80 + def visit_alias_global_variable_node(node); end + + # Inspect a AliasMethodNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:92 + def visit_alias_method_node(node); end + + # Inspect a AlternationPatternNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:104 + def visit_alternation_pattern_node(node); end + + # Inspect a AndNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:116 + def visit_and_node(node); end + + # Inspect a ArgumentsNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:128 + def visit_arguments_node(node); end + + # Inspect a ArrayNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:144 + def visit_array_node(node); end + + # Inspect a ArrayPatternNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:162 + def visit_array_pattern_node(node); end + + # Inspect a AssocNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:201 + def visit_assoc_node(node); end + + # Inspect a AssocSplatNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:213 + def visit_assoc_splat_node(node); end + + # Inspect a BackReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:227 + def visit_back_reference_read_node(node); end + + # Inspect a BeginNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:235 + def visit_begin_node(node); end + + # Inspect a BlockArgumentNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:268 + def visit_block_argument_node(node); end + + # Inspect a BlockLocalVariableNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:282 + def visit_block_local_variable_node(node); end + + # Inspect a BlockNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:290 + def visit_block_node(node); end + + # Inspect a BlockParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:312 + def visit_block_parameter_node(node); end + + # Inspect a BlockParametersNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:326 + def visit_block_parameters_node(node); end + + # Inspect a BreakNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:350 + def visit_break_node(node); end + + # Inspect a CallAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:364 + def visit_call_and_write_node(node); end + + # Inspect a CallNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:384 + def visit_call_node(node); end + + # Inspect a CallOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:415 + def visit_call_operator_write_node(node); end + + # Inspect a CallOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:436 + def visit_call_or_write_node(node); end + + # Inspect a CallTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:456 + def visit_call_target_node(node); end + + # Inspect a CapturePatternNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:468 + def visit_capture_pattern_node(node); end + + # Inspect a CaseMatchNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:480 + def visit_case_match_node(node); end + + # Inspect a CaseNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:510 + def visit_case_node(node); end + + # Inspect a ClassNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:540 + def visit_class_node(node); end + + # Inspect a ClassVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:566 + def visit_class_variable_and_write_node(node); end + + # Inspect a ClassVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:578 + def visit_class_variable_operator_write_node(node); end + + # Inspect a ClassVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:591 + def visit_class_variable_or_write_node(node); end + + # Inspect a ClassVariableReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:603 + def visit_class_variable_read_node(node); end + + # Inspect a ClassVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:611 + def visit_class_variable_target_node(node); end + + # Inspect a ClassVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:619 + def visit_class_variable_write_node(node); end + + # Inspect a ConstantAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:631 + def visit_constant_and_write_node(node); end + + # Inspect a ConstantOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:643 + def visit_constant_operator_write_node(node); end + + # Inspect a ConstantOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:656 + def visit_constant_or_write_node(node); end + + # Inspect a ConstantPathAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:668 + def visit_constant_path_and_write_node(node); end + + # Inspect a ConstantPathNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:680 + def visit_constant_path_node(node); end + + # Inspect a ConstantPathOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:700 + def visit_constant_path_operator_write_node(node); end + + # Inspect a ConstantPathOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:713 + def visit_constant_path_or_write_node(node); end + + # Inspect a ConstantPathTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:725 + def visit_constant_path_target_node(node); end + + # Inspect a ConstantPathWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:745 + def visit_constant_path_write_node(node); end + + # Inspect a ConstantReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:757 + def visit_constant_read_node(node); end + + # Inspect a ConstantTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:765 + def visit_constant_target_node(node); end + + # Inspect a ConstantWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:773 + def visit_constant_write_node(node); end + + # Inspect a DefNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:785 + def visit_def_node(node); end + + # Inspect a DefinedNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:819 + def visit_defined_node(node); end + + # Inspect a ElseNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:831 + def visit_else_node(node); end + + # Inspect a EmbeddedStatementsNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:846 + def visit_embedded_statements_node(node); end + + # Inspect a EmbeddedVariableNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:861 + def visit_embedded_variable_node(node); end + + # Inspect a EnsureNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:871 + def visit_ensure_node(node); end + + # Inspect a FalseNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:886 + def visit_false_node(node); end + + # Inspect a FindPatternNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:893 + def visit_find_pattern_node(node); end + + # Inspect a FlipFlopNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:921 + def visit_flip_flop_node(node); end + + # Inspect a FloatNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:941 + def visit_float_node(node); end + + # Inspect a ForNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:949 + def visit_for_node(node); end + + # Inspect a ForwardingArgumentsNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:970 + def visit_forwarding_arguments_node(node); end + + # Inspect a ForwardingParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:977 + def visit_forwarding_parameter_node(node); end + + # Inspect a ForwardingSuperNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:984 + def visit_forwarding_super_node(node); end + + # Inspect a GlobalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:997 + def visit_global_variable_and_write_node(node); end + + # Inspect a GlobalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1009 + def visit_global_variable_operator_write_node(node); end + + # Inspect a GlobalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1022 + def visit_global_variable_or_write_node(node); end + + # Inspect a GlobalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1034 + def visit_global_variable_read_node(node); end + + # Inspect a GlobalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1042 + def visit_global_variable_target_node(node); end + + # Inspect a GlobalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1050 + def visit_global_variable_write_node(node); end + + # Inspect a HashNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1062 + def visit_hash_node(node); end + + # Inspect a HashPatternNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1080 + def visit_hash_pattern_node(node); end + + # Inspect a IfNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1110 + def visit_if_node(node); end + + # Inspect a ImaginaryNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1134 + def visit_imaginary_node(node); end + + # Inspect a ImplicitNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1143 + def visit_implicit_node(node); end + + # Inspect a ImplicitRestNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1152 + def visit_implicit_rest_node(node); end + + # Inspect a InNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1159 + def visit_in_node(node); end + + # Inspect a IndexAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1176 + def visit_index_and_write_node(node); end + + # Inspect a IndexOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1207 + def visit_index_operator_write_node(node); end + + # Inspect a IndexOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1239 + def visit_index_or_write_node(node); end + + # Inspect a IndexTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1270 + def visit_index_target_node(node); end + + # Inspect a InstanceVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1293 + def visit_instance_variable_and_write_node(node); end + + # Inspect a InstanceVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1305 + def visit_instance_variable_operator_write_node(node); end + + # Inspect a InstanceVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1318 + def visit_instance_variable_or_write_node(node); end + + # Inspect a InstanceVariableReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1330 + def visit_instance_variable_read_node(node); end + + # Inspect a InstanceVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1338 + def visit_instance_variable_target_node(node); end + + # Inspect a InstanceVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1346 + def visit_instance_variable_write_node(node); end + + # Inspect a IntegerNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1358 + def visit_integer_node(node); end + + # Inspect a InterpolatedMatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1366 + def visit_interpolated_match_last_line_node(node); end + + # Inspect a InterpolatedRegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1384 + def visit_interpolated_regular_expression_node(node); end + + # Inspect a InterpolatedStringNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1402 + def visit_interpolated_string_node(node); end + + # Inspect a InterpolatedSymbolNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1420 + def visit_interpolated_symbol_node(node); end + + # Inspect a InterpolatedXStringNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1438 + def visit_interpolated_x_string_node(node); end + + # Inspect a ItLocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1456 + def visit_it_local_variable_read_node(node); end + + # Inspect a ItParametersNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1463 + def visit_it_parameters_node(node); end + + # Inspect a KeywordHashNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1470 + def visit_keyword_hash_node(node); end + + # Inspect a KeywordRestParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1486 + def visit_keyword_rest_parameter_node(node); end + + # Inspect a LambdaNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1500 + def visit_lambda_node(node); end + + # Inspect a LocalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1523 + def visit_local_variable_and_write_node(node); end + + # Inspect a LocalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1536 + def visit_local_variable_operator_write_node(node); end + + # Inspect a LocalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1550 + def visit_local_variable_or_write_node(node); end + + # Inspect a LocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1563 + def visit_local_variable_read_node(node); end + + # Inspect a LocalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1572 + def visit_local_variable_target_node(node); end + + # Inspect a LocalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1581 + def visit_local_variable_write_node(node); end + + # Inspect a MatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1594 + def visit_match_last_line_node(node); end + + # Inspect a MatchPredicateNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1605 + def visit_match_predicate_node(node); end + + # Inspect a MatchRequiredNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1617 + def visit_match_required_node(node); end + + # Inspect a MatchWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1629 + def visit_match_write_node(node); end + + # Inspect a MissingNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1647 + def visit_missing_node(node); end + + # Inspect a ModuleNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1654 + def visit_module_node(node); end + + # Inspect a MultiTargetNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1673 + def visit_multi_target_node(node); end + + # Inspect a MultiWriteNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1706 + def visit_multi_write_node(node); end + + # Inspect a NextNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1742 + def visit_next_node(node); end + + # Inspect a NilNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1756 + def visit_nil_node(node); end + + # Inspect a NoKeywordsParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1763 + def visit_no_keywords_parameter_node(node); end + + # Inspect a NumberedParametersNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1772 + def visit_numbered_parameters_node(node); end + + # Inspect a NumberedReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1780 + def visit_numbered_reference_read_node(node); end + + # Inspect a OptionalKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1788 + def visit_optional_keyword_parameter_node(node); end + + # Inspect a OptionalParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1799 + def visit_optional_parameter_node(node); end + + # Inspect a OrNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1811 + def visit_or_node(node); end + + # Inspect a ParametersNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1823 + def visit_parameters_node(node); end + + # Inspect a ParenthesesNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1884 + def visit_parentheses_node(node); end + + # Inspect a PinnedExpressionNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1899 + def visit_pinned_expression_node(node); end + + # Inspect a PinnedVariableNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1911 + def visit_pinned_variable_node(node); end + + # Inspect a PostExecutionNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1921 + def visit_post_execution_node(node); end + + # Inspect a PreExecutionNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1937 + def visit_pre_execution_node(node); end + + # Inspect a ProgramNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1953 + def visit_program_node(node); end + + # Inspect a RangeNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1963 + def visit_range_node(node); end + + # Inspect a RationalNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1983 + def visit_rational_node(node); end + + # Inspect a RedoNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1992 + def visit_redo_node(node); end + + # Inspect a RegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:1999 + def visit_regular_expression_node(node); end + + # Inspect a RequiredKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2010 + def visit_required_keyword_parameter_node(node); end + + # Inspect a RequiredParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2019 + def visit_required_parameter_node(node); end + + # Inspect a RescueModifierNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2027 + def visit_rescue_modifier_node(node); end + + # Inspect a RescueNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2039 + def visit_rescue_node(node); end + + # Inspect a RestParameterNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2076 + def visit_rest_parameter_node(node); end + + # Inspect a RetryNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2090 + def visit_retry_node(node); end + + # Inspect a ReturnNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2097 + def visit_return_node(node); end + + # Inspect a SelfNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2111 + def visit_self_node(node); end + + # Inspect a ShareableConstantNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2118 + def visit_shareable_constant_node(node); end + + # Inspect a SingletonClassNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2127 + def visit_singleton_class_node(node); end + + # Inspect a SourceEncodingNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2146 + def visit_source_encoding_node(node); end + + # Inspect a SourceFileNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2153 + def visit_source_file_node(node); end + + # Inspect a SourceLineNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2161 + def visit_source_line_node(node); end + + # Inspect a SplatNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2168 + def visit_splat_node(node); end + + # Inspect a StatementsNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2182 + def visit_statements_node(node); end + + # Inspect a StringNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2198 + def visit_string_node(node); end + + # Inspect a SuperNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2209 + def visit_super_node(node); end + + # Inspect a SymbolNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2231 + def visit_symbol_node(node); end + + # Inspect a TrueNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2242 + def visit_true_node(node); end + + # Inspect a UndefNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2249 + def visit_undef_node(node); end + + # Inspect a UnlessNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2266 + def visit_unless_node(node); end + + # Inspect a UntilNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2290 + def visit_until_node(node); end + + # Inspect a WhenNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2308 + def visit_when_node(node); end + + # Inspect a WhileNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2332 + def visit_while_node(node); end + + # Inspect a XStringNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2350 + def visit_x_string_node(node); end + + # Inspect a YieldNode node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2361 + def visit_yield_node(node); end + + private + + # Compose a string representing the given inner location field. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2385 + def inspect_location(location); end + + # Compose a header for the given node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:2379 + def inspect_node(name, node); end + + class << self + # Compose an inspect string for the given node. + # + # pkg:gem/prism#lib/prism/inspect_visitor.rb:44 + sig { params(node: Prism::Node).returns(String) } + def compose(node); end + end +end + +# Most of the time, we can simply pass down the indent to the next node. +# However, when we are inside a list we want some extra special formatting +# when we hit an element in that list. In this case, we have a special +# command that replaces the subsequent indent with the given value. +# +# pkg:gem/prism#lib/prism/inspect_visitor.rb:20 +class Prism::InspectVisitor::Replace + # pkg:gem/prism#lib/prism/inspect_visitor.rb:23 + def initialize(value); end + + # pkg:gem/prism#lib/prism/inspect_visitor.rb:21 + def value; end +end + +# Represents the use of the `&&=` operator for assignment to an instance variable. +# +# @target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10486 +class Prism::InstanceVariableAndWriteNode < ::Prism::Node + # Initialize a new InstanceVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10488 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10593 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10500 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10505 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10522 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10517 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:10527 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::InstanceVariableAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10532 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:10535 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:219 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10510 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10577 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:10540 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10543 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10572 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10556 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10551 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10564 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10582 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:10569 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10587 + def type; end + end +end + +# Represents assigning to an instance variable using an operator that isn't `=`. +# +# @target += value +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10606 +class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node + # Initialize a new InstanceVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10608 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10712 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10621 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:10693 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10677 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10626 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10643 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10638 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:10648 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol + ).returns(Prism::InstanceVariableOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10653 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:10656 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:231 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10631 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10696 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:10661 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10664 + sig { returns(Prism::Location) } + def name_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:438 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:445 + def operator_loc; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10685 + def save_binary_operator_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10672 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10701 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:10690 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10706 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to an instance variable. +# +# @target ||= value +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10726 +class Prism::InstanceVariableOrWriteNode < ::Prism::Node + # Initialize a new InstanceVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10728 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10833 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10740 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10745 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10762 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10757 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:10767 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::InstanceVariableOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10772 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:10775 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:225 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10750 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10817 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:10780 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10783 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:10812 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:10796 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10791 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:10804 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10822 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:10809 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10827 + def type; end + end +end + +# Represents referencing an instance variable. +# +# @foo +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10846 +class Prism::InstanceVariableReadNode < ::Prism::Node + # Initialize a new InstanceVariableReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10848 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10919 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10857 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10862 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10878 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10873 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode + # + # pkg:gem/prism#lib/prism/node.rb:10883 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::InstanceVariableReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10888 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:10891 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10867 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10903 + sig { override.returns(String) } + def inspect; end + + # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @x # name `:@x` + # + # @_test # name `:@_test` + # + # pkg:gem/prism#lib/prism/node.rb:10900 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10908 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10913 + def type; end + end +end + +# Represents writing to an instance variable in a context that doesn't have an explicit value. +# +# @foo, @bar = baz +# ^^^^ ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:10929 +class Prism::InstanceVariableTargetNode < ::Prism::Node + # Initialize a new InstanceVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:10931 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:10998 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:10940 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10945 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:10961 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:10956 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:10966 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::InstanceVariableTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:10971 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:10974 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:10950 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:10982 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:10979 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:10987 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:10992 + def type; end + end +end + +# Represents writing to an instance variable. +# +# @foo = 1 +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:11008 +class Prism::InstanceVariableWriteNode < ::Prism::Node + # Initialize a new InstanceVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11010 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11131 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11022 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11027 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11044 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11039 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:11049 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::InstanceVariableWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:11057 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11032 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11115 + sig { override.returns(String) } + def inspect; end + + # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @x = :y # name `:@x` + # + # @_foo = "bar" # name `@_foo` + # + # pkg:gem/prism#lib/prism/node.rb:11066 + sig { returns(Symbol) } + def name; end + + # The location of the variable name. + # + # @_x = 1 + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:11072 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11110 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # @x = y + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:11097 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11080 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11105 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11120 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # @foo = :bar + # ^^^^ + # + # @_x = 1234 + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:11091 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11125 + def type; end + end +end + +# Flags for integer nodes that correspond to the base of the integer. +# +# pkg:gem/prism#lib/prism/node.rb:19828 +module Prism::IntegerBaseFlags; end + +# 0b prefix +# +# pkg:gem/prism#lib/prism/node.rb:19830 +Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) + +# 0d or no prefix +# +# pkg:gem/prism#lib/prism/node.rb:19833 +Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) + +# 0x prefix +# +# pkg:gem/prism#lib/prism/node.rb:19839 +Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + +# 0o or 0 prefix +# +# pkg:gem/prism#lib/prism/node.rb:19836 +Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + +# Represents an integer number literal. +# +# 1 +# ^ +# +# pkg:gem/prism#lib/prism/node.rb:11144 +class Prism::IntegerNode < ::Prism::Node + # Initialize a new IntegerNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11146 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Integer + ).void + end + def initialize(source, node_id, location, flags, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11233 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11155 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def binary?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11194 + sig { returns(T::Boolean) } + def binary?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11160 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11176 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11171 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode + # + # pkg:gem/prism#lib/prism/node.rb:11181 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Integer + ).returns(Prism::IntegerNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value); end + + # def decimal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11199 + sig { returns(T::Boolean) } + def decimal?; end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11186 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:11189 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11165 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def hexadecimal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11209 + sig { returns(T::Boolean) } + def hexadecimal?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11217 + sig { override.returns(String) } + def inspect; end + + # def octal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11204 + sig { returns(T::Boolean) } + def octal?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11222 + sig { override.returns(Symbol) } + def type; end + + # The value of the integer literal as a number. + # + # pkg:gem/prism#lib/prism/node.rb:11214 + sig { returns(Integer) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11227 + def type; end + end +end + +# Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object. +# +# if /foo #{bar} baz/ then end +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:11244 +class Prism::InterpolatedMatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # Initialize a new InterpolatedMatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11246 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11407 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11257 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11322 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11262 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11386 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:11368 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11279 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11274 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode + # + # pkg:gem/prism#lib/prism/node.rb:11284 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedMatchLastLineNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, parts: self.parts, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11289 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:11292 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11267 + def each_child_node; end + + # def euc_jp?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11317 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11302 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11342 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11347 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11337 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11297 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11391 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11307 + sig { returns(T::Boolean) } + def multi_line?; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:122 + def newline_flag!(lines); end + + # def once?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11312 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11381 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:11352 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # pkg:gem/prism#lib/prism/node.rb:11365 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11376 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11360 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11396 + sig { override.returns(Symbol) } + def type; end + + # def utf_8?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11332 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11327 + sig { returns(T::Boolean) } + def windows_31j?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11401 + def type; end + end +end + +# Represents a regular expression literal that contains interpolation. +# +# /foo #{bar} baz/ +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:11421 +class Prism::InterpolatedRegularExpressionNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # Initialize a new InterpolatedRegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11423 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11584 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11434 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11499 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11439 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11563 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:11545 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11456 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11451 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode + # + # pkg:gem/prism#lib/prism/node.rb:11461 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedRegularExpressionNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, parts: self.parts, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11466 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:11469 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11444 + def each_child_node; end + + # def euc_jp?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11494 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11479 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11519 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11524 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11514 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11474 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11568 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11484 + sig { returns(T::Boolean) } + def multi_line?; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:129 + def newline_flag!(lines); end + + # def once?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11489 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11558 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:11529 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # pkg:gem/prism#lib/prism/node.rb:11542 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11553 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11537 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11573 + sig { override.returns(Symbol) } + def type; end + + # def utf_8?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11509 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11504 + sig { returns(T::Boolean) } + def windows_31j?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11578 + def type; end + end +end + +# Represents a string literal that contains interpolation. +# +# "foo #{bar} baz" +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:11598 +class Prism::InterpolatedStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # Initialize a new InterpolatedStringNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11600 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode, Prism::XStringNode, Prism::InterpolatedXStringNode, Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11728 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11611 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11616 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:11707 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:11683 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11633 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11628 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode], ?closing_loc: Location?) -> InterpolatedStringNode + # + # pkg:gem/prism#lib/prism/node.rb:11638 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode, Prism::XStringNode, Prism::InterpolatedXStringNode, Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::InterpolatedStringNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, parts: self.parts, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11643 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode], closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:11646 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11621 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def frozen?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11651 + sig { returns(T::Boolean) } + def frozen?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11712 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:11656 + sig { returns(T::Boolean) } + def mutable?; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:136 + def newline_flag!(lines); end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:11702 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:11661 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] + # + # pkg:gem/prism#lib/prism/node.rb:11680 + sig do + returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode, Prism::XStringNode, Prism::InterpolatedXStringNode, Prism::SymbolNode, Prism::InterpolatedSymbolNode)]) + end + def parts; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11697 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11675 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11717 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11722 + def type; end + end +end + +# Flags for interpolated string nodes that indicated mutability if they are also marked as literals. +# +# pkg:gem/prism#lib/prism/node.rb:19843 +module Prism::InterpolatedStringNodeFlags; end + +# pkg:gem/prism#lib/prism/node.rb:19845 +Prism::InterpolatedStringNodeFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/node.rb:19848 +Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) + +# Represents a symbol literal that contains interpolation. +# +# :"foo #{bar} baz" +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:11742 +class Prism::InterpolatedSymbolNode < ::Prism::Node + # Initialize a new InterpolatedSymbolNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11744 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11862 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11755 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11760 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:11841 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:11817 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11777 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11772 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode + # + # pkg:gem/prism#lib/prism/node.rb:11782 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location) + ).returns(Prism::InterpolatedSymbolNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, parts: self.parts, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11787 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:11790 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11765 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11846 + sig { override.returns(String) } + def inspect; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:143 + def newline_flag!(lines); end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:11836 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:11795 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # pkg:gem/prism#lib/prism/node.rb:11814 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11831 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11809 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11851 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11856 + def type; end + end +end + +# Represents an xstring literal that contains interpolation. +# +# `foo #{bar} baz` +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:11875 +class Prism::InterpolatedXStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # Initialize a new InterpolatedXStringNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11877 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:11983 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:11888 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11893 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11962 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:11944 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:11910 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:11905 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode + # + # pkg:gem/prism#lib/prism/node.rb:11915 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location + ).returns(Prism::InterpolatedXStringNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, parts: self.parts, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:11920 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:11923 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:11898 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:11967 + sig { override.returns(String) } + def inspect; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:150 + def newline_flag!(lines); end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:11957 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:11928 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # pkg:gem/prism#lib/prism/node.rb:11941 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11952 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:11936 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:11972 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:11977 + def type; end + end +end + +# Represents reading from the implicit `it` local variable. +# +# -> { it } +# ^^ +# +# pkg:gem/prism#lib/prism/node.rb:11996 +class Prism::ItLocalVariableReadNode < ::Prism::Node + # Initialize a new ItLocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:11998 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12061 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12006 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12011 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12027 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12022 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode + # + # pkg:gem/prism#lib/prism/node.rb:12032 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ItLocalVariableReadNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12037 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:12040 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12016 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12045 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12050 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12055 + def type; end + end +end + +# Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda. +# +# -> { it + it } +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12070 +class Prism::ItParametersNode < ::Prism::Node + # Initialize a new ItParametersNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12072 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12135 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12080 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12085 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12101 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12096 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode + # + # pkg:gem/prism#lib/prism/node.rb:12106 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ItParametersNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12111 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:12114 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12090 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12119 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12124 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12129 + def type; end + end +end + +# Represents a hash literal without opening and closing braces. +# +# foo(a: b) +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12144 +class Prism::KeywordHashNode < ::Prism::Node + # Initialize a new KeywordHashNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12146 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)] + ).void + end + def initialize(source, node_id, location, flags, elements); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12219 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12155 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12160 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12177 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12172 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode + # + # pkg:gem/prism#lib/prism/node.rb:12182 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)] + ).returns(Prism::KeywordHashNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, elements: self.elements); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12187 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[AssocNode | AssocSplatNode] } + # + # pkg:gem/prism#lib/prism/node.rb:12190 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12165 + def each_child_node; end + + # attr_reader elements: Array[AssocNode | AssocSplatNode] + # + # pkg:gem/prism#lib/prism/node.rb:12200 + sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } + def elements; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12203 + sig { override.returns(String) } + def inspect; end + + # def symbol_keys?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:12195 + sig { returns(T::Boolean) } + def symbol_keys?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12208 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12213 + def type; end + end +end + +# Flags for keyword hash nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19852 +module Prism::KeywordHashNodeFlags; end + +# a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments +# +# pkg:gem/prism#lib/prism/node.rb:19854 +Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) + +# Represents a keyword rest parameter to a method, block, or lambda definition. +# +# def a(**b) +# ^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:12232 +class Prism::KeywordRestParameterNode < ::Prism::Node + # Initialize a new KeywordRestParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12234 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12345 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12245 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12250 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12266 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12261 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:12271 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::KeywordRestParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12276 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:12279 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12255 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12329 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # pkg:gem/prism#lib/prism/node.rb:12289 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:12292 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:12324 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12311 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:12284 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12306 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12319 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12334 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12339 + def type; end + end +end + +# Represents using a lambda literal (not the lambda method call). +# +# ->(value) { value * 2 } +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12358 +class Prism::LambdaNode < ::Prism::Node + # Initialize a new LambdaNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12360 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)) + ).void + end + def initialize(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12497 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12374 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: StatementsNode | BeginNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:12463 + sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12379 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:12476 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12447 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12400 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12392 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil) -> LambdaNode + # + # pkg:gem/prism#lib/prism/node.rb:12405 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)) + ).returns(Prism::LambdaNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, locals: self.locals, operator_loc: self.operator_loc, opening_loc: self.opening_loc, closing_loc: self.closing_loc, parameters: self.parameters, body: self.body); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12410 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil } + # + # pkg:gem/prism#lib/prism/node.rb:12413 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12384 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12481 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # pkg:gem/prism#lib/prism/node.rb:12418 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:12471 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12434 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:12466 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12421 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:12460 + sig { returns(T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode))) } + def parameters; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12455 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12442 + def save_opening_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12429 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12486 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12491 + def type; end + end +end + +# This class is responsible for lexing the source using prism and then +# converting those tokens to be compatible with Ripper. In the vast majority +# of cases, this is a one-to-one mapping of the token type. Everything else +# generally lines up. However, there are a few cases that require special +# handling. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:10 +class Prism::LexCompat + # pkg:gem/prism#lib/prism/lex_compat.rb:586 + def initialize(code, **options); end + + # pkg:gem/prism#lib/prism/lex_compat.rb:828 + def add_on_sp_tokens(tokens, source, data_loc, bom, eof_token); end + + # pkg:gem/prism#lib/prism/lex_compat.rb:584 + def options; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:591 + def result; end +end + +# In previous versions of Ruby, Ripper wouldn't flush the bom before the +# first token, so we had to have a hack in place to account for that. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:581 +Prism::LexCompat::BOM_FLUSHED = T.let(T.unsafe(nil), TrueClass) + +# A heredoc in this case is a list of tokens that belong to the body of the +# heredoc that should be appended onto the list of tokens when the heredoc +# closes. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:253 +module Prism::LexCompat::Heredoc + class << self + # Here we will split between the two types of heredocs and return the + # object that will store their tokens. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:565 + def build(opening); end + end +end + +# Dash heredocs are a little more complicated. They are a list of tokens +# that need to be split on "\\\n" to mimic Ripper's behavior. We also need +# to keep track of the state that the heredoc was opened in. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:277 +class Prism::LexCompat::Heredoc::DashHeredoc + # pkg:gem/prism#lib/prism/lex_compat.rb:280 + def initialize(split); end + + # pkg:gem/prism#lib/prism/lex_compat.rb:285 + def <<(token); end + + # pkg:gem/prism#lib/prism/lex_compat.rb:278 + def split; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:289 + def to_a; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:278 + def tokens; end +end + +# Heredocs that are dedenting heredocs are a little more complicated. +# Ripper outputs on_ignored_sp tokens for the whitespace that is being +# removed from the output. prism only modifies the node itself and keeps +# the token the same. This simplifies prism, but makes comparing against +# Ripper much harder because there is a length mismatch. +# +# Fortunately, we already have to pull out the heredoc tokens in order to +# insert them into the stream in the correct order. As such, we can do +# some extra manipulation on the tokens to make them match Ripper's +# output by mirroring the dedent logic that Ripper uses. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:336 +class Prism::LexCompat::Heredoc::DedentingHeredoc + # pkg:gem/prism#lib/prism/lex_compat.rb:341 + def initialize; end + + # As tokens are coming in, we track the minimum amount of common leading + # whitespace on plain string content tokens. This allows us to later + # remove that amount of whitespace from the beginning of each line. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:352 + def <<(token); end + + # pkg:gem/prism#lib/prism/lex_compat.rb:339 + def dedent; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:339 + def dedent_next; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:339 + def embexpr_balance; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:389 + def to_a; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:339 + def tokens; end +end + +# pkg:gem/prism#lib/prism/lex_compat.rb:337 +Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), Integer) + +# Heredocs that are no dash or tilde heredocs are just a list of tokens. +# We need to keep them around so that we can insert them in the correct +# order back into the token stream and set the state of the last token to +# the state that the heredoc was opened in. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:258 +class Prism::LexCompat::Heredoc::PlainHeredoc + # pkg:gem/prism#lib/prism/lex_compat.rb:261 + def initialize; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:265 + def <<(token); end + + # pkg:gem/prism#lib/prism/lex_compat.rb:269 + def to_a; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:259 + def tokens; end +end + +# Tokens where state should be ignored +# used for :on_sp, :on_comment, :on_heredoc_end, :on_embexpr_end +# +# pkg:gem/prism#lib/prism/lex_compat.rb:244 +class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token + # pkg:gem/prism#lib/prism/lex_compat.rb:245 + def ==(other); end +end + +# This is a mapping of prism token types to Ripper token types. This is a +# many-to-one mapping because we split up our token types, whereas Ripper +# tends to group them. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:31 +Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) + +# A result class specialized for holding tokens produced by the lexer. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:12 +class Prism::LexCompat::Result < ::Prism::Result + # Create a new lex compat result object with the given values. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:17 + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for Result. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:23 + def deconstruct_keys(keys); end + + # The list of tokens that were produced by the lexer. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:14 + def value; end +end + +# When we produce tokens, we produce the same arrays that Ripper does. +# However, we add a couple of convenience methods onto them to make them a +# little easier to work with. We delegate all other methods to the array. +# +# pkg:gem/prism#lib/prism/lex_compat.rb:202 +class Prism::LexCompat::Token < ::BasicObject + # Create a new token object with the given ripper-compatible array. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:204 + def initialize(array); end + + # We want to pretend that this is just an Array. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:229 + def ==(other); end + + # The type of the token. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:214 + def event; end + + # The location of the token in the source. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:209 + def location; end + + # pkg:gem/prism#lib/prism/lex_compat.rb:237 + def method_missing(name, *, **, &); end + + # The state of the lexer when this token was produced. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:224 + def state; end + + # The slice of the source that this token represents. + # + # pkg:gem/prism#lib/prism/lex_compat.rb:219 + def value; end + + private + + # pkg:gem/prism#lib/prism/lex_compat.rb:233 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# This is a result specific to the `lex` and `lex_file` methods. +# +# pkg:gem/prism#lib/prism/parse_result.rb:778 +class Prism::LexResult < ::Prism::Result + # Create a new lex result object with the given values. + # + # pkg:gem/prism#lib/prism/parse_result.rb:783 + sig do + params( + value: T::Array[T.untyped], + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for LexResult. + # + # pkg:gem/prism#lib/prism/parse_result.rb:789 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The list of tokens that were parsed from the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:780 + sig { returns(T::Array[T.untyped]) } + def value; end +end + +# Represents the use of the `&&=` operator for assignment to a local variable. +# +# target &&= value +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12513 +class Prism::LocalVariableAndWriteNode < ::Prism::Node + # Initialize a new LocalVariableAndWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12515 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).void + end + def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12624 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12528 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12533 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12550 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12545 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:12555 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableAndWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value, name: self.name, depth: self.depth); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12560 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:12563 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # pkg:gem/prism#lib/prism/node.rb:12600 + sig { returns(Integer) } + def depth; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:237 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12538 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12608 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:12597 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12568 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:12603 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12581 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12576 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12589 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12613 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:12594 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12618 + def type; end + end +end + +# Represents assigning to a local variable using an operator that isn't `=`. +# +# target += value +# ^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12638 +class Prism::LocalVariableOperatorWriteNode < ::Prism::Node + # Initialize a new LocalVariableOperatorWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12640 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer + ).void + end + def initialize(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12748 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12654 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:12726 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12707 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12659 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12676 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12671 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:12681 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer + ).returns(Prism::LocalVariableOperatorWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, name: self.name, binary_operator: self.binary_operator, depth: self.depth); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12686 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:12689 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # pkg:gem/prism#lib/prism/node.rb:12729 + sig { returns(Integer) } + def depth; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:249 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12664 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12732 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:12723 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12694 + sig { returns(Prism::Location) } + def name_loc; end + + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:454 + def operator; end + + # Returns the location of the binary operator used to modify the receiver. + # This method is deprecated in favor of #binary_operator_loc. + # + # pkg:gem/prism#lib/prism/node_ext.rb:461 + def operator_loc; end + + # Save the binary_operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12715 + def save_binary_operator_loc(repository); end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12702 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12737 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:12720 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12742 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a local variable. +# +# target ||= value +# ^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12763 +class Prism::LocalVariableOrWriteNode < ::Prism::Node + # Initialize a new LocalVariableOrWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12765 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).void + end + def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12874 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12778 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12783 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12800 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12795 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:12805 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableOrWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value, name: self.name, depth: self.depth); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12810 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:12813 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # pkg:gem/prism#lib/prism/node.rb:12850 + sig { returns(Integer) } + def depth; end + + # pkg:gem/prism#lib/prism/desugar_compiler.rb:243 + def desugar; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12788 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12858 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:12847 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12818 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:12853 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:12831 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12826 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:12839 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12863 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:12844 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12868 + def type; end + end +end + +# Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. +# +# foo +# ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12888 +class Prism::LocalVariableReadNode < ::Prism::Node + # Initialize a new LocalVariableReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12890 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).void + end + def initialize(source, node_id, location, flags, name, depth); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:12975 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:12900 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12905 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:12921 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:12916 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode + # + # pkg:gem/prism#lib/prism/node.rb:12926 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, depth: self.depth); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:12931 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:12934 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The number of visible scopes that should be searched to find the origin of this local variable. + # + # foo = 1; foo # depth 0 + # + # bar = 2; tap { bar } # depth 1 + # + # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). + # + # pkg:gem/prism#lib/prism/node.rb:12956 + sig { returns(Integer) } + def depth; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:12910 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:12959 + sig { override.returns(String) } + def inspect; end + + # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # x # name `:x` + # + # _Test # name `:_Test` + # + # Note that this can also be an underscore followed by a number for the default block parameters. + # + # _1 # name `:_1` + # + # pkg:gem/prism#lib/prism/node.rb:12947 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:12964 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:12969 + def type; end + end +end + +# Represents writing to a local variable in a context that doesn't have an explicit value. +# +# foo, bar = baz +# ^^^ ^^^ +# +# foo => baz +# ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:12989 +class Prism::LocalVariableTargetNode < ::Prism::Node + # Initialize a new LocalVariableTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:12991 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).void + end + def initialize(source, node_id, location, flags, name, depth); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13062 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13001 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13006 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13022 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13017 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:13027 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer + ).returns(Prism::LocalVariableTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, depth: self.depth); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13032 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:13035 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # pkg:gem/prism#lib/prism/node.rb:13043 + sig { returns(Integer) } + def depth; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13011 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13046 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:13040 + sig { returns(Symbol) } + def name; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13051 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13056 + def type; end + end +end + +# Represents writing to a local variable. +# +# foo = 1 +# ^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13073 +class Prism::LocalVariableWriteNode < ::Prism::Node + # Initialize a new LocalVariableWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13075 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, depth, name_loc, value, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13210 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13088 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13093 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13110 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13105 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:13115 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::LocalVariableWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, depth: self.depth, name_loc: self.name_loc, value: self.value, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13120 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:13123 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The number of semantic scopes we have to traverse to find the declaration of this variable. + # + # foo = 1 # depth 0 + # + # tap { foo = 1 } # depth 1 + # + # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). + # + # pkg:gem/prism#lib/prism/node.rb:13141 + sig { returns(Integer) } + def depth; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13098 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13194 + sig { override.returns(String) } + def inspect; end + + # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # foo = :bar # name `:foo` + # + # abc = 123 # name `:abc` + # + # pkg:gem/prism#lib/prism/node.rb:13132 + sig { returns(Symbol) } + def name; end + + # The location of the variable name. + # + # foo = :bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:13147 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13189 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # x = :y + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:13176 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13155 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13184 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13199 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo = :bar + # ^^^^ + # + # abc = 1234 + # ^^^^ + # + # Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write. + # + # foo = foo + # + # pkg:gem/prism#lib/prism/node.rb:13170 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13204 + def type; end + end +end + +# This represents a location in the source. +# +# pkg:gem/prism#lib/prism/parse_result.rb:287 +class Prism::Location + # Create a new location object with the given source, start byte offset, and + # byte length. + # + # pkg:gem/prism#lib/prism/parse_result.rb:302 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void } + def initialize(source, start_offset, length); end + + # Returns true if the given other location is equal to this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:490 + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other); end + + # Join this location with the first occurrence of the string in the source + # that occurs after this location on the same line, and return the new + # location. This will raise an error if the string does not exist. + # + # pkg:gem/prism#lib/prism/parse_result.rb:509 + sig { params(string: String).returns(Prism::Location) } + def adjoin(string); end + + # The end column in code units using the given cache to fetch or calculate + # the value. + # + # pkg:gem/prism#lib/prism/parse_result.rb:475 + sig do + params( + cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)) + ).returns(Integer) + end + def cached_end_code_units_column(cache); end + + # The end offset from the start of the file in code units using the given + # cache to fetch or calculate the value. + # + # pkg:gem/prism#lib/prism/parse_result.rb:411 + sig do + params( + cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)) + ).returns(Integer) + end + def cached_end_code_units_offset(cache); end + + # The start column in code units using the given cache to fetch or calculate + # the value. + # + # pkg:gem/prism#lib/prism/parse_result.rb:451 + sig do + params( + cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)) + ).returns(Integer) + end + def cached_start_code_units_column(cache); end + + # The start offset from the start of the file in code units using the given + # cache to fetch or calculate the value. + # + # pkg:gem/prism#lib/prism/parse_result.rb:389 + sig do + params( + cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)) + ).returns(Integer) + end + def cached_start_code_units_offset(cache); end + + # Returns a new location that is the result of chopping off the last byte. + # + # pkg:gem/prism#lib/prism/parse_result.rb:348 + sig { returns(Prism::Location) } + def chop; end + + # Returns all comments that are associated with this location (both leading + # and trailing comments). + # + # pkg:gem/prism#lib/prism/parse_result.rb:338 + sig { returns(T::Array[Prism::Comment]) } + def comments; end + + # Create a new location object with the given options. + # + # pkg:gem/prism#lib/prism/parse_result.rb:343 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) } + def copy(source: self.source, start_offset: self.start_offset, length: self.length); end + + # Implement the hash pattern matching interface for Location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:480 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The column number in characters where this location ends from the start of + # the line. + # + # pkg:gem/prism#lib/prism/parse_result.rb:463 + sig { returns(Integer) } + def end_character_column; end + + # The character offset from the beginning of the source where this location + # ends. + # + # pkg:gem/prism#lib/prism/parse_result.rb:400 + sig { returns(Integer) } + def end_character_offset; end + + # The column number in code units of the given encoding where this location + # ends from the start of the line. + # + # pkg:gem/prism#lib/prism/parse_result.rb:469 + sig { params(encoding: Encoding).returns(Integer) } + def end_code_units_column(encoding = Encoding::UTF_16LE); end + + # The offset from the start of the file in code units of the given encoding. + # + # pkg:gem/prism#lib/prism/parse_result.rb:405 + sig { params(encoding: Encoding).returns(Integer) } + def end_code_units_offset(encoding = Encoding::UTF_16LE); end + + # The column number in bytes where this location ends from the start of the + # line. + # + # pkg:gem/prism#lib/prism/parse_result.rb:457 + sig { returns(Integer) } + def end_column; end + + # The line number where this location ends. + # + # pkg:gem/prism#lib/prism/parse_result.rb:427 + sig { returns(Integer) } + def end_line; end + + # The byte offset from the beginning of the source where this location ends. + # + # pkg:gem/prism#lib/prism/parse_result.rb:394 + sig { returns(Integer) } + def end_offset; end + + # Returns a string representation of this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:353 + sig { returns(String) } + def inspect; end + + # Returns a new location that stretches from this location to the given + # other location. Raises an error if this location is not before the other + # location or if they don't share the same source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:499 + sig { params(other: Prism::Location).returns(Prism::Location) } + def join(other); end + + # Attach a comment to the leading comments of this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:321 + sig { params(comment: Prism::Comment).void } + def leading_comment(comment); end + + # These are the comments that are associated with this location that exist + # before the start of this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:316 + sig { returns(T::Array[Prism::Comment]) } + def leading_comments; end + + # The length of this location in bytes. + # + # pkg:gem/prism#lib/prism/parse_result.rb:298 + sig { returns(Integer) } + def length; end + + # Implement the pretty print interface for Location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:485 + sig { params(q: T.untyped).void } + def pretty_print(q); end + + # The source code that this location represents. + # + # pkg:gem/prism#lib/prism/parse_result.rb:363 + sig { returns(String) } + def slice; end + + # The source code that this location represents starting from the beginning + # of the line that this location starts on to the end of the line that this + # location ends on. + # + # pkg:gem/prism#lib/prism/parse_result.rb:370 + def slice_lines; end + + # Returns all of the lines of the source code associated with this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:358 + sig { returns(T::Array[String]) } + def source_lines; end + + # The column number in characters where this location ends from the start of + # the line. + # + # pkg:gem/prism#lib/prism/parse_result.rb:439 + sig { returns(Integer) } + def start_character_column; end + + # The character offset from the beginning of the source where this location + # starts. + # + # pkg:gem/prism#lib/prism/parse_result.rb:378 + sig { returns(Integer) } + def start_character_offset; end + + # The column number in code units of the given encoding where this location + # starts from the start of the line. + # + # pkg:gem/prism#lib/prism/parse_result.rb:445 + sig { params(encoding: Encoding).returns(Integer) } + def start_code_units_column(encoding = Encoding::UTF_16LE); end + + # The offset from the start of the file in code units of the given encoding. + # + # pkg:gem/prism#lib/prism/parse_result.rb:383 + sig { params(encoding: Encoding).returns(Integer) } + def start_code_units_offset(encoding = Encoding::UTF_16LE); end + + # The column number in bytes where this location starts from the start of + # the line. + # + # pkg:gem/prism#lib/prism/parse_result.rb:433 + sig { returns(Integer) } + def start_column; end + + # The line number where this location starts. + # + # pkg:gem/prism#lib/prism/parse_result.rb:416 + sig { returns(Integer) } + def start_line; end + + # The content of the line where this location starts before this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:421 + sig { returns(String) } + def start_line_slice; end + + # The byte offset from the beginning of the source where this location + # starts. + # + # pkg:gem/prism#lib/prism/parse_result.rb:295 + sig { returns(Integer) } + def start_offset; end + + # Attach a comment to the trailing comments of this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:332 + sig { params(comment: Prism::Comment).void } + def trailing_comment(comment); end + + # These are the comments that are associated with this location that exist + # after the end of this location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:327 + sig { returns(T::Array[Prism::Comment]) } + def trailing_comments; end + + protected + + # A Source object that is used to determine more information from the given + # offset and length. + # + # pkg:gem/prism#lib/prism/parse_result.rb:290 + sig { returns(Prism::Source) } + def source; end +end + +# Flags for while and until loop nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19858 +module Prism::LoopFlags; end + +# a loop after a begin statement, so the body is executed first before the condition +# +# pkg:gem/prism#lib/prism/node.rb:19860 +Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) + +# This represents a magic comment that was encountered during parsing. +# +# pkg:gem/prism#lib/prism/parse_result.rb:571 +class Prism::MagicComment + # Create a new magic comment object with the given key and value locations. + # + # pkg:gem/prism#lib/prism/parse_result.rb:579 + sig { params(key_loc: Prism::Location, value_loc: Prism::Location).void } + def initialize(key_loc, value_loc); end + + # Implement the hash pattern matching interface for MagicComment. + # + # pkg:gem/prism#lib/prism/parse_result.rb:595 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Returns a string representation of this magic comment. + # + # pkg:gem/prism#lib/prism/parse_result.rb:600 + sig { returns(String) } + def inspect; end + + # Returns the key of the magic comment by slicing it from the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:585 + sig { returns(String) } + def key; end + + # A Location object representing the location of the key in the source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:573 + sig { returns(Prism::Location) } + def key_loc; end + + # Returns the value of the magic comment by slicing it from the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:590 + sig { returns(String) } + def value; end + + # A Location object representing the location of the value in the source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:576 + sig { returns(Prism::Location) } + def value_loc; end +end + +# Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. +# +# if /foo/i then end +# ^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13224 +class Prism::MatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # Initialize a new MatchLastLineNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13226 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).void + end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13405 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13238 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13302 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13243 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13384 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:13358 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13259 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13254 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13379 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:13345 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode + # + # pkg:gem/prism#lib/prism/node.rb:13264 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::MatchLastLineNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, content_loc: self.content_loc, closing_loc: self.closing_loc, unescaped: self.unescaped); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13269 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String } + # + # pkg:gem/prism#lib/prism/node.rb:13272 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13248 + def each_child_node; end + + # def euc_jp?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13297 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13282 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13322 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13327 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13317 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13277 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13389 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13287 + sig { returns(T::Boolean) } + def multi_line?; end + + # def once?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13292 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13374 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:13332 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13366 + def save_closing_loc(repository); end + + # Save the content_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13353 + def save_content_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13340 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13394 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # pkg:gem/prism#lib/prism/node.rb:13371 + sig { returns(String) } + def unescaped; end + + # def utf_8?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13312 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:13307 + sig { returns(T::Boolean) } + def windows_31j?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13399 + def type; end + end +end + +# Represents the use of the modifier `in` operator. +# +# foo in bar +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13419 +class Prism::MatchPredicateNode < ::Prism::Node + # Initialize a new MatchPredicateNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13421 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, value, pattern, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13513 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13432 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13437 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13455 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13450 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode + # + # pkg:gem/prism#lib/prism/node.rb:13460 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::MatchPredicateNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value, pattern: self.pattern, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13465 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:13468 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13442 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13497 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13492 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:13479 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader pattern: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:13476 + sig { returns(Prism::Node) } + def pattern; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13487 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13502 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:13473 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13507 + def type; end + end +end + +# Represents the use of the `=>` operator. +# +# foo => bar +# ^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13525 +class Prism::MatchRequiredNode < ::Prism::Node + # Initialize a new MatchRequiredNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13527 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, value, pattern, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13667 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13538 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13543 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13561 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13556 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode + # + # pkg:gem/prism#lib/prism/node.rb:13566 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::MatchRequiredNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value, pattern: self.pattern, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13571 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:13574 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13548 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13651 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13646 + sig { returns(String) } + def operator; end + + # The location of the operator. + # + # foo => bar + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:13633 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the right-hand side of the operator. The type of the node depends on the expression. + # + # Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`. + # + # foo => a # This is equivalent to writing `a = foo` + # ^ + # + # Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant. + # + # foo => [a] + # ^^^ + # + # foo => a, b + # ^^^^ + # + # foo => Bar[a, b] + # ^^^^^^^^^ + # + # If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead. + # + # foo => *, 1, *a + # ^^^^^ + # + # Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`. + # + # foo => { a: 1, b: } + # + # foo => Bar[a: 1, b:] + # + # foo => Bar[**] + # + # To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode` + # + # foo => ^a + # ^^ + # + # Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`. + # + # foo => ^(a + 1) + # + # Anything else will result in the regular node for that expression, for example a `ConstantReadNode`. + # + # foo => CONST + # + # pkg:gem/prism#lib/prism/node.rb:13627 + sig { returns(Prism::Node) } + def pattern; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13641 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13656 + sig { override.returns(Symbol) } + def type; end + + # Represents the left-hand side of the operator. + # + # foo => bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:13582 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13661 + def type; end + end +end + +# Represents writing local variables using a regular expression match with named capture groups. +# +# /(?bar)/ =~ baz +# ^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13679 +class Prism::MatchWriteNode < ::Prism::Node + # Initialize a new MatchWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13681 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode] + ).void + end + def initialize(source, node_id, location, flags, call, targets); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13754 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13691 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader call: CallNode + # + # pkg:gem/prism#lib/prism/node.rb:13732 + sig { returns(Prism::CallNode) } + def call; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13696 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13714 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13709 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:13719 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode] + ).returns(Prism::MatchWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, call: self.call, targets: self.targets); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13724 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, call: CallNode, targets: Array[LocalVariableTargetNode] } + # + # pkg:gem/prism#lib/prism/node.rb:13727 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13701 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13738 + sig { override.returns(String) } + def inspect; end + + # attr_reader targets: Array[LocalVariableTargetNode] + # + # pkg:gem/prism#lib/prism/node.rb:13735 + sig { returns(T::Array[Prism::LocalVariableTargetNode]) } + def targets; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13743 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13748 + def type; end + end +end + +# Represents a node that is missing from the source and results in a syntax error. +# +# pkg:gem/prism#lib/prism/node.rb:13763 +class Prism::MissingNode < ::Prism::Node + # Initialize a new MissingNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13765 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13828 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13773 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13778 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13794 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13789 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode + # + # pkg:gem/prism#lib/prism/node.rb:13799 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::MissingNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13804 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:13807 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13783 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13812 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13817 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13822 + def type; end + end +end + +# Represents a module declaration involving the `module` keyword. +# +# module Foo end +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13837 +class Prism::ModuleNode < ::Prism::Node + # Initialize a new ModuleNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13839 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location, + name: Symbol + ).void + end + def initialize(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:13961 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13853 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: StatementsNode | BeginNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:13916 + sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13858 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:13879 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:13871 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant_path: ConstantReadNode | ConstantPathNode | MissingNode + # + # pkg:gem/prism#lib/prism/node.rb:13913 + sig { returns(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode)) } + def constant_path; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | MissingNode, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode + # + # pkg:gem/prism#lib/prism/node.rb:13884 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode), + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location, + name: Symbol + ).returns(Prism::ModuleNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, locals: self.locals, module_keyword_loc: self.module_keyword_loc, constant_path: self.constant_path, body: self.body, end_keyword_loc: self.end_keyword_loc, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:13889 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], module_keyword_loc: Location, constant_path: ConstantReadNode | ConstantPathNode | MissingNode, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:13892 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:13863 + def each_child_node; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13940 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:13919 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:13945 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # pkg:gem/prism#lib/prism/node.rb:13897 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def module_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:13935 + sig { returns(String) } + def module_keyword; end + + # attr_reader module_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:13900 + sig { returns(Prism::Location) } + def module_keyword_loc; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:13932 + sig { returns(Symbol) } + def name; end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13927 + def save_end_keyword_loc(repository); end + + # Save the module_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:13908 + def save_module_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:13950 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:13955 + def type; end + end +end + +# Represents a multi-target expression. +# +# a, (b, c) = 1, 2, 3 +# ^^^^^^ +# +# This can be a part of `MultiWriteNode` as above, or the target of a `for` loop +# +# for a, b in [[1, 2], [3, 4]] +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:13982 +class Prism::MultiTargetNode < ::Prism::Node + # Initialize a new MultiTargetNode node. + # + # pkg:gem/prism#lib/prism/node.rb:13984 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14146 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:13997 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14025 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14016 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode + # + # pkg:gem/prism#lib/prism/node.rb:14030 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location) + ).returns(Prism::MultiTargetNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, lefts: self.lefts, rest: self.rest, rights: self.rights, lparen_loc: self.lparen_loc, rparen_loc: self.rparen_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14035 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], lparen_loc: Location?, rparen_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:14038 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14007 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14130 + sig { override.returns(String) } + def inspect; end + + # Represents the targets expressions before a splat node. + # + # a, (b, c, *) = 1, 2, 3, 4, 5 + # ^^^^ + # + # The splat node can be absent, in that case all target expressions are in the left field. + # + # a, (b, c) = 1, 2, 3, 4, 5 + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:14051 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)]) + end + def lefts; end + + # def lparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:14120 + sig { returns(T.nilable(String)) } + def lparen; end + + # The location of the opening parenthesis. + # + # a, (b, c) = 1, 2, 3 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14079 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # Represents a splat node in the target expression. + # + # a, (b, *c) = 1, 2, 3, 4 + # ^^ + # + # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. + # + # a, (b, *) = 1, 2, 3, 4 + # ^ + # + # If the `*` is omitted, this field will contain an `ImplicitRestNode` + # + # a, (b,) = 1, 2, 3, 4 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14067 + sig { returns(T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode))) } + def rest; end + + # Represents the targets expressions after a splat node. + # + # a, (*, b, c) = 1, 2, 3, 4, 5 + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:14073 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)]) + end + def rights; end + + # def rparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:14125 + sig { returns(T.nilable(String)) } + def rparen; end + + # The location of the closing parenthesis. + # + # a, (b, c) = 1, 2, 3 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14101 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14093 + def save_lparen_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14115 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14135 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14140 + def type; end + end +end + +# Represents a write to a multi-target expression. +# +# a, b, c = 1, 2, 3 +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:14162 +class Prism::MultiWriteNode < ::Prism::Node + # Initialize a new MultiWriteNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14164 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14357 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14179 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14184 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14209 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14199 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode + # + # pkg:gem/prism#lib/prism/node.rb:14214 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::MultiWriteNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, lefts: self.lefts, rest: self.rest, rights: self.rights, lparen_loc: self.lparen_loc, rparen_loc: self.rparen_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14219 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:14222 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14189 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14341 + sig { override.returns(String) } + def inspect; end + + # Represents the targets expressions before a splat node. + # + # a, b, * = 1, 2, 3, 4, 5 + # ^^^^ + # + # The splat node can be absent, in that case all target expressions are in the left field. + # + # a, b, c = 1, 2, 3, 4, 5 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:14235 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)]) + end + def lefts; end + + # def lparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:14326 + sig { returns(T.nilable(String)) } + def lparen; end + + # The location of the opening parenthesis. + # + # (a, b, c) = 1, 2, 3 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14263 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:14336 + sig { returns(String) } + def operator; end + + # The location of the operator. + # + # a, b, c = 1, 2, 3 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14307 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents a splat node in the target expression. + # + # a, b, *c = 1, 2, 3, 4 + # ^^ + # + # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. + # + # a, b, * = 1, 2, 3, 4 + # ^ + # + # If the `*` is omitted, this field will contain an `ImplicitRestNode` + # + # a, b, = 1, 2, 3, 4 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14251 + sig { returns(T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode))) } + def rest; end + + # Represents the targets expressions after a splat node. + # + # a, *, b, c = 1, 2, 3, 4, 5 + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:14257 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)]) + end + def rights; end + + # def rparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:14331 + sig { returns(T.nilable(String)) } + def rparen; end + + # The location of the closing parenthesis. + # + # (a, b, c) = 1, 2, 3 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:14285 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14277 + def save_lparen_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14315 + def save_operator_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14299 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14346 + sig { override.returns(Symbol) } + def type; end + + # The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # a, b, c = 1, 2, 3 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:14323 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14351 + def type; end + end +end + +# This visitor walks through the tree and copies each node as it is being +# visited. This is useful for consumers that want to mutate the tree, as you +# can change subtrees in place without effecting the rest of the tree. +# +# pkg:gem/prism#lib/prism/mutation_compiler.rb:16 +class Prism::MutationCompiler < ::Prism::Compiler + # Copy a AliasGlobalVariableNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:18 + def visit_alias_global_variable_node(node); end + + # Copy a AliasMethodNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:23 + def visit_alias_method_node(node); end + + # Copy a AlternationPatternNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:28 + def visit_alternation_pattern_node(node); end + + # Copy a AndNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:33 + def visit_and_node(node); end + + # Copy a ArgumentsNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:38 + def visit_arguments_node(node); end + + # Copy a ArrayNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:43 + def visit_array_node(node); end + + # Copy a ArrayPatternNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:48 + def visit_array_pattern_node(node); end + + # Copy a AssocNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:53 + def visit_assoc_node(node); end + + # Copy a AssocSplatNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:58 + def visit_assoc_splat_node(node); end + + # Copy a BackReferenceReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:63 + def visit_back_reference_read_node(node); end + + # Copy a BeginNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:68 + def visit_begin_node(node); end + + # Copy a BlockArgumentNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:73 + def visit_block_argument_node(node); end + + # Copy a BlockLocalVariableNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:78 + def visit_block_local_variable_node(node); end + + # Copy a BlockNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:83 + def visit_block_node(node); end + + # Copy a BlockParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:88 + def visit_block_parameter_node(node); end + + # Copy a BlockParametersNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:93 + def visit_block_parameters_node(node); end + + # Copy a BreakNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:98 + def visit_break_node(node); end + + # Copy a CallAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:103 + def visit_call_and_write_node(node); end + + # Copy a CallNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:108 + def visit_call_node(node); end + + # Copy a CallOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:113 + def visit_call_operator_write_node(node); end + + # Copy a CallOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:118 + def visit_call_or_write_node(node); end + + # Copy a CallTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:123 + def visit_call_target_node(node); end + + # Copy a CapturePatternNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:128 + def visit_capture_pattern_node(node); end + + # Copy a CaseMatchNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:133 + def visit_case_match_node(node); end + + # Copy a CaseNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:138 + def visit_case_node(node); end + + # Copy a ClassNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:143 + def visit_class_node(node); end + + # Copy a ClassVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:148 + def visit_class_variable_and_write_node(node); end + + # Copy a ClassVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:153 + def visit_class_variable_operator_write_node(node); end + + # Copy a ClassVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:158 + def visit_class_variable_or_write_node(node); end + + # Copy a ClassVariableReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:163 + def visit_class_variable_read_node(node); end + + # Copy a ClassVariableTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:168 + def visit_class_variable_target_node(node); end + + # Copy a ClassVariableWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:173 + def visit_class_variable_write_node(node); end + + # Copy a ConstantAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:178 + def visit_constant_and_write_node(node); end + + # Copy a ConstantOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:183 + def visit_constant_operator_write_node(node); end + + # Copy a ConstantOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:188 + def visit_constant_or_write_node(node); end + + # Copy a ConstantPathAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:193 + def visit_constant_path_and_write_node(node); end + + # Copy a ConstantPathNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:198 + def visit_constant_path_node(node); end + + # Copy a ConstantPathOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:203 + def visit_constant_path_operator_write_node(node); end + + # Copy a ConstantPathOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:208 + def visit_constant_path_or_write_node(node); end + + # Copy a ConstantPathTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:213 + def visit_constant_path_target_node(node); end + + # Copy a ConstantPathWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:218 + def visit_constant_path_write_node(node); end + + # Copy a ConstantReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:223 + def visit_constant_read_node(node); end + + # Copy a ConstantTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:228 + def visit_constant_target_node(node); end + + # Copy a ConstantWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:233 + def visit_constant_write_node(node); end + + # Copy a DefNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:238 + def visit_def_node(node); end + + # Copy a DefinedNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:243 + def visit_defined_node(node); end + + # Copy a ElseNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:248 + def visit_else_node(node); end + + # Copy a EmbeddedStatementsNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:253 + def visit_embedded_statements_node(node); end + + # Copy a EmbeddedVariableNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:258 + def visit_embedded_variable_node(node); end + + # Copy a EnsureNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:263 + def visit_ensure_node(node); end + + # Copy a FalseNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:268 + def visit_false_node(node); end + + # Copy a FindPatternNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:273 + def visit_find_pattern_node(node); end + + # Copy a FlipFlopNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:278 + def visit_flip_flop_node(node); end + + # Copy a FloatNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:283 + def visit_float_node(node); end + + # Copy a ForNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:288 + def visit_for_node(node); end + + # Copy a ForwardingArgumentsNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:293 + def visit_forwarding_arguments_node(node); end + + # Copy a ForwardingParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:298 + def visit_forwarding_parameter_node(node); end + + # Copy a ForwardingSuperNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:303 + def visit_forwarding_super_node(node); end + + # Copy a GlobalVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:308 + def visit_global_variable_and_write_node(node); end + + # Copy a GlobalVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:313 + def visit_global_variable_operator_write_node(node); end + + # Copy a GlobalVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:318 + def visit_global_variable_or_write_node(node); end + + # Copy a GlobalVariableReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:323 + def visit_global_variable_read_node(node); end + + # Copy a GlobalVariableTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:328 + def visit_global_variable_target_node(node); end + + # Copy a GlobalVariableWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:333 + def visit_global_variable_write_node(node); end + + # Copy a HashNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:338 + def visit_hash_node(node); end + + # Copy a HashPatternNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:343 + def visit_hash_pattern_node(node); end + + # Copy a IfNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:348 + def visit_if_node(node); end + + # Copy a ImaginaryNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:353 + def visit_imaginary_node(node); end + + # Copy a ImplicitNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:358 + def visit_implicit_node(node); end + + # Copy a ImplicitRestNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:363 + def visit_implicit_rest_node(node); end + + # Copy a InNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:368 + def visit_in_node(node); end + + # Copy a IndexAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:373 + def visit_index_and_write_node(node); end + + # Copy a IndexOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:378 + def visit_index_operator_write_node(node); end + + # Copy a IndexOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:383 + def visit_index_or_write_node(node); end + + # Copy a IndexTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:388 + def visit_index_target_node(node); end + + # Copy a InstanceVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:393 + def visit_instance_variable_and_write_node(node); end + + # Copy a InstanceVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:398 + def visit_instance_variable_operator_write_node(node); end + + # Copy a InstanceVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:403 + def visit_instance_variable_or_write_node(node); end + + # Copy a InstanceVariableReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:408 + def visit_instance_variable_read_node(node); end + + # Copy a InstanceVariableTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:413 + def visit_instance_variable_target_node(node); end + + # Copy a InstanceVariableWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:418 + def visit_instance_variable_write_node(node); end + + # Copy a IntegerNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:423 + def visit_integer_node(node); end + + # Copy a InterpolatedMatchLastLineNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:428 + def visit_interpolated_match_last_line_node(node); end + + # Copy a InterpolatedRegularExpressionNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:433 + def visit_interpolated_regular_expression_node(node); end + + # Copy a InterpolatedStringNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:438 + def visit_interpolated_string_node(node); end + + # Copy a InterpolatedSymbolNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:443 + def visit_interpolated_symbol_node(node); end + + # Copy a InterpolatedXStringNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:448 + def visit_interpolated_x_string_node(node); end + + # Copy a ItLocalVariableReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:453 + def visit_it_local_variable_read_node(node); end + + # Copy a ItParametersNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:458 + def visit_it_parameters_node(node); end + + # Copy a KeywordHashNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:463 + def visit_keyword_hash_node(node); end + + # Copy a KeywordRestParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:468 + def visit_keyword_rest_parameter_node(node); end + + # Copy a LambdaNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:473 + def visit_lambda_node(node); end + + # Copy a LocalVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:478 + def visit_local_variable_and_write_node(node); end + + # Copy a LocalVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:483 + def visit_local_variable_operator_write_node(node); end + + # Copy a LocalVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:488 + def visit_local_variable_or_write_node(node); end + + # Copy a LocalVariableReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:493 + def visit_local_variable_read_node(node); end + + # Copy a LocalVariableTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:498 + def visit_local_variable_target_node(node); end + + # Copy a LocalVariableWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:503 + def visit_local_variable_write_node(node); end + + # Copy a MatchLastLineNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:508 + def visit_match_last_line_node(node); end + + # Copy a MatchPredicateNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:513 + def visit_match_predicate_node(node); end + + # Copy a MatchRequiredNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:518 + def visit_match_required_node(node); end + + # Copy a MatchWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:523 + def visit_match_write_node(node); end + + # Copy a MissingNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:528 + def visit_missing_node(node); end + + # Copy a ModuleNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:533 + def visit_module_node(node); end + + # Copy a MultiTargetNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:538 + def visit_multi_target_node(node); end + + # Copy a MultiWriteNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:543 + def visit_multi_write_node(node); end + + # Copy a NextNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:548 + def visit_next_node(node); end + + # Copy a NilNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:553 + def visit_nil_node(node); end + + # Copy a NoKeywordsParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:558 + def visit_no_keywords_parameter_node(node); end + + # Copy a NumberedParametersNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:563 + def visit_numbered_parameters_node(node); end + + # Copy a NumberedReferenceReadNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:568 + def visit_numbered_reference_read_node(node); end + + # Copy a OptionalKeywordParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:573 + def visit_optional_keyword_parameter_node(node); end + + # Copy a OptionalParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:578 + def visit_optional_parameter_node(node); end + + # Copy a OrNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:583 + def visit_or_node(node); end + + # Copy a ParametersNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:588 + def visit_parameters_node(node); end + + # Copy a ParenthesesNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:593 + def visit_parentheses_node(node); end + + # Copy a PinnedExpressionNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:598 + def visit_pinned_expression_node(node); end + + # Copy a PinnedVariableNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:603 + def visit_pinned_variable_node(node); end + + # Copy a PostExecutionNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:608 + def visit_post_execution_node(node); end + + # Copy a PreExecutionNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:613 + def visit_pre_execution_node(node); end + + # Copy a ProgramNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:618 + def visit_program_node(node); end + + # Copy a RangeNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:623 + def visit_range_node(node); end + + # Copy a RationalNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:628 + def visit_rational_node(node); end + + # Copy a RedoNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:633 + def visit_redo_node(node); end + + # Copy a RegularExpressionNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:638 + def visit_regular_expression_node(node); end + + # Copy a RequiredKeywordParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:643 + def visit_required_keyword_parameter_node(node); end + + # Copy a RequiredParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:648 + def visit_required_parameter_node(node); end + + # Copy a RescueModifierNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:653 + def visit_rescue_modifier_node(node); end + + # Copy a RescueNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:658 + def visit_rescue_node(node); end + + # Copy a RestParameterNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:663 + def visit_rest_parameter_node(node); end + + # Copy a RetryNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:668 + def visit_retry_node(node); end + + # Copy a ReturnNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:673 + def visit_return_node(node); end + + # Copy a SelfNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:678 + def visit_self_node(node); end + + # Copy a ShareableConstantNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:683 + def visit_shareable_constant_node(node); end + + # Copy a SingletonClassNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:688 + def visit_singleton_class_node(node); end + + # Copy a SourceEncodingNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:693 + def visit_source_encoding_node(node); end + + # Copy a SourceFileNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:698 + def visit_source_file_node(node); end + + # Copy a SourceLineNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:703 + def visit_source_line_node(node); end + + # Copy a SplatNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:708 + def visit_splat_node(node); end + + # Copy a StatementsNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:713 + def visit_statements_node(node); end + + # Copy a StringNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:718 + def visit_string_node(node); end + + # Copy a SuperNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:723 + def visit_super_node(node); end + + # Copy a SymbolNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:728 + def visit_symbol_node(node); end + + # Copy a TrueNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:733 + def visit_true_node(node); end + + # Copy a UndefNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:738 + def visit_undef_node(node); end + + # Copy a UnlessNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:743 + def visit_unless_node(node); end + + # Copy a UntilNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:748 + def visit_until_node(node); end + + # Copy a WhenNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:753 + def visit_when_node(node); end + + # Copy a WhileNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:758 + def visit_while_node(node); end + + # Copy a XStringNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:763 + def visit_x_string_node(node); end + + # Copy a YieldNode node + # + # pkg:gem/prism#lib/prism/mutation_compiler.rb:768 + def visit_yield_node(node); end +end + +# Represents the use of the `next` keyword. +# +# next 1 +# ^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:14375 +class Prism::NextNode < ::Prism::Node + # Initialize a new NextNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14377 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, arguments, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14466 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14387 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:14429 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14392 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14411 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14404 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode + # + # pkg:gem/prism#lib/prism/node.rb:14416 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location + ).returns(Prism::NextNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, arguments: self.arguments, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14421 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:14424 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14397 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14450 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:14445 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:14432 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14440 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14455 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14460 + def type; end + end +end + +# Represents the use of the `nil` keyword. +# +# nil +# ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:14477 +class Prism::NilNode < ::Prism::Node + # Initialize a new NilNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14479 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14542 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14487 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14492 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14508 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14503 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode + # + # pkg:gem/prism#lib/prism/node.rb:14513 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::NilNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14518 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:14521 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14497 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14526 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14531 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14536 + def type; end + end +end + +# Represents the use of `**nil` inside method arguments. +# +# def a(**nil) +# ^^^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:14552 +class Prism::NoKeywordsParameterNode < ::Prism::Node + # Initialize a new NoKeywordsParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14554 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, operator_loc, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14655 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14564 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14569 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14585 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14580 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:14590 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + keyword_loc: Prism::Location + ).returns(Prism::NoKeywordsParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, operator_loc: self.operator_loc, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14595 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:14598 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14574 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14639 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:14634 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:14616 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:14629 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:14603 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14624 + def save_keyword_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14611 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14644 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14649 + def type; end + end +end + +# This represents a node in the tree. It is the parent class of all of the +# various node types. +# +# pkg:gem/prism#lib/prism/node.rb:15 +class Prism::Node + abstract! + + # Accepts a visitor and calls back into the specialized visit function. + # + # pkg:gem/prism#lib/prism/node.rb:269 + sig { abstract.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Returns the first node that matches the given block when visited in a + # breadth-first search. This is useful for finding a node that matches a + # particular condition. + # + # node.breadth_first_search { |node| node.node_id == node_id } + # + # pkg:gem/prism#lib/prism/node.rb:219 + sig { params(block: T.proc.params(node: Prism::Node).returns(T::Boolean)).returns(T.nilable(Prism::Node)) } + def breadth_first_search(&block); end + + # Returns all of the nodes that match the given block when visited in a + # breadth-first search. This is useful for finding all nodes that match a + # particular condition. + # + # node.breadth_first_search_all { |node| node.is_a?(Prism::CallNode) } + # + # pkg:gem/prism#lib/prism/node.rb:237 + sig { params(block: T.proc.params(node: Prism::Node).returns(T::Boolean)).returns(T::Array[Prism::Node]) } + def breadth_first_search_all(&block); end + + # Delegates to the cached_end_code_units_column of the associated location + # object. + # + # pkg:gem/prism#lib/prism/node.rb:118 + def cached_end_code_units_column(cache); end + + # Delegates to the cached_end_code_units_offset of the associated location + # object. + # + # pkg:gem/prism#lib/prism/node.rb:86 + def cached_end_code_units_offset(cache); end + + # Delegates to the cached_start_code_units_column of the associated location + # object. + # + # pkg:gem/prism#lib/prism/node.rb:112 + def cached_start_code_units_column(cache); end + + # Delegates to the cached_start_code_units_offset of the associated location + # object. + # + # pkg:gem/prism#lib/prism/node.rb:80 + def cached_start_code_units_offset(cache); end + + # Returns an array of child nodes, including `nil`s in the place of optional + # nodes that were not present. + # + # pkg:gem/prism#lib/prism/node.rb:275 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # Returns an array of child nodes and locations that could potentially have + # comments attached to them. + # + # pkg:gem/prism#lib/prism/node.rb:296 + sig { abstract.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # Delegates to the comments of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:133 + def comments; end + + # Returns an array of child nodes, excluding any `nil`s in the place of + # optional nodes that were not present. + # + # pkg:gem/prism#lib/prism/node.rb:290 + sig { abstract.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # pkg:gem/prism#lib/prism/node.rb:279 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # pkg:gem/prism#lib/prism/node_ext.rb:10 + def deprecated(*replacements); end + + # With a block given, yields each child node. Without a block, returns + # an enumerator that contains each child node. Excludes any `nil`s in + # the place of optional nodes that were not present. + # + # pkg:gem/prism#lib/prism/node.rb:284 + def each_child_node; end + + # Delegates to the end_character_column of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:106 + def end_character_column; end + + # Delegates to the end_character_offset of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:74 + def end_character_offset; end + + # Delegates to the end_column of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:96 + def end_column; end + + # Delegates to the end_line of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:50 + def end_line; end + + # The end offset of the node in the source. This method is effectively a + # delegate method to the location object. + # + # pkg:gem/prism#lib/prism/node.rb:63 + sig { returns(Integer) } + def end_offset; end + + sig { abstract.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # pkg:gem/prism#lib/prism/node.rb:229 + def find(&block); end + + # pkg:gem/prism#lib/prism/node.rb:248 + def find_all(&block); end + + # Returns a string representation of the node. + # + # pkg:gem/prism#lib/prism/node.rb:301 + sig { abstract.returns(String) } + def inspect; end + + # Delegates to the leading_comments of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:123 + def leading_comments; end + + # A Location instance that represents the location of this node in the + # source. + # + # pkg:gem/prism#lib/prism/node.rb:33 + sig { returns(Prism::Location) } + def location; end + + # Returns true if the node has the newline flag set. + # + # pkg:gem/prism#lib/prism/node.rb:164 + sig { returns(T::Boolean) } + def newline?; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:70 + def newline_flag!(lines); end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:66 + def newline_flag?; end + + # A unique identifier for this node. This is used in a very specific + # use case where you want to keep around a reference to a node without + # having to keep around the syntax tree in memory. This unique identifier + # will be consistent across multiple parses of the same source code. + # + # pkg:gem/prism#lib/prism/node.rb:24 + sig { returns(Integer) } + def node_id; end + + # Similar to inspect, but respects the current level of indentation given by + # the pretty print object. + # + # pkg:gem/prism#lib/prism/node.rb:175 + sig { params(q: T.untyped).void } + def pretty_print(q); end + + # Save this node using a saved source so that it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:27 + def save(repository); end + + # Save the location using a saved source so that it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:40 + def save_location(repository); end + + # An alias for source_lines, used to mimic the API from + # RubyVM::AbstractSyntaxTree to make it easier to migrate. + # + # pkg:gem/prism#lib/prism/node.rb:144 + sig { returns(T::Array[String]) } + def script_lines; end + + # Slice the location of the node from the source. + # + # pkg:gem/prism#lib/prism/node.rb:147 + sig { returns(String) } + def slice; end + + # Slice the location of the node from the source, starting at the beginning + # of the line that the location starts on, ending at the end of the line + # that the location ends on. + # + # pkg:gem/prism#lib/prism/node.rb:154 + sig { returns(String) } + def slice_lines; end + + # Returns all of the lines of the source code associated with this node. + # + # pkg:gem/prism#lib/prism/node.rb:138 + sig { returns(T::Array[String]) } + def source_lines; end + + # Delegates to the start_character_column of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:101 + def start_character_column; end + + # Delegates to the start_character_offset of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:69 + def start_character_offset; end + + # Delegates to the start_column of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:91 + def start_column; end + + # Delegates to the start_line of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:45 + def start_line; end + + # The start offset of the node in the source. This method is effectively a + # delegate method to the location object. + # + # pkg:gem/prism#lib/prism/node.rb:56 + sig { returns(Integer) } + def start_offset; end + + # Returns true if the node has the static literal flag set. + # + # pkg:gem/prism#lib/prism/node.rb:169 + sig { returns(T::Boolean) } + def static_literal?; end + + # Convert this node into a graphviz dot graph string. + # + # pkg:gem/prism#lib/prism/node.rb:183 + sig { returns(String) } + def to_dot; end + + # Delegates to the trailing_comments of the associated location object. + # + # pkg:gem/prism#lib/prism/node.rb:128 + def trailing_comments; end + + # Returns a list of nodes that are descendants of this node that contain the + # given line and column. This is useful for locating a node that is selected + # based on the line and column of the source code. + # + # Important to note is that the column given to this method should be in + # bytes, as opposed to characters or code units. + # + # pkg:gem/prism#lib/prism/node.rb:194 + sig { params(line: Integer, column: Integer).returns(T::Array[Prism::Node]) } + def tunnel(line, column); end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # pkg:gem/prism#lib/prism/node.rb:317 + sig { abstract.returns(Symbol) } + def type; end + + protected + + # An bitset of flags for this node. There are certain flags that are common + # for all nodes, and then some nodes have specific flags. + # + # pkg:gem/prism#lib/prism/node.rb:160 + sig { returns(Integer) } + def flags; end + + private + + # A pointer to the source that this node was created from. + # + # pkg:gem/prism#lib/prism/node.rb:17 + sig { returns(Prism::Source) } + def source; end + + class << self + # Returns a list of the fields that exist for this node class. Fields + # describe the structure of the node. This kind of reflection is useful for + # things like recursively visiting each node _and_ field in the tree. + # + # pkg:gem/prism#lib/prism/node.rb:253 + def fields; end + + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # pkg:gem/prism#lib/prism/node.rb:325 + def type; end + end +end + +# The flags that are common to all nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19957 +module Prism::NodeFlags; end + +# A flag to indicate that the node is a candidate to emit a :line event +# through tracepoint when compiled. +# +# pkg:gem/prism#lib/prism/node.rb:19960 +Prism::NodeFlags::NEWLINE = T.let(T.unsafe(nil), Integer) + +# A flag to indicate that the value that the node represents is a value that +# can be determined at parse-time. +# +# pkg:gem/prism#lib/prism/node.rb:19964 +Prism::NodeFlags::STATIC_LITERAL = T.let(T.unsafe(nil), Integer) + +# Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. +# +# -> { _1 + _2 } +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:14666 +class Prism::NumberedParametersNode < ::Prism::Node + # Initialize a new NumberedParametersNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14668 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + maximum: Integer + ).void + end + def initialize(source, node_id, location, flags, maximum); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14735 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14677 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14682 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14698 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14693 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode + # + # pkg:gem/prism#lib/prism/node.rb:14703 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + maximum: Integer + ).returns(Prism::NumberedParametersNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, maximum: self.maximum); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14708 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, maximum: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:14711 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14687 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14719 + sig { override.returns(String) } + def inspect; end + + # attr_reader maximum: Integer + # + # pkg:gem/prism#lib/prism/node.rb:14716 + sig { returns(Integer) } + def maximum; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14724 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14729 + def type; end + end +end + +# Represents reading a numbered reference to a capture in the previous match. +# +# $1 +# ^^ +# +# pkg:gem/prism#lib/prism/node.rb:14745 +class Prism::NumberedReferenceReadNode < ::Prism::Node + # Initialize a new NumberedReferenceReadNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14747 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + number: Integer + ).void + end + def initialize(source, node_id, location, flags, number); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14820 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14756 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14761 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14777 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14772 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode + # + # pkg:gem/prism#lib/prism/node.rb:14782 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + number: Integer + ).returns(Prism::NumberedReferenceReadNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, number: self.number); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14787 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, number: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:14790 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14766 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14804 + sig { override.returns(String) } + def inspect; end + + # The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. + # + # $1 # number `1` + # + # $5432 # number `5432` + # + # $4294967296 # number `0` + # + # pkg:gem/prism#lib/prism/node.rb:14801 + sig { returns(Integer) } + def number; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14809 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14814 + def type; end + end +end + +# Represents an optional keyword parameter to a method, block, or lambda definition. +# +# def a(b: 1) +# ^^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:14831 +class Prism::OptionalKeywordParameterNode < ::Prism::Node + # Initialize a new OptionalKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14833 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:14924 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14844 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14849 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14866 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14861 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:14871 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::OptionalKeywordParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14876 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:14879 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14854 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:14908 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:14889 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:14892 + sig { returns(Prism::Location) } + def name_loc; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:14884 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:14900 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:14913 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:14905 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:14918 + def type; end + end +end + +# Represents an optional parameter to a method, block, or lambda definition. +# +# def a(b = 1) +# ^^^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:14938 +class Prism::OptionalParameterNode < ::Prism::Node + # Initialize a new OptionalParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:14940 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15050 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:14952 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14957 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:14974 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:14969 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:14979 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node + ).returns(Prism::OptionalParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc, value: self.value); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:14984 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:14987 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:14962 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15034 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:14997 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15000 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15029 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15013 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:14992 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15008 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15021 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15039 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:15026 + sig { returns(Prism::Node) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15044 + def type; end + end +end + +# Represents the use of the `||` operator or the `or` keyword. +# +# left or right +# ^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:15064 +class Prism::OrNode < ::Prism::Node + # Initialize a new OrNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15066 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, left, right, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15173 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15077 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15082 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15100 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15095 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode + # + # pkg:gem/prism#lib/prism/node.rb:15105 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location + ).returns(Prism::OrNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, left: self.left, right: self.right, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15110 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:15113 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15087 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15157 + sig { override.returns(String) } + def inspect; end + + # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # left or right + # ^^^^ + # + # 1 || 2 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:15124 + sig { returns(Prism::Node) } + def left; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15152 + sig { returns(String) } + def operator; end + + # The location of the `or` keyword or the `||` operator. + # + # left or right + # ^^ + # + # pkg:gem/prism#lib/prism/node.rb:15139 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the right side of the expression. + # + # left || right + # ^^^^^ + # + # 1 or 2 + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:15133 + sig { returns(Prism::Node) } + def right; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15147 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15162 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15167 + def type; end + end +end + +# A parser for the pack template language. +# +# pkg:gem/prism#lib/prism/pack.rb:8 +module Prism::Pack + class << self + # pkg:gem/prism#lib/prism.rb:92 + def parse(_arg0, _arg1, _arg2); end + end +end + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::AGNOSTIC_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::BACK = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::BER = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::BIG_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::COMMENT = T.let(T.unsafe(nil), Symbol) + +# A directive in the pack template language. +# +# pkg:gem/prism#lib/prism/pack.rb:62 +class Prism::Pack::Directive + # Initialize a new directive with the given values. + # + # pkg:gem/prism#lib/prism/pack.rb:91 + def initialize(version, variant, source, type, signed, endian, size, length_type, length); end + + # Provide a human-readable description of the directive. + # + # pkg:gem/prism#lib/prism/pack.rb:133 + def describe; end + + # The type of endianness of the directive. + # + # pkg:gem/prism#lib/prism/pack.rb:79 + def endian; end + + # The length of this directive (used for integers). + # + # pkg:gem/prism#lib/prism/pack.rb:88 + def length; end + + # The length type of this directive (used for integers). + # + # pkg:gem/prism#lib/prism/pack.rb:85 + def length_type; end + + # The type of signedness of the directive. + # + # pkg:gem/prism#lib/prism/pack.rb:76 + def signed; end + + # The size of the directive. + # + # pkg:gem/prism#lib/prism/pack.rb:82 + def size; end + + # A byteslice of the source string that this directive represents. + # + # pkg:gem/prism#lib/prism/pack.rb:70 + def source; end + + # The type of the directive. + # + # pkg:gem/prism#lib/prism/pack.rb:73 + def type; end + + # A symbol representing whether or not we are packing or unpacking. + # + # pkg:gem/prism#lib/prism/pack.rb:67 + def variant; end + + # A symbol representing the version of Ruby. + # + # pkg:gem/prism#lib/prism/pack.rb:64 + def version; end +end + +# The descriptions of the various types of endianness. +# +# pkg:gem/prism#lib/prism/pack.rb:104 +Prism::Pack::Directive::ENDIAN_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# The descriptions of the various types of signedness. +# +# pkg:gem/prism#lib/prism/pack.rb:113 +Prism::Pack::Directive::SIGNED_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# The descriptions of the various types of sizes. +# +# pkg:gem/prism#lib/prism/pack.rb:120 +Prism::Pack::Directive::SIZE_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::ENDIAN_NA = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::FLOAT = T.let(T.unsafe(nil), Symbol) + +# The result of parsing a pack template. +# +# pkg:gem/prism#lib/prism/pack.rb:200 +class Prism::Pack::Format + # Create a new Format with the given directives and encoding. + # + # pkg:gem/prism#lib/prism/pack.rb:208 + def initialize(directives, encoding); end + + # Provide a human-readable description of the format. + # + # pkg:gem/prism#lib/prism/pack.rb:214 + def describe; end + + # A list of the directives in the template. + # + # pkg:gem/prism#lib/prism/pack.rb:202 + def directives; end + + # The encoding of the template. + # + # pkg:gem/prism#lib/prism/pack.rb:205 + def encoding; end +end + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::INTEGER = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::LENGTH_FIXED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::LENGTH_MAX = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::LENGTH_NA = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::LENGTH_RELATIVE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::LITTLE_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::MOVE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::NATIVE_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::NULL = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIGNED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIGNED_NA = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_16 = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_32 = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_64 = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_8 = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_INT = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_LONG = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_LONG_LONG = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_NA = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_P = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SIZE_SHORT = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::SPACE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_BASE64 = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_FIXED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_HEX_HIGH = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_HEX_LOW = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_LSB = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_MIME = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_MSB = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_NULL_PADDED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_NULL_TERMINATED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_POINTER = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_SPACE_PADDED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::STRING_UU = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::UNSIGNED = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/prism#lib/prism/pack.rb:58 +Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) + +# Flags for parameter nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19864 +module Prism::ParameterFlags; end + +# a parameter name that has been repeated in the method signature +# +# pkg:gem/prism#lib/prism/node.rb:19866 +Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) + +# Represents the list of parameters on a method, block, or lambda definition. +# +# def a(b, c, d) +# ^^^^^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:15186 +class Prism::ParametersNode < ::Prism::Node + # Initialize a new ParametersNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15188 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], + optionals: T::Array[Prism::OptionalParameterNode], + rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), + posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)], + keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], + keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), + block: T.nilable(Prism::BlockParameterNode) + ).void + end + def initialize(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15294 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15203 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader block: BlockParameterNode? + # + # pkg:gem/prism#lib/prism/node.rb:15275 + sig { returns(T.nilable(Prism::BlockParameterNode)) } + def block; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15208 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15239 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15226 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?) -> ParametersNode + # + # pkg:gem/prism#lib/prism/node.rb:15244 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], + optionals: T::Array[Prism::OptionalParameterNode], + rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), + posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)], + keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], + keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), + block: T.nilable(Prism::BlockParameterNode) + ).returns(Prism::ParametersNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, requireds: self.requireds, optionals: self.optionals, rest: self.rest, posts: self.posts, keywords: self.keywords, keyword_rest: self.keyword_rest, block: self.block); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15249 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode? } + # + # pkg:gem/prism#lib/prism/node.rb:15252 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15213 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15278 + sig { override.returns(String) } + def inspect; end + + # attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:15272 + sig do + returns(T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode))) + end + def keyword_rest; end + + # attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] + # + # pkg:gem/prism#lib/prism/node.rb:15269 + sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) } + def keywords; end + + # attr_reader optionals: Array[OptionalParameterNode] + # + # pkg:gem/prism#lib/prism/node.rb:15260 + sig { returns(T::Array[Prism::OptionalParameterNode]) } + def optionals; end + + # attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] + # + # pkg:gem/prism#lib/prism/node.rb:15266 + sig do + returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)]) + end + def posts; end + + # attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode] + # + # pkg:gem/prism#lib/prism/node.rb:15257 + sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)]) } + def requireds; end + + # attr_reader rest: RestParameterNode | ImplicitRestNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:15263 + sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) } + def rest; end + + # Mirrors the Method#parameters method. + # + # pkg:gem/prism#lib/prism/node_ext.rb:272 + sig { returns(T::Array[T.any([Symbol, Symbol], [Symbol])]) } + def signature; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15283 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15288 + def type; end + end +end + +# Represents a parenthesized expression +# +# (10 + 34) +# ^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:15314 +class Prism::ParenthesesNode < ::Prism::Node + # Initialize a new ParenthesesNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15316 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, body, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15429 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15327 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:15374 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15332 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15408 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15390 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15351 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15344 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode + # + # pkg:gem/prism#lib/prism/node.rb:15356 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::ParenthesesNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, body: self.body, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15361 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Prism::node?, opening_loc: Location, closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:15364 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15337 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15413 + sig { override.returns(String) } + def inspect; end + + # def multiple_statements?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:15369 + sig { returns(T::Boolean) } + def multiple_statements?; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:86 + def newline_flag!(lines); end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15403 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15377 + sig { returns(Prism::Location) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15398 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15385 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15418 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15423 + def type; end + end +end + +# Flags for parentheses nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19870 +module Prism::ParenthesesNodeFlags; end + +# parentheses that contain multiple potentially void statements +# +# pkg:gem/prism#lib/prism/node.rb:19872 +Prism::ParenthesesNodeFlags::MULTIPLE_STATEMENTS = T.let(T.unsafe(nil), Integer) + +# This represents an error that was encountered during parsing. +# +# pkg:gem/prism#lib/prism/parse_result.rb:606 +class Prism::ParseError + # Create a new error object with the given message and location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:621 + sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void } + def initialize(type, message, location, level); end + + # Implement the hash pattern matching interface for ParseError. + # + # pkg:gem/prism#lib/prism/parse_result.rb:629 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Returns a string representation of this error. + # + # pkg:gem/prism#lib/prism/parse_result.rb:634 + sig { returns(String) } + def inspect; end + + # The level of this error. + # + # pkg:gem/prism#lib/prism/parse_result.rb:618 + sig { returns(Symbol) } + def level; end + + # A Location object representing the location of this error in the source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:615 + sig { returns(Prism::Location) } + def location; end + + # The message associated with this error. + # + # pkg:gem/prism#lib/prism/parse_result.rb:612 + sig { returns(String) } + def message; end + + # The type of error. This is an _internal_ symbol that is used for + # communicating with translation layers. It is not meant to be public API. + # + # pkg:gem/prism#lib/prism/parse_result.rb:609 + sig { returns(Symbol) } + def type; end +end + +# This is a result specific to the `parse_lex` and `parse_lex_file` methods. +# +# pkg:gem/prism#lib/prism/parse_result.rb:795 +class Prism::ParseLexResult < ::Prism::Result + # Create a new parse lex result object with the given values. + # + # pkg:gem/prism#lib/prism/parse_result.rb:801 + sig do + params( + value: [Prism::ProgramNode, T::Array[T.untyped]], + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for ParseLexResult. + # + # pkg:gem/prism#lib/prism/parse_result.rb:807 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # A tuple of the syntax tree and the list of tokens that were parsed from + # the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:798 + sig { returns([Prism::ProgramNode, T::Array[T.untyped]]) } + def value; end +end + +# This is a result specific to the `parse` and `parse_file` methods. +# +# pkg:gem/prism#lib/prism/parse_result.rb:736 +class Prism::ParseResult < ::Prism::Result + # Create a new parse result object with the given values. + # + # pkg:gem/prism#lib/prism/parse_result.rb:749 + sig do + params( + value: Prism::ProgramNode, + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Attach the list of comments to their respective locations in the tree. + # + # pkg:gem/prism#lib/prism/parse_result.rb:760 + def attach_comments!; end + + # Implement the hash pattern matching interface for ParseResult. + # + # pkg:gem/prism#lib/prism/parse_result.rb:755 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Returns a string representation of the syntax tree with the errors + # displayed inline. + # + # pkg:gem/prism#lib/prism/parse_result.rb:772 + def errors_format; end + + # Walk the tree and mark nodes that are on a new line, loosely emulating + # the behavior of CRuby's `:line` tracepoint event. + # + # pkg:gem/prism#lib/prism/parse_result.rb:766 + def mark_newlines!; end + + # The syntax tree that was parsed from the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:746 + sig { returns(Prism::ProgramNode) } + def value; end +end + +# When we've parsed the source, we have both the syntax tree and the list of +# comments that we found in the source. This class is responsible for +# walking the tree and finding the nearest location to attach each comment. +# +# It does this by first finding the nearest locations to each comment. +# Locations can either come from nodes directly or from location fields on +# nodes. For example, a `ClassNode` has an overall location encompassing the +# entire class, but it also has a location for the `class` keyword. +# +# Once the nearest locations are found, it determines which one to attach +# to. If it's a trailing comment (a comment on the same line as other source +# code), it will favor attaching to the nearest location that occurs before +# the comment. Otherwise it will favor attaching to the nearest location +# that is after the comment. +# +# pkg:gem/prism#lib/prism/parse_result/comments.rb:20 +class Prism::ParseResult::Comments + # Create a new Comments object that will attach comments to the given + # parse result. + # + # pkg:gem/prism#lib/prism/parse_result/comments.rb:87 + def initialize(parse_result); end + + # Attach the comments to their respective locations in the tree by + # mutating the parse result. + # + # pkg:gem/prism#lib/prism/parse_result/comments.rb:93 + def attach!; end + + # The parse result that we are attaching comments to. + # + # pkg:gem/prism#lib/prism/parse_result/comments.rb:83 + def parse_result; end + + private + + # Responsible for finding the nearest targets to the given comment within + # the context of the given encapsulating node. + # + # pkg:gem/prism#lib/prism/parse_result/comments.rb:120 + def nearest_targets(node, comment); end +end + +# A target for attaching comments that is based on a location field on a +# node. For example, the `end` token of a ClassNode. +# +# pkg:gem/prism#lib/prism/parse_result/comments.rb:54 +class Prism::ParseResult::Comments::LocationTarget + # pkg:gem/prism#lib/prism/parse_result/comments.rb:57 + def initialize(location); end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:69 + def encloses?(comment); end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:65 + def end_offset; end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:73 + def leading_comment(comment); end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:55 + def location; end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:61 + def start_offset; end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:77 + def trailing_comment(comment); end +end + +# A target for attaching comments that is based on a specific node's +# location. +# +# pkg:gem/prism#lib/prism/parse_result/comments.rb:23 +class Prism::ParseResult::Comments::NodeTarget + # pkg:gem/prism#lib/prism/parse_result/comments.rb:26 + def initialize(node); end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:38 + def encloses?(comment); end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:34 + def end_offset; end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:43 + def leading_comment(comment); end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:24 + def node; end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:30 + def start_offset; end + + # pkg:gem/prism#lib/prism/parse_result/comments.rb:47 + def trailing_comment(comment); end +end + +# An object to represent the set of errors on a parse result. This object +# can be used to format the errors in a human-readable way. +# +# pkg:gem/prism#lib/prism/parse_result/errors.rb:10 +class Prism::ParseResult::Errors + # Initialize a new set of errors from the given parse result. + # + # pkg:gem/prism#lib/prism/parse_result/errors.rb:15 + def initialize(parse_result); end + + # Formats the errors in a human-readable way and return them as a string. + # + # pkg:gem/prism#lib/prism/parse_result/errors.rb:20 + def format; end + + # The parse result that contains the errors. + # + # pkg:gem/prism#lib/prism/parse_result/errors.rb:12 + def parse_result; end +end + +# The :line tracepoint event gets fired whenever the Ruby VM encounters an +# expression on a new line. The types of expressions that can trigger this +# event are: +# +# * if statements +# * unless statements +# * nodes that are children of statements lists +# +# In order to keep track of the newlines, we have a list of offsets that +# come back from the parser. We assign these offsets to the first nodes that +# we find in the tree that are on those lines. +# +# Note that the logic in this file should be kept in sync with the Java +# MarkNewlinesVisitor, since that visitor is responsible for marking the +# newlines for JRuby/TruffleRuby. +# +# This file is autoloaded only when `mark_newlines!` is called, so the +# re-opening of the various nodes in this file will only be performed in +# that case. We do that to avoid storing the extra `@newline` instance +# variable on every node if we don't need it. +# +# pkg:gem/prism#lib/prism/parse_result/newlines.rb:26 +class Prism::ParseResult::Newlines < ::Prism::Visitor + # Create a new Newlines visitor with the given newline offsets. + # + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:28 + def initialize(lines); end + + # Permit block/lambda nodes to mark newlines within themselves. + # + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:34 + def visit_block_node(node); end + + # Mark if/unless nodes as newlines. + # + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:48 + def visit_if_node(node); end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:45 + def visit_lambda_node(node); end + + # Permit statements lists to mark newlines within themselves. + # + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:56 + def visit_statements_node(node); end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:53 + def visit_unless_node(node); end +end + +# This represents a warning that was encountered during parsing. +# +# pkg:gem/prism#lib/prism/parse_result.rb:640 +class Prism::ParseWarning + # Create a new warning object with the given message and location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:655 + sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void } + def initialize(type, message, location, level); end + + # Implement the hash pattern matching interface for ParseWarning. + # + # pkg:gem/prism#lib/prism/parse_result.rb:663 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Returns a string representation of this warning. + # + # pkg:gem/prism#lib/prism/parse_result.rb:668 + sig { returns(String) } + def inspect; end + + # The level of this warning. + # + # pkg:gem/prism#lib/prism/parse_result.rb:652 + sig { returns(Symbol) } + def level; end + + # A Location object representing the location of this warning in the source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:649 + sig { returns(Prism::Location) } + def location; end + + # The message associated with this warning. + # + # pkg:gem/prism#lib/prism/parse_result.rb:646 + sig { returns(String) } + def message; end + + # The type of warning. This is an _internal_ symbol that is used for + # communicating with translation layers. It is not meant to be public API. + # + # pkg:gem/prism#lib/prism/parse_result.rb:643 + sig { returns(Symbol) } + def type; end +end + +# A pattern is an object that wraps a Ruby pattern matching expression. The +# expression would normally be passed to an `in` clause within a `case` +# expression or a rightward assignment expression. For example, in the +# following snippet: +# +# case node +# in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] +# end +# +# the pattern is the ConstantPathNode[...] expression. +# +# The pattern gets compiled into an object that responds to #call by running +# the #compile method. This method itself will run back through Prism to +# parse the expression into a tree, then walk the tree to generate the +# necessary callable objects. For example, if you wanted to compile the +# expression above into a callable, you would: +# +# callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile +# callable.call(node) +# +# The callable object returned by #compile is guaranteed to respond to #call +# with a single argument, which is the node to match against. It also is +# guaranteed to respond to #===, which means it itself can be used in a `case` +# expression, as in: +# +# case node +# when callable +# end +# +# If the query given to the initializer cannot be compiled into a valid +# matcher (either because of a syntax error or because it is using syntax we +# do not yet support) then a Prism::Pattern::CompilationError will be +# raised. +# +# pkg:gem/prism#lib/prism/pattern.rb:38 +class Prism::Pattern + # Create a new pattern with the given query. The query should be a string + # containing a Ruby pattern matching expression. + # + # pkg:gem/prism#lib/prism/pattern.rb:64 + def initialize(query); end + + # Compile the query into a callable object that can be used to match against + # nodes. + # + # pkg:gem/prism#lib/prism/pattern.rb:71 + def compile; end + + # The query that this pattern was initialized with. + # + # pkg:gem/prism#lib/prism/pattern.rb:60 + def query; end + + # Scan the given node and all of its children for nodes that match the + # pattern. If a block is given, it will be called with each node that + # matches the pattern. If no block is given, an enumerator will be returned + # that will yield each node that matches the pattern. + # + # pkg:gem/prism#lib/prism/pattern.rb:87 + def scan(root); end + + private + + # Shortcut for combining two procs into one that returns true if both return + # true. + # + # pkg:gem/prism#lib/prism/pattern.rb:103 + def combine_and(left, right); end + + # Shortcut for combining two procs into one that returns true if either + # returns true. + # + # pkg:gem/prism#lib/prism/pattern.rb:109 + def combine_or(left, right); end + + # in foo | bar + # + # pkg:gem/prism#lib/prism/pattern.rb:144 + def compile_alternation_pattern_node(node); end + + # in [foo, bar, baz] + # + # pkg:gem/prism#lib/prism/pattern.rb:119 + def compile_array_pattern_node(node); end + + # Compile a name associated with a constant. + # + # pkg:gem/prism#lib/prism/pattern.rb:169 + def compile_constant_name(node, name); end + + # in Prism::ConstantReadNode + # + # pkg:gem/prism#lib/prism/pattern.rb:149 + def compile_constant_path_node(node); end + + # in ConstantReadNode + # in String + # + # pkg:gem/prism#lib/prism/pattern.rb:164 + def compile_constant_read_node(node); end + + # Raise an error because the given node is not supported. + # + # pkg:gem/prism#lib/prism/pattern.rb:114 + def compile_error(node); end + + # in InstanceVariableReadNode[name: Symbol] + # in { name: Symbol } + # + # pkg:gem/prism#lib/prism/pattern.rb:185 + def compile_hash_pattern_node(node); end + + # in nil + # + # pkg:gem/prism#lib/prism/pattern.rb:215 + def compile_nil_node(node); end + + # Compile any kind of node. Dispatch out to the individual compilation + # methods based on the type of node. + # + # pkg:gem/prism#lib/prism/pattern.rb:244 + def compile_node(node); end + + # in /foo/ + # + # pkg:gem/prism#lib/prism/pattern.rb:220 + def compile_regular_expression_node(node); end + + # in "" + # in "foo" + # + # pkg:gem/prism#lib/prism/pattern.rb:228 + def compile_string_node(node); end + + # in :+ + # in :foo + # + # pkg:gem/prism#lib/prism/pattern.rb:236 + def compile_symbol_node(node); end +end + +# Raised when the query given to a pattern is either invalid Ruby syntax or +# is using syntax that we don't yet support. +# +# pkg:gem/prism#lib/prism/pattern.rb:41 +class Prism::Pattern::CompilationError < ::StandardError + # Create a new CompilationError with the given representation of the node + # that caused the error. + # + # pkg:gem/prism#lib/prism/pattern.rb:44 + def initialize(repr); end +end + +# Represents the use of the `^` operator for pinning an expression in a pattern matching expression. +# +# foo in ^(bar) +# ^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:15442 +class Prism::PinnedExpressionNode < ::Prism::Node + # Initialize a new PinnedExpressionNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15444 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15581 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15456 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15461 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15478 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15473 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode + # + # pkg:gem/prism#lib/prism/node.rb:15483 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location + ).returns(Prism::PinnedExpressionNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, expression: self.expression, operator_loc: self.operator_loc, lparen_loc: self.lparen_loc, rparen_loc: self.rparen_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15488 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:15491 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15466 + def each_child_node; end + + # The expression used in the pinned expression + # + # foo in ^(bar) + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:15499 + sig { returns(Prism::Node) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15565 + sig { override.returns(String) } + def inspect; end + + # def lparen: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15555 + sig { returns(String) } + def lparen; end + + # The location of the opening parenthesis. + # + # foo in ^(bar) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:15521 + sig { returns(Prism::Location) } + def lparen_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15550 + sig { returns(String) } + def operator; end + + # The location of the `^` operator + # + # foo in ^(bar) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:15505 + sig { returns(Prism::Location) } + def operator_loc; end + + # def rparen: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15560 + sig { returns(String) } + def rparen; end + + # The location of the closing parenthesis. + # + # foo in ^(bar) + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:15537 + sig { returns(Prism::Location) } + def rparen_loc; end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15529 + def save_lparen_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15513 + def save_operator_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15545 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15570 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15575 + def type; end + end +end + +# Represents the use of the `^` operator for pinning a variable in a pattern matching expression. +# +# foo in ^bar +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:15594 +class Prism::PinnedVariableNode < ::Prism::Node + # Initialize a new PinnedVariableNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15596 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + variable: T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, variable, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15689 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15606 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15611 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15628 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15623 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode, ?operator_loc: Location) -> PinnedVariableNode + # + # pkg:gem/prism#lib/prism/node.rb:15633 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + variable: T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode), + operator_loc: Prism::Location + ).returns(Prism::PinnedVariableNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, variable: self.variable, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15638 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:15641 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15616 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15673 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15668 + sig { returns(String) } + def operator; end + + # The location of the `^` operator + # + # foo in ^bar + # ^ + # + # pkg:gem/prism#lib/prism/node.rb:15655 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15663 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15678 + sig { override.returns(Symbol) } + def type; end + + # The variable used in the pinned expression + # + # foo in ^bar + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:15649 + sig do + returns(T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode)) + end + def variable; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15683 + def type; end + end +end + +# Represents the use of the `END` keyword. +# +# END { foo } +# ^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:15700 +class Prism::PostExecutionNode < ::Prism::Node + # Initialize a new PostExecutionNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15702 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15829 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15714 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15719 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15808 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15785 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15738 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15731 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode + # + # pkg:gem/prism#lib/prism/node.rb:15743 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::PostExecutionNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, statements: self.statements, keyword_loc: self.keyword_loc, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15748 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:15751 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15724 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15813 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15798 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15759 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15803 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15772 + sig { returns(Prism::Location) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15793 + def save_closing_loc(repository); end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15767 + def save_keyword_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15780 + def save_opening_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:15756 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15818 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15823 + def type; end + end +end + +# Represents the use of the `BEGIN` keyword. +# +# BEGIN { foo } +# ^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:15842 +class Prism::PreExecutionNode < ::Prism::Node + # Initialize a new PreExecutionNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15844 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:15971 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15856 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15861 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15950 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15927 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:15880 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:15873 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode + # + # pkg:gem/prism#lib/prism/node.rb:15885 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location + ).returns(Prism::PreExecutionNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, statements: self.statements, keyword_loc: self.keyword_loc, opening_loc: self.opening_loc, closing_loc: self.closing_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15890 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:15893 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:15866 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:15955 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15940 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15901 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:15945 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:15914 + sig { returns(Prism::Location) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15935 + def save_closing_loc(repository); end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15909 + def save_keyword_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:15922 + def save_opening_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:15898 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:15960 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:15965 + def type; end + end +end + +# The top level node of any parse tree. +# +# pkg:gem/prism#lib/prism/node.rb:15981 +class Prism::ProgramNode < ::Prism::Node + # Initialize a new ProgramNode node. + # + # pkg:gem/prism#lib/prism/node.rb:15983 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + statements: Prism::StatementsNode + ).void + end + def initialize(source, node_id, location, flags, locals, statements); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16055 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:15993 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:15998 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16015 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16010 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode + # + # pkg:gem/prism#lib/prism/node.rb:16020 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + statements: Prism::StatementsNode + ).returns(Prism::ProgramNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, locals: self.locals, statements: self.statements); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16025 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], statements: StatementsNode } + # + # pkg:gem/prism#lib/prism/node.rb:16028 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16003 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16039 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # pkg:gem/prism#lib/prism/node.rb:16033 + sig { returns(T::Array[Symbol]) } + def locals; end + + # attr_reader statements: StatementsNode + # + # pkg:gem/prism#lib/prism/node.rb:16036 + sig { returns(Prism::StatementsNode) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16044 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16049 + def type; end + end +end + +# Flags for range and flip-flop nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19876 +module Prism::RangeFlags; end + +# ... operator +# +# pkg:gem/prism#lib/prism/node.rb:19878 +Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) + +# Represents the use of the `..` or `...` operators. +# +# 1..2 +# ^^^^ +# +# c if a =~ /left/ ... b =~ /right/ +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:16070 +class Prism::RangeNode < ::Prism::Node + # Initialize a new RangeNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16072 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, left, right, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16185 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16083 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16088 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16109 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16101 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode + # + # pkg:gem/prism#lib/prism/node.rb:16114 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location + ).returns(Prism::RangeNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, left: self.left, right: self.right, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16119 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:16122 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16093 + def each_child_node; end + + # def exclude_end?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16127 + sig { returns(T::Boolean) } + def exclude_end?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16169 + sig { override.returns(String) } + def inspect; end + + # The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # 1... + # ^ + # + # hello...goodbye + # ^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:16138 + sig { returns(T.nilable(Prism::Node)) } + def left; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:16164 + sig { returns(String) } + def operator; end + + # The location of the `..` or `...` operator. + # + # pkg:gem/prism#lib/prism/node.rb:16151 + sig { returns(Prism::Location) } + def operator_loc; end + + # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # ..5 + # ^ + # + # 1...foo + # ^^^ + # If neither right-hand or left-hand side was included, this will be a MissingNode. + # + # pkg:gem/prism#lib/prism/node.rb:16148 + sig { returns(T.nilable(Prism::Node)) } + def right; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16159 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16174 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16179 + def type; end + end +end + +# Represents a rational number literal. +# +# 1.0r +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:16198 +class Prism::RationalNode < ::Prism::Node + # Initialize a new RationalNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16200 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + numerator: Integer, + denominator: Integer + ).void + end + def initialize(source, node_id, location, flags, numerator, denominator); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16295 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16210 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def binary?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16249 + sig { returns(T::Boolean) } + def binary?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16215 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16231 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16226 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode + # + # pkg:gem/prism#lib/prism/node.rb:16236 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + numerator: Integer, + denominator: Integer + ).returns(Prism::RationalNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, numerator: self.numerator, denominator: self.denominator); end + + # def decimal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16254 + sig { returns(T::Boolean) } + def decimal?; end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16241 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numerator: Integer, denominator: Integer } + # + # pkg:gem/prism#lib/prism/node.rb:16244 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The denominator of the rational number. + # + # 1.5r # denominator 2 + # + # pkg:gem/prism#lib/prism/node.rb:16276 + sig { returns(Integer) } + def denominator; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16220 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def hexadecimal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16264 + sig { returns(T::Boolean) } + def hexadecimal?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16279 + sig { override.returns(String) } + def inspect; end + + # The numerator of the rational number. + # + # 1.5r # numerator 3 + # + # pkg:gem/prism#lib/prism/node.rb:16271 + sig { returns(Integer) } + def numerator; end + + # Returns the value of the node as an IntegerNode or a FloatNode. This + # method is deprecated in favor of #value or #numerator/#denominator. + # + # pkg:gem/prism#lib/prism/node_ext.rb:123 + def numeric; end + + # def octal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16259 + sig { returns(T::Boolean) } + def octal?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16284 + sig { override.returns(Symbol) } + def type; end + + # Returns the value of the node as a Ruby Rational. + # + # pkg:gem/prism#lib/prism/node_ext.rb:117 + sig { returns(Rational) } + def value; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16289 + def type; end + end +end + +# Represents the use of the `redo` keyword. +# +# redo +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:16307 +class Prism::RedoNode < ::Prism::Node + # Initialize a new RedoNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16309 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16372 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16317 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16322 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16338 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16333 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode + # + # pkg:gem/prism#lib/prism/node.rb:16343 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::RedoNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16348 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:16351 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16327 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16356 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16361 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16366 + def type; end + end +end + +# The Reflection module provides the ability to reflect on the structure of +# the syntax tree itself, as opposed to looking at a single syntax tree. This +# is useful in metaprogramming contexts. +# +# pkg:gem/prism#lib/prism/reflection.rb:16 +module Prism::Reflection + class << self + # Returns the fields for the given node. + # + # pkg:gem/prism#lib/prism/reflection.rb:107 + sig { params(node: T.class_of(Prism::Node)).returns(T::Array[Prism::Reflection::Field]) } + def fields_for(node); end + end +end + +# A constant field represents a constant value on a node. Effectively, it +# represents an identifier found within the source. It resolves to a symbol +# in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:48 +class Prism::Reflection::ConstantField < ::Prism::Reflection::Field; end + +# A constant list field represents a list of constant values on a node. It +# resolves to an array of symbols in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:58 +class Prism::Reflection::ConstantListField < ::Prism::Reflection::Field; end + +# A field represents a single piece of data on a node. It is the base class +# for all other field types. +# +# pkg:gem/prism#lib/prism/reflection.rb:19 +class Prism::Reflection::Field + # Initializes the field with the given name. + # + # pkg:gem/prism#lib/prism/reflection.rb:24 + sig { params(name: Symbol).void } + def initialize(name); end + + # The name of the field. + # + # pkg:gem/prism#lib/prism/reflection.rb:21 + sig { returns(Symbol) } + def name; end +end + +# A flags field represents a bitset of flags on a node. It resolves to an +# integer in Ruby. Note that the flags cannot be accessed directly on the +# node because the integer is kept private. Instead, the various flags in +# the bitset should be accessed through their query methods. +# +# pkg:gem/prism#lib/prism/reflection.rb:95 +class Prism::Reflection::FlagsField < ::Prism::Reflection::Field + # Initializes the flags field with the given name and flags. + # + # pkg:gem/prism#lib/prism/reflection.rb:100 + sig { params(name: Symbol, flags: T::Array[Symbol]).void } + def initialize(name, flags); end + + # The names of the flags in the bitset. + # + # pkg:gem/prism#lib/prism/reflection.rb:97 + sig { returns(T::Array[Symbol]) } + def flags; end +end + +# A float field represents a double-precision floating point value. It is +# used exclusively to represent the value of a floating point literal. It +# resolves to a Float in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:88 +class Prism::Reflection::FloatField < ::Prism::Reflection::Field; end + +# An integer field represents an integer value. It is used to represent the +# value of an integer literal, the depth of local variables, and the number +# of a numbered reference. It resolves to an Integer in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:82 +class Prism::Reflection::IntegerField < ::Prism::Reflection::Field; end + +# A location field represents the location of some part of the node in the +# source code. For example, the location of a keyword or an operator. It +# resolves to a Prism::Location in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:70 +class Prism::Reflection::LocationField < ::Prism::Reflection::Field; end + +# A node field represents a single child node in the syntax tree. It +# resolves to a Prism::Node in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:31 +class Prism::Reflection::NodeField < ::Prism::Reflection::Field; end + +# A node list field represents a list of child nodes in the syntax tree. It +# resolves to an array of Prism::Node instances in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:42 +class Prism::Reflection::NodeListField < ::Prism::Reflection::Field; end + +# An optional constant field represents a constant value on a node that may +# or may not be present. It resolves to either a symbol or nil in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:53 +class Prism::Reflection::OptionalConstantField < ::Prism::Reflection::Field; end + +# An optional location field represents the location of some part of the +# node in the source code that may or may not be present. It resolves to +# either a Prism::Location or nil in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:76 +class Prism::Reflection::OptionalLocationField < ::Prism::Reflection::Field; end + +# An optional node field represents a single child node in the syntax tree +# that may or may not be present. It resolves to either a Prism::Node or nil +# in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:37 +class Prism::Reflection::OptionalNodeField < ::Prism::Reflection::Field; end + +# A string field represents a string value on a node. It almost always +# represents the unescaped value of a string-like literal. It resolves to a +# string in Ruby. +# +# pkg:gem/prism#lib/prism/reflection.rb:64 +class Prism::Reflection::StringField < ::Prism::Reflection::Field; end + +# Flags for regular expression and match last line nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19882 +module Prism::RegularExpressionFlags; end + +# n - forces the ASCII-8BIT encoding +# +# pkg:gem/prism#lib/prism/node.rb:19899 +Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) + +# e - forces the EUC-JP encoding +# +# pkg:gem/prism#lib/prism/node.rb:19896 +Prism::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer) + +# x - ignores whitespace and allows comments in regular expressions +# +# pkg:gem/prism#lib/prism/node.rb:19887 +Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to binary +# +# pkg:gem/prism#lib/prism/node.rb:19911 +Prism::RegularExpressionFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to US-ASCII +# +# pkg:gem/prism#lib/prism/node.rb:19914 +Prism::RegularExpressionFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# pkg:gem/prism#lib/prism/node.rb:19908 +Prism::RegularExpressionFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# i - ignores the case of characters when matching +# +# pkg:gem/prism#lib/prism/node.rb:19884 +Prism::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer) + +# m - allows $ to match the end of lines within strings +# +# pkg:gem/prism#lib/prism/node.rb:19890 +Prism::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer) + +# o - only interpolates values into the regular expression once +# +# pkg:gem/prism#lib/prism/node.rb:19893 +Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) + +# u - forces the UTF-8 encoding +# +# pkg:gem/prism#lib/prism/node.rb:19905 +Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) + +# s - forces the Windows-31J encoding +# +# pkg:gem/prism#lib/prism/node.rb:19902 +Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) + +# Represents a regular expression literal with no interpolation. +# +# /foo/i +# ^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:16381 +class Prism::RegularExpressionNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # Initialize a new RegularExpressionNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16383 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).void + end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16562 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16395 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16459 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16400 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:16541 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:16515 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16416 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16411 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:16536 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:16502 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode + # + # pkg:gem/prism#lib/prism/node.rb:16421 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::RegularExpressionNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, content_loc: self.content_loc, closing_loc: self.closing_loc, unescaped: self.unescaped); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16426 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String } + # + # pkg:gem/prism#lib/prism/node.rb:16429 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16405 + def each_child_node; end + + # def euc_jp?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16454 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16439 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16479 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16484 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16474 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16434 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16546 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16444 + sig { returns(T::Boolean) } + def multi_line?; end + + # def once?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16449 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:16531 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:16489 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16523 + def save_closing_loc(repository); end + + # Save the content_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16510 + def save_content_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16497 + def save_opening_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16551 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # pkg:gem/prism#lib/prism/node.rb:16528 + sig { returns(String) } + def unescaped; end + + # def utf_8?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16469 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16464 + sig { returns(T::Boolean) } + def windows_31j?; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16556 + def type; end + end +end + +# pkg:gem/prism#lib/prism/node_ext.rb:23 +module Prism::RegularExpressionOptions + # Returns a numeric value that represents the flags that were used to create + # the regular expression. + # + # pkg:gem/prism#lib/prism/node_ext.rb:26 + def options; end +end + +# Prism parses deterministically for the same input. This provides a nice +# property that is exposed through the #node_id API on nodes. Effectively this +# means that for the same input, these values will remain consistent every +# time the source is parsed. This means we can reparse the source same with a +# #node_id value and find the exact same node again. +# +# The Relocation module provides an API around this property. It allows you to +# "save" nodes and locations using a minimal amount of memory (just the +# node_id and a field identifier) and then reify them later. +# +# pkg:gem/prism#lib/prism/relocation.rb:14 +module Prism::Relocation + class << self + # Create a new repository for the given filepath. + # + # pkg:gem/prism#lib/prism/relocation.rb:496 + def filepath(value); end + + # Create a new repository for the given string. + # + # pkg:gem/prism#lib/prism/relocation.rb:501 + def string(value); end + end +end + +# A field representing the start and end character columns. +# +# pkg:gem/prism#lib/prism/relocation.rb:270 +class Prism::Relocation::CharacterColumnsField + # Fetches the start and end character column of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:272 + def fields(value); end +end + +# A field representing the start and end character offsets. +# +# pkg:gem/prism#lib/prism/relocation.rb:218 +class Prism::Relocation::CharacterOffsetsField + # Fetches the start and end character offset of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:220 + def fields(value); end +end + +# A field representing the start and end code unit columns for a specific +# encoding. +# +# pkg:gem/prism#lib/prism/relocation.rb:282 +class Prism::Relocation::CodeUnitColumnsField + # Initialize a new field with the associated repository and encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:291 + def initialize(repository, encoding); end + + # The associated encoding for the code units. + # + # pkg:gem/prism#lib/prism/relocation.rb:288 + def encoding; end + + # Fetches the start and end code units column of a value for a particular + # encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:299 + def fields(value); end + + # The repository object that is used for lazily creating a code units + # cache. + # + # pkg:gem/prism#lib/prism/relocation.rb:285 + def repository; end + + private + + # Lazily create a code units cache for the associated encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:309 + def cache; end +end + +# A field representing the start and end code unit offsets. +# +# pkg:gem/prism#lib/prism/relocation.rb:229 +class Prism::Relocation::CodeUnitOffsetsField + # Initialize a new field with the associated repository and encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:238 + def initialize(repository, encoding); end + + # The associated encoding for the code units. + # + # pkg:gem/prism#lib/prism/relocation.rb:235 + def encoding; end + + # Fetches the start and end code units offset of a value for a particular + # encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:246 + def fields(value); end + + # A pointer to the repository object that is used for lazily creating a + # code units cache. + # + # pkg:gem/prism#lib/prism/relocation.rb:232 + def repository; end + + private + + # Lazily create a code units cache for the associated encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:256 + def cache; end +end + +# A field representing the start and end byte columns. +# +# pkg:gem/prism#lib/prism/relocation.rb:262 +class Prism::Relocation::ColumnsField + # Fetches the start and end byte column of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:264 + def fields(value); end +end + +# An abstract field used as the parent class of the two comments fields. +# +# pkg:gem/prism#lib/prism/relocation.rb:315 +class Prism::Relocation::CommentsField + private + + # Create comment objects from the given values. + # + # pkg:gem/prism#lib/prism/relocation.rb:330 + def comments(values); end +end + +# An object that represents a slice of a comment. +# +# pkg:gem/prism#lib/prism/relocation.rb:317 +class Prism::Relocation::CommentsField::Comment + # Initialize a new comment with the given slice. + # + # pkg:gem/prism#lib/prism/relocation.rb:322 + def initialize(slice); end + + # The slice of the comment. + # + # pkg:gem/prism#lib/prism/relocation.rb:319 + def slice; end +end + +# An entry in a repository that will lazily reify its values when they are +# first accessed. +# +# pkg:gem/prism#lib/prism/relocation.rb:17 +class Prism::Relocation::Entry + # Initialize a new entry with the given repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:25 + def initialize(repository); end + + # Fetch the leading and trailing comments of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:120 + def comments; end + + # Fetch the end character column of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:93 + def end_character_column; end + + # Fetch the end character offset of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:61 + def end_character_offset; end + + # Fetch the end code units column of the value, for the encoding that was + # configured on the repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:105 + def end_code_units_column; end + + # Fetch the end code units offset of the value, for the encoding that was + # configured on the repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:73 + def end_code_units_offset; end + + # Fetch the end byte column of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:83 + def end_column; end + + # Fetch the end line of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:41 + def end_line; end + + # Fetch the end byte offset of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:51 + def end_offset; end + + # Fetch the filepath of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:31 + def filepath; end + + # Fetch the leading comments of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:110 + def leading_comments; end + + # Reify the values on this entry with the given values. This is an + # internal-only API that is called from the repository when it is time to + # reify the values. + # + # pkg:gem/prism#lib/prism/relocation.rb:127 + def reify!(values); end + + # Fetch the start character column of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:88 + def start_character_column; end + + # Fetch the start character offset of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:56 + def start_character_offset; end + + # Fetch the start code units column of the value, for the encoding that + # was configured on the repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:99 + def start_code_units_column; end + + # Fetch the start code units offset of the value, for the encoding that + # was configured on the repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:67 + def start_code_units_offset; end + + # Fetch the start byte column of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:78 + def start_column; end + + # Fetch the start line of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:36 + def start_line; end + + # Fetch the start byte offset of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:46 + def start_offset; end + + # Fetch the trailing comments of the value. + # + # pkg:gem/prism#lib/prism/relocation.rb:115 + def trailing_comments; end + + private + + # Fetch a value from the entry, raising an error if it is missing. + # + # pkg:gem/prism#lib/prism/relocation.rb:135 + def fetch_value(name); end + + # Return the values from the repository, reifying them if necessary. + # + # pkg:gem/prism#lib/prism/relocation.rb:143 + def values; end +end + +# Raised if a value that could potentially be on an entry is missing +# because it was either not configured on the repository or it has not yet +# been fetched. +# +# pkg:gem/prism#lib/prism/relocation.rb:21 +class Prism::Relocation::Entry::MissingValueError < ::StandardError; end + +# A field that represents the file path. +# +# pkg:gem/prism#lib/prism/relocation.rb:186 +class Prism::Relocation::FilepathField + # Initialize a new field with the given file path. + # + # pkg:gem/prism#lib/prism/relocation.rb:191 + def initialize(value); end + + # Fetch the file path. + # + # pkg:gem/prism#lib/prism/relocation.rb:196 + def fields(_value); end + + # The file path that this field represents. + # + # pkg:gem/prism#lib/prism/relocation.rb:188 + def value; end +end + +# A field representing the leading comments. +# +# pkg:gem/prism#lib/prism/relocation.rb:336 +class Prism::Relocation::LeadingCommentsField < ::Prism::Relocation::CommentsField + # Fetches the leading comments of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:338 + def fields(value); end +end + +# A field representing the start and end lines. +# +# pkg:gem/prism#lib/prism/relocation.rb:202 +class Prism::Relocation::LinesField + # Fetches the start and end line of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:204 + def fields(value); end +end + +# A field representing the start and end byte offsets. +# +# pkg:gem/prism#lib/prism/relocation.rb:210 +class Prism::Relocation::OffsetsField + # Fetches the start and end byte offset of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:212 + def fields(value); end +end + +# A repository is a configured collection of fields and a set of entries +# that knows how to reparse a source and reify the values. +# +# pkg:gem/prism#lib/prism/relocation.rb:353 +class Prism::Relocation::Repository + # Initialize a new repository with the given source. + # + # pkg:gem/prism#lib/prism/relocation.rb:370 + def initialize(source); end + + # Configure the character columns field for this repository and return + # self. + # + # pkg:gem/prism#lib/prism/relocation.rb:416 + def character_columns; end + + # Configure the character offsets field for this repository and return + # self. + # + # pkg:gem/prism#lib/prism/relocation.rb:399 + def character_offsets; end + + # Configure the code unit columns field for this repository for a specific + # encoding and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:422 + def code_unit_columns(encoding); end + + # Configure the code unit offsets field for this repository for a specific + # encoding and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:405 + def code_unit_offsets(encoding); end + + # Create a code units cache for the given encoding from the source. + # + # pkg:gem/prism#lib/prism/relocation.rb:377 + def code_units_cache(encoding); end + + # Configure the columns field for this repository and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:410 + def columns; end + + # Configure both the leading and trailing comment fields for this + # repository and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:440 + def comments; end + + # This method is called from nodes and locations when they want to enter + # themselves into the repository. It it internal-only and meant to be + # called from the #save* APIs. + # + # pkg:gem/prism#lib/prism/relocation.rb:447 + def enter(node_id, field_name); end + + # The entries that have been saved on this repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:367 + def entries; end + + # The fields that have been configured on this repository. + # + # pkg:gem/prism#lib/prism/relocation.rb:364 + def fields; end + + # Configure the filepath field for this repository and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:382 + def filepath; end + + # Configure the leading comments field for this repository and return + # self. + # + # pkg:gem/prism#lib/prism/relocation.rb:428 + def leading_comments; end + + # Configure the lines field for this repository and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:388 + def lines; end + + # Configure the offsets field for this repository and return self. + # + # pkg:gem/prism#lib/prism/relocation.rb:393 + def offsets; end + + # This method is called from the entries in the repository when they need + # to reify their values. It is internal-only and meant to be called from + # the various value APIs. + # + # pkg:gem/prism#lib/prism/relocation.rb:456 + def reify!; end + + # The source associated with this repository. This will be either a + # SourceFilepath (the most common use case) or a SourceString. + # + # pkg:gem/prism#lib/prism/relocation.rb:361 + def source; end + + # Configure the trailing comments field for this repository and return + # self. + # + # pkg:gem/prism#lib/prism/relocation.rb:434 + def trailing_comments; end + + private + + # Append the given field to the repository and return the repository so + # that these calls can be chained. + # + # pkg:gem/prism#lib/prism/relocation.rb:488 + def field(name, value); end +end + +# Raised when multiple fields of the same type are configured on the same +# repository. +# +# pkg:gem/prism#lib/prism/relocation.rb:356 +class Prism::Relocation::Repository::ConfigurationError < ::StandardError; end + +# Represents the source of a repository that will be reparsed. +# +# pkg:gem/prism#lib/prism/relocation.rb:149 +class Prism::Relocation::Source + # Initialize the source with the given value. + # + # pkg:gem/prism#lib/prism/relocation.rb:154 + def initialize(value); end + + # Create a code units cache for the given encoding. + # + # pkg:gem/prism#lib/prism/relocation.rb:164 + def code_units_cache(encoding); end + + # Reparse the value and return the parse result. + # + # pkg:gem/prism#lib/prism/relocation.rb:159 + def result; end + + # The value that will need to be reparsed. + # + # pkg:gem/prism#lib/prism/relocation.rb:151 + def value; end +end + +# A source that is represented by a file path. +# +# pkg:gem/prism#lib/prism/relocation.rb:170 +class Prism::Relocation::SourceFilepath < ::Prism::Relocation::Source + # Reparse the file and return the parse result. + # + # pkg:gem/prism#lib/prism/relocation.rb:172 + def result; end +end + +# A source that is represented by a string. +# +# pkg:gem/prism#lib/prism/relocation.rb:178 +class Prism::Relocation::SourceString < ::Prism::Relocation::Source + # Reparse the string and return the parse result. + # + # pkg:gem/prism#lib/prism/relocation.rb:180 + def result; end +end + +# A field representing the trailing comments. +# +# pkg:gem/prism#lib/prism/relocation.rb:344 +class Prism::Relocation::TrailingCommentsField < ::Prism::Relocation::CommentsField + # Fetches the trailing comments of a value. + # + # pkg:gem/prism#lib/prism/relocation.rb:346 + def fields(value); end +end + +# Represents a required keyword parameter to a method, block, or lambda definition. +# +# def a(b: ) +# ^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:16577 +class Prism::RequiredKeywordParameterNode < ::Prism::Node + # Initialize a new RequiredKeywordParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16579 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16665 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16589 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16594 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16610 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16605 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:16615 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol, + name_loc: Prism::Location + ).returns(Prism::RequiredKeywordParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16620 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:16623 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16599 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16649 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:16633 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:16636 + sig { returns(Prism::Location) } + def name_loc; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16628 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16644 + def save_name_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16654 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16659 + def type; end + end +end + +# Represents a required parameter to a method, block, or lambda definition. +# +# def a(b) +# ^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:16678 +class Prism::RequiredParameterNode < ::Prism::Node + # Initialize a new RequiredParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16680 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void } + def initialize(source, node_id, location, flags, name); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16752 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16689 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16694 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16710 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16705 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:16715 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: Symbol + ).returns(Prism::RequiredParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16720 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol } + # + # pkg:gem/prism#lib/prism/node.rb:16723 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16699 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16736 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # pkg:gem/prism#lib/prism/node.rb:16733 + sig { returns(Symbol) } + def name; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:16728 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16741 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16746 + def type; end + end +end + +# Represents an expression modified with a rescue. +# +# foo rescue nil +# ^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:16763 +class Prism::RescueModifierNode < ::Prism::Node + # Initialize a new RescueModifierNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16765 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node + ).void + end + def initialize(source, node_id, location, flags, expression, keyword_loc, rescue_expression); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:16857 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16776 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16781 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16799 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16794 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode + # + # pkg:gem/prism#lib/prism/node.rb:16804 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node + ).returns(Prism::RescueModifierNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, expression: self.expression, keyword_loc: self.keyword_loc, rescue_expression: self.rescue_expression); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16809 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node } + # + # pkg:gem/prism#lib/prism/node.rb:16812 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16786 + def each_child_node; end + + # attr_reader expression: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:16817 + sig { returns(Prism::Node) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:16841 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:16836 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:16820 + sig { returns(Prism::Location) } + def keyword_loc; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:116 + def newline_flag!(lines); end + + # attr_reader rescue_expression: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:16833 + sig { returns(Prism::Node) } + def rescue_expression; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16828 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:16846 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:16851 + def type; end + end +end + +# Represents a rescue statement. +# +# begin +# rescue Foo, *splat, Bar => ex +# foo +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# end +# +# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field. +# +# pkg:gem/prism#lib/prism/node.rb:16874 +class Prism::RescueNode < ::Prism::Node + # Initialize a new RescueNode node. + # + # pkg:gem/prism#lib/prism/node.rb:16876 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)), + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(Prism::RescueNode) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, then_keyword_loc, statements, subsequent); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17033 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:16891 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16896 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:16921 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:16911 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Returns the subsequent rescue clause of the rescue node. This method is + # deprecated in favor of #subsequent. + # + # pkg:gem/prism#lib/prism/node_ext.rb:497 + def consequent; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode + # + # pkg:gem/prism#lib/prism/node.rb:16926 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)), + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + subsequent: T.nilable(Prism::RescueNode) + ).returns(Prism::RescueNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, exceptions: self.exceptions, operator_loc: self.operator_loc, reference: self.reference, then_keyword_loc: self.then_keyword_loc, statements: self.statements, subsequent: self.subsequent); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:16931 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil, then_keyword_loc: Location?, statements: StatementsNode?, subsequent: RescueNode? } + # + # pkg:gem/prism#lib/prism/node.rb:16934 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16901 + def each_child_node; end + + # attr_reader exceptions: Array[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:16952 + sig { returns(T::Array[Prism::Node]) } + def exceptions; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17017 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17002 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:16939 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def operator: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:17007 + sig { returns(T.nilable(String)) } + def operator; end + + # attr_reader operator_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:16955 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; end + + # attr_reader reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:16974 + sig do + returns(T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode))) + end + def reference; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16947 + def save_keyword_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16969 + def save_operator_loc(repository); end + + # Save the then_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:16991 + def save_then_keyword_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:16996 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # attr_reader subsequent: RescueNode? + # + # pkg:gem/prism#lib/prism/node.rb:16999 + sig { returns(T.nilable(Prism::RescueNode)) } + def subsequent; end + + # def then_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:17012 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # attr_reader then_keyword_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:16977 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17022 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17027 + def type; end + end +end + +# Represents a rest parameter to a method, block, or lambda definition. +# +# def a(*b) +# ^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:17051 +class Prism::RestParameterNode < ::Prism::Node + # Initialize a new RestParameterNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17053 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17164 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17064 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17069 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17085 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17080 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode + # + # pkg:gem/prism#lib/prism/node.rb:17090 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location + ).returns(Prism::RestParameterNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, operator_loc: self.operator_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17095 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:17098 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17074 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17148 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # pkg:gem/prism#lib/prism/node.rb:17108 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:17111 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17143 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:17130 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17103 + sig { returns(T::Boolean) } + def repeated_parameter?; end + + # Save the name_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17125 + def save_name_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17138 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17153 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17158 + def type; end + end +end + +# This represents the result of a call to ::parse or ::parse_file. It contains +# the requested structure, any comments that were encounters, and any errors +# that were encountered. +# +# pkg:gem/prism#lib/prism/parse_result.rb:676 +class Prism::Result + # Create a new result object with the given values. + # + # pkg:gem/prism#lib/prism/parse_result.rb:698 + sig do + params( + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(comments, magic_comments, data_loc, errors, warnings, source); end + + # Create a code units cache for the given encoding. + # + # pkg:gem/prism#lib/prism/parse_result.rb:730 + sig do + params( + encoding: Encoding + ).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))) + end + def code_units_cache(encoding); end + + # The list of comments that were encountered during parsing. + # + # pkg:gem/prism#lib/prism/parse_result.rb:678 + sig { returns(T::Array[Prism::Comment]) } + def comments; end + + # An optional location that represents the location of the __END__ marker + # and the rest of the content of the file. This content is loaded into the + # DATA constant when the file being parsed is the main file being executed. + # + # pkg:gem/prism#lib/prism/parse_result.rb:686 + sig { returns(T.nilable(Prism::Location)) } + def data_loc; end + + # Implement the hash pattern matching interface for Result. + # + # pkg:gem/prism#lib/prism/parse_result.rb:708 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Returns the encoding of the source code that was parsed. + # + # pkg:gem/prism#lib/prism/parse_result.rb:713 + sig { returns(Encoding) } + def encoding; end + + # The list of errors that were generated during parsing. + # + # pkg:gem/prism#lib/prism/parse_result.rb:689 + sig { returns(T::Array[Prism::ParseError]) } + def errors; end + + # Returns true if there were errors during parsing and false if there were + # not. + # + # pkg:gem/prism#lib/prism/parse_result.rb:725 + sig { returns(T::Boolean) } + def failure?; end + + # The list of magic comments that were encountered during parsing. + # + # pkg:gem/prism#lib/prism/parse_result.rb:681 + sig { returns(T::Array[Prism::MagicComment]) } + def magic_comments; end + + # A Source instance that represents the source code that was parsed. + # + # pkg:gem/prism#lib/prism/parse_result.rb:695 + sig { returns(Prism::Source) } + def source; end + + # Returns true if there were no errors during parsing and false if there + # were. + # + # pkg:gem/prism#lib/prism/parse_result.rb:719 + sig { returns(T::Boolean) } + def success?; end + + # The list of warnings that were generated during parsing. + # + # pkg:gem/prism#lib/prism/parse_result.rb:692 + sig { returns(T::Array[Prism::ParseWarning]) } + def warnings; end +end + +# Represents the use of the `retry` keyword. +# +# retry +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17177 +class Prism::RetryNode < ::Prism::Node + # Initialize a new RetryNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17179 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17242 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17187 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17192 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17208 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17203 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode + # + # pkg:gem/prism#lib/prism/node.rb:17213 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::RetryNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17218 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:17221 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17197 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17226 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17231 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17236 + def type; end + end +end + +# Represents the use of the `return` keyword. +# +# return 1 +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17251 +class Prism::ReturnNode < ::Prism::Node + # Initialize a new ReturnNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17253 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, arguments); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17342 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17263 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:17318 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17268 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17287 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17280 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode + # + # pkg:gem/prism#lib/prism/node.rb:17292 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode) + ).returns(Prism::ReturnNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, arguments: self.arguments); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, arguments: ArgumentsNode? } + # + # pkg:gem/prism#lib/prism/node.rb:17300 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17273 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17326 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17321 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:17305 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17313 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17331 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17336 + def type; end + end +end + +# This object is passed to the various Prism.* methods that accept the +# `scopes` option as an element of the list. It defines both the local +# variables visible at that scope as well as the forwarding parameters +# available at that scope. +# +# pkg:gem/prism#lib/prism/parse_result.rb:884 +class Prism::Scope + # Create a new scope object with the given locals and forwarding. + # + # pkg:gem/prism#lib/prism/parse_result.rb:895 + sig { params(locals: T::Array[Symbol], forwarding: T::Array[Symbol]).void } + def initialize(locals, forwarding); end + + # The list of local variables that are forwarded to the next scope. This + # should by defined as an array of symbols containing the specific values of + # :*, :**, :&, or :"...". + # + # pkg:gem/prism#lib/prism/parse_result.rb:892 + sig { returns(T::Array[Symbol]) } + def forwarding; end + + # The list of local variables that are defined in this scope. This should be + # defined as an array of symbols. + # + # pkg:gem/prism#lib/prism/parse_result.rb:887 + sig { returns(T::Array[Symbol]) } + def locals; end +end + +# Represents the `self` keyword. +# +# self +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17353 +class Prism::SelfNode < ::Prism::Node + # Initialize a new SelfNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17355 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17418 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17363 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17368 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17384 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17379 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode + # + # pkg:gem/prism#lib/prism/node.rb:17389 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::SelfNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17394 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:17397 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17373 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17402 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17407 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17412 + def type; end + end +end + +# A module responsible for deserializing parse results. +# +# pkg:gem/prism#lib/prism/serialize.rb:17 +module Prism::Serialize + class << self + # Deserialize the dumped output from a request to lex or lex_file. + # + # The formatting of the source of this method is purposeful to illustrate + # the structure of the serialized data. + # + # pkg:gem/prism#lib/prism/serialize.rb:87 + def load_lex(input, serialized, freeze); end + + # Deserialize the dumped output from a request to parse or parse_file. + # + # The formatting of the source of this method is purposeful to illustrate + # the structure of the serialized data. + # + # pkg:gem/prism#lib/prism/serialize.rb:34 + def load_parse(input, serialized, freeze); end + + # Deserialize the dumped output from a request to parse_comments or + # parse_file_comments. + # + # The formatting of the source of this method is purposeful to illustrate + # the structure of the serialized data. + # + # pkg:gem/prism#lib/prism/serialize.rb:131 + def load_parse_comments(input, serialized, freeze); end + + # Deserialize the dumped output from a request to parse_lex or + # parse_lex_file. + # + # The formatting of the source of this method is purposeful to illustrate + # the structure of the serialized data. + # + # pkg:gem/prism#lib/prism/serialize.rb:153 + def load_parse_lex(input, serialized, freeze); end + end +end + +# pkg:gem/prism#lib/prism/serialize.rb:202 +class Prism::Serialize::ConstantPool + # pkg:gem/prism#lib/prism/serialize.rb:205 + def initialize(input, serialized, base, size); end + + # pkg:gem/prism#lib/prism/serialize.rb:213 + def get(index, encoding); end + + # pkg:gem/prism#lib/prism/serialize.rb:203 + def size; end +end + +# StringIO is synchronized and that adds a high overhead on TruffleRuby. +# +# pkg:gem/prism#lib/prism/serialize.rb:256 +Prism::Serialize::FastStringIO = StringIO + +# pkg:gem/prism#lib/prism/serialize.rb:259 +class Prism::Serialize::Loader + # pkg:gem/prism#lib/prism/serialize.rb:262 + def initialize(source, serialized); end + + # pkg:gem/prism#lib/prism/serialize.rb:270 + def eof?; end + + # pkg:gem/prism#lib/prism/serialize.rb:260 + def input; end + + # pkg:gem/prism#lib/prism/serialize.rb:260 + def io; end + + # pkg:gem/prism#lib/prism/serialize.rb:304 + def load_comments(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:831 + def load_constant(constant_pool, encoding); end + + # pkg:gem/prism#lib/prism/serialize.rb:275 + def load_constant_pool(constant_pool); end + + # pkg:gem/prism#lib/prism/serialize.rb:782 + def load_double; end + + # pkg:gem/prism#lib/prism/serialize.rb:797 + def load_embedded_string(encoding); end + + # pkg:gem/prism#lib/prism/serialize.rb:292 + def load_encoding; end + + # pkg:gem/prism#lib/prism/serialize.rb:667 + def load_error_level; end + + # pkg:gem/prism#lib/prism/serialize.rb:682 + def load_errors(encoding, freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:286 + def load_header; end + + # pkg:gem/prism#lib/prism/serialize.rb:771 + def load_integer; end + + # pkg:gem/prism#lib/prism/serialize.rb:298 + def load_line_offsets(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:818 + def load_location(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:812 + def load_location_object(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:321 + def load_magic_comments(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:842 + def load_node(constant_pool, encoding, freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:836 + def load_optional_constant(constant_pool, encoding); end + + # pkg:gem/prism#lib/prism/serialize.rb:823 + def load_optional_location(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:827 + def load_optional_location_object(freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:790 + def load_optional_node(constant_pool, encoding, freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:801 + def load_string(encoding); end + + # pkg:gem/prism#lib/prism/serialize.rb:733 + def load_tokens; end + + # pkg:gem/prism#lib/prism/serialize.rb:786 + def load_uint32; end + + # pkg:gem/prism#lib/prism/serialize.rb:766 + def load_varsint; end + + # variable-length integer using https://en.wikipedia.org/wiki/LEB128 + # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints + # + # pkg:gem/prism#lib/prism/serialize.rb:752 + def load_varuint; end + + # pkg:gem/prism#lib/prism/serialize.rb:701 + def load_warning_level; end + + # pkg:gem/prism#lib/prism/serialize.rb:714 + def load_warnings(encoding, freeze); end + + # pkg:gem/prism#lib/prism/serialize.rb:260 + def source; end +end + +# pkg:gem/prism#lib/prism/serialize.rb:338 +Prism::Serialize::Loader::DIAGNOSTIC_TYPES = T.let(T.unsafe(nil), Array) + +# The major version of prism that we are expecting to find in the serialized +# strings. +# +# pkg:gem/prism#lib/prism/serialize.rb:20 +Prism::Serialize::MAJOR_VERSION = T.let(T.unsafe(nil), Integer) + +# The minor version of prism that we are expecting to find in the serialized +# strings. +# +# pkg:gem/prism#lib/prism/serialize.rb:24 +Prism::Serialize::MINOR_VERSION = T.let(T.unsafe(nil), Integer) + +# The patch version of prism that we are expecting to find in the serialized +# strings. +# +# pkg:gem/prism#lib/prism/serialize.rb:28 +Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) + +# The token types that can be indexed by their enum values. +# +# pkg:gem/prism#lib/prism/serialize.rb:2227 +Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) + +# This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified. +# +# C = { a: 1 } +# ^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17428 +class Prism::ShareableConstantNode < ::Prism::Node + # Initialize a new ShareableConstantNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17430 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode) + ).void + end + def initialize(source, node_id, location, flags, write); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17513 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17439 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17444 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17461 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17456 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) -> ShareableConstantNode + # + # pkg:gem/prism#lib/prism/node.rb:17466 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode) + ).returns(Prism::ShareableConstantNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, write: self.write); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17471 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode } + # + # pkg:gem/prism#lib/prism/node.rb:17474 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17449 + def each_child_node; end + + # def experimental_copy?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17489 + sig { returns(T::Boolean) } + def experimental_copy?; end + + # def experimental_everything?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17484 + sig { returns(T::Boolean) } + def experimental_everything?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17497 + sig { override.returns(String) } + def inspect; end + + # def literal?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17479 + sig { returns(T::Boolean) } + def literal?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17502 + sig { override.returns(Symbol) } + def type; end + + # The constant write that should be modified with the shareability state. + # + # pkg:gem/prism#lib/prism/node.rb:17494 + sig do + returns(T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode)) + end + def write; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17507 + def type; end + end +end + +# Flags for shareable constant nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19918 +module Prism::ShareableConstantNodeFlags; end + +# constant writes that should be modified with shareable constant value experimental copy +# +# pkg:gem/prism#lib/prism/node.rb:19926 +Prism::ShareableConstantNodeFlags::EXPERIMENTAL_COPY = T.let(T.unsafe(nil), Integer) + +# constant writes that should be modified with shareable constant value experimental everything +# +# pkg:gem/prism#lib/prism/node.rb:19923 +Prism::ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING = T.let(T.unsafe(nil), Integer) + +# constant writes that should be modified with shareable constant value literal +# +# pkg:gem/prism#lib/prism/node.rb:19920 +Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) + +# Represents a singleton class declaration involving the `class` keyword. +# +# class << self end +# ^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17524 +class Prism::SingletonClassNode < ::Prism::Node + # Initialize a new SingletonClassNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17526 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17663 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17540 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: StatementsNode | BeginNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:17616 + sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17545 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def class_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17632 + sig { returns(String) } + def class_keyword; end + + # attr_reader class_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:17587 + sig { returns(Prism::Location) } + def class_keyword_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17566 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17558 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location) -> SingletonClassNode + # + # pkg:gem/prism#lib/prism/node.rb:17571 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)), + end_keyword_loc: Prism::Location + ).returns(Prism::SingletonClassNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, locals: self.locals, class_keyword_loc: self.class_keyword_loc, operator_loc: self.operator_loc, expression: self.expression, body: self.body, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17576 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:17579 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17550 + def each_child_node; end + + # def end_keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17642 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:17619 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + # attr_reader expression: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:17613 + sig { returns(Prism::Node) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17647 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # pkg:gem/prism#lib/prism/node.rb:17584 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17637 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:17600 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the class_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17595 + def save_class_keyword_loc(repository); end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17627 + def save_end_keyword_loc(repository); end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17608 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17652 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17657 + def type; end + end +end + +# This represents a source of Ruby code that has been parsed. It is used in +# conjunction with locations to allow them to resolve line numbers and source +# ranges. +# +# pkg:gem/prism#lib/prism/parse_result.rb:8 +class Prism::Source + # Create a new source object with the given source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:46 + sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void } + def initialize(source, start_line = 1, offsets = []); end + + # Converts the line number and column in bytes to a byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:80 + def byte_offset(line, column); end + + # Return the column number in characters for the given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:117 + sig { params(byte_offset: Integer).returns(Integer) } + def character_column(byte_offset); end + + # Return the character offset for the given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:112 + sig { params(byte_offset: Integer).returns(Integer) } + def character_offset(byte_offset); end + + # Generate a cache that targets a specific encoding for calculating code + # unit offsets. + # + # pkg:gem/prism#lib/prism/parse_result.rb:145 + sig do + params( + encoding: Encoding + ).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))) + end + def code_units_cache(encoding); end + + # Returns the column number in code units for the given encoding for the + # given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:151 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_column(byte_offset, encoding); end + + # Returns the offset from the start of the file for the given byte offset + # counting in code units for the given encoding. + # + # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the + # concept of code units that differs from the number of characters in other + # encodings, it is not captured here. + # + # We purposefully replace invalid and undefined characters with replacement + # characters in this conversion. This happens for two reasons. First, it's + # possible that the given byte offset will not occur on a character + # boundary. Second, it's possible that the source code will contain a + # character that has no equivalent in the given encoding. + # + # pkg:gem/prism#lib/prism/parse_result.rb:133 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_offset(byte_offset, encoding); end + + # Return the column number for the given byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:107 + sig { params(byte_offset: Integer).returns(Integer) } + def column(byte_offset); end + + # Freeze this object and the objects it contains. + # + # pkg:gem/prism#lib/prism/parse_result.rb:156 + def deep_freeze; end + + # Returns the encoding of the source code, which is set by parameters to the + # parser or by the encoding magic comment. + # + # pkg:gem/prism#lib/prism/parse_result.rb:64 + sig { returns(Encoding) } + def encoding; end + + # Binary search through the offsets to find the line number for the given + # byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:90 + sig { params(byte_offset: Integer).returns(Integer) } + def line(byte_offset); end + + # Returns the byte offset of the end of the line corresponding to the given + # byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:102 + def line_end(byte_offset); end + + # Return the byte offset of the start of the line corresponding to the given + # byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:96 + sig { params(byte_offset: Integer).returns(Integer) } + def line_start(byte_offset); end + + # Returns the lines of the source code as an array of strings. + # + # pkg:gem/prism#lib/prism/parse_result.rb:69 + sig { returns(T::Array[String]) } + def lines; end + + # The list of newline byte offsets in the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:43 + sig { returns(T::Array[Integer]) } + def offsets; end + + # Replace the value of offsets with the given value. + # + # pkg:gem/prism#lib/prism/parse_result.rb:58 + sig { params(offsets: T::Array[Integer]).void } + def replace_offsets(offsets); end + + # Replace the value of start_line with the given value. + # + # pkg:gem/prism#lib/prism/parse_result.rb:53 + sig { params(start_line: Integer).void } + def replace_start_line(start_line); end + + # Perform a byteslice on the source code using the given byte offset and + # byte length. + # + # pkg:gem/prism#lib/prism/parse_result.rb:75 + sig { params(byte_offset: Integer, length: Integer).returns(String) } + def slice(byte_offset, length); end + + # The source code that this source object represents. + # + # pkg:gem/prism#lib/prism/parse_result.rb:37 + sig { returns(String) } + def source; end + + # The line number where this source starts. + # + # pkg:gem/prism#lib/prism/parse_result.rb:40 + sig { returns(Integer) } + def start_line; end + + private + + # Binary search through the offsets to find the line number for the given + # byte offset. + # + # pkg:gem/prism#lib/prism/parse_result.rb:166 + def find_line(byte_offset); end + + class << self + # Create a new source object with the given source code. This method should + # be used instead of `new` and it will return either a `Source` or a + # specialized and more performant `ASCIISource` if no multibyte characters + # are present in the source code. + # + # pkg:gem/prism#lib/prism/parse_result.rb:13 + def for(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end + end +end + +# Represents the use of the `__ENCODING__` keyword. +# +# __ENCODING__ +# ^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17679 +class Prism::SourceEncodingNode < ::Prism::Node + # Initialize a new SourceEncodingNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17681 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17744 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17689 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17694 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17710 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17705 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode + # + # pkg:gem/prism#lib/prism/node.rb:17715 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::SourceEncodingNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17720 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:17723 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17699 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17728 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17733 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17738 + def type; end + end +end + +# Represents the use of the `__FILE__` keyword. +# +# __FILE__ +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17753 +class Prism::SourceFileNode < ::Prism::Node + # Initialize a new SourceFileNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17755 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + filepath: String + ).void + end + def initialize(source, node_id, location, flags, filepath); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17842 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17764 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17769 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17785 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17780 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode + # + # pkg:gem/prism#lib/prism/node.rb:17790 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + filepath: String + ).returns(Prism::SourceFileNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, filepath: self.filepath); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17795 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, filepath: String } + # + # pkg:gem/prism#lib/prism/node.rb:17798 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17774 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs. + # + # pkg:gem/prism#lib/prism/node.rb:17823 + sig { returns(String) } + def filepath; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17808 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17803 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def frozen?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17813 + sig { returns(T::Boolean) } + def frozen?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17826 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:17818 + sig { returns(T::Boolean) } + def mutable?; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17831 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17836 + def type; end + end +end + +# Represents the use of the `__LINE__` keyword. +# +# __LINE__ +# ^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:17853 +class Prism::SourceLineNode < ::Prism::Node + # Initialize a new SourceLineNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17855 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:17918 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17863 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17868 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17884 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17879 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode + # + # pkg:gem/prism#lib/prism/node.rb:17889 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::SourceLineNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17894 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:17897 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17873 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:17902 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:17907 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:17912 + def type; end + end +end + +# Represents the use of the splat operator. +# +# [*a] +# ^^ +# +# pkg:gem/prism#lib/prism/node.rb:17927 +class Prism::SplatNode < ::Prism::Node + # Initialize a new SplatNode node. + # + # pkg:gem/prism#lib/prism/node.rb:17929 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node) + ).void + end + def initialize(source, node_id, location, flags, operator_loc, expression); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18018 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:17939 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17944 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:17963 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:17956 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode + # + # pkg:gem/prism#lib/prism/node.rb:17968 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node) + ).returns(Prism::SplatNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, operator_loc: self.operator_loc, expression: self.expression); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:17973 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, expression: Prism::node? } + # + # pkg:gem/prism#lib/prism/node.rb:17976 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:17949 + def each_child_node; end + + # attr_reader expression: Prism::node? + # + # pkg:gem/prism#lib/prism/node.rb:17994 + sig { returns(T.nilable(Prism::Node)) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18002 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:17997 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:17981 + sig { returns(Prism::Location) } + def operator_loc; end + + # Save the operator_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:17989 + def save_operator_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18007 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18012 + def type; end + end +end + +# Represents a set of statements contained within some scope. +# +# foo; bar; baz +# ^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:18029 +class Prism::StatementsNode < ::Prism::Node + # Initialize a new StatementsNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18031 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T::Array[Prism::Node] + ).void + end + def initialize(source, node_id, location, flags, body); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18099 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18040 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Array[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18080 + sig { returns(T::Array[Prism::Node]) } + def body; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18045 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18062 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18057 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode + # + # pkg:gem/prism#lib/prism/node.rb:18067 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + body: T::Array[Prism::Node] + ).returns(Prism::StatementsNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, body: self.body); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18072 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Array[Prism::node] } + # + # pkg:gem/prism#lib/prism/node.rb:18075 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18050 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18083 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18088 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18093 + def type; end + end +end + +# Flags for string nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19930 +module Prism::StringFlags; end + +# internal bytes forced the encoding to binary +# +# pkg:gem/prism#lib/prism/node.rb:19935 +Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# pkg:gem/prism#lib/prism/node.rb:19932 +Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/node.rb:19938 +Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/node.rb:19941 +Prism::StringFlags::MUTABLE = T.let(T.unsafe(nil), Integer) + +# Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string. +# +# "foo" +# ^^^^^ +# +# %w[foo] +# ^^^ +# +# "foo #{bar} baz" +# ^^^^ ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:18116 +class Prism::StringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # Initialize a new StringNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18118 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).void + end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18274 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18130 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18135 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18253 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18221 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18151 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18146 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:18248 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:18208 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode + # + # pkg:gem/prism#lib/prism/node.rb:18156 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).returns(Prism::StringNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, content_loc: self.content_loc, closing_loc: self.closing_loc, unescaped: self.unescaped); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18161 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String } + # + # pkg:gem/prism#lib/prism/node.rb:18164 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18140 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18174 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18169 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def frozen?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18179 + sig { returns(T::Boolean) } + def frozen?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18258 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18184 + sig { returns(T::Boolean) } + def mutable?; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18243 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18189 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18235 + def save_closing_loc(repository); end + + # Save the content_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18216 + def save_content_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18203 + def save_opening_loc(repository); end + + # Occasionally it's helpful to treat a string as if it were interpolated so + # that there's a consistent interface for working with strings. + # + # pkg:gem/prism#lib/prism/node_ext.rb:75 + sig { returns(Prism::InterpolatedStringNode) } + def to_interpolated; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18263 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # pkg:gem/prism#lib/prism/node.rb:18240 + sig { returns(String) } + def unescaped; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18268 + def type; end + end +end + +# Here we are going to patch StringQuery to put in the class-level methods so +# that it can maintain a consistent interface +# Query methods that allow categorizing strings based on their context for +# where they could be valid in a Ruby syntax tree. +# +# pkg:gem/prism#lib/prism/string_query.rb:7 +class Prism::StringQuery + # Initialize a new query with the given string. + # + # pkg:gem/prism#lib/prism/string_query.rb:12 + def initialize(string); end + + # Whether or not this string is a valid constant name. + # + # pkg:gem/prism#lib/prism/string_query.rb:22 + def constant?; end + + # Whether or not this string is a valid local variable name. + # + # pkg:gem/prism#lib/prism/string_query.rb:17 + def local?; end + + # Whether or not this string is a valid method name. + # + # pkg:gem/prism#lib/prism/string_query.rb:27 + def method_name?; end + + # The string that this query is wrapping. + # + # pkg:gem/prism#lib/prism/string_query.rb:9 + def string; end + + class << self + # Mirrors the C extension's StringQuery::constant? method. + # + # pkg:gem/prism#lib/prism.rb:92 + sig { params(string: String).returns(T::Boolean) } + def constant?(string); end + + # Mirrors the C extension's StringQuery::local? method. + # + # pkg:gem/prism#lib/prism.rb:92 + sig { params(string: String).returns(T::Boolean) } + def local?(string); end + + # Mirrors the C extension's StringQuery::method_name? method. + # + # pkg:gem/prism#lib/prism.rb:92 + sig { params(string: String).returns(T::Boolean) } + def method_name?(string); end + end +end + +# Represents the use of the `super` keyword with parentheses or arguments. +# +# super() +# ^^^^^^^ +# +# super foo, bar +# ^^^^^^^^^^^^^^ +# +# If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead. +# +# pkg:gem/prism#lib/prism/node.rb:18293 +class Prism::SuperNode < ::Prism::Node + # Initialize a new SuperNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18295 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode)) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18440 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18308 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Can be only `nil` when there are empty parentheses, like `super()`. + # + # pkg:gem/prism#lib/prism/node.rb:18384 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # attr_reader block: BlockNode | BlockArgumentNode | nil + # + # pkg:gem/prism#lib/prism/node.rb:18406 + sig { returns(T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))) } + def block; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18313 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18334 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18326 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: BlockNode | BlockArgumentNode | nil) -> SuperNode + # + # pkg:gem/prism#lib/prism/node.rb:18339 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode)) + ).returns(Prism::SuperNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, lparen_loc: self.lparen_loc, arguments: self.arguments, rparen_loc: self.rparen_loc, block: self.block); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18344 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: BlockNode | BlockArgumentNode | nil } + # + # pkg:gem/prism#lib/prism/node.rb:18347 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18318 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18424 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:18409 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:18352 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18414 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18365 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18419 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18387 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18360 + def save_keyword_loc(repository); end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18379 + def save_lparen_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18401 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18429 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18434 + def type; end + end +end + +# Flags for symbol nodes. +# +# pkg:gem/prism#lib/prism/node.rb:19945 +module Prism::SymbolFlags; end + +# internal bytes forced the encoding to binary +# +# pkg:gem/prism#lib/prism/node.rb:19950 +Prism::SymbolFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to US-ASCII +# +# pkg:gem/prism#lib/prism/node.rb:19953 +Prism::SymbolFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# pkg:gem/prism#lib/prism/node.rb:19947 +Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# Represents a symbol literal or a symbol contained within a `%i` list. +# +# :foo +# ^^^^ +# +# %i[foo] +# ^^^ +# +# pkg:gem/prism#lib/prism/node.rb:18457 +class Prism::SymbolNode < ::Prism::Node + # Initialize a new SymbolNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18459 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).void + end + def initialize(source, node_id, location, flags, opening_loc, value_loc, closing_loc, unescaped); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18616 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18471 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18476 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18595 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18563 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18492 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18487 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode + # + # pkg:gem/prism#lib/prism/node.rb:18497 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String + ).returns(Prism::SymbolNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, value_loc: self.value_loc, closing_loc: self.closing_loc, unescaped: self.unescaped); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18502 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String } + # + # pkg:gem/prism#lib/prism/node.rb:18505 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18481 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18515 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18520 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:18510 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18600 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18585 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18525 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18577 + def save_closing_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18539 + def save_opening_loc(repository); end + + # Save the value_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18558 + def save_value_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18605 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # pkg:gem/prism#lib/prism/node.rb:18582 + sig { returns(String) } + def unescaped; end + + # def value: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18590 + sig { returns(T.nilable(String)) } + def value; end + + # attr_reader value_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:18544 + sig { returns(T.nilable(Prism::Location)) } + def value_loc; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18610 + def type; end + end +end + +# This represents a token from the Ruby source. +# +# pkg:gem/prism#lib/prism/parse_result.rb:813 +class Prism::Token + # Create a new token object with the given type, value, and location. + # + # pkg:gem/prism#lib/prism/parse_result.rb:825 + sig { params(source: Prism::Source, type: Symbol, value: String, location: T.any(Integer, Prism::Location)).void } + def initialize(source, type, value, location); end + + # Returns true if the given other token is equal to this token. + # + # pkg:gem/prism#lib/prism/parse_result.rb:860 + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other); end + + # Implement the hash pattern matching interface for Token. + # + # pkg:gem/prism#lib/prism/parse_result.rb:833 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Freeze this object and the objects it contains. + # + # pkg:gem/prism#lib/prism/parse_result.rb:873 + def deep_freeze; end + + # Returns a string representation of this token. + # + # pkg:gem/prism#lib/prism/parse_result.rb:867 + def inspect; end + + # A Location object representing the location of this token in the source. + # + # pkg:gem/prism#lib/prism/parse_result.rb:838 + sig { returns(Prism::Location) } + def location; end + + # Implement the pretty print interface for Token. + # + # pkg:gem/prism#lib/prism/parse_result.rb:845 + sig { params(q: T.untyped).void } + def pretty_print(q); end + + # The type of token that this token is. + # + # pkg:gem/prism#lib/prism/parse_result.rb:819 + sig { returns(Symbol) } + def type; end + + # A byteslice of the source that this token represents. + # + # pkg:gem/prism#lib/prism/parse_result.rb:822 + sig { returns(String) } + def value; end + + private + + # The Source object that represents the source this token came from. + # + # pkg:gem/prism#lib/prism/parse_result.rb:815 + sig { returns(Prism::Source) } + def source; end +end + +# This module is responsible for converting the prism syntax tree into other +# syntax trees. +# +# pkg:gem/prism#lib/prism/translation.rb:7 +module Prism::Translation; end + +# This class is the entry-point for converting a prism syntax tree into the +# whitequark/parser gem's syntax tree. It inherits from the base parser for +# the parser gem, and overrides the parse* methods to parse with prism and +# then translate. +# +# Note that this version of the parser always parses using the latest +# version of Ruby syntax supported by Prism. If you want specific version +# support, use one of the version-specific subclasses, such as +# `Prism::Translation::Parser34`. If you want to parse using the same +# version of Ruby syntax as the currently running version of Ruby, use +# `Prism::Translation::ParserCurrent`. +# +# pkg:gem/prism#lib/prism/translation/parser.rb:29 +class Prism::Translation::Parser < ::Parser::Base + # The `builder` argument is used to create the parser using our custom builder class by default. + # + # By using the `:parser` keyword argument, you can translate in a way that is compatible with + # the Parser gem using any parser. + # + # For example, in RuboCop for Ruby LSP, the following approach can be used to improve performance + # by reusing a pre-parsed `Prism::ParseLexResult`: + # + # class PrismPreparsed + # def initialize(prism_result) + # @prism_result = prism_result + # end + # + # def parse_lex(source, **options) + # @prism_result + # end + # end + # + # prism_preparsed = PrismPreparsed.new(prism_result) + # + # Prism::Translation::Ruby34.new(builder, parser: prism_preparsed) + # + # In an object passed to the `:parser` keyword argument, the `parse` and `parse_lex` methods + # should be implemented as needed. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:74 + def initialize(builder = T.unsafe(nil), parser: T.unsafe(nil)); end + + # The default encoding for Ruby files is UTF-8. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:91 + def default_encoding; end + + # Parses a source buffer and returns the AST. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:99 + def parse(source_buffer); end + + # Parses a source buffer and returns the AST and the source code comments. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:112 + def parse_with_comments(source_buffer); end + + # Parses a source buffer and returns the AST, the source code comments, + # and the tokens emitted by the lexer. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:129 + def tokenize(source_buffer, recover = T.unsafe(nil)); end + + # Since prism resolves num params for us, we don't need to support this + # kind of logic here. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:155 + def try_declare_numparam(node); end + + # pkg:gem/prism#lib/prism/translation/parser.rb:86 + sig { overridable.returns(Integer) } + def version; end + + # pkg:gem/prism#lib/prism/translation/parser.rb:95 + def yyerror; end + + private + + # Build the parser gem AST from the prism AST. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:313 + def build_ast(program, offset_cache); end + + # Build the parser gem comments from the prism comments. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:318 + def build_comments(comments, offset_cache); end + + # Prism deals with offsets in bytes, while the parser gem deals with + # offsets in characters. We need to handle this conversion in order to + # build the parser gem AST. + # + # If the bytesize of the source is the same as the length, then we can + # just use the offset directly. Otherwise, we build an array where the + # index is the byte offset and the value is the character offset. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:296 + def build_offset_cache(source); end + + # Build a range from a prism location. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:330 + def build_range(location, offset_cache); end + + # Build the parser gem tokens from the prism tokens. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:325 + def build_tokens(tokens, offset_cache); end + + # Converts the version format handled by Parser to the format handled by Prism. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:353 + def convert_for_prism(version); end + + # Build a diagnostic from the given prism parse error. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:174 + def error_diagnostic(error, offset_cache); end + + # Options for how prism should parse/lex the source. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:339 + def prism_options; end + + # If there was a error generated during the parse, then raise an + # appropriate syntax error. Otherwise return the result. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:274 + def unwrap(result, offset_cache); end + + # This is a hook to allow consumers to disable some errors if they don't + # want them to block creating the syntax tree. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:163 + def valid_error?(error); end + + # This is a hook to allow consumers to disable some warnings if they don't + # want them to block creating the syntax tree. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:169 + def valid_warning?(warning); end + + # Build a diagnostic from the given prism parse warning. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:247 + def warning_diagnostic(warning, offset_cache); end +end + +# This class is the entry-point for Ruby 3.3 of `Prism::Translation::Parser`. +# +# pkg:gem/prism#lib/prism/translation/parser_versions.rb:7 +class Prism::Translation::Parser33 < ::Prism::Translation::Parser + # pkg:gem/prism#lib/prism/translation/parser_versions.rb:8 + sig { override.returns(Integer) } + def version; end +end + +# This class is the entry-point for Ruby 3.4 of `Prism::Translation::Parser`. +# +# pkg:gem/prism#lib/prism/translation/parser_versions.rb:14 +class Prism::Translation::Parser34 < ::Prism::Translation::Parser + # pkg:gem/prism#lib/prism/translation/parser_versions.rb:15 + sig { override.returns(Integer) } + def version; end +end + +# pkg:gem/prism#lib/prism/translation/parser_versions.rb:27 +Prism::Translation::Parser35 = Prism::Translation::Parser40 + +# This class is the entry-point for Ruby 4.0 of `Prism::Translation::Parser`. +# +# pkg:gem/prism#lib/prism/translation/parser_versions.rb:21 +class Prism::Translation::Parser40 < ::Prism::Translation::Parser + # pkg:gem/prism#lib/prism/translation/parser_versions.rb:22 + sig { override.returns(Integer) } + def version; end +end + +# This class is the entry-point for Ruby 4.1 of `Prism::Translation::Parser`. +# +# pkg:gem/prism#lib/prism/translation/parser_versions.rb:30 +class Prism::Translation::Parser41 < ::Prism::Translation::Parser + # pkg:gem/prism#lib/prism/translation/parser_versions.rb:31 + def version; end +end + +# A builder that knows how to convert more modern Ruby syntax +# into whitequark/parser gem's syntax tree. +# +# pkg:gem/prism#lib/prism/translation/parser/builder.rb:9 +class Prism::Translation::Parser::Builder < ::Parser::Builders::Default + # The following three lines have been added to support the `it` block parameter syntax in the source code below. + # + # if args.type == :itarg + # block_type = :itblock + # args = :it + # + # https://github.com/whitequark/parser/blob/v3.3.7.1/lib/parser/builders/default.rb#L1122-L1155 + # + # pkg:gem/prism#lib/prism/translation/parser/builder.rb:22 + def block(method_call, begin_t, args, body, end_t); end + + # It represents the `it` block argument, which is not yet implemented in the Parser gem. + # + # pkg:gem/prism#lib/prism/translation/parser/builder.rb:11 + def itarg; end +end + +# A visitor that knows how to convert a prism syntax tree into the +# whitequark/parser gem's syntax tree. +# +# pkg:gem/prism#lib/prism/translation/parser/compiler.rb:9 +class Prism::Translation::Parser::Compiler < ::Prism::Compiler + # Initialize a new compiler with the given parser, offset cache, and + # options. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:40 + def initialize(parser, offset_cache, forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # The Parser::Builders::Default instance that is being used to build the + # AST. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:19 + def builder; end + + # The types of values that can be forwarded in the current scope. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:30 + def forwarding; end + + # Whether or not the current node is in a destructure. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:33 + def in_destructure; end + + # Whether or not the current node is in a pattern. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:36 + def in_pattern; end + + # The offset cache that is used to map between byte and character + # offsets in the file. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:27 + def offset_cache; end + + # The Parser::Base instance that is being used to build the AST. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:15 + def parser; end + + # The Parser::Source::Buffer instance that is holding a reference to the + # source code. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:23 + def source_buffer; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:59 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:53 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:65 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:71 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:128 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:77 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:105 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:134 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:182 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:194 + def visit_back_reference_read_node(node); end + + # begin end + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:200 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:245 + def visit_block_argument_node(node); end + + # foo { |; bar| } + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:251 + def visit_block_local_variable_node(node); end + + # A block on a keyword or method call. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:256 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:262 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:267 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:276 + def visit_break_node(node); end + + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:381 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:288 + def visit_call_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:362 + def visit_call_operator_write_node(node); end + + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:400 + def visit_call_or_write_node(node); end + + # foo.bar, = 1 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:419 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:431 + def visit_capture_pattern_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:450 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:437 + def visit_case_node(node); end + + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:463 + def visit_class_node(node); end + + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:502 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:492 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:512 + def visit_class_variable_or_write_node(node); end + + # @@foo + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:476 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:522 + def visit_class_variable_target_node(node); end + + # @@foo = 1 + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:482 + def visit_class_variable_write_node(node); end + + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:553 + def visit_constant_and_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:543 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:563 + def visit_constant_or_write_node(node); end + + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:619 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:579 + def visit_constant_path_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:609 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:629 + def visit_constant_path_or_write_node(node); end + + # Foo::Bar, = baz + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:639 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:599 + def visit_constant_path_write_node(node); end + + # Foo + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:528 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:573 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:537 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:648 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:695 + def visit_defined_node(node); end + + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:731 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:737 + def visit_embedded_statements_node(node); end + + # "foo #@bar" + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:747 + def visit_embedded_variable_node(node); end + + # begin; foo; ensure; bar; end + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:753 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:759 + def visit_false_node(node); end + + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:765 + def visit_find_pattern_node(node); end + + # if foo .. bar; end + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1541 + def visit_flip_flop_node(node); end + + # 1.0 + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:777 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:783 + def visit_for_node(node); end + + # def foo(...); bar(...); end + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:801 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:807 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:816 + def visit_forwarding_super_node(node); end + + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:854 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:844 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:864 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:828 + def visit_global_variable_read_node(node); end + + # $foo, = bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:874 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:834 + def visit_global_variable_write_node(node); end + + # {} + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:880 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:890 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:908 + def visit_if_node(node); end + + # 1i + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:950 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:956 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:962 + def visit_implicit_rest_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:968 + def visit_in_node(node); end + + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1016 + def visit_index_and_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:998 + def visit_index_operator_write_node(node); end + + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1034 + def visit_index_or_write_node(node); end + + # foo[bar], = 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1052 + def visit_index_target_node(node); end + + # @foo &&= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1089 + def visit_instance_variable_and_write_node(node); end + + # @foo += bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1079 + def visit_instance_variable_operator_write_node(node); end + + # @foo ||= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1099 + def visit_instance_variable_or_write_node(node); end + + # @foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1063 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1109 + def visit_instance_variable_target_node(node); end + + # @foo = 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1069 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1115 + def visit_integer_node(node); end + + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1132 + def visit_interpolated_match_last_line_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1121 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1136 + def visit_interpolated_string_node(node); end + + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1150 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1160 + def visit_interpolated_x_string_node(node); end + + # -> { it } + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1174 + def visit_it_local_variable_read_node(node); end + + # -> { it } + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1180 + def visit_it_parameters_node(node); end + + # foo(bar: baz) + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1196 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1205 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1214 + def visit_lambda_node(node); end + + # foo &&= bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1266 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1256 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1276 + def visit_local_variable_or_write_node(node); end + + # foo + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1240 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1286 + def visit_local_variable_target_node(node); end + + # foo = 1 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1246 + def visit_local_variable_write_node(node); end + + # if /foo/ then end + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1577 + def visit_match_last_line_node(node); end + + # foo in bar + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1296 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1306 + def visit_match_required_node(node); end + + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1316 + def visit_match_write_node(node); end + + # A node that is missing from the syntax tree. This is only used in the + # case of a syntax error. The parser gem doesn't have such a concept, so + # we invent our own here. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1327 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1333 + def visit_module_node(node); end + + # foo, bar = baz + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1344 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1354 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1377 + def visit_next_node(node); end + + # nil + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1389 + def visit_nil_node(node); end + + # def foo(**nil); end + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1395 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1405 + def visit_numbered_parameters_node(node); end + + # $1 + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1411 + def visit_numbered_reference_read_node(node); end + + # def foo(bar: baz); end + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1417 + def visit_optional_keyword_parameter_node(node); end + + # def foo(bar = 1); end + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1423 + def visit_optional_parameter_node(node); end + + # a or b + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1429 + def visit_or_node(node); end + + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1435 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1474 + def visit_parentheses_node(node); end + + # foo => ^(bar) + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1484 + def visit_pinned_expression_node(node); end + + # foo = 1 and bar => ^foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1492 + def visit_pinned_variable_node(node); end + + # END {} + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1497 + def visit_post_execution_node(node); end + + # BEGIN {} + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1507 + def visit_pre_execution_node(node); end + + # The top-level program node. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1517 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1523 + def visit_range_node(node); end + + # 1r + # ^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1545 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1551 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1557 + def visit_regular_expression_node(node); end + + # def foo(bar:); end + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1581 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1587 + def visit_required_parameter_node(node); end + + # foo rescue bar + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1593 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1611 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1620 + def visit_rest_parameter_node(node); end + + # retry + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1626 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1635 + def visit_return_node(node); end + + # self + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1647 + def visit_self_node(node); end + + # A shareable constant. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1652 + def visit_shareable_constant_node(node); end + + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1658 + def visit_singleton_class_node(node); end + + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1670 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1676 + def visit_source_file_node(node); end + + # __LINE__ + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1682 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1694 + def visit_splat_node(node); end + + # A list of statements. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1707 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1713 + def visit_string_node(node); end + + # super(foo) + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1738 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1761 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1788 + def visit_true_node(node); end + + # undef foo + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1794 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1803 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1833 + def visit_until_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1859 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1877 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1903 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1929 + def visit_yield_node(node); end + + private + + # Initialize a new compiler with the given option overrides, used to + # visit a subtree with the given options. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1943 + def copy_compiler(forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # When *, **, &, or ... are used as an argument in a method call, we + # check if they were allowed by the current context. To determine that + # we build this lookup table. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1950 + def find_forwarding(node); end + + # Returns the set of targets for a MultiTargetNode or a MultiWriteNode. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1963 + def multi_target_elements(node); end + + # Negate the value of a numeric node. This is a special case where you + # have a negative sign on one line and then a number on the next line. + # In normal Ruby, this will always be a method call. The parser gem, + # however, marks this as a numeric literal. We have to massage the tree + # here to get it into the correct form. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1975 + def numeric_negate(message_loc, receiver); end + + # Blocks can have a special set of parameters that automatically expand + # when given arrays if they have a single required parameter and no + # other parameters. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:1989 + def procarg0?(parameters); end + + # Constructs a new source range from the given start and end offsets. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2006 + def srange(location); end + + # Constructs a new source range from the given start and end offsets. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2011 + def srange_offsets(start_offset, end_offset); end + + # Constructs a new source range by finding a semicolon between the given + # start offset and end offset. If the semicolon is not found, it returns + # nil. Importantly it does not search past newlines or comments. + # + # Note that end_offset is allowed to be nil, in which case this will + # search until the end of the string. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2021 + def srange_semicolon(start_offset, end_offset); end + + # When the content of a string node is split across multiple lines, the + # parser gem creates individual string nodes for each line the content is part of. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2138 + def string_nodes_from_interpolation(node, opening); end + + # Create parser string nodes from a single prism node. The parser gem + # "glues" strings together when a line continuation is encountered. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2150 + def string_nodes_from_line_continuations(unescaped, escaped, start_offset, opening); end + + # Transform a location into a token that the parser gem expects. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2029 + def token(location); end + + # Visit a block node on a call. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2034 + def visit_block(call, block); end + + # Visit a heredoc that can be either a string or an xstring. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2069 + def visit_heredoc(node); end + + # Visit a numeric node and account for the optional sign. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2115 + def visit_numeric(node, value); end + + # Within the given block, track that we're within a pattern. + # + # pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2127 + def within_pattern; end +end + +# Raised when the tree is malformed or there is a bug in the compiler. +# +# pkg:gem/prism#lib/prism/translation/parser/compiler.rb:11 +class Prism::Translation::Parser::Compiler::CompilationError < ::StandardError; end + +# Locations in the parser gem AST are generated using this class. We +# store a reference to its constant to make it slightly faster to look +# up. +# +# pkg:gem/prism#lib/prism/translation/parser/compiler.rb:2003 +Prism::Translation::Parser::Compiler::Range = Parser::Source::Range + +# pkg:gem/prism#lib/prism/translation/parser.rb:30 +Prism::Translation::Parser::Diagnostic = Parser::Diagnostic + +# Accepts a list of prism tokens and converts them into the expected +# format for the parser gem. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:13 +class Prism::Translation::Parser::Lexer + # Initialize the lexer with the given source buffer, prism tokens, and + # offset cache. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:231 + def initialize(source_buffer, lexed, offset_cache); end + + # An array of tuples that contain prism tokens and their associated lex + # state when they were lexed. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:224 + def lexed; end + + # A hash that maps offsets in bytes to offsets in characters. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:227 + def offset_cache; end + + # The Parser::Source::Buffer that the tokens were lexed from. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:220 + def source_buffer; end + + # Convert the prism tokens into the expected format for the parser gem. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:241 + def to_a; end + + private + + # Wonky heredoc tab/spaces rules. + # https://github.com/ruby/prism/blob/v1.3.0/src/prism.c#L10548-L10558 + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:593 + def calculate_heredoc_whitespace(heredoc_token_index); end + + # Escape a byte value, given the control and meta flags. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:735 + def escape_build(value, control, meta); end + + # Read an escape out of the string scanner, given the control and meta + # flags, and push the unescaped value into the result. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:743 + def escape_read(result, scanner, control, meta); end + + # Determine if characters preceeded by a backslash should be escaped or not + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:804 + def interpolation?(quote); end + + # Parse a complex from the string representation. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:564 + def parse_complex(value); end + + # Parse a float from the string representation. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:557 + def parse_float(value); end + + # Parse an integer from the string representation. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:550 + def parse_integer(value); end + + # Parse a rational from the string representation. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:579 + def parse_rational(value); end + + # Determine if the string is part of a %-style array. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:814 + def percent_array?(quote); end + + # For %-arrays whitespace, the parser gem only considers whitespace before the newline. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:792 + def percent_array_leading_whitespace(string); end + + # In a percent array, certain whitespace can be preceeded with a backslash, + # causing the following characters to be part of the previous element. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:784 + def percent_array_unescape(string); end + + # Creates a new parser range, taking prisms byte offsets into account + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:545 + def range(start_offset, end_offset); end + + # Regexp allow interpolation but are handled differently during unescaping + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:809 + def regexp?(quote); end + + # Certain strings are merged into a single string token. + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:718 + def simplify_string?(value, quote); end + + # Wonky heredoc tab/spaces rules. + # https://github.com/ruby/prism/blob/v1.3.0/src/prism.c#L16528-L16545 + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:640 + def trim_heredoc_whitespace(string, heredoc); end + + # Apply Ruby string escaping rules + # + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:675 + def unescape_string(string, quote); end +end + +# Types of tokens that are allowed to continue a method call with comments in-between. +# For these, the parser gem doesn't emit a newline token after the last comment. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:211 +Prism::Translation::Parser::Lexer::COMMENT_CONTINUATION_TYPES = T.let(T.unsafe(nil), Set) + +# When one of these delimiters is encountered, then the other +# one is allowed to be escaped as well. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:666 +Prism::Translation::Parser::Lexer::DELIMITER_SYMETRY = T.let(T.unsafe(nil), Hash) + +# Escape sequences that have special and should appear unescaped in the resulting string. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:657 +Prism::Translation::Parser::Lexer::ESCAPES = T.let(T.unsafe(nil), Hash) + +# These constants represent flags in our lex state. We really, really +# don't want to be using them and we really, really don't want to be +# exposing them as part of our public API. Unfortunately, we don't have +# another way of matching the exact tokens that the parser gem expects +# without them. We should find another way to do this, but in the +# meantime we'll hide them from the documentation and mark them as +# private constants. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:193 +Prism::Translation::Parser::Lexer::EXPR_BEG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:194 +Prism::Translation::Parser::Lexer::EXPR_LABEL = T.let(T.unsafe(nil), Integer) + +# Heredocs are complex and require us to keep track of a bit of info to refer to later +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 +class Prism::Translation::Parser::Lexer::HeredocData < ::Struct + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def common_whitespace; end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def common_whitespace=(_); end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def identifier; end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def identifier=(_); end + + class << self + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def [](*_arg0); end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def inspect; end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def keyword_init?; end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def members; end + + # pkg:gem/prism#lib/prism/translation/parser/lexer.rb:215 + def new(*_arg0); end + end +end + +# It is used to determine whether `do` is of the token type `kDO` or `kDO_LAMBDA`. +# +# NOTE: In edge cases like `-> (foo = -> (bar) {}) do end`, please note that `kDO` is still returned +# instead of `kDO_LAMBDA`, which is expected: https://github.com/ruby/prism/pull/3046 +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:200 +Prism::Translation::Parser::Lexer::LAMBDA_TOKEN_TYPES = T.let(T.unsafe(nil), Set) + +# The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem. +# The following token types are listed as those classified as `tLPAREN`. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:204 +Prism::Translation::Parser::Lexer::LPAREN_CONVERSION_TOKEN_TYPES = T.let(T.unsafe(nil), Set) + +# https://github.com/whitequark/parser/blob/v3.3.6.0/lib/parser/lexer-strings.rl#L14 +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:671 +Prism::Translation::Parser::Lexer::REGEXP_META_CHARACTERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:237 +Prism::Translation::Parser::Lexer::Range = Parser::Source::Range + +# The direct translating of types between the two lexers. +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:19 +Prism::Translation::Parser::Lexer::TYPES = T.let(T.unsafe(nil), Hash) + +# These tokens are always skipped +# +# pkg:gem/prism#lib/prism/translation/parser/lexer.rb:15 +Prism::Translation::Parser::Lexer::TYPES_ALWAYS_SKIP = T.let(T.unsafe(nil), Set) + +# The parser gem has a list of diagnostics with a hard-coded set of error +# messages. We create our own diagnostic class in order to set our own +# error messages. +# +# pkg:gem/prism#lib/prism/translation/parser.rb:36 +class Prism::Translation::Parser::PrismDiagnostic < ::Parser::Diagnostic + # Initialize a new diagnostic with the given message and location. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:41 + def initialize(message, level, reason, location); end + + # This is the cached message coming from prism. + # + # pkg:gem/prism#lib/prism/translation/parser.rb:38 + def message; end +end + +# pkg:gem/prism#lib/prism/translation/parser.rb:47 +Prism::Translation::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) + +# pkg:gem/prism#lib/prism/translation/parser_current.rb:14 +Prism::Translation::ParserCurrent = Prism::Translation::Parser40 + +# This class provides a compatibility layer between prism and Ripper. It +# functions by parsing the entire tree first and then walking it and +# executing each of the Ripper callbacks as it goes. To use this class, you +# treat `Prism::Translation::Ripper` effectively as you would treat the +# `Ripper` class. +# +# Note that this class will serve the most common use cases, but Ripper's +# API is extensive and undocumented. It relies on reporting the state of the +# parser at any given time. We do our best to replicate that here, but +# because it is a different architecture it is not possible to perfectly +# replicate the behavior of Ripper. +# +# The main known difference is that we may omit dispatching some events in +# some cases. This impacts the following events: +# +# - on_assign_error +# - on_comma +# - on_ignored_nl +# - on_ignored_sp +# - on_kw +# - on_label_end +# - on_lbrace +# - on_lbracket +# - on_lparen +# - on_nl +# - on_op +# - on_operator_ambiguous +# - on_rbrace +# - on_rbracket +# - on_rparen +# - on_semicolon +# - on_sp +# - on_symbeg +# - on_tstring_beg +# - on_tstring_end +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:42 +class Prism::Translation::Ripper < ::Prism::Compiler + # Create a new Translation::Ripper object with the given source. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:482 + def initialize(source, filename = T.unsafe(nil), lineno = T.unsafe(nil)); end + + # The current column number of the parser. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:479 + def column; end + + # True if the parser encountered an error during parsing. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:495 + sig { returns(T::Boolean) } + def error?; end + + # The filename of the source being parsed. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:473 + def filename; end + + # The current line number of the parser. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:476 + def lineno; end + + # Parse the source and return the result. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:500 + sig { returns(T.untyped) } + def parse; end + + # The source that is being parsed. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:470 + def source; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:599 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:589 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:623 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:643 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:834 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:653 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:813 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:841 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:854 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:863 + def visit_back_reference_read_node(node); end + + # begin end + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:870 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:934 + def visit_block_argument_node(node); end + + # foo { |; bar| } + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:940 + def visit_block_local_variable_node(node); end + + # Visit a BlockNode. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:946 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:982 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:996 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1020 + def visit_break_node(node); end + + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1251 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1040 + def visit_call_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1229 + def visit_call_operator_write_node(node); end + + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1273 + def visit_call_or_write_node(node); end + + # foo.bar, = 1 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1295 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1320 + def visit_capture_pattern_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1343 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1330 + def visit_case_node(node); end + + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1356 + def visit_class_node(node); end + + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1409 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1395 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1423 + def visit_class_variable_or_write_node(node); end + + # @@foo + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1374 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1437 + def visit_class_variable_target_node(node); end + + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1384 + def visit_class_variable_write_node(node); end + + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1479 + def visit_constant_and_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1465 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1493 + def visit_constant_or_write_node(node); end + + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1580 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1514 + def visit_constant_path_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1566 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1594 + def visit_constant_path_or_write_node(node); end + + # Foo::Bar, = baz + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1608 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1537 + def visit_constant_path_write_node(node); end + + # Foo + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1444 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1507 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1454 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1617 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1664 + def visit_defined_node(node); end + + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1686 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1702 + def visit_embedded_statements_node(node); end + + # "foo #@bar" + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1723 + def visit_embedded_variable_node(node); end + + # Visit an EnsureNode node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1734 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1752 + def visit_false_node(node); end + + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1759 + def visit_find_pattern_node(node); end + + # if foo .. bar; end + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1784 + def visit_flip_flop_node(node); end + + # 1.0 + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1798 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1804 + def visit_for_node(node); end + + # def foo(...); bar(...); end + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1821 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1828 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1838 + def visit_forwarding_super_node(node); end + + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1887 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1873 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1901 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1852 + def visit_global_variable_read_node(node); end + + # $foo, = bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1915 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1862 + def visit_global_variable_write_node(node); end + + # {} + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1922 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1937 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1979 + def visit_if_node(node); end + + # 1i + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2015 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2021 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2026 + def visit_implicit_rest_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2033 + def visit_in_node(node); end + + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2068 + def visit_index_and_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2051 + def visit_index_operator_write_node(node); end + + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2085 + def visit_index_or_write_node(node); end + + # foo[bar], = 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2102 + def visit_index_target_node(node); end + + # @foo &&= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2144 + def visit_instance_variable_and_write_node(node); end + + # @foo += bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2130 + def visit_instance_variable_operator_write_node(node); end + + # @foo ||= bar + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2158 + def visit_instance_variable_or_write_node(node); end + + # @foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2112 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2172 + def visit_instance_variable_target_node(node); end + + # @foo = 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2119 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2179 + def visit_integer_node(node); end + + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2185 + def visit_interpolated_match_last_line_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2204 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2223 + def visit_interpolated_string_node(node); end + + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2251 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2264 + def visit_interpolated_x_string_node(node); end + + # -> { it } + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2294 + def visit_it_local_variable_read_node(node); end + + # -> { it } + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2301 + def visit_it_parameters_node(node); end + + # foo(bar: baz) + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2306 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2318 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2332 + def visit_lambda_node(node); end + + # foo &&= bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2424 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2410 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # ^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2438 + def visit_local_variable_or_write_node(node); end + + # foo + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2392 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2452 + def visit_local_variable_target_node(node); end + + # foo = 1 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2399 + def visit_local_variable_write_node(node); end + + # if /foo/ then end + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2459 + def visit_match_last_line_node(node); end + + # foo in bar + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2474 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2483 + def visit_match_required_node(node); end + + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2492 + def visit_match_write_node(node); end + + # A node that is missing from the syntax tree. This is only used in the + # case of a syntax error. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2498 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2504 + def visit_module_node(node); end + + # (foo, bar), bar = qux + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2521 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2575 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2595 + def visit_next_node(node); end + + # nil + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2609 + def visit_nil_node(node); end + + # def foo(**nil); end + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2616 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2625 + def visit_numbered_parameters_node(node); end + + # $1 + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2630 + def visit_numbered_reference_read_node(node); end + + # def foo(bar: baz); end + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2637 + def visit_optional_keyword_parameter_node(node); end + + # def foo(bar = 1); end + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2647 + def visit_optional_parameter_node(node); end + + # a or b + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2657 + def visit_or_node(node); end + + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2667 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2694 + def visit_parentheses_node(node); end + + # foo => ^(bar) + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2708 + def visit_pinned_expression_node(node); end + + # foo = 1 and bar => ^foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2717 + def visit_pinned_variable_node(node); end + + # END {} + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2723 + def visit_post_execution_node(node); end + + # BEGIN {} + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2738 + def visit_pre_execution_node(node); end + + # The top-level program node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2752 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2763 + def visit_range_node(node); end + + # 1r + # ^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2777 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2783 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2790 + def visit_regular_expression_node(node); end + + # def foo(bar:); end + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2812 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2819 + def visit_required_parameter_node(node); end + + # foo rescue bar + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2826 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2836 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2894 + def visit_rest_parameter_node(node); end + + # retry + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2906 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2916 + def visit_return_node(node); end + + # self + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2930 + def visit_self_node(node); end + + # A shareable constant. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2936 + def visit_shareable_constant_node(node); end + + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2942 + def visit_singleton_class_node(node); end + + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2952 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2959 + def visit_source_file_node(node); end + + # __LINE__ + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2966 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2979 + def visit_splat_node(node); end + + # A list of statements. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2984 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3001 + def visit_string_node(node); end + + # super(foo) + # ^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3133 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3154 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3178 + def visit_true_node(node); end + + # undef foo + # ^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3185 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3197 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3225 + def visit_until_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3249 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3270 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3294 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3317 + def visit_yield_node(node); end + + private + + # :stopdoc: + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3457 + def _dispatch_0; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3458 + def _dispatch_1(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3459 + def _dispatch_2(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3460 + def _dispatch_3(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3461 + def _dispatch_4(arg, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3462 + def _dispatch_5(arg, _, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3463 + def _dispatch_7(arg, _, _, _, _, _, _); end + + # This method is responsible for updating lineno and column information + # to reflect the current node. + # + # This method could be drastically improved with some caching on the start + # of every line, but for now it's good enough. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3447 + def bounds(location); end + + # Returns true if the given node is a command node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1220 + def command?(node); end + + # This method is called when the parser found syntax error. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3485 + def compile_error(msg); end + + # This method is provided by the Ripper C extension. It is called when a + # string needs to be dedented because of a tilde heredoc. It is expected + # that it will modify the string in place and return the number of bytes + # that were removed. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3500 + def dedent_string(string, width); end + + # Extract the arguments and block Ripper-style, which means if the block + # is like `&b` then it's moved to arguments. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1184 + def get_arguments_and_block(arguments_node, block_node); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_BEGIN(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_CHAR(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_END(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on___end__(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_alias(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_alias_error(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_aref(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_aref_field(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_arg_ambiguous(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_arg_paren(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_args_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_args_add_block(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_args_add_star(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_args_forward; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_args_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_array(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_aryptn(arg, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_assign(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_assign_error(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_assoc_new(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_assoc_splat(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_assoclist_from_args(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_backref(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_backtick(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_bare_assoc_hash(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_begin(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_binary(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_block_var(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_blockarg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_bodystmt(arg, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_brace_block(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_break(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_call(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_case(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_class(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_class_name_error(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_comma(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_command(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_command_call(arg, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_comment(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_const(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_const_path_field(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_const_path_ref(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_const_ref(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_cvar(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_def(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_defined(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_defs(arg, _, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_do_block(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_dot2(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_dot3(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_dyna_symbol(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_else(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_elsif(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_embdoc(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_embdoc_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_embdoc_end(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_embexpr_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_embexpr_end(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_embvar(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_ensure(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_excessed_comma; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_fcall(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_field(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_float(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_fndptn(arg, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_for(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_gvar(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_hash(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_heredoc_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_heredoc_dedent(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_heredoc_end(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_hshptn(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_ident(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_if(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_if_mod(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_ifop(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_ignored_nl(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_ignored_sp(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_imaginary(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_in(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_int(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_ivar(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_kw(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_kwrest_param(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_label(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_label_end(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_lambda(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_lbrace(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_lbracket(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_lparen(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_magic_comment(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_massign(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_method_add_arg(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_method_add_block(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mlhs_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mlhs_add_post(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mlhs_add_star(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mlhs_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mlhs_paren(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_module(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mrhs_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mrhs_add_star(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mrhs_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_mrhs_new_from_args(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_next(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_nl(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_nokw_param(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_op(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_opassign(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_operator_ambiguous(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_param_error(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_params(arg, _, _, _, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_paren(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_parse_error(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_period(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_program(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_qsymbols_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_qsymbols_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_qsymbols_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_qwords_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_qwords_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_qwords_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_rational(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_rbrace(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_rbracket(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_redo; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_regexp_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_regexp_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_regexp_end(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_regexp_literal(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_regexp_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_rescue(arg, _, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_rescue_mod(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_rest_param(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_retry; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_return(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_return0; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_rparen(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_sclass(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_semicolon(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_sp(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_stmts_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_stmts_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_string_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_string_concat(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_string_content; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_string_dvar(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_string_embexpr(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_string_literal(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_super(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_symbeg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_symbol(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_symbol_literal(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_symbols_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_symbols_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_symbols_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_tlambda(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_tlambeg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_top_const_field(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_top_const_ref(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_tstring_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_tstring_content(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_tstring_end(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_unary(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_undef(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_unless(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_unless_mod(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_until(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_until_mod(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_var_alias(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_var_field(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_var_ref(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_vcall(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_void_stmt; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_when(arg, _, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_while(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_while_mod(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_word_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_word_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_words_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_words_beg(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_words_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3493 + def on_words_sep(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_xstring_add(arg, _); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_xstring_literal(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_xstring_new; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_yield(arg); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_yield0; end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:3471 + def on_zsuper; end + + # Lazily initialize the parse result. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3343 + def result; end + + # Returns true if there is a comma between the two locations. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3352 + def trailing_comma?(left, right); end + + # Visit one side of an alias global variable node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:608 + def visit_alias_global_variable_node_value(node); end + + # Visit a list of elements, like the elements of an array or arguments. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:794 + def visit_arguments(elements); end + + # Visit the clauses of a begin node to form an on_bodystmt call. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:878 + def visit_begin_node_clauses(location, node, allow_newline); end + + # Visit the body of a structure that can have either a set of statements + # or statements wrapped in rescue/else/ensure. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:913 + def visit_body_node(location, node, allow_newline = T.unsafe(nil)); end + + # Visit the arguments and block of a call node and return the arguments + # and block as they should be used. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1198 + def visit_call_node_arguments(arguments_node, block_node, trailing_comma); end + + # Visit a constant path that is part of a write node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:1546 + def visit_constant_path_write_node_target(node); end + + # Visit a destructured positional parameter node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2681 + def visit_destructured_parameter_node(node); end + + # Visit a string that is expressed using a <<~ heredoc. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3052 + def visit_heredoc_node(parts, base); end + + # Ripper gives back the escaped string content but strips out the common + # leading whitespace. Prism gives back the unescaped string content and + # a location for the escaped string content. Unfortunately these don't + # work well together, so here we need to re-derive the common leading + # whitespace. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3027 + def visit_heredoc_node_whitespace(parts); end + + # Visit a heredoc node that is representing a string. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3098 + def visit_heredoc_string_node(node); end + + # Visit a heredoc node that is representing an xstring. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3115 + def visit_heredoc_x_string_node(node); end + + # Visit the targets of a multi-target node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2534 + def visit_multi_target_node_targets(lefts, rest, rights, skippable); end + + # Visit a node that represents a number. We need to explicitly handle the + # unary - operator. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3391 + def visit_number_node(node); end + + # Visit a pattern within a pattern match. This is used to bypass the + # parenthesis node that can be used to wrap patterns. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:633 + def visit_pattern_node(node); end + + # Visit the list of statements of a statements node. We support nil + # statements in the list. This would normally not be allowed by the + # structure of the prism parse tree, but we manually add them here so that + # we can mirror Ripper's void stmt. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2993 + def visit_statements_node_body(body); end + + # Visit an individual part of a string-like node. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:2283 + def visit_string_content(part); end + + # Visit the string content of a particular node. This method is used to + # split into the various token types. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3364 + def visit_token(token, allow_keywords = T.unsafe(nil)); end + + # Dispatch a words_sep event that contains the space between the elements + # of list literals. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:783 + def visit_words_sep(opening_loc, previous, current); end + + # Visit a node that represents a write value. This is used to handle the + # special case of an implicit array that is generated without brackets. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3409 + def visit_write_value(node); end + + # Returns true if there is a semicolon between the two locations. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3357 + def void_stmt?(left, right, allow_newline); end + + # This method is called when weak warning is produced by the parser. + # +fmt+ and +args+ is printf style. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3476 + def warn(fmt, *args); end + + # This method is called when strong warning is produced by the parser. + # +fmt+ and +args+ is printf style. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:3481 + def warning(fmt, *args); end + + class << self + # Tokenizes the Ruby program and returns an array of an array, + # which is formatted like + # [[lineno, column], type, token, state]. + # The +filename+ argument is mostly ignored. + # By default, this method does not handle syntax errors in +src+, + # use the +raise_errors+ keyword to raise a SyntaxError for an error in +src+. + # + # require "ripper" + # require "pp" + # + # pp Ripper.lex("def m(a) nil end") + # #=> [[[1, 0], :on_kw, "def", FNAME ], + # [[1, 3], :on_sp, " ", FNAME ], + # [[1, 4], :on_ident, "m", ENDFN ], + # [[1, 5], :on_lparen, "(", BEG|LABEL], + # [[1, 6], :on_ident, "a", ARG ], + # [[1, 7], :on_rparen, ")", ENDFN ], + # [[1, 8], :on_sp, " ", BEG ], + # [[1, 9], :on_kw, "nil", END ], + # [[1, 12], :on_sp, " ", END ], + # [[1, 13], :on_kw, "end", END ]] + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:71 + def lex(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end + + # pkg:gem/prism#lib/prism/translation/ripper.rb:463 + def lex_state_name(state); end + + # Parses the given Ruby program read from +src+. + # +src+ must be a String or an IO or a object with a #gets method. + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:45 + def parse(src, filename = T.unsafe(nil), lineno = T.unsafe(nil)); end + + # Parses +src+ and create S-exp tree. + # Returns more readable tree rather than Ripper.sexp_raw. + # This method is mainly for developer use. + # The +filename+ argument is mostly ignored. + # By default, this method does not handle syntax errors in +src+, + # returning +nil+ in such cases. Use the +raise_errors+ keyword + # to raise a SyntaxError for an error in +src+. + # + # require "ripper" + # require "pp" + # + # pp Ripper.sexp("def m(a) nil end") + # #=> [:program, + # [[:def, + # [:@ident, "m", [1, 4]], + # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil, nil, nil]], + # [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]] + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:393 + sig { params(source: String, filename: String, lineno: Integer, raise_errors: T.untyped).returns(T.untyped) } + def sexp(source, filename = "-", lineno = 1, raise_errors: false); end + + # Parses +src+ and create S-exp tree. + # This method is mainly for developer use. + # The +filename+ argument is mostly ignored. + # By default, this method does not handle syntax errors in +src+, + # returning +nil+ in such cases. Use the +raise_errors+ keyword + # to raise a SyntaxError for an error in +src+. + # + # require "ripper" + # require "pp" + # + # pp Ripper.sexp_raw("def m(a) nil end") + # #=> [:program, + # [:stmts_add, + # [:stmts_new], + # [:def, + # [:@ident, "m", [1, 4]], + # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil]], + # [:bodystmt, + # [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "nil", [1, 9]]]], + # nil, + # nil, + # nil]]]] + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:428 + sig { params(source: String, filename: String, lineno: Integer, raise_errors: T.untyped).returns(T.untyped) } + def sexp_raw(source, filename = "-", lineno = 1, raise_errors: false); end + + # Tokenizes the Ruby program and returns an array of strings. + # The +filename+ and +lineno+ arguments are mostly ignored, since the + # return value is just the tokenized input. + # By default, this method does not handle syntax errors in +src+, + # use the +raise_errors+ keyword to raise a SyntaxError for an error in +src+. + # + # p Ripper.tokenize("def m(a) nil end") + # # => ["def", " ", "m", "(", "a", ")", " ", "nil", " ", "end"] + # + # pkg:gem/prism#lib/prism/translation/ripper.rb:90 + def tokenize(*, **, &); end + end +end + +# A list of all of the Ruby binary operators. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:349 +Prism::Translation::Ripper::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) + +# This array contains name of all ripper events. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:301 +Prism::Translation::Ripper::EVENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_ARG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:460 +Prism::Translation::Ripper::EXPR_ARG_ANY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_BEG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:459 +Prism::Translation::Ripper::EXPR_BEG_ANY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_CLASS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_CMDARG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_DOT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_END = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_ENDARG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_ENDFN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:461 +Prism::Translation::Ripper::EXPR_END_ANY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_FITEM = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_FNAME = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_LABEL = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_LABELED = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:455 +Prism::Translation::Ripper::EXPR_MID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:457 +Prism::Translation::Ripper::EXPR_NONE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper.rb:458 +Prism::Translation::Ripper::EXPR_VALUE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/prism#lib/prism/translation/ripper/filter.rb:6 +class Prism::Translation::Ripper::Filter + # :stopdoc: + # + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:8 + def initialize(src, filename = T.unsafe(nil), lineno = T.unsafe(nil)); end + + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:23 + def column; end + + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:15 + def filename; end + + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:19 + def lineno; end + + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:31 + def parse(init = T.unsafe(nil)); end + + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:27 + def state; end + + private + + # pkg:gem/prism#lib/prism/translation/ripper/filter.rb:46 + def on_default(event, token, data); end +end + +# A list of all of the Ruby keywords. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:304 +Prism::Translation::Ripper::KEYWORDS = T.let(T.unsafe(nil), Array) + +# Ripper-internal bitflags. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:449 +Prism::Translation::Ripper::LEX_STATE_NAMES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:9 +class Prism::Translation::Ripper::Lexer < ::Prism::Translation::Ripper + # Pretty much just the same as Prism.lex_compat. + # + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:111 + def lex(raise_errors: T.unsafe(nil)); end + + # Returns the lex_compat result wrapped in `Elem`. Errors are omitted. + # Since ripper is a streaming parser, tokens are expected to be emitted in the order + # that the parser encounters them. This is not implemented. + # + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:118 + def parse(*, **, &); end + + # Similar to parse but ripper sorts the elements by position in the source. Also + # includes errors. Since prism does error recovery, in cases of syntax errors + # the result may differ greatly compared to ripper. + # + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:127 + def scan(*, **, &); end +end + +# pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:50 +class Prism::Translation::Ripper::Lexer::Elem + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:53 + def initialize(pos, event, tok, state, message = T.unsafe(nil)); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:61 + def [](index); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def event; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def event=(_arg0); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:78 + def inspect; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def message; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def message=(_arg0); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def pos; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def pos=(_arg0); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:84 + def pretty_print(q); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def state; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def state=(_arg0); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:101 + def to_a; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:82 + def to_s; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def tok; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:51 + def tok=(_arg0); end +end + +# :stopdoc: +# +# pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:11 +class Prism::Translation::Ripper::Lexer::State + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:15 + def initialize(i); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:36 + def &(i); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:35 + def ==(i); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:21 + def [](index); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:38 + def allbits?(i); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:39 + def anybits?(i); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:33 + def inspect; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:40 + def nobits?(i); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:34 + def pretty_print(q); end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:32 + def to_i; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:13 + def to_int; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:13 + def to_s; end + + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:37 + def |(i); end + + class << self + # pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:45 + def cached(i); end + end +end + +# Instances are frozen and there are only a handful of them so we cache them here. +# +# pkg:gem/prism#lib/prism/translation/ripper/lexer.rb:43 +Prism::Translation::Ripper::Lexer::State::STATES = T.let(T.unsafe(nil), Hash) + +# This array contains name of parser events. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:295 +Prism::Translation::Ripper::PARSER_EVENTS = T.let(T.unsafe(nil), Array) + +# This contains a table of all of the parser events and their +# corresponding arity. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:96 +Prism::Translation::Ripper::PARSER_EVENT_TABLE = T.let(T.unsafe(nil), Hash) + +# This array contains name of scanner events. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:298 +Prism::Translation::Ripper::SCANNER_EVENTS = T.let(T.unsafe(nil), Array) + +# This contains a table of all of the scanner events and their +# corresponding arity. +# +# pkg:gem/prism#lib/prism/translation/ripper.rb:239 +Prism::Translation::Ripper::SCANNER_EVENT_TABLE = T.let(T.unsafe(nil), Hash) + +# This class mirrors the ::Ripper::SexpBuilder subclass of ::Ripper that +# returns the arrays of [type, *children]. +# +# pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:11 +class Prism::Translation::Ripper::SexpBuilder < ::Prism::Translation::Ripper + # :stopdoc: + # + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:14 + def error; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_BEGIN(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_CHAR(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_END(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on___end__(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_alias(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_alias_error(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_aref(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_aref_field(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_arg_ambiguous(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_arg_paren(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_args_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_args_add_block(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_args_add_star(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_args_forward(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_args_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_array(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_aryptn(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_assign(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_assign_error(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_assoc_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_assoc_splat(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_assoclist_from_args(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_backref(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_backtick(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_bare_assoc_hash(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_begin(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_binary(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_block_var(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_blockarg(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_bodystmt(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_brace_block(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_break(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_call(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_case(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_class(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_class_name_error(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_comma(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_command(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_command_call(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_comment(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_const(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_const_path_field(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_const_path_ref(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_const_ref(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_cvar(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_def(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_defined(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_defs(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_do_block(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_dot2(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_dot3(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_dyna_symbol(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_else(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_elsif(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_embdoc(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_embdoc_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_embdoc_end(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_embexpr_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_embexpr_end(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_embvar(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_ensure(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_excessed_comma(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_fcall(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_field(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_float(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_fndptn(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_for(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_gvar(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_hash(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_heredoc_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_heredoc_end(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_hshptn(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_ident(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_if(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_if_mod(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_ifop(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_ignored_nl(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_ignored_sp(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_imaginary(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_in(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_int(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_ivar(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_kw(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_kwrest_param(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_label(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_label_end(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_lambda(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_lbrace(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_lbracket(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_lparen(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_magic_comment(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_massign(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_method_add_arg(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_method_add_block(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mlhs_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mlhs_add_post(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mlhs_add_star(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mlhs_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mlhs_paren(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_module(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mrhs_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mrhs_add_star(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mrhs_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_mrhs_new_from_args(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_next(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_nl(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_nokw_param(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_op(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_opassign(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_operator_ambiguous(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_param_error(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_params(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_paren(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_period(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_program(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_qsymbols_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_qsymbols_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_qsymbols_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_qwords_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_qwords_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_qwords_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_rational(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_rbrace(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_rbracket(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_redo(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_regexp_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_regexp_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_regexp_end(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_regexp_literal(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_regexp_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_rescue(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_rescue_mod(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_rest_param(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_retry(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_return(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_return0(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_rparen(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_sclass(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_semicolon(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_sp(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_stmts_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_stmts_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_string_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_string_concat(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_string_content(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_string_dvar(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_string_embexpr(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_string_literal(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_super(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_symbeg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_symbol(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_symbol_literal(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_symbols_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_symbols_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_symbols_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_tlambda(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_tlambeg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_top_const_field(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_top_const_ref(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_tstring_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_tstring_content(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_tstring_end(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_unary(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_undef(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_unless(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_unless_mod(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_until(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_until_mod(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_var_alias(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_var_field(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_var_ref(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_vcall(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_void_stmt(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_when(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_while(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_while_mod(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_word_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_word_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_words_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_words_beg(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_words_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:55 + def on_words_sep(tok); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_xstring_add(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_xstring_literal(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_xstring_new(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_yield(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_yield0(*args); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_zsuper(*args); end + + private + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:67 + def compile_error(mesg); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:18 + def dedent_element(e, width); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:62 + def on_error(mesg); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:25 + def on_heredoc_dedent(val, width); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:47 + def on_parse_error(mesg); end +end + +# This class mirrors the ::Ripper::SexpBuilderPP subclass of ::Ripper that +# returns the same values as ::Ripper::SexpBuilder except with a couple of +# niceties that flatten linked lists into arrays. +# +# pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:75 +class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::SexpBuilder + private + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:93 + def _dispatch_event_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:97 + def _dispatch_event_push(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_args_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_args_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:80 + def on_heredoc_dedent(val, width); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_mlhs_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:110 + def on_mlhs_add_post(list, post); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:106 + def on_mlhs_add_star(list, star); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_mlhs_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:102 + def on_mlhs_paren(list); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_mrhs_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_mrhs_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_qsymbols_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_qsymbols_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_qwords_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_qwords_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_regexp_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_regexp_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_stmts_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_stmts_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_string_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_symbols_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_symbols_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_word_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_word_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_words_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_words_new; end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:118 + def on_xstring_add(list, item); end + + # pkg:gem/prism#lib/prism/translation/ripper/sexp.rb:116 + def on_xstring_new; end +end + +# This module is the entry-point for converting a prism syntax tree into the +# seattlerb/ruby_parser gem's syntax tree. +# +# pkg:gem/prism#lib/prism/translation/ruby_parser.rb:20 +class Prism::Translation::RubyParser + # Parse the given source and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1917 + def parse(source, filepath = T.unsafe(nil)); end + + # Parse the given file and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1923 + def parse_file(filepath); end + + # Parse the give file and translate it into the + # seattlerb/ruby_parser gem's Sexp format. This method is + # provided for API compatibility to RubyParser and takes an + # optional +timeout+ argument. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1931 + def process(ruby, file = T.unsafe(nil), timeout = T.unsafe(nil)); end + + private + + # Translate the given parse result and filepath into the + # seattlerb/ruby_parser gem's Sexp format. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1953 + def translate(result, filepath); end + + class << self + # Parse the given source and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1938 + def parse(source, filepath = T.unsafe(nil)); end + + # Parse the given file and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1944 + def parse_file(filepath); end + end +end + +# A prism visitor that builds Sexp objects. +# +# pkg:gem/prism#lib/prism/translation/ruby_parser.rb:22 +class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler + # Initialize a new compiler with the given file name. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:37 + def initialize(file, in_def: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # This is the name of the file that we are compiling. We set it on every + # Sexp object that is generated, and also use it to compile `__FILE__` + # nodes. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:26 + def file; end + + # Class variables will change their type based on if they are inside of + # a method definition or not, so we need to track that state. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:30 + def in_def; end + + # Some nodes will change their representation if they are inside of a + # pattern, so we need to track that state. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:34 + def in_pattern; end + + # ``` + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:55 + def visit_alias_global_variable_node(node); end + + # ``` + # alias foo bar + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:47 + def visit_alias_method_node(node); end + + # ``` + # foo => bar | baz + # ^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:63 + def visit_alternation_pattern_node(node); end + + # ``` + # a and b + # ^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:71 + def visit_and_node(node); end + + # ``` + # foo(bar) + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:128 + def visit_arguments_node(node); end + + # ``` + # [] + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:91 + def visit_array_node(node); end + + # ``` + # foo => [bar] + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:103 + def visit_array_pattern_node(node); end + + # ``` + # { a: 1 } + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:136 + def visit_assoc_node(node); end + + # ``` + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:147 + def visit_assoc_splat_node(node); end + + # ``` + # $+ + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:159 + def visit_back_reference_read_node(node); end + + # ``` + # begin end + # ^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:167 + def visit_begin_node(node); end + + # ``` + # foo(&bar) + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:202 + def visit_block_argument_node(node); end + + # ``` + # foo { |; bar| } + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:212 + def visit_block_local_variable_node(node); end + + # A block on a keyword or method call. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:217 + def visit_block_node(node); end + + # ``` + # def foo(&bar); end + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:225 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:230 + def visit_block_parameters_node(node); end + + # ``` + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:272 + def visit_break_node(node); end + + # ``` + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:346 + def visit_call_and_write_node(node); end + + # ``` + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:292 + def visit_call_node(node); end + + # ``` + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:334 + def visit_call_operator_write_node(node); end + + # ``` + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:358 + def visit_call_or_write_node(node); end + + # ``` + # foo.bar, = 1 + # ^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:383 + def visit_call_target_node(node); end + + # ``` + # foo => bar => baz + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:391 + def visit_capture_pattern_node(node); end + + # ``` + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:407 + def visit_case_match_node(node); end + + # ``` + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:399 + def visit_case_node(node); end + + # ``` + # class Foo; end + # ^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:415 + def visit_class_node(node); end + + # ``` + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:468 + def visit_class_variable_and_write_node(node); end + + # ``` + # @@foo += bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:460 + def visit_class_variable_operator_write_node(node); end + + # ``` + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:476 + def visit_class_variable_or_write_node(node); end + + # ``` + # @@foo + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:441 + def visit_class_variable_read_node(node); end + + # ``` + # @@foo, = bar + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:484 + def visit_class_variable_target_node(node); end + + # ``` + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:452 + def visit_class_variable_write_node(node); end + + # ``` + # Foo &&= bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:525 + def visit_constant_and_write_node(node); end + + # ``` + # Foo += bar + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:517 + def visit_constant_operator_write_node(node); end + + # ``` + # Foo ||= bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:533 + def visit_constant_or_write_node(node); end + + # ``` + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:580 + def visit_constant_path_and_write_node(node); end + + # ``` + # Foo::Bar + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:549 + def visit_constant_path_node(node); end + + # ``` + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:572 + def visit_constant_path_operator_write_node(node); end + + # ``` + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:588 + def visit_constant_path_or_write_node(node); end + + # ``` + # Foo::Bar, = baz + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:596 + def visit_constant_path_target_node(node); end + + # ``` + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:564 + def visit_constant_path_write_node(node); end + + # ``` + # Foo + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:498 + def visit_constant_read_node(node); end + + # ``` + # Foo, = bar + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:541 + def visit_constant_target_node(node); end + + # ``` + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:509 + def visit_constant_write_node(node); end + + # ``` + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:614 + def visit_def_node(node); end + + # ``` + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:649 + def visit_defined_node(node); end + + # ``` + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:657 + def visit_else_node(node); end + + # ``` + # "foo #{bar}" + # ^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:665 + def visit_embedded_statements_node(node); end + + # ``` + # "foo #@bar" + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:675 + def visit_embedded_variable_node(node); end + + # ``` + # begin; foo; ensure; bar; end + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:683 + def visit_ensure_node(node); end + + # ``` + # false + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:691 + def visit_false_node(node); end + + # ``` + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:699 + def visit_find_pattern_node(node); end + + # ``` + # if foo .. bar; end + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:707 + def visit_flip_flop_node(node); end + + # ``` + # 1.0 + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:719 + def visit_float_node(node); end + + # ``` + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:727 + def visit_for_node(node); end + + # ``` + # def foo(...); bar(...); end + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:735 + def visit_forwarding_arguments_node(node); end + + # ``` + # def foo(...); end + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:743 + def visit_forwarding_parameter_node(node); end + + # ``` + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:754 + def visit_forwarding_super_node(node); end + + # ``` + # $foo &&= bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:789 + def visit_global_variable_and_write_node(node); end + + # ``` + # $foo += bar + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:781 + def visit_global_variable_operator_write_node(node); end + + # ``` + # $foo ||= bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:797 + def visit_global_variable_or_write_node(node); end + + # ``` + # $foo + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:762 + def visit_global_variable_read_node(node); end + + # ``` + # $foo, = bar + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:805 + def visit_global_variable_target_node(node); end + + # ``` + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:773 + def visit_global_variable_write_node(node); end + + # ``` + # {} + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:813 + def visit_hash_node(node); end + + # ``` + # foo => {} + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:821 + def visit_hash_pattern_node(node); end + + # ``` + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:844 + def visit_if_node(node); end + + # 1i + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:849 + def visit_imaginary_node(node); end + + # ``` + # { foo: } + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:857 + def visit_implicit_node(node); end + + # ``` + # foo { |bar,| } + # ^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:864 + def visit_implicit_rest_node(node); end + + # ``` + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:871 + def visit_in_node(node); end + + # ``` + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:901 + def visit_index_and_write_node(node); end + + # ``` + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:886 + def visit_index_operator_write_node(node); end + + # ``` + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:916 + def visit_index_or_write_node(node); end + + # ``` + # foo[bar], = 1 + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:931 + def visit_index_target_node(node); end + + # ``` + # @foo &&= bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:969 + def visit_instance_variable_and_write_node(node); end + + # ``` + # @foo += bar + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:961 + def visit_instance_variable_operator_write_node(node); end + + # ``` + # @foo ||= bar + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:977 + def visit_instance_variable_or_write_node(node); end + + # ``` + # @foo + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:942 + def visit_instance_variable_read_node(node); end + + # ``` + # @foo, = bar + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:985 + def visit_instance_variable_target_node(node); end + + # ``` + # @foo = 1 + # ^^^^^^^^ + # + # @foo, @bar = 1 + # ^^^^ ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:953 + def visit_instance_variable_write_node(node); end + + # ``` + # 1 + # ^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:993 + def visit_integer_node(node); end + + # ``` + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1001 + def visit_interpolated_match_last_line_node(node); end + + # ``` + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1020 + def visit_interpolated_regular_expression_node(node); end + + # ``` + # "foo #{bar}" + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1037 + def visit_interpolated_string_node(node); end + + # ``` + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1046 + def visit_interpolated_symbol_node(node); end + + # ``` + # `foo #{bar}` + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1055 + def visit_interpolated_x_string_node(node); end + + # ``` + # -> { it } + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1138 + def visit_it_local_variable_read_node(node); end + + # ``` + # foo(bar: baz) + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1146 + def visit_keyword_hash_node(node); end + + # ``` + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1157 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1162 + def visit_lambda_node(node); end + + # ``` + # foo &&= bar + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1213 + def visit_local_variable_and_write_node(node); end + + # ``` + # foo += bar + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1205 + def visit_local_variable_operator_write_node(node); end + + # ``` + # foo ||= bar + # ^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1221 + def visit_local_variable_or_write_node(node); end + + # ``` + # foo + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1182 + def visit_local_variable_read_node(node); end + + # ``` + # foo, = bar + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1229 + def visit_local_variable_target_node(node); end + + # ``` + # foo = 1 + # ^^^^^^^ + # + # foo, bar = 1 + # ^^^ ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1197 + def visit_local_variable_write_node(node); end + + # ``` + # if /foo/ then end + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1237 + def visit_match_last_line_node(node); end + + # ``` + # foo in bar + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1245 + def visit_match_predicate_node(node); end + + # ``` + # foo => bar + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1253 + def visit_match_required_node(node); end + + # ``` + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1261 + def visit_match_write_node(node); end + + # A node that is missing from the syntax tree. This is only used in the + # case of a syntax error. The parser gem doesn't have such a concept, so + # we invent our own here. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1268 + def visit_missing_node(node); end + + # ``` + # module Foo; end + # ^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1276 + def visit_module_node(node); end + + # ``` + # foo, bar = baz + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1302 + def visit_multi_target_node(node); end + + # ``` + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1314 + def visit_multi_write_node(node); end + + # ``` + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1340 + def visit_next_node(node); end + + # ``` + # nil + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1355 + def visit_nil_node(node); end + + # ``` + # def foo(**nil); end + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1363 + def visit_no_keywords_parameter_node(node); end + + # ``` + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1371 + def visit_numbered_parameters_node(node); end + + # ``` + # $1 + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1379 + def visit_numbered_reference_read_node(node); end + + # ``` + # def foo(bar: baz); end + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1387 + def visit_optional_keyword_parameter_node(node); end + + # ``` + # def foo(bar = 1); end + # ^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1395 + def visit_optional_parameter_node(node); end + + # ``` + # a or b + # ^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1403 + def visit_or_node(node); end + + # ``` + # def foo(bar, *baz); end + # ^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1423 + def visit_parameters_node(node); end + + # ``` + # () + # ^^ + # + # (1) + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1465 + def visit_parentheses_node(node); end + + # ``` + # foo => ^(bar) + # ^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1477 + def visit_pinned_expression_node(node); end + + # ``` + # foo = 1 and bar => ^foo + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1485 + def visit_pinned_variable_node(node); end + + # END {} + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1494 + def visit_post_execution_node(node); end + + # BEGIN {} + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1499 + def visit_pre_execution_node(node); end + + # The top-level program node. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1504 + def visit_program_node(node); end + + # ``` + # 0..5 + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1512 + def visit_range_node(node); end + + # ``` + # 1r + # ^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1536 + def visit_rational_node(node); end + + # ``` + # redo + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1544 + def visit_redo_node(node); end + + # ``` + # /foo/ + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1552 + def visit_regular_expression_node(node); end + + # ``` + # def foo(bar:); end + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1560 + def visit_required_keyword_parameter_node(node); end + + # ``` + # def foo(bar); end + # ^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1568 + def visit_required_parameter_node(node); end + + # ``` + # foo rescue bar + # ^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1576 + def visit_rescue_modifier_node(node); end + + # ``` + # begin; rescue; end + # ^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1584 + def visit_rescue_node(node); end + + # ``` + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1606 + def visit_rest_parameter_node(node); end + + # ``` + # retry + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1614 + def visit_retry_node(node); end + + # ``` + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1625 + def visit_return_node(node); end + + # ``` + # self + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1640 + def visit_self_node(node); end + + # A shareable constant. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1645 + def visit_shareable_constant_node(node); end + + # ``` + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1653 + def visit_singleton_class_node(node); end + + # ``` + # __ENCODING__ + # ^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1663 + def visit_source_encoding_node(node); end + + # ``` + # __FILE__ + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1672 + def visit_source_file_node(node); end + + # ``` + # __LINE__ + # ^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1680 + def visit_source_line_node(node); end + + # ``` + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1694 + def visit_splat_node(node); end + + # A list of statements. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1703 + def visit_statements_node(node); end + + # ``` + # "foo" + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1717 + def visit_string_node(node); end + + # ``` + # super(foo) + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1732 + def visit_super_node(node); end + + # ``` + # :foo + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1748 + def visit_symbol_node(node); end + + # ``` + # true + # ^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1756 + def visit_true_node(node); end + + # ``` + # undef foo + # ^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1764 + def visit_undef_node(node); end + + # ``` + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1776 + def visit_unless_node(node); end + + # ``` + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1787 + def visit_until_node(node); end + + # ``` + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1795 + def visit_when_node(node); end + + # ``` + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1806 + def visit_while_node(node); end + + # ``` + # `foo` + # ^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1814 + def visit_x_string_node(node); end + + # ``` + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1832 + def visit_yield_node(node); end + + private + + # Attach prism comments to the given sexp. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1839 + def attach_comments(sexp, node); end + + # If a class variable is written within a method definition, it has a + # different type than everywhere else. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:490 + def class_variable_write_type; end + + # Create a new compiler with the given options. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1850 + def copy_compiler(in_def: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # Call nodes with operators following them will either be op_asgn or + # op_asgn2 nodes. That is determined by their call operator and their + # right-hand side. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:369 + def op_asgn?(node); end + + # Call nodes with operators following them can use &. as an operator, + # which changes their type by prefixing "safe_". + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:375 + def op_asgn_type(node, type); end + + # Create a new Sexp object from the given prism node and arguments. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1855 + def s(node, *arguments); end + + # Visit a block node, which will modify the AST by wrapping the given + # visited node in an iter node. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1865 + def visit_block(node, sexp, block); end + + # ``` + # def foo((bar, baz)); end + # ^^^^^^^^^^ + # ``` + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1440 + def visit_destructured_parameter(node); end + + # Visit the interpolated content of the string-like node. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1062 + def visit_interpolated_parts(parts); end + + # Pattern constants get wrapped in another layer of :const. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1886 + def visit_pattern_constant(node); end + + # If the bounds of a range node are empty parentheses, then they do not + # get replaced by their usual s(:nil), but instead are s(:begin). + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1524 + def visit_range_bounds_node(node); end + + # Visit the value of a write, which will be on the right-hand side of + # a write operator. Because implicit arrays can have splats, those could + # potentially be wrapped in an svalue node. + # + # pkg:gem/prism#lib/prism/translation/ruby_parser.rb:1900 + def visit_write_value(node); end +end + +# Represents the use of the literal `true` keyword. +# +# true +# ^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:18630 +class Prism::TrueNode < ::Prism::Node + # Initialize a new TrueNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18632 + sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void } + def initialize(source, node_id, location, flags); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18695 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18640 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18645 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18661 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18656 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode + # + # pkg:gem/prism#lib/prism/node.rb:18666 + sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::TrueNode) } + def copy(node_id: self.node_id, location: self.location, flags: self.flags); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18671 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location } + # + # pkg:gem/prism#lib/prism/node.rb:18674 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18650 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18679 + sig { override.returns(String) } + def inspect; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18684 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18689 + def type; end + end +end + +# Represents the use of the `undef` keyword. +# +# undef :foo, :bar, :baz +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:18704 +class Prism::UndefNode < ::Prism::Node + # Initialize a new UndefNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18706 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location + ).void + end + def initialize(source, node_id, location, flags, names, keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18793 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18716 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18721 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18738 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18733 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode + # + # pkg:gem/prism#lib/prism/node.rb:18743 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location + ).returns(Prism::UndefNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, names: self.names, keyword_loc: self.keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18748 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location } + # + # pkg:gem/prism#lib/prism/node.rb:18751 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18726 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18777 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:18772 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:18759 + sig { returns(Prism::Location) } + def keyword_loc; end + + # attr_reader names: Array[SymbolNode | InterpolatedSymbolNode] + # + # pkg:gem/prism#lib/prism/node.rb:18756 + sig { returns(T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)]) } + def names; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18767 + def save_keyword_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18782 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18787 + def type; end + end +end + +# Represents the use of the `unless` keyword, either in the block form or the modifier form. +# +# bar unless foo +# ^^^^^^^^^^^^^^ +# +# unless foo then bar end +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:18808 +class Prism::UnlessNode < ::Prism::Node + # Initialize a new UnlessNode node. + # + # pkg:gem/prism#lib/prism/node.rb:18810 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + else_clause: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:18986 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:18824 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18829 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:18852 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:18843 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Returns the else clause of the unless node. This method is deprecated in + # favor of #else_clause. + # + # pkg:gem/prism#lib/prism/node_ext.rb:506 + def consequent; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode + # + # pkg:gem/prism#lib/prism/node.rb:18857 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + else_clause: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location) + ).returns(Prism::UnlessNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, predicate: self.predicate, then_keyword_loc: self.then_keyword_loc, statements: self.statements, else_clause: self.else_clause, end_keyword_loc: self.end_keyword_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:18862 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, else_clause: ElseNode?, end_keyword_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:18865 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:18834 + def each_child_node; end + + # The else clause of the unless expression, if present. + # + # unless cond then bar else baz end + # ^^^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:18930 + sig { returns(T.nilable(Prism::ElseNode)) } + def else_clause; end + + # def end_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18965 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # The location of the `end` keyword, if present. + # + # unless cond then bar end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:18936 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:18970 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:18955 + sig { returns(String) } + def keyword; end + + # The location of the `unless` keyword. + # + # unless cond then bar end + # ^^^^^^ + # + # bar unless cond + # ^^^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:18876 + sig { returns(Prism::Location) } + def keyword_loc; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:98 + def newline_flag!(lines); end + + # The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # unless cond then bar end + # ^^^^ + # + # bar unless cond + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:18895 + sig { returns(Prism::Node) } + def predicate; end + + # Save the end_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18950 + def save_end_keyword_loc(repository); end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18884 + def save_keyword_loc(repository); end + + # Save the then_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:18915 + def save_then_keyword_loc(repository); end + + # The body of statements that will executed if the unless condition is + # falsey. Will be `nil` if no body is provided. + # + # unless cond then bar end + # ^^^ + # + # pkg:gem/prism#lib/prism/node.rb:18924 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:18960 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # The location of the `then` keyword, if present. + # + # unless cond then bar end + # ^^^^ + # + # pkg:gem/prism#lib/prism/node.rb:18901 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:18975 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:18980 + def type; end + end +end + +# Represents the use of the `until` keyword, either in the block form or the modifier form. +# +# bar until foo +# ^^^^^^^^^^^^^ +# +# until foo do bar end +# ^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:19004 +class Prism::UntilNode < ::Prism::Node + # Initialize a new UntilNode node. + # + # pkg:gem/prism#lib/prism/node.rb:19006 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:19156 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:19019 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def begin_modifier?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:19063 + sig { returns(T::Boolean) } + def begin_modifier?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19024 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19135 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19100 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:19045 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:19037 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode + # + # pkg:gem/prism#lib/prism/node.rb:19050 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::UntilNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, do_keyword_loc: self.do_keyword_loc, closing_loc: self.closing_loc, predicate: self.predicate, statements: self.statements); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19055 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, do_keyword_loc: Location?, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? } + # + # pkg:gem/prism#lib/prism/node.rb:19058 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def do_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19130 + sig { returns(T.nilable(String)) } + def do_keyword; end + + # attr_reader do_keyword_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19081 + sig { returns(T.nilable(Prism::Location)) } + def do_keyword_loc; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:19029 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:19140 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19125 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19068 + sig { returns(Prism::Location) } + def keyword_loc; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:104 + def newline_flag!(lines); end + + # attr_reader predicate: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:19119 + sig { returns(Prism::Node) } + def predicate; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19114 + def save_closing_loc(repository); end + + # Save the do_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19095 + def save_do_keyword_loc(repository); end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19076 + def save_keyword_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:19122 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:19145 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:19150 + def type; end + end +end + +# The version constant is set by reading the result of calling pm_version. +Prism::VERSION = T.let(T.unsafe(nil), String) + +# A visitor is a class that provides a default implementation for every accept +# method defined on the nodes. This means it can walk a tree without the +# caller needing to define any special handling. This allows you to handle a +# subset of the tree, while still walking the whole tree. +# +# For example, to find all of the method calls that call the `foo` method, you +# could write: +# +# class FooCalls < Prism::Visitor +# def visit_call_node(node) +# if node.name == :foo +# # Do something with the node +# end +# +# # Call super so that the visitor continues walking the tree +# super +# end +# end +# +# pkg:gem/prism#lib/prism/visitor.rb:57 +class Prism::Visitor < ::Prism::BasicVisitor + # Visit a AliasGlobalVariableNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:59 + sig { params(node: Prism::AliasGlobalVariableNode).void } + def visit_alias_global_variable_node(node); end + + # Visit a AliasMethodNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:64 + sig { params(node: Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end + + # Visit a AlternationPatternNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:69 + sig { params(node: Prism::AlternationPatternNode).void } + def visit_alternation_pattern_node(node); end + + # Visit a AndNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:74 + sig { params(node: Prism::AndNode).void } + def visit_and_node(node); end + + # Visit a ArgumentsNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:79 + sig { params(node: Prism::ArgumentsNode).void } + def visit_arguments_node(node); end + + # Visit a ArrayNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:84 + sig { params(node: Prism::ArrayNode).void } + def visit_array_node(node); end + + # Visit a ArrayPatternNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:89 + sig { params(node: Prism::ArrayPatternNode).void } + def visit_array_pattern_node(node); end + + # Visit a AssocNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:94 + sig { params(node: Prism::AssocNode).void } + def visit_assoc_node(node); end + + # Visit a AssocSplatNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:99 + sig { params(node: Prism::AssocSplatNode).void } + def visit_assoc_splat_node(node); end + + # Visit a BackReferenceReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:104 + sig { params(node: Prism::BackReferenceReadNode).void } + def visit_back_reference_read_node(node); end + + # Visit a BeginNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:109 + sig { params(node: Prism::BeginNode).void } + def visit_begin_node(node); end + + # Visit a BlockArgumentNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:114 + sig { params(node: Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end + + # Visit a BlockLocalVariableNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:119 + sig { params(node: Prism::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node); end + + # Visit a BlockNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:124 + sig { params(node: Prism::BlockNode).void } + def visit_block_node(node); end + + # Visit a BlockParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:129 + sig { params(node: Prism::BlockParameterNode).void } + def visit_block_parameter_node(node); end + + # Visit a BlockParametersNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:134 + sig { params(node: Prism::BlockParametersNode).void } + def visit_block_parameters_node(node); end + + # Visit a BreakNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:139 + sig { params(node: Prism::BreakNode).void } + def visit_break_node(node); end + + # Visit a CallAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:144 + sig { params(node: Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # Visit a CallNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:149 + sig { params(node: Prism::CallNode).void } + def visit_call_node(node); end + + # Visit a CallOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:154 + sig { params(node: Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # Visit a CallOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:159 + sig { params(node: Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end + + # Visit a CallTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:164 + sig { params(node: Prism::CallTargetNode).void } + def visit_call_target_node(node); end + + # Visit a CapturePatternNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:169 + sig { params(node: Prism::CapturePatternNode).void } + def visit_capture_pattern_node(node); end + + # Visit a CaseMatchNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:174 + sig { params(node: Prism::CaseMatchNode).void } + def visit_case_match_node(node); end + + # Visit a CaseNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:179 + sig { params(node: Prism::CaseNode).void } + def visit_case_node(node); end + + # Visit a ClassNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:184 + sig { params(node: Prism::ClassNode).void } + def visit_class_node(node); end + + # Visit a ClassVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:189 + sig { params(node: Prism::ClassVariableAndWriteNode).void } + def visit_class_variable_and_write_node(node); end + + # Visit a ClassVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:194 + sig { params(node: Prism::ClassVariableOperatorWriteNode).void } + def visit_class_variable_operator_write_node(node); end + + # Visit a ClassVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:199 + sig { params(node: Prism::ClassVariableOrWriteNode).void } + def visit_class_variable_or_write_node(node); end + + # Visit a ClassVariableReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:204 + sig { params(node: Prism::ClassVariableReadNode).void } + def visit_class_variable_read_node(node); end + + # Visit a ClassVariableTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:209 + sig { params(node: Prism::ClassVariableTargetNode).void } + def visit_class_variable_target_node(node); end + + # Visit a ClassVariableWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:214 + sig { params(node: Prism::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node); end + + # Visit a ConstantAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:219 + sig { params(node: Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # Visit a ConstantOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:224 + sig { params(node: Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # Visit a ConstantOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:229 + sig { params(node: Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # Visit a ConstantPathAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:234 + sig { params(node: Prism::ConstantPathAndWriteNode).void } + def visit_constant_path_and_write_node(node); end + + # Visit a ConstantPathNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:239 + sig { params(node: Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end + + # Visit a ConstantPathOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:244 + sig { params(node: Prism::ConstantPathOperatorWriteNode).void } + def visit_constant_path_operator_write_node(node); end + + # Visit a ConstantPathOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:249 + sig { params(node: Prism::ConstantPathOrWriteNode).void } + def visit_constant_path_or_write_node(node); end + + # Visit a ConstantPathTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:254 + sig { params(node: Prism::ConstantPathTargetNode).void } + def visit_constant_path_target_node(node); end + + # Visit a ConstantPathWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:259 + sig { params(node: Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # Visit a ConstantReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:264 + sig { params(node: Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end + + # Visit a ConstantTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:269 + sig { params(node: Prism::ConstantTargetNode).void } + def visit_constant_target_node(node); end + + # Visit a ConstantWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:274 + sig { params(node: Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # Visit a DefNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:279 + sig { params(node: Prism::DefNode).void } + def visit_def_node(node); end + + # Visit a DefinedNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:284 + sig { params(node: Prism::DefinedNode).void } + def visit_defined_node(node); end + + # Visit a ElseNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:289 + sig { params(node: Prism::ElseNode).void } + def visit_else_node(node); end + + # Visit a EmbeddedStatementsNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:294 + sig { params(node: Prism::EmbeddedStatementsNode).void } + def visit_embedded_statements_node(node); end + + # Visit a EmbeddedVariableNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:299 + sig { params(node: Prism::EmbeddedVariableNode).void } + def visit_embedded_variable_node(node); end + + # Visit a EnsureNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:304 + sig { params(node: Prism::EnsureNode).void } + def visit_ensure_node(node); end + + # Visit a FalseNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:309 + sig { params(node: Prism::FalseNode).void } + def visit_false_node(node); end + + # Visit a FindPatternNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:314 + sig { params(node: Prism::FindPatternNode).void } + def visit_find_pattern_node(node); end + + # Visit a FlipFlopNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:319 + sig { params(node: Prism::FlipFlopNode).void } + def visit_flip_flop_node(node); end + + # Visit a FloatNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:324 + sig { params(node: Prism::FloatNode).void } + def visit_float_node(node); end + + # Visit a ForNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:329 + sig { params(node: Prism::ForNode).void } + def visit_for_node(node); end + + # Visit a ForwardingArgumentsNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:334 + sig { params(node: Prism::ForwardingArgumentsNode).void } + def visit_forwarding_arguments_node(node); end + + # Visit a ForwardingParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:339 + sig { params(node: Prism::ForwardingParameterNode).void } + def visit_forwarding_parameter_node(node); end + + # Visit a ForwardingSuperNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:344 + sig { params(node: Prism::ForwardingSuperNode).void } + def visit_forwarding_super_node(node); end + + # Visit a GlobalVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:349 + sig { params(node: Prism::GlobalVariableAndWriteNode).void } + def visit_global_variable_and_write_node(node); end + + # Visit a GlobalVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:354 + sig { params(node: Prism::GlobalVariableOperatorWriteNode).void } + def visit_global_variable_operator_write_node(node); end + + # Visit a GlobalVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:359 + sig { params(node: Prism::GlobalVariableOrWriteNode).void } + def visit_global_variable_or_write_node(node); end + + # Visit a GlobalVariableReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:364 + sig { params(node: Prism::GlobalVariableReadNode).void } + def visit_global_variable_read_node(node); end + + # Visit a GlobalVariableTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:369 + sig { params(node: Prism::GlobalVariableTargetNode).void } + def visit_global_variable_target_node(node); end + + # Visit a GlobalVariableWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:374 + sig { params(node: Prism::GlobalVariableWriteNode).void } + def visit_global_variable_write_node(node); end + + # Visit a HashNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:379 + sig { params(node: Prism::HashNode).void } + def visit_hash_node(node); end + + # Visit a HashPatternNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:384 + sig { params(node: Prism::HashPatternNode).void } + def visit_hash_pattern_node(node); end + + # Visit a IfNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:389 + sig { params(node: Prism::IfNode).void } + def visit_if_node(node); end + + # Visit a ImaginaryNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:394 + sig { params(node: Prism::ImaginaryNode).void } + def visit_imaginary_node(node); end + + # Visit a ImplicitNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:399 + sig { params(node: Prism::ImplicitNode).void } + def visit_implicit_node(node); end + + # Visit a ImplicitRestNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:404 + sig { params(node: Prism::ImplicitRestNode).void } + def visit_implicit_rest_node(node); end + + # Visit a InNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:409 + sig { params(node: Prism::InNode).void } + def visit_in_node(node); end + + # Visit a IndexAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:414 + sig { params(node: Prism::IndexAndWriteNode).void } + def visit_index_and_write_node(node); end + + # Visit a IndexOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:419 + sig { params(node: Prism::IndexOperatorWriteNode).void } + def visit_index_operator_write_node(node); end + + # Visit a IndexOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:424 + sig { params(node: Prism::IndexOrWriteNode).void } + def visit_index_or_write_node(node); end + + # Visit a IndexTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:429 + sig { params(node: Prism::IndexTargetNode).void } + def visit_index_target_node(node); end + + # Visit a InstanceVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:434 + sig { params(node: Prism::InstanceVariableAndWriteNode).void } + def visit_instance_variable_and_write_node(node); end + + # Visit a InstanceVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:439 + sig { params(node: Prism::InstanceVariableOperatorWriteNode).void } + def visit_instance_variable_operator_write_node(node); end + + # Visit a InstanceVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:444 + sig { params(node: Prism::InstanceVariableOrWriteNode).void } + def visit_instance_variable_or_write_node(node); end + + # Visit a InstanceVariableReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:449 + sig { params(node: Prism::InstanceVariableReadNode).void } + def visit_instance_variable_read_node(node); end + + # Visit a InstanceVariableTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:454 + sig { params(node: Prism::InstanceVariableTargetNode).void } + def visit_instance_variable_target_node(node); end + + # Visit a InstanceVariableWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:459 + sig { params(node: Prism::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node); end + + # Visit a IntegerNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:464 + sig { params(node: Prism::IntegerNode).void } + def visit_integer_node(node); end + + # Visit a InterpolatedMatchLastLineNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:469 + sig { params(node: Prism::InterpolatedMatchLastLineNode).void } + def visit_interpolated_match_last_line_node(node); end + + # Visit a InterpolatedRegularExpressionNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:474 + sig { params(node: Prism::InterpolatedRegularExpressionNode).void } + def visit_interpolated_regular_expression_node(node); end + + # Visit a InterpolatedStringNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:479 + sig { params(node: Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # Visit a InterpolatedSymbolNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:484 + sig { params(node: Prism::InterpolatedSymbolNode).void } + def visit_interpolated_symbol_node(node); end + + # Visit a InterpolatedXStringNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:489 + sig { params(node: Prism::InterpolatedXStringNode).void } + def visit_interpolated_x_string_node(node); end + + # Visit a ItLocalVariableReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:494 + sig { params(node: Prism::ItLocalVariableReadNode).void } + def visit_it_local_variable_read_node(node); end + + # Visit a ItParametersNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:499 + sig { params(node: Prism::ItParametersNode).void } + def visit_it_parameters_node(node); end + + # Visit a KeywordHashNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:504 + sig { params(node: Prism::KeywordHashNode).void } + def visit_keyword_hash_node(node); end + + # Visit a KeywordRestParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:509 + sig { params(node: Prism::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node); end + + # Visit a LambdaNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:514 + sig { params(node: Prism::LambdaNode).void } + def visit_lambda_node(node); end + + # Visit a LocalVariableAndWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:519 + sig { params(node: Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end + + # Visit a LocalVariableOperatorWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:524 + sig { params(node: Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end + + # Visit a LocalVariableOrWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:529 + sig { params(node: Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end + + # Visit a LocalVariableReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:534 + sig { params(node: Prism::LocalVariableReadNode).void } + def visit_local_variable_read_node(node); end + + # Visit a LocalVariableTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:539 + sig { params(node: Prism::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node); end + + # Visit a LocalVariableWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:544 + sig { params(node: Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # Visit a MatchLastLineNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:549 + sig { params(node: Prism::MatchLastLineNode).void } + def visit_match_last_line_node(node); end + + # Visit a MatchPredicateNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:554 + sig { params(node: Prism::MatchPredicateNode).void } + def visit_match_predicate_node(node); end + + # Visit a MatchRequiredNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:559 + sig { params(node: Prism::MatchRequiredNode).void } + def visit_match_required_node(node); end + + # Visit a MatchWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:564 + sig { params(node: Prism::MatchWriteNode).void } + def visit_match_write_node(node); end + + # Visit a MissingNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:569 + sig { params(node: Prism::MissingNode).void } + def visit_missing_node(node); end + + # Visit a ModuleNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:574 + sig { params(node: Prism::ModuleNode).void } + def visit_module_node(node); end + + # Visit a MultiTargetNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:579 + sig { params(node: Prism::MultiTargetNode).void } + def visit_multi_target_node(node); end + + # Visit a MultiWriteNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:584 + sig { params(node: Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # Visit a NextNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:589 + sig { params(node: Prism::NextNode).void } + def visit_next_node(node); end + + # Visit a NilNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:594 + sig { params(node: Prism::NilNode).void } + def visit_nil_node(node); end + + # Visit a NoKeywordsParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:599 + sig { params(node: Prism::NoKeywordsParameterNode).void } + def visit_no_keywords_parameter_node(node); end + + # Visit a NumberedParametersNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:604 + sig { params(node: Prism::NumberedParametersNode).void } + def visit_numbered_parameters_node(node); end + + # Visit a NumberedReferenceReadNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:609 + sig { params(node: Prism::NumberedReferenceReadNode).void } + def visit_numbered_reference_read_node(node); end + + # Visit a OptionalKeywordParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:614 + sig { params(node: Prism::OptionalKeywordParameterNode).void } + def visit_optional_keyword_parameter_node(node); end + + # Visit a OptionalParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:619 + sig { params(node: Prism::OptionalParameterNode).void } + def visit_optional_parameter_node(node); end + + # Visit a OrNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:624 + sig { params(node: Prism::OrNode).void } + def visit_or_node(node); end + + # Visit a ParametersNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:629 + sig { params(node: Prism::ParametersNode).void } + def visit_parameters_node(node); end + + # Visit a ParenthesesNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:634 + sig { params(node: Prism::ParenthesesNode).void } + def visit_parentheses_node(node); end + + # Visit a PinnedExpressionNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:639 + sig { params(node: Prism::PinnedExpressionNode).void } + def visit_pinned_expression_node(node); end + + # Visit a PinnedVariableNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:644 + sig { params(node: Prism::PinnedVariableNode).void } + def visit_pinned_variable_node(node); end + + # Visit a PostExecutionNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:649 + sig { params(node: Prism::PostExecutionNode).void } + def visit_post_execution_node(node); end + + # Visit a PreExecutionNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:654 + sig { params(node: Prism::PreExecutionNode).void } + def visit_pre_execution_node(node); end + + # Visit a ProgramNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:659 + sig { params(node: Prism::ProgramNode).void } + def visit_program_node(node); end + + # Visit a RangeNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:664 + sig { params(node: Prism::RangeNode).void } + def visit_range_node(node); end + + # Visit a RationalNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:669 + sig { params(node: Prism::RationalNode).void } + def visit_rational_node(node); end + + # Visit a RedoNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:674 + sig { params(node: Prism::RedoNode).void } + def visit_redo_node(node); end + + # Visit a RegularExpressionNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:679 + sig { params(node: Prism::RegularExpressionNode).void } + def visit_regular_expression_node(node); end + + # Visit a RequiredKeywordParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:684 + sig { params(node: Prism::RequiredKeywordParameterNode).void } + def visit_required_keyword_parameter_node(node); end + + # Visit a RequiredParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:689 + sig { params(node: Prism::RequiredParameterNode).void } + def visit_required_parameter_node(node); end + + # Visit a RescueModifierNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:694 + sig { params(node: Prism::RescueModifierNode).void } + def visit_rescue_modifier_node(node); end + + # Visit a RescueNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:699 + sig { params(node: Prism::RescueNode).void } + def visit_rescue_node(node); end + + # Visit a RestParameterNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:704 + sig { params(node: Prism::RestParameterNode).void } + def visit_rest_parameter_node(node); end + + # Visit a RetryNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:709 + sig { params(node: Prism::RetryNode).void } + def visit_retry_node(node); end + + # Visit a ReturnNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:714 + sig { params(node: Prism::ReturnNode).void } + def visit_return_node(node); end + + # Visit a SelfNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:719 + sig { params(node: Prism::SelfNode).void } + def visit_self_node(node); end + + # Visit a ShareableConstantNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:724 + sig { params(node: Prism::ShareableConstantNode).void } + def visit_shareable_constant_node(node); end + + # Visit a SingletonClassNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:729 + sig { params(node: Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + # Visit a SourceEncodingNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:734 + sig { params(node: Prism::SourceEncodingNode).void } + def visit_source_encoding_node(node); end + + # Visit a SourceFileNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:739 + sig { params(node: Prism::SourceFileNode).void } + def visit_source_file_node(node); end + + # Visit a SourceLineNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:744 + sig { params(node: Prism::SourceLineNode).void } + def visit_source_line_node(node); end + + # Visit a SplatNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:749 + sig { params(node: Prism::SplatNode).void } + def visit_splat_node(node); end + + # Visit a StatementsNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:754 + sig { params(node: Prism::StatementsNode).void } + def visit_statements_node(node); end + + # Visit a StringNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:759 + sig { params(node: Prism::StringNode).void } + def visit_string_node(node); end + + # Visit a SuperNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:764 + sig { params(node: Prism::SuperNode).void } + def visit_super_node(node); end + + # Visit a SymbolNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:769 + sig { params(node: Prism::SymbolNode).void } + def visit_symbol_node(node); end + + # Visit a TrueNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:774 + sig { params(node: Prism::TrueNode).void } + def visit_true_node(node); end + + # Visit a UndefNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:779 + sig { params(node: Prism::UndefNode).void } + def visit_undef_node(node); end + + # Visit a UnlessNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:784 + sig { params(node: Prism::UnlessNode).void } + def visit_unless_node(node); end + + # Visit a UntilNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:789 + sig { params(node: Prism::UntilNode).void } + def visit_until_node(node); end + + # Visit a WhenNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:794 + sig { params(node: Prism::WhenNode).void } + def visit_when_node(node); end + + # Visit a WhileNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:799 + sig { params(node: Prism::WhileNode).void } + def visit_while_node(node); end + + # Visit a XStringNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:804 + sig { params(node: Prism::XStringNode).void } + def visit_x_string_node(node); end + + # Visit a YieldNode node + # + # pkg:gem/prism#lib/prism/visitor.rb:809 + sig { params(node: Prism::YieldNode).void } + def visit_yield_node(node); end +end + +# Represents the use of the `when` keyword within a case statement. +# +# case true +# when true +# ^^^^^^^^^ +# end +# +# pkg:gem/prism#lib/prism/node.rb:19173 +class Prism::WhenNode < ::Prism::Node + # Initialize a new WhenNode node. + # + # pkg:gem/prism#lib/prism/node.rb:19175 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, conditions, then_keyword_loc, statements); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:19295 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:19187 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19192 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:19213 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:19205 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader conditions: Array[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:19244 + sig { returns(T::Array[Prism::Node]) } + def conditions; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode + # + # pkg:gem/prism#lib/prism/node.rb:19218 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::WhenNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, conditions: self.conditions, then_keyword_loc: self.then_keyword_loc, statements: self.statements); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19223 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode? } + # + # pkg:gem/prism#lib/prism/node.rb:19226 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:19197 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:19279 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19269 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19231 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19239 + def save_keyword_loc(repository); end + + # Save the then_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19261 + def save_then_keyword_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:19266 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19274 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # attr_reader then_keyword_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19247 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:19284 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:19289 + def type; end + end +end + +# Represents the use of the `while` keyword, either in the block form or the modifier form. +# +# bar while foo +# ^^^^^^^^^^^^^ +# +# while foo do bar end +# ^^^^^^^^^^^^^^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:19312 +class Prism::WhileNode < ::Prism::Node + # Initialize a new WhileNode node. + # + # pkg:gem/prism#lib/prism/node.rb:19314 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:19464 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:19327 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def begin_modifier?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:19371 + sig { returns(T::Boolean) } + def begin_modifier?; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19332 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19443 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19408 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:19353 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:19345 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode + # + # pkg:gem/prism#lib/prism/node.rb:19358 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode) + ).returns(Prism::WhileNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, do_keyword_loc: self.do_keyword_loc, closing_loc: self.closing_loc, predicate: self.predicate, statements: self.statements); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19363 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, do_keyword_loc: Location?, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? } + # + # pkg:gem/prism#lib/prism/node.rb:19366 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def do_keyword: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19438 + sig { returns(T.nilable(String)) } + def do_keyword; end + + # attr_reader do_keyword_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19389 + sig { returns(T.nilable(Prism::Location)) } + def do_keyword_loc; end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:19337 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:19448 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19433 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19376 + sig { returns(Prism::Location) } + def keyword_loc; end + + # pkg:gem/prism#lib/prism/parse_result/newlines.rb:110 + def newline_flag!(lines); end + + # attr_reader predicate: Prism::node + # + # pkg:gem/prism#lib/prism/node.rb:19427 + sig { returns(Prism::Node) } + def predicate; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19422 + def save_closing_loc(repository); end + + # Save the do_keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19403 + def save_do_keyword_loc(repository); end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19384 + def save_keyword_loc(repository); end + + # attr_reader statements: StatementsNode? + # + # pkg:gem/prism#lib/prism/node.rb:19430 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:19453 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:19458 + def type; end + end +end + +# Represents an xstring literal with no interpolation. +# +# `foo` +# ^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:19479 +class Prism::XStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # Initialize a new XStringNode node. + # + # pkg:gem/prism#lib/prism/node.rb:19481 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).void + end + def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:19615 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:19493 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19498 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19594 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19568 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:19514 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:19509 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19589 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19555 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode + # + # pkg:gem/prism#lib/prism/node.rb:19519 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String + ).returns(Prism::XStringNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, opening_loc: self.opening_loc, content_loc: self.content_loc, closing_loc: self.closing_loc, unescaped: self.unescaped); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19524 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String } + # + # pkg:gem/prism#lib/prism/node.rb:19527 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:19503 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:19537 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # pkg:gem/prism#lib/prism/node.rb:19532 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:19599 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19584 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19542 + sig { returns(Prism::Location) } + def opening_loc; end + + # Save the closing_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19576 + def save_closing_loc(repository); end + + # Save the content_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19563 + def save_content_loc(repository); end + + # Save the opening_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19550 + def save_opening_loc(repository); end + + # Occasionally it's helpful to treat a string as if it were interpolated so + # that there's a consistent interface for working with strings. + # + # pkg:gem/prism#lib/prism/node_ext.rb:93 + sig { returns(Prism::InterpolatedXStringNode) } + def to_interpolated; end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:19604 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # pkg:gem/prism#lib/prism/node.rb:19581 + sig { returns(String) } + def unescaped; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:19609 + def type; end + end +end + +# Represents the use of the `yield` keyword. +# +# yield 1 +# ^^^^^^^ +# +# pkg:gem/prism#lib/prism/node.rb:19629 +class Prism::YieldNode < ::Prism::Node + # Initialize a new YieldNode node. + # + # pkg:gem/prism#lib/prism/node.rb:19631 + sig do + params( + source: Prism::Source, + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location) + ).void + end + def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # pkg:gem/prism#lib/prism/node.rb:19770 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # pkg:gem/prism#lib/prism/node.rb:19643 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # pkg:gem/prism#lib/prism/node.rb:19717 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19648 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # pkg:gem/prism#lib/prism/node.rb:19667 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # pkg:gem/prism#lib/prism/node.rb:19660 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode + # + # pkg:gem/prism#lib/prism/node.rb:19672 + sig do + params( + node_id: Integer, + location: Prism::Location, + flags: Integer, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location) + ).returns(Prism::YieldNode) + end + def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, lparen_loc: self.lparen_loc, arguments: self.arguments, rparen_loc: self.rparen_loc); end + + # def deconstruct: () -> Array[Node?] + # + # pkg:gem/prism#lib/prism/node.rb:19677 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location? } + # + # pkg:gem/prism#lib/prism/node.rb:19680 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + # + # pkg:gem/prism#lib/prism/node.rb:19653 + def each_child_node; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # pkg:gem/prism#lib/prism/node.rb:19754 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # pkg:gem/prism#lib/prism/node.rb:19739 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # pkg:gem/prism#lib/prism/node.rb:19685 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19744 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19698 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # pkg:gem/prism#lib/prism/node.rb:19749 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # pkg:gem/prism#lib/prism/node.rb:19720 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Save the keyword_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19693 + def save_keyword_loc(repository); end + + # Save the lparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19712 + def save_lparen_loc(repository); end + + # Save the rparen_loc location using the given saved source so that + # it can be retrieved later. + # + # pkg:gem/prism#lib/prism/node.rb:19734 + def save_rparen_loc(repository); end + + # Return a symbol representation of this node type. See `Node#type`. + # + # pkg:gem/prism#lib/prism/node.rb:19759 + sig { override.returns(Symbol) } + def type; end + + class << self + # Return a symbol representation of this node type. See `Node::type`. + # + # pkg:gem/prism#lib/prism/node.rb:19764 + def type; end + end +end + +# pkg:gem/prism#lib/prism/translation/ruby_parser.rb:11 +class RubyParser; end + +# pkg:gem/prism#lib/prism/translation/ruby_parser.rb:12 +class RubyParser::SyntaxError < ::RuntimeError; end diff --git a/sorbet/rbi/gems/rack-session@2.1.2.rbi b/sorbet/rbi/gems/rack-session@2.1.2.rbi new file mode 100644 index 0000000..f342a65 --- /dev/null +++ b/sorbet/rbi/gems/rack-session@2.1.2.rbi @@ -0,0 +1,753 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack-session` gem. +# Please instead update this file by running `bin/tapioca gem rack-session`. + + +# Released under the MIT License. +# Copyright, 2022-2023, by Samuel Williams. +# Copyright, 2022, by Jeremy Evans. +# Released under the MIT License. +# Copyright, 2022-2023, by Samuel Williams. +# +# pkg:gem/rack-session#lib/rack/session/constants.rb:7 +module Rack; end + +# pkg:gem/rack-session#lib/rack/session/constants.rb:8 +module Rack::Session; end + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:47 +module Rack::Session::Abstract; end + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:499 +class Rack::Session::Abstract::ID < ::Rack::Session::Abstract::Persisted + # All thread safety and session destroy procedures should occur here. + # Should return a new session id or nil if options[:drop] + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:529 + def delete_session(req, sid, options); end + + # All thread safety and session retrieval procedures should occur here. + # Should return [session_id, session]. + # If nil is provided as the session id, generation of a new valid id + # should occur within. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:514 + def find_session(req, sid); end + + # All thread safety and session storage procedures should occur here. + # Must return the session id if the session was saved successfully, or + # false if the session could not be saved. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:522 + def write_session(req, sid, session, options); end + + class << self + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:500 + def inherited(klass); end + end +end + +# ID sets up a basic framework for implementing an id based sessioning +# service. Cookies sent to the client for maintaining sessions will only +# contain an id reference. Only #find_session, #write_session and +# #delete_session are required to be overwritten. +# +# All parameters are optional. +# * :key determines the name of the cookie, by default it is +# 'rack.session' +# * :path, :domain, :expire_after, :secure, :httponly, :partitioned and :same_site set +# the related cookie options as by Rack::Response#set_cookie +# * :skip will not a set a cookie in the response nor update the session state +# * :defer will not set a cookie in the response but still update the session +# state if it is used with a backend +# * :renew (implementation dependent) will prompt the generation of a new +# session id, and migration of data to be referenced at the new id. If +# :defer is set, it will be overridden and the cookie will be set. +# * :sidbits sets the number of bits in length that a generated session +# id will be. +# +# These options can be set on a per request basis, at the location of +# env['rack.session.options']. Additionally the id of the +# session can be found within the options hash at the key :id. It is +# highly not recommended to change its value. +# +# Is Rack::Utils::Context compatible. +# +# Not included by default; you must require 'rack/session/abstract/id' +# to use. +# +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:239 +class Rack::Session::Abstract::Persisted + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:257 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:267 + def call(env); end + + # Acquires the session from the environment and the session id from + # the session options and passes them to #write_session. If successful + # and the :defer option is not true, a cookie will be added to the + # response with the session's id. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:381 + def commit_session(req, res); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:271 + def context(env, app = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:255 + def default_options; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:255 + def key; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:255 + def same_site; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:255 + def sid_secure; end + + private + + # Session should be committed if it was loaded, any of specific options like :renew, :drop + # or :expire_after was given and the security permissions match. Skips if skip is given. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:350 + def commit_session?(req, session, options); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:416 + def cookie_value(data); end + + # Returns the current session id from the SessionHash. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:336 + def current_session_id(req); end + + # All thread safety and session destroy procedures should occur here. + # Should return a new session id or nil if options[:drop] + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:455 + def delete_session(req, sid, options); end + + # Extract session id from request object. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:328 + def extract_session_id(request); end + + # All thread safety and session retrieval procedures should occur here. + # Should return [session_id, session]. + # If nil is provided as the session id, generation of a new valid id + # should occur within. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:440 + def find_session(env, sid); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:367 + def force_options?(options); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:363 + def forced_session_update?(session, options); end + + # Generate a new session id using Ruby #rand. The size of the + # session id is controlled by the :sidbits option. + # Monkey patch this to use custom methods for session id generation. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:296 + def generate_sid(secure = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:286 + def initialize_sid; end + + # Extracts the session id from provided cookies and passes it and the + # environment to #find_session. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:320 + def load_session(req); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:359 + def loaded_session?(session); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:282 + def make_request(env); end + + # Sets the lazy session at 'rack.session' and places options and session + # metadata into 'rack.session.options'. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:309 + def prepare_session(req); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:371 + def security_matches?(request, options); end + + # Allow subclasses to prepare_session for different Session classes + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:431 + def session_class; end + + # Check if the session exists or not. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:342 + def session_exists?(req); end + + # Sets the cookie back to the client with session id. We skip the cookie + # setting if the value didn't change (sid is the same) or expires was given. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:423 + def set_cookie(request, response, cookie); end + + # All thread safety and session storage procedures should occur here. + # Must return the session id if the session was saved successfully, or + # false if the session could not be saved. + # + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:448 + def write_session(req, sid, session, options); end +end + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:240 +Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:460 +class Rack::Session::Abstract::PersistedSecure < ::Rack::Session::Abstract::Persisted + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:483 + def extract_session_id(*); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:477 + def generate_sid(*); end + + private + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:494 + def cookie_value(data); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:490 + def session_class; end +end + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:461 +class Rack::Session::Abstract::PersistedSecure::SecureSessionHash < ::Rack::Session::Abstract::SessionHash + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:462 + def [](key); end +end + +# SessionHash is responsible to lazily load the session from store. +# +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:50 +class Rack::Session::Abstract::SessionHash + include ::Enumerable + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:68 + def initialize(store, req); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:88 + def [](key); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:114 + def []=(key, value); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:120 + def clear; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:146 + def delete(key); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:125 + def destroy; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:93 + def dig(key, *keys); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:83 + def each(&block); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:169 + def empty?; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:159 + def exists?; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:98 + def fetch(key, default = T.unsafe(nil), &block); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:107 + def has_key?(key); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:74 + def id; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:52 + def id=(_arg0); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:112 + def include?(key); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:151 + def inspect; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:111 + def key?(key); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:174 + def keys; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:165 + def loaded?; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:139 + def merge!(hash); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:79 + def options; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:141 + def replace(hash); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:118 + def store(key, value); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:130 + def to_hash; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:135 + def update(hash); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:179 + def values; end + + private + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:194 + def load!; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:186 + def load_for_read!; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:190 + def load_for_write!; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:200 + def stringify_keys(other); end + + class << self + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:56 + def find(req); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:60 + def set(req, session); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:64 + def set_options(req, options); end + end +end + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:54 +Rack::Session::Abstract::SessionHash::Unspecified = T.let(T.unsafe(nil), Object) + +# Rack::Session::Cookie provides simple cookie based session management. +# By default, the session is a Ruby Hash that is serialized and encoded as +# a cookie set to :key (default: rack.session). +# +# This middleware accepts a :secrets option which enables encryption of +# session cookies. This option should be one or more random "secret keys" +# that are each at least 64 bytes in length. Multiple secret keys can be +# supplied in an Array, which is useful when rotating secrets. +# +# Several options are also accepted that are passed to Rack::Session::Encryptor. +# These options include: +# * :serialize_json +# Use JSON for message serialization instead of Marshal. This can be +# viewed as a security enhancement. +# * :gzip_over +# For message data over this many bytes, compress it with the deflate +# algorithm. +# +# Refer to Rack::Session::Encryptor for more details on these options. +# +# Prior to version TODO, the session hash was stored as base64 encoded +# marshalled data. When a :secret option was supplied, the integrity of the +# encoded data was protected with HMAC-SHA1. This functionality is still +# supported using a set of a legacy options. +# +# Lastly, a :coder option is also accepted. When used, both encryption and +# the legacy HMAC will be skipped. This option could create security issues +# in your application! +# +# Example: +# +# use Rack::Session::Cookie, { +# key: 'rack.session', +# domain: 'foo.com', +# path: '/', +# expire_after: 2592000, +# secrets: 'a randomly generated, raw binary string 64 bytes in size', +# } +# +# Example using legacy HMAC options: +# +# Rack::Session:Cookie.new(application, { +# # The secret used for legacy HMAC cookies, this enables the functionality +# legacy_hmac_secret: 'legacy secret', +# # legacy_hmac_coder will default to Rack::Session::Cookie::Base64::Marshal +# legacy_hmac_coder: Rack::Session::Cookie::Identity.new, +# # legacy_hmac will default to OpenSSL::Digest::SHA1 +# legacy_hmac: OpenSSL::Digest::SHA256 +# }) +# +# +# Rack::Session::Cookie.new(application, { +# :coder => Rack::Session::Cookie::Identity.new +# }) +# +# +# Rack::Session::Cookie.new(application, { +# :coder => Class.new { +# def encode(str); str.reverse; end +# def decode(str); str.reverse; end +# }.new +# }) +# +# pkg:gem/rack-session#lib/rack/session/cookie.rb:91 +class Rack::Session::Cookie < ::Rack::Session::Abstract::PersistedSecure + # pkg:gem/rack-session#lib/rack/session/cookie.rb:159 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:157 + def coder; end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:157 + def encryptors; end + + private + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:279 + def delete_session(req, session_id, options); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:294 + def encode_session_data(session); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:209 + def extract_session_id(request); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:203 + def find_session(req, sid); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:284 + def legacy_digest_match?(data, digest); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:290 + def legacy_generate_hmac(data); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:252 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # Were consider "secure" if: + # * Encrypted cookies are enabled and one or more encryptor is + # initialized + # * The legacy HMAC option is enabled + # * Customer :coder is used, with :let_coder_handle_secure_encoding + # set to true + # + # pkg:gem/rack-session#lib/rack/session/cookie.rb:308 + def secure?(options); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:213 + def unpacked_cookie_data(request); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:267 + def write_session(req, session_id, session, options); end +end + +# Encode session cookies as Base64 +# +# pkg:gem/rack-session#lib/rack/session/cookie.rb:93 +class Rack::Session::Cookie::Base64 + # pkg:gem/rack-session#lib/rack/session/cookie.rb:98 + def decode(str); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:94 + def encode(str); end +end + +# N.B. Unlike other encoding methods, the contained objects must be a +# valid JSON composite type, either a Hash or an Array. +# +# pkg:gem/rack-session#lib/rack/session/cookie.rb:116 +class Rack::Session::Cookie::Base64::JSON < ::Rack::Session::Cookie::Base64 + # pkg:gem/rack-session#lib/rack/session/cookie.rb:121 + def decode(str); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:117 + def encode(obj); end +end + +# Encode session cookies as Marshaled Base64 data +# +# pkg:gem/rack-session#lib/rack/session/cookie.rb:103 +class Rack::Session::Cookie::Base64::Marshal < ::Rack::Session::Cookie::Base64 + # pkg:gem/rack-session#lib/rack/session/cookie.rb:108 + def decode(str); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:104 + def encode(str); end +end + +# pkg:gem/rack-session#lib/rack/session/cookie.rb:127 +class Rack::Session::Cookie::Base64::ZipJSON < ::Rack::Session::Cookie::Base64 + # pkg:gem/rack-session#lib/rack/session/cookie.rb:132 + def decode(str); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:128 + def encode(obj); end +end + +# Use no encoding for session cookies +# +# pkg:gem/rack-session#lib/rack/session/cookie.rb:142 +class Rack::Session::Cookie::Identity + # pkg:gem/rack-session#lib/rack/session/cookie.rb:144 + def decode(str); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:143 + def encode(str); end +end + +# pkg:gem/rack-session#lib/rack/session/cookie.rb:147 +class Rack::Session::Cookie::Marshal + # pkg:gem/rack-session#lib/rack/session/cookie.rb:152 + def decode(str); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:148 + def encode(str); end +end + +# pkg:gem/rack-session#lib/rack/session/cookie.rb:258 +class Rack::Session::Cookie::SessionId + # pkg:gem/rack-session#lib/rack/session/cookie.rb:261 + def initialize(session_id, cookie_value); end + + # pkg:gem/rack-session#lib/rack/session/cookie.rb:259 + def cookie_value; end +end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:16 +class Rack::Session::Encryptor + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:347 + def initialize(secret, opts = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:362 + def decrypt(base64_data); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:376 + def encrypt(message); end + + private + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:392 + def guess_decryptor(base64_data); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:390 + def v1; end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:390 + def v2; end +end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:17 +class Rack::Session::Encryptor::Error < ::StandardError; end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:23 +class Rack::Session::Encryptor::InvalidMessage < ::Rack::Session::Encryptor::Error; end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:20 +class Rack::Session::Encryptor::InvalidSignature < ::Rack::Session::Encryptor::Error; end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:26 +module Rack::Session::Encryptor::Serializable + private + + # Return the deserialized message. The first 2 bytes will be read as the + # amount of padding. + # + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:45 + def deserialized_message(data); end + + # Returns a serialized payload of the message. If a :pad_size is supplied, + # the message will be padded. The first 2 bytes of the returned string will + # indicating the amount of padding. + # + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:32 + def serialize_payload(message); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:54 + def serializer; end +end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:59 +class Rack::Session::Encryptor::V1 + include ::Rack::Session::Encryptor::Serializable + + # The secret String must be at least 64 bytes in size. The first 32 bytes + # will be used for the encryption cipher key. The remainder will be used + # for an HMAC key. + # + # Options may include: + # * :serialize_json + # Use JSON for message serialization instead of Marshal. This can be + # viewed as a security enhancement. + # * :pad_size + # Pad encrypted message data, to a multiple of this many bytes + # (default: 32). This can be between 2-4096 bytes, or +nil+ to disable + # padding. + # * :purpose + # Limit messages to a specific purpose. This can be viewed as a + # security enhancement to prevent message reuse from different contexts + # if keys are reused. + # + # Cryptography and Output Format: + # + # urlsafe_encode64(version + random_data + IV + encrypted data + HMAC) + # + # Where: + # * version - 1 byte with value 0x01 + # * random_data - 32 bytes used for generating the per-message secret + # * IV - 16 bytes random initialization vector + # * HMAC - 32 bytes HMAC-SHA-256 of all preceding data, plus the purpose + # value + # + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:89 + def initialize(secret, opts = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:113 + def decrypt(base64_data); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:138 + def encrypt(message); end + + private + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:175 + def cipher_secret_from_message_secret(message_secret); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:183 + def compute_signature(data); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:165 + def new_cipher; end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:169 + def new_message_and_cipher_secret; end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:179 + def set_cipher_key(cipher, key); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:190 + def verify_authenticity!(data, signature); end +end + +# pkg:gem/rack-session#lib/rack/session/encryptor.rb:199 +class Rack::Session::Encryptor::V2 + include ::Rack::Session::Encryptor::Serializable + + # The secret String must be at least 32 bytes in size. + # + # Options may include: + # * :pad_size + # Pad encrypted message data, to a multiple of this many bytes + # (default: 32). This can be between 2-4096 bytes, or +nil+ to disable + # padding. + # * :purpose + # Limit messages to a specific purpose. This can be viewed as a + # security enhancement to prevent message reuse from different contexts + # if keys are reused. + # + # Cryptography and Output Format: + # + # strict_encode64(version + salt + IV + authentication tag + ciphertext) + # + # Where: + # * version - 1 byte with value 0x02 + # * salt - 32 bytes used for generating the per-message secret + # * IV - 12 bytes random initialization vector + # * authentication tag - 16 bytes authentication tag generated by the GCM mode, covering version and salt + # + # Considerations about V2: + # + # 1) It uses non URL-safe Base64 encoding as it's faster than its + # URL-safe counterpart - as of Ruby 3.2, Base64.urlsafe_encode64 is + # roughly equivalent to + # + # Base64.strict_encode64(data).tr("-_", "+/") + # + # - and cookie values don't need to be URL-safe. + # + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:233 + def initialize(secret, opts = T.unsafe(nil)); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:257 + def decrypt(base64_data); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:285 + def encrypt(message); end + + private + + # JRuby's OpenSSL implementation doesn't currently support passing + # an argument to #auth_tag. Here we work around that. + # + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:341 + def auth_tag_from(cipher); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:323 + def message_secret_from_salt(salt); end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:313 + def new_cipher; end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:317 + def new_salt_and_message_secret; end + + # pkg:gem/rack-session#lib/rack/session/encryptor.rb:327 + def set_cipher_key(cipher, key); end +end + +# pkg:gem/rack-session#lib/rack/session/constants.rb:9 +Rack::Session::RACK_SESSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rack-session#lib/rack/session/constants.rb:10 +Rack::Session::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack-session#lib/rack/session/constants.rb:11 +Rack::Session::RACK_SESSION_UNPACKED_COOKIE_DATA = T.let(T.unsafe(nil), String) + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:21 +class Rack::Session::SessionId + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:26 + def initialize(public_id); end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:34 + def cookie_value; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:37 + def empty?; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:38 + def inspect; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:30 + def private_id; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:24 + def public_id; end + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:35 + def to_s; end + + private + + # pkg:gem/rack-session#lib/rack/session/abstract/id.rb:42 + def hash_sid(sid); end +end + +# pkg:gem/rack-session#lib/rack/session/abstract/id.rb:22 +Rack::Session::SessionId::ID_VERSION = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/rack-test@2.2.0.rbi b/sorbet/rbi/gems/rack-test@2.2.0.rbi new file mode 100644 index 0000000..8c48515 --- /dev/null +++ b/sorbet/rbi/gems/rack-test@2.2.0.rbi @@ -0,0 +1,681 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack-test` gem. +# Please instead update this file by running `bin/tapioca gem rack-test`. + + +# pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:6 +module Rack; end + +# For backwards compatibility with 1.1.0 and below +# +# pkg:gem/rack-test#lib/rack/test.rb:381 +Rack::MockSession = Rack::Test::Session + +# pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:7 +module Rack::Test + class << self + # Whether the version of rack in use handles encodings. + # + # pkg:gem/rack-test#lib/rack/test.rb:375 + def encoding_aware_strings?; end + end +end + +# Represents individual cookies in the cookie jar. This is considered private +# API and behavior of this class can change at any time. +# +# pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:10 +class Rack::Test::Cookie + include ::Rack::Utils + + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:23 + def initialize(raw, uri = T.unsafe(nil), default_host = T.unsafe(nil)); end + + # Order cookies by name, path, and domain. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:106 + def <=>(other); end + + # The explicit or implicit domain for the cookie. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:59 + def domain; end + + # Whether the cookie has a value. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:54 + def empty?; end + + # Whether the cookie is currently expired. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:86 + def expired?; end + + # A Time value for when the cookie expires, if the expires option is set. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:81 + def expires; end + + # Whether the cookie has the httponly flag, indicating it is not available via + # a javascript API. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:71 + def http_only?; end + + # Cookies that do not match the URI will not be sent in requests to the URI. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:101 + def matches?(uri); end + + # The name of the cookie, will be a string + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:14 + def name; end + + # The explicit or implicit path for the cookie. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:76 + def path; end + + # The raw string for the cookie, without options. Will generally be in + # name=value format is name and value are provided. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:21 + def raw; end + + # Wether the given cookie can replace the current cookie in the cookie jar. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:49 + def replaces?(other); end + + # Whether the cookie has the secure flag, indicating it can only be sent over + # an encrypted connection. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:65 + def secure?; end + + # A hash of cookie options, including the cookie value, but excluding the cookie name. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:111 + def to_h; end + + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:120 + def to_hash; end + + # Whether the cookie is valid for the given URI. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:91 + def valid?(uri); end + + # The value of the cookie, will be a string or nil if there is no value. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:17 + def value; end + + private + + # The default URI to use for the cookie, including just the host. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:125 + def default_uri; end +end + +# Represents all cookies for a session, handling adding and +# removing cookies, and finding which cookies apply to a given +# request. This is considered private API and behavior of this +# class can change at any time. +# +# pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:134 +class Rack::Test::CookieJar + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:137 + def initialize(cookies = T.unsafe(nil), default_host = T.unsafe(nil)); end + + # Add a Cookie to the cookie jar. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:197 + def <<(new_cookie); end + + # Return the value for first cookie with the given name, or nil + # if no such cookie exists. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:150 + def [](name); end + + # Set a cookie with the given name and value in the + # cookie jar. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:160 + def []=(name, value); end + + # Delete all cookies with the given name from the cookie jar. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:174 + def delete(name); end + + # Return a raw cookie string for the cookie header to + # use for the given URI. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:208 + def for(uri); end + + # Return the first cookie with the given name, or nil if + # no such cookie exists. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:166 + def get_cookie(name); end + + # Add a string of raw cookie information to the cookie jar, + # if the cookie is valid for the given URI. + # Cookies should be separated with a newline. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:184 + def merge(raw_cookies, uri = T.unsafe(nil)); end + + # Return a hash cookie names and cookie values for cookies in the jar. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:225 + def to_hash; end + + private + + # Yield each cookie that matches for the URI. + # + # The cookies are sorted by most specific first. So, we loop through + # all the cookies in order and add it to a hash by cookie name if + # the cookie can be sent to the current URI. It's added to the hash + # so that when we are done, the cookies will be unique by name and + # we'll have grabbed the most specific to the URI. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:244 + def each_cookie_for(uri); end + + # Ensure the copy uses a distinct cookies array. + # + # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:143 + def initialize_copy(other); end +end + +# pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:135 +Rack::Test::CookieJar::DELIMITER = T.let(T.unsafe(nil), String) + +# The default host to use for requests, when a full URI is not +# provided. +# +# pkg:gem/rack-test#lib/rack/test.rb:33 +Rack::Test::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# The ending boundary in multipart requests +# +# pkg:gem/rack-test#lib/rack/test.rb:42 +Rack::Test::END_BOUNDARY = T.let(T.unsafe(nil), String) + +# The common base class for exceptions raised by Rack::Test +# +# pkg:gem/rack-test#lib/rack/test.rb:45 +class Rack::Test::Error < ::StandardError; end + +# The default multipart boundary to use for multipart request bodies +# +# pkg:gem/rack-test#lib/rack/test.rb:36 +Rack::Test::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# This module serves as the primary integration point for using Rack::Test +# in a testing environment. It depends on an app method being defined in the +# same context, and provides the Rack::Test API methods (see Rack::Test::Session +# for their documentation). It defines the following methods that are delegated +# to the current session: :request, :get, :post, :put, :patch, :delete, :options, +# :head, :custom_request, :follow_redirect!, :header, :env, :set_cookie, +# :clear_cookies, :authorize, :basic_authorize, :last_response, and :last_request. +# +# Example: +# +# class HomepageTest < Test::Unit::TestCase +# include Rack::Test::Methods +# +# def app +# MyApp +# end +# end +# +# pkg:gem/rack-test#lib/rack/test/methods.rb:24 +module Rack::Test::Methods + extend ::Forwardable + + # Private accessor to avoid uninitialized instance variable warning in Ruby 2.* + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:90 + def _rack_test_current_session=(_arg0); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def authorize(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def basic_authorize(*, **, &); end + + # Create a new Rack::Test::Session for #app. + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:40 + def build_rack_test_session(_name); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def clear_cookies(*, **, &); end + + # Return the currently actively session. This is the session to + # which the delegated methods are sent. + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:55 + def current_session; end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def custom_request(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def delete(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def env(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def follow_redirect!(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def get(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def head(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def header(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def last_request(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def last_response(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def options(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def patch(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def post(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def put(*, **, &); end + + # For backwards compatibility with older rack-test versions. + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:37 + def rack_mock_session(name = T.unsafe(nil)); end + + # Return the existing session with the given name, or a new + # rack session. Always use a new session if name is nil. + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:29 + def rack_test_session(name = T.unsafe(nil)); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def request(*, **, &); end + + # pkg:gem/rack-test#lib/rack/test/methods.rb:68 + def set_cookie(*, **, &); end + + # Create a new session (or reuse an existing session with the given name), + # and make it the current session for the given block. + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:61 + def with_session(name); end + + private + + # Private accessor to avoid uninitialized instance variable warning in Ruby 2.* + # + # pkg:gem/rack-test#lib/rack/test/methods.rb:90 + def _rack_test_current_session; end +end + +# The starting boundary in multipart requests +# +# pkg:gem/rack-test#lib/rack/test.rb:39 +Rack::Test::START_BOUNDARY = T.let(T.unsafe(nil), String) + +# Rack::Test::Session handles a series of requests issued to a Rack app. +# It keeps track of the cookies for the session, and allows for setting headers +# and a default rack environment that is used for future requests. +# +# Rack::Test::Session's methods are most often called through Rack::Test::Methods, +# which will automatically build a session when it's first used. +# +# pkg:gem/rack-test#lib/rack/test.rb:53 +class Rack::Test::Session + include ::Rack::Utils + include ::Rack::Test::Utils + extend ::Forwardable + + # Creates a Rack::Test::Session for a given Rack app or Rack::Test::BasicSession. + # + # Note: Generally, you won't need to initialize a Rack::Test::Session directly. + # Instead, you should include Rack::Test::Methods into your testing context. + # (See README.rdoc for an example) + # + # The following methods are defined via metaprogramming: get, post, put, patch, + # delete, options, and head. Each method submits a request with the given request + # method, with the given URI and optional parameters and rack environment. + # Examples: + # + # # URI only: + # get("/") # GET / + # get("/?foo=bar") # GET /?foo=bar + # + # # URI and parameters + # get("/foo", 'bar'=>'baz') # GET /foo?bar=baz + # post("/foo", 'bar'=>'baz') # POST /foo (bar=baz in request body) + # + # # URI, parameters, and rack environment + # get("/bar", {}, 'CONTENT_TYPE'=>'foo') + # get("/bar", {'foo'=>'baz'}, 'HTTP_ACCEPT'=>'*') + # + # The above methods as well as #request and #custom_request store the Rack::Request + # submitted in #last_request. The methods store a Rack::MockResponse based on the + # response in #last_response. #last_response is also returned by the methods. + # If a block is given, #last_response is also yielded to the block. + # + # pkg:gem/rack-test#lib/rack/test.rb:99 + def initialize(app, default_host = T.unsafe(nil)); end + + # Run a block after the each request completes. + # + # pkg:gem/rack-test#lib/rack/test.rb:118 + def after_request(&block); end + + # pkg:gem/rack-test#lib/rack/test.rb:203 + def authorize(username, password); end + + # Set the username and password for HTTP Basic authorization, to be + # included in subsequent requests in the HTTP_AUTHORIZATION header. + # + # Example: + # basic_authorize "bryan", "secret" + # + # pkg:gem/rack-test#lib/rack/test.rb:198 + def basic_authorize(username, password); end + + # Replace the current cookie jar with an empty cookie jar. + # + # pkg:gem/rack-test#lib/rack/test.rb:123 + def clear_cookies; end + + # The Rack::Test::CookieJar for the cookies for the current session. + # + # pkg:gem/rack-test#lib/rack/test.rb:67 + def cookie_jar; end + + # The Rack::Test::CookieJar for the cookies for the current session. + # + # pkg:gem/rack-test#lib/rack/test.rb:67 + def cookie_jar=(_arg0); end + + # Issue a request using the given HTTP verb for the given URI, with optional + # params and rack environment. Example: + # + # custom_request "LINK", "/" + # + # pkg:gem/rack-test#lib/rack/test.rb:160 + def custom_request(verb, uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # The default host used for the session for when using paths for URIs. + # + # pkg:gem/rack-test#lib/rack/test.rb:70 + def default_host; end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def delete(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # Set an entry in the rack environment to be included on all subsequent + # requests through the session. Use a value of nil to remove a previously + # value. Example: + # + # env "rack.session", {:csrf => 'token'} + # + # pkg:gem/rack-test#lib/rack/test.rb:185 + def env(name, value); end + + # Rack::Test will not follow any redirects automatically. This method + # will follow the redirect returned (including setting the Referer header + # on the new request) in the last response. If the last response was not + # a redirect, an error will be raised. + # + # pkg:gem/rack-test#lib/rack/test.rb:209 + def follow_redirect!; end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def get(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def head(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # Set a header to be included on all subsequent requests through the + # session. Use a value of nil to remove a previously configured header. + # + # In accordance with the Rack spec, headers will be included in the Rack + # environment hash in HTTP_USER_AGENT form. Example: + # + # header "user-agent", "Firefox" + # + # pkg:gem/rack-test#lib/rack/test.rb:173 + def header(name, value); end + + # Return the last request issued in the session. Raises an error if no + # requests have been sent yet. + # + # pkg:gem/rack-test#lib/rack/test.rb:134 + def last_request; end + + # Return the last response received in the session. Raises an error if + # no requests have been sent yet. + # + # pkg:gem/rack-test#lib/rack/test.rb:141 + def last_response; end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def options(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def patch(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def post(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # pkg:gem/rack-test#lib/rack/test.rb:110 + def put(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # Issue a request to the Rack app for the given URI and optional Rack + # environment. Example: + # + # request "/" + # + # pkg:gem/rack-test#lib/rack/test.rb:150 + def request(uri, env = T.unsafe(nil), &block); end + + # Yield to the block, and restore the last request, last response, and + # cookie jar to the state they were prior to block execution upon + # exiting the block. + # + # pkg:gem/rack-test#lib/rack/test.rb:240 + def restore_state; end + + # Set a cookie in the current cookie jar. + # + # pkg:gem/rack-test#lib/rack/test.rb:128 + def set_cookie(cookie, uri = T.unsafe(nil)); end + + private + + # Append a string version of the query params to the array of query params. + # + # pkg:gem/rack-test#lib/rack/test.rb:340 + def append_query_params(query_array, query_params); end + + # close() gets called automatically in newer Rack versions. + # + # pkg:gem/rack-test#lib/rack/test.rb:266 + def close_body(body); end + + # Update environment to use based on given URI. + # + # pkg:gem/rack-test#lib/rack/test.rb:293 + def env_for(uri, env); end + + # Return the multipart content type to use based on the environment. + # + # pkg:gem/rack-test#lib/rack/test.rb:346 + def multipart_content_type(env); end + + # Normalize URI based on given URI/path and environment. + # + # pkg:gem/rack-test#lib/rack/test.rb:271 + def parse_uri(path, env); end + + # Submit the request with the given URI and rack environment to + # the mock session. Returns and potentially yields the last response. + # + # pkg:gem/rack-test#lib/rack/test.rb:357 + def process_request(uri, env); end + + class << self + # pkg:gem/rack-test#lib/rack/test.rb:57 + def new(app, default_host = T.unsafe(nil)); end + end +end + +# pkg:gem/rack-test#lib/rack/test.rb:279 +Rack::Test::Session::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# Wraps a Tempfile with a content type. Including one or more UploadedFile's +# in the params causes Rack::Test to build and issue a multipart request. +# +# Example: +# post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg", "image/jpeg") +# +# pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:14 +class Rack::Test::UploadedFile + # Creates a new UploadedFile instance. + # + # Arguments: + # content :: is a path to a file, or an {IO} or {StringIO} object representing the content. + # content_type :: MIME type of the file + # binary :: Whether the file should be set to binmode (content treated as binary). + # original_filename :: The filename to use for the file. Required if content is StringIO, optional override if not + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:31 + def initialize(content, content_type = T.unsafe(nil), binary = T.unsafe(nil), original_filename: T.unsafe(nil)); end + + # Append to given buffer in 64K chunks to avoid multiple large + # copies of file data in memory. Rewind tempfile before and + # after to make sure all data in tempfile is appended to the + # buffer. + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:60 + def append_to(buffer); end + + # The content type of the "uploaded" file + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:22 + def content_type; end + + # The content type of the "uploaded" file + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:22 + def content_type=(_arg0); end + + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:49 + def local_path; end + + # Delegate all methods not handled to the tempfile. + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:52 + def method_missing(method_name, *args, &block); end + + # The filename, *not* including the path, of the "uploaded" file + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:16 + def original_filename; end + + # The path to the tempfile. Will not work if the receiver's content is from a StringIO. + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:46 + def path; end + + # The tempfile + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:19 + def tempfile; end + + private + + # Create a tempfile and copy the content from the given path into the tempfile, optionally renaming if + # original_filename has been set. + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:86 + def initialize_from_file_path(path); end + + # Use the StringIO as the tempfile. + # + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:78 + def initialize_from_stringio(stringio); end + + # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:71 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/rack-test#lib/rack/test/utils.rb:5 +module Rack::Test::Utils + include ::Rack::Utils + extend ::Rack::Utils + extend ::Rack::Test::Utils + + # Build a multipart body for the given params. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:34 + def build_multipart(params, _first = T.unsafe(nil), multipart = T.unsafe(nil)); end + + # Build a query string for the given value and prefix. The value + # can be an array or hash of parameters. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:11 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + private + + # Append each multipart parameter value to the buffer. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:100 + def _build_parts(buffer, parameters); end + + # Append the multipart fragment for a parameter that is a file upload to the buffer. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:133 + def build_file_part(buffer, parameter_name, uploaded_file); end + + # Build the multipart content for uploading. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:94 + def build_parts(buffer, parameters); end + + # Append the multipart fragment for a parameter that isn't a file upload to the buffer. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:121 + def build_primitive_part(buffer, parameter_name, value); end + + # Return a flattened hash of parameter values based on the given params. + # + # pkg:gem/rack-test#lib/rack/test/utils.rb:62 + def normalize_multipart_params(params, first = T.unsafe(nil)); end +end + +# pkg:gem/rack-test#lib/rack/test/version.rb:3 +Rack::Test::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rack@3.2.7.rbi b/sorbet/rbi/gems/rack@3.2.7.rbi new file mode 100644 index 0000000..a883b42 --- /dev/null +++ b/sorbet/rbi/gems/rack@3.2.7.rbi @@ -0,0 +1,4633 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack` gem. +# Please instead update this file by running `bin/tapioca gem rack`. + + +# Copyright (C) 2007-2019 Leah Neukirchen +# +# Rack is freely distributable under the terms of an MIT-style license. +# See MIT-LICENSE or https://opensource.org/licenses/MIT. +# +# pkg:gem/rack#lib/rack/version.rb:8 +module Rack + class << self + # Return the Rack release as a dotted string. + # + # pkg:gem/rack#lib/rack/version.rb:14 + def release; end + end +end + +# pkg:gem/rack#lib/rack.rb:59 +module Rack::Auth; end + +# Rack::Auth::AbstractHandler implements common authentication functionality. +# +# +realm+ should be set for all handlers. +# +# pkg:gem/rack#lib/rack/auth/abstract/handler.rb:11 +class Rack::Auth::AbstractHandler + # pkg:gem/rack#lib/rack/auth/abstract/handler.rb:15 + def initialize(app, realm = T.unsafe(nil), &authenticator); end + + # pkg:gem/rack#lib/rack/auth/abstract/handler.rb:13 + def realm; end + + # pkg:gem/rack#lib/rack/auth/abstract/handler.rb:13 + def realm=(_arg0); end + + private + + # pkg:gem/rack#lib/rack/auth/abstract/handler.rb:31 + def bad_request; end + + # pkg:gem/rack#lib/rack/auth/abstract/handler.rb:22 + def unauthorized(www_authenticate = T.unsafe(nil)); end +end + +# pkg:gem/rack#lib/rack/auth/abstract/request.rb:8 +class Rack::Auth::AbstractRequest + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:10 + def initialize(env); end + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:35 + def params; end + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:27 + def parts; end + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:19 + def provided?; end + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:14 + def request; end + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:31 + def scheme; end + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:23 + def valid?; end + + private + + # pkg:gem/rack#lib/rack/auth/abstract/request.rb:44 + def authorization_key; end +end + +# pkg:gem/rack#lib/rack/auth/abstract/request.rb:42 +Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array) + +# Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617. +# +# Initialize with the Rack application that you want protecting, +# and a block that checks if a username and password pair are valid. +# +# pkg:gem/rack#lib/rack/auth/basic.rb:13 +class Rack::Auth::Basic < ::Rack::Auth::AbstractHandler + # pkg:gem/rack#lib/rack/auth/basic.rb:15 + def call(env); end + + private + + # pkg:gem/rack#lib/rack/auth/basic.rb:34 + def challenge; end + + # pkg:gem/rack#lib/rack/auth/basic.rb:38 + def valid?(auth); end +end + +# pkg:gem/rack#lib/rack/auth/basic.rb:42 +class Rack::Auth::Basic::Request < ::Rack::Auth::AbstractRequest + # pkg:gem/rack#lib/rack/auth/basic.rb:43 + def basic?; end + + # pkg:gem/rack#lib/rack/auth/basic.rb:47 + def credentials; end + + # pkg:gem/rack#lib/rack/auth/basic.rb:51 + def username; end +end + +# pkg:gem/rack#lib/rack/builder.rb:6 +Rack::BUILDER_TOPLEVEL_BINDING = T.let(T.unsafe(nil), Proc) + +# Represents a 400 Bad Request error when input data fails to meet the +# requirements. +# +# pkg:gem/rack#lib/rack/bad_request.rb:6 +module Rack::BadRequest; end + +# Proxy for response bodies allowing calling a block when +# the response body is closed (after the response has been fully +# sent to the client). +# +# pkg:gem/rack#lib/rack/body_proxy.rb:7 +class Rack::BodyProxy + # Set the response body to wrap, and the block to call when the + # response has been fully sent. + # + # pkg:gem/rack#lib/rack/body_proxy.rb:10 + def initialize(body, &block); end + + # If not already closed, close the wrapped body and + # then call the block the proxy was initialized with. + # + # pkg:gem/rack#lib/rack/body_proxy.rb:28 + def close; end + + # Whether the proxy is closed. The proxy starts as not closed, + # and becomes closed on the first call to close. + # + # pkg:gem/rack#lib/rack/body_proxy.rb:40 + def closed?; end + + # Delegate missing methods to the wrapped body. + # + # pkg:gem/rack#lib/rack/body_proxy.rb:45 + def method_missing(method_name, *args, **, &block); end + + private + + # Return whether the wrapped body responds to the method. + # + # pkg:gem/rack#lib/rack/body_proxy.rb:17 + def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end +end + +# Rack::Builder provides a domain-specific language (DSL) to construct Rack +# applications. It is primarily used to parse +config.ru+ files which +# instantiate several middleware and a final application which are hosted +# by a Rack-compatible web server. +# +# Example: +# +# app = Rack::Builder.new do +# use Rack::CommonLogger +# map "/ok" do +# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] } +# end +# end +# +# run app +# +# Or +# +# app = Rack::Builder.app do +# use Rack::CommonLogger +# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] } +# end +# +# run app +# +# +use+ adds middleware to the stack, +run+ dispatches to an application. +# You can use +map+ to construct a Rack::URLMap in a convenient way. +# +# pkg:gem/rack#lib/rack/builder.rb:36 +class Rack::Builder + # Initialize a new Rack::Builder instance. +default_app+ specifies the + # default application if +run+ is not called later. If a block + # is given, it is evaluated in the context of the instance. + # + # pkg:gem/rack#lib/rack/builder.rb:116 + def initialize(default_app = T.unsafe(nil), **options, &block); end + + # Call the Rack application generated by this builder instance. Note that + # this rebuilds the Rack application and runs the warmup code (if any) + # every time it is called, so it should not be used if performance is important. + # + # pkg:gem/rack#lib/rack/builder.rb:282 + def call(env); end + + # Freeze the app (set using run) and all middleware instances when building the application + # in to_app. + # + # pkg:gem/rack#lib/rack/builder.rb:265 + def freeze_app; end + + # Creates a route within the application. Routes under the mapped path will be sent to + # the Rack application specified by run inside the block. Other requests will be sent to the + # default application specified by run outside the block. + # + # class App + # def call(env) + # [200, {'content-type' => 'text/plain'}, ["Hello World"]] + # end + # end + # + # class Heartbeat + # def call(env) + # [200, { "content-type" => "text/plain" }, ["OK"]] + # end + # end + # + # app = Rack::Builder.app do + # map '/heartbeat' do + # run Heartbeat.new + # end + # run App.new + # end + # + # run app + # + # The +use+ method can also be used inside the block to specify middleware to run under a specific path: + # + # app = Rack::Builder.app do + # map '/heartbeat' do + # use Middleware + # run Heartbeat.new + # end + # run App.new + # end + # + # This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+. + # + # Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement + # outside the block. + # + # pkg:gem/rack#lib/rack/builder.rb:256 + def map(path, &block); end + + # Any options provided to the Rack::Builder instance at initialization. + # These options can be server-specific. Some general options are: + # + # * +:isolation+: One of +process+, +thread+ or +fiber+. The execution + # isolation model to use. + # + # pkg:gem/rack#lib/rack/builder.rb:132 + def options; end + + # Takes a block or argument that is an object that responds to #call and + # returns a Rack response. + # + # You can use a block: + # + # run do |env| + # [200, { "content-type" => "text/plain" }, ["Hello World!"]] + # end + # + # You can also provide a lambda: + # + # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] } + # + # You can also provide a class instance: + # + # class Heartbeat + # def call(env) + # [200, { "content-type" => "text/plain" }, ["OK"]] + # end + # end + # + # run Heartbeat.new + # + # pkg:gem/rack#lib/rack/builder.rb:195 + def run(app = T.unsafe(nil), &block); end + + # Return the Rack application generated by this instance. + # + # pkg:gem/rack#lib/rack/builder.rb:270 + def to_app; end + + # Specifies middleware to use in a stack. + # + # class Middleware + # def initialize(app) + # @app = app + # end + # + # def call(env) + # env["rack.some_header"] = "setting an example" + # @app.call(env) + # end + # end + # + # use Middleware + # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] } + # + # All requests through to this application will first be processed by the middleware class. + # The +call+ method in this example sets an additional environment key which then can be + # referenced in the application if required. + # + # pkg:gem/rack#lib/rack/builder.rb:159 + def use(middleware, *args, **, &block); end + + # Takes a lambda or block that is used to warm-up the application. This block is called + # before the Rack application is returned by to_app. + # + # warmup do |app| + # client = Rack::MockRequest.new(app) + # client.get('/') + # end + # + # use SomeMiddleware + # run MyApp + # + # pkg:gem/rack#lib/rack/builder.rb:213 + def warmup(prc = T.unsafe(nil), &block); end + + private + + # Generate a URLMap instance by generating new Rack applications for each + # map block in this instance. + # + # pkg:gem/rack#lib/rack/builder.rb:290 + def generate_map(default_app, mapping); end + + class << self + # Create a new Rack::Builder instance and return the Rack application + # generated from it. + # + # pkg:gem/rack#lib/rack/builder.rb:136 + def app(default_app = T.unsafe(nil), &block); end + + # Load the given file as a rackup file, treating the + # contents as if specified inside a Rack::Builder block. + # + # Ignores content in the file after +__END__+, so that + # use of +__END__+ will not result in a syntax error. + # + # Example config.ru file: + # + # $ cat config.ru + # + # use Rack::ContentLength + # require './app.rb' + # run App + # + # pkg:gem/rack#lib/rack/builder.rb:87 + def load_file(path, **options); end + + # Evaluate the given +builder_script+ string in the context of + # a Rack::Builder block, returning a Rack application. + # + # pkg:gem/rack#lib/rack/builder.rb:102 + def new_from_string(builder_script, path = T.unsafe(nil), **options); end + + # Parse the given config file to get a Rack application. + # + # If the config file ends in +.ru+, it is treated as a + # rackup file and the contents will be treated as if + # specified inside a Rack::Builder block. + # + # If the config file does not end in +.ru+, it is + # required and Rack will use the basename of the file + # to guess which constant will be the Rack application to run. + # + # Examples: + # + # Rack::Builder.parse_file('config.ru') + # # Rack application built using Rack::Builder.new + # + # Rack::Builder.parse_file('app.rb') + # # requires app.rb, which can be anywhere in Ruby's + # # load path. After requiring, assumes App constant + # # is a Rack application + # + # Rack::Builder.parse_file('./my_app.rb') + # # requires ./my_app.rb, which should be in the + # # process's current directory. After requiring, + # # assumes MyApp constant is a Rack application + # + # pkg:gem/rack#lib/rack/builder.rb:65 + def parse_file(path, **options); end + end +end + +# https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom +# +# pkg:gem/rack#lib/rack/builder.rb:39 +Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String) + +# Response Header Keys +# +# pkg:gem/rack#lib/rack/constants.rb:19 +Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:35 +Rack::CONNECT = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:20 +Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:21 +Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# Rack::Cascade tries a request on several apps, and returns the +# first response that is not 404 or 405 (or in a list of configured +# status codes). If all applications tried return one of the configured +# status codes, return the last response. +# +# pkg:gem/rack#lib/rack/cascade.rb:11 +class Rack::Cascade + # Set the apps to send requests to, and what statuses result in + # cascading. Arguments: + # + # apps: An enumerable of rack applications. + # cascade_for: The statuses to use cascading for. If a response is received + # from an app, the next app is tried. + # + # pkg:gem/rack#lib/rack/cascade.rb:21 + def initialize(apps, cascade_for = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/cascade.rb:65 + def <<(app); end + + # Append an app to the list of apps to cascade. This app will + # be tried last. + # + # pkg:gem/rack#lib/rack/cascade.rb:56 + def add(app); end + + # An array of applications to try in order. + # + # pkg:gem/rack#lib/rack/cascade.rb:13 + def apps; end + + # Call each app in order. If the responses uses a status that requires + # cascading, try the next app. If all responses require cascading, + # return the response from the last app. + # + # pkg:gem/rack#lib/rack/cascade.rb:32 + def call(env); end + + # Whether the given app is one of the apps to cascade to. + # + # pkg:gem/rack#lib/rack/cascade.rb:61 + def include?(app); end +end + +# Rack::CommonLogger forwards every request to the given +app+, and +# logs a line in the +# {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common] +# to the configured logger. +# +# pkg:gem/rack#lib/rack/common_logger.rb:13 +class Rack::CommonLogger + # +logger+ can be any object that supports the +write+ or +<<+ methods, + # which includes the standard library Logger. These methods are called + # with a single string argument, the log message. + # If +logger+ is nil, CommonLogger will fall back env['rack.errors']. + # + # pkg:gem/rack#lib/rack/common_logger.rb:29 + def initialize(app, logger = T.unsafe(nil)); end + + # Log all requests in common_log format after a response has been + # returned. Note that if the app raises an exception, the request + # will not be logged, so if exception handling middleware are used, + # they should be loaded after this middleware. Additionally, because + # the logging happens after the request body has been fully sent, any + # exceptions raised during the sending of the response body will + # cause the request not to be logged. + # + # pkg:gem/rack#lib/rack/common_logger.rb:41 + def call(env); end + + private + + # Attempt to determine the content length for the response to + # include it in the logged data. + # + # pkg:gem/rack#lib/rack/common_logger.rb:84 + def extract_content_length(headers); end + + # Log the request to the configured logger. + # + # pkg:gem/rack#lib/rack/common_logger.rb:52 + def log(env, status, response_headers, began_at); end +end + +# Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common +# +# lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 - +# +# %{%s - %s [%s] "%s %s%s %s" %d %s\n} % +# +# The actual format is slightly different than the above due to the +# separation of SCRIPT_NAME and PATH_INFO, and because the elapsed +# time in seconds is included at the end. +# +# pkg:gem/rack#lib/rack/common_logger.rb:23 +Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String) + +# Middleware that enables conditional GET using if-none-match and +# if-modified-since. The application should set either or both of the +# last-modified or etag response headers according to RFC 2616. When +# either of the conditions is met, the response body is set to be zero +# length and the response status is set to 304 Not Modified. +# +# Applications that defer response body generation until the body's each +# message is received will avoid response body generation completely when +# a conditional GET matches. +# +# Adapted from Michael Klishin's Merb implementation: +# https://github.com/wycats/merb/blob/master/merb-core/lib/merb-core/rack/middleware/conditional_get.rb +# +# pkg:gem/rack#lib/rack/conditional_get.rb:21 +class Rack::ConditionalGet + # pkg:gem/rack#lib/rack/conditional_get.rb:22 + def initialize(app); end + + # Return empty 304 response if the response has not been + # modified since the last request. + # + # pkg:gem/rack#lib/rack/conditional_get.rb:28 + def call(env); end + + private + + # Whether the etag response header matches the if-none-match request header. + # If so, the request has not been modified. + # + # pkg:gem/rack#lib/rack/conditional_get.rb:63 + def etag_matches?(none_match, headers); end + + # Return whether the response has not been modified since the + # last request. + # + # pkg:gem/rack#lib/rack/conditional_get.rb:52 + def fresh?(env, headers); end + + # Whether the last-modified response header matches the if-modified-since + # request header. If so, the request has not been modified. + # + # pkg:gem/rack#lib/rack/conditional_get.rb:69 + def modified_since?(modified_since, headers); end + + # Return a Time object for the given string (which should be in RFC2822 + # format), or nil if the string cannot be parsed. + # + # pkg:gem/rack#lib/rack/conditional_get.rb:76 + def to_rfc2822(since); end +end + +# Rack::Config modifies the environment using the block given during +# initialization. +# +# Example: +# use Rack::Config do |env| +# env['my-key'] = 'some-value' +# end +# +# pkg:gem/rack#lib/rack/config.rb:11 +class Rack::Config + # pkg:gem/rack#lib/rack/config.rb:12 + def initialize(app, &block); end + + # pkg:gem/rack#lib/rack/config.rb:17 + def call(env); end +end + +# Sets the content-length header on responses that do not specify +# a content-length or transfer-encoding header. Note that this +# does not fix responses that have an invalid content-length +# header specified. +# +# pkg:gem/rack#lib/rack/content_length.rb:12 +class Rack::ContentLength + include ::Rack::Utils + + # pkg:gem/rack#lib/rack/content_length.rb:15 + def initialize(app); end + + # pkg:gem/rack#lib/rack/content_length.rb:19 + def call(env); end +end + +# Sets the content-type header on responses which don't have one. +# +# Builder Usage: +# use Rack::ContentType, "text/plain" +# +# When no content type argument is provided, "text/html" is the +# default. +# +# pkg:gem/rack#lib/rack/content_type.rb:15 +class Rack::ContentType + include ::Rack::Utils + + # pkg:gem/rack#lib/rack/content_type.rb:18 + def initialize(app, content_type = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/content_type.rb:23 + def call(env); end +end + +# pkg:gem/rack#lib/rack/constants.rb:32 +Rack::DELETE = T.let(T.unsafe(nil), String) + +# This middleware enables content encoding of http responses, +# usually for purposes of compression. +# +# Currently supported encodings: +# +# * gzip +# * identity (no transformation) +# +# This middleware automatically detects when encoding is supported +# and allowed. For example no encoding is made when a cache +# directive of 'no-transform' is present, when the response status +# code is one that doesn't allow an entity body, or when the body +# is empty. +# +# Note that despite the name, Deflater does not support the +deflate+ +# encoding. +# +# pkg:gem/rack#lib/rack/deflater.rb:28 +class Rack::Deflater + # Creates Rack::Deflater middleware. Options: + # + # :if :: a lambda enabling / disabling deflation based on returned boolean value + # (e.g use Rack::Deflater, :if => lambda { |*, body| sum=0; body.each { |i| sum += i.length }; sum > 512 }). + # However, be aware that calling `body.each` inside the block will break cases where `body.each` is not idempotent, + # such as when it is an +IO+ instance. + # :include :: a list of content types that should be compressed. By default, all content types are compressed. + # :sync :: determines if the stream is going to be flushed after every chunk. Flushing after every chunk reduces + # latency for time-sensitive streaming applications, but hurts compression and throughput. + # Defaults to +true+. + # + # pkg:gem/rack#lib/rack/deflater.rb:39 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/deflater.rb:46 + def call(env); end + + private + + # Whether the body should be compressed. + # + # pkg:gem/rack#lib/rack/deflater.rb:136 + def should_deflate?(env, status, headers, body); end +end + +# Body class used for gzip encoded responses. +# +# pkg:gem/rack#lib/rack/deflater.rb:83 +class Rack::Deflater::GzipStream + # Initialize the gzip stream. Arguments: + # body :: Response body to compress with gzip + # mtime :: The modification time of the body, used to set the + # modification time in the gzip header. + # sync :: Whether to flush each gzip chunk as soon as it is ready. + # + # pkg:gem/rack#lib/rack/deflater.rb:92 + def initialize(body, mtime, sync); end + + # Close the original body if possible. + # + # pkg:gem/rack#lib/rack/deflater.rb:128 + def close; end + + # Yield gzip compressed strings to the given block. + # + # pkg:gem/rack#lib/rack/deflater.rb:99 + def each(&block); end + + # Call the block passed to #each with the gzipped data. + # + # pkg:gem/rack#lib/rack/deflater.rb:123 + def write(data); end +end + +# pkg:gem/rack#lib/rack/deflater.rb:85 +Rack::Deflater::GzipStream::BUFFER_LENGTH = T.let(T.unsafe(nil), Integer) + +# Rack::Directory serves entries below the +root+ given, according to the +# path info of the Rack request. If a directory is found, the file's contents +# will be presented in an html based index. If a file is found, the env will +# be passed to the specified +app+. +# +# If +app+ is not specified, a Rack::Files of the same +root+ will be used. +# +# pkg:gem/rack#lib/rack/directory.rb:19 +class Rack::Directory + # Set the root directory and application for serving files. + # + # pkg:gem/rack#lib/rack/directory.rb:83 + def initialize(root, app = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/directory.rb:90 + def call(env); end + + # Rack response to use for requests with invalid paths, or nil if path is valid. + # + # pkg:gem/rack#lib/rack/directory.rb:110 + def check_bad_request(path_info); end + + # Rack response to use for requests with paths outside the root, or nil if path is inside the root. + # + # pkg:gem/rack#lib/rack/directory.rb:120 + def check_forbidden(path_info); end + + # Rack response to use for unreadable and non-file, non-directory entries. + # + # pkg:gem/rack#lib/rack/directory.rb:184 + def entity_not_found(path_info); end + + # Provide human readable file sizes + # + # pkg:gem/rack#lib/rack/directory.rb:200 + def filesize_format(int); end + + # Internals of request handling. Similar to call but does + # not remove body for HEAD requests. + # + # pkg:gem/rack#lib/rack/directory.rb:97 + def get(env); end + + # Rack response to use for directories under the root. + # + # pkg:gem/rack#lib/rack/directory.rb:133 + def list_directory(path_info, path, script_name); end + + # Rack response to use for files and directories under the root. + # Unreadable and non-file, non-directory entries will get a 404 response. + # + # pkg:gem/rack#lib/rack/directory.rb:174 + def list_path(env, path, path_info, script_name); end + + # The root of the directory hierarchy. Only requests for files and + # directories inside of the root directory are supported. + # + # pkg:gem/rack#lib/rack/directory.rb:80 + def root; end + + # File::Stat for the given path, but return nil for missing/bad entries. + # + # pkg:gem/rack#lib/rack/directory.rb:166 + def stat(path); end +end + +# pkg:gem/rack#lib/rack/directory.rb:20 +Rack::Directory::DIR_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/directory.rb:43 +Rack::Directory::DIR_PAGE_FOOTER = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/directory.rb:21 +Rack::Directory::DIR_PAGE_HEADER = T.let(T.unsafe(nil), String) + +# Body class for directory entries, showing an index page with links +# to each file. +# +# pkg:gem/rack#lib/rack/directory.rb:51 +class Rack::Directory::DirectoryBody < ::Struct + # Yield strings for each part of the directory entry + # + # pkg:gem/rack#lib/rack/directory.rb:53 + def each; end + + private + + # Escape each element in the array of html strings. + # + # pkg:gem/rack#lib/rack/directory.rb:73 + def DIR_FILE_escape(htmls); end +end + +# Stolen from Ramaze +# +# pkg:gem/rack#lib/rack/directory.rb:192 +Rack::Directory::FILESIZE_FORMAT = T.let(T.unsafe(nil), Array) + +# pkg:gem/rack#lib/rack/constants.rb:22 +Rack::ETAG = T.let(T.unsafe(nil), String) + +# Automatically sets the etag header on all String bodies. +# +# The etag header is skipped if etag or last-modified headers are sent or if +# a sendfile body (body.responds_to :to_path) is given (since such cases +# should be handled by apache/nginx). +# +# On initialization, you can pass two parameters: a cache-control directive +# used when etag is absent and a directive when it is present. The first +# defaults to nil, while the second defaults to "max-age=0, private, must-revalidate" +# +# pkg:gem/rack#lib/rack/etag.rb:18 +class Rack::ETag + # pkg:gem/rack#lib/rack/etag.rb:22 + def initialize(app, no_cache_control = T.unsafe(nil), cache_control = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/etag.rb:28 + def call(env); end + + private + + # pkg:gem/rack#lib/rack/etag.rb:61 + def digest_body(body); end + + # pkg:gem/rack#lib/rack/etag.rb:53 + def etag_status?(status); end + + # pkg:gem/rack#lib/rack/etag.rb:57 + def skip_caching?(headers); end +end + +# pkg:gem/rack#lib/rack/etag.rb:20 +Rack::ETag::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/etag.rb:19 +Rack::ETag::ETAG_STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:23 +Rack::EXPIRES = T.let(T.unsafe(nil), String) + +# This middleware provides hooks to certain places in the request / +# response lifecycle. This is so that middleware that don't need to filter +# the response data can safely leave it alone and not have to send messages +# down the traditional "rack stack". +# +# The events are: +# +# * on_start(request, response) +# +# This event is sent at the start of the request, before the next +# middleware in the chain is called. This method is called with a request +# object, and a response object. Right now, the response object is always +# nil, but in the future it may actually be a real response object. +# +# * on_commit(request, response) +# +# The response has been committed. The application has returned, but the +# response has not been sent to the webserver yet. This method is always +# called with a request object and the response object. The response +# object is constructed from the rack triple that the application returned. +# Changes may still be made to the response object at this point. +# +# * on_send(request, response) +# +# The webserver has started iterating over the response body, or has called +# the streaming body, and presumably has started sending data over the +# wire. This method is always called with a request object and the response +# object. The response object is constructed from the rack triple that the +# application returned. Changes SHOULD NOT be made to the response object +# as the webserver has already started sending data. Any mutations will +# likely result in an exception. +# +# * on_finish(request, response) +# +# The webserver has closed the response, and all data has been written to +# the response socket. The request and response object should both be +# read-only at this point. The body MAY NOT be available on the response +# object as it may have been flushed to the socket. +# +# * on_error(request, response, error) +# +# An exception has occurred in the application or an `on_commit` event. +# This method will get the request, the response (if available) and the +# exception that was raised. +# +# ## Order +# +# `on_start` is called on the handlers in the order that they were passed to +# the constructor. `on_commit`, on_send`, `on_finish`, and `on_error` are +# called in the reverse order. `on_finish` handlers are called inside an +# `ensure` block, so they are guaranteed to be called even if something +# raises an exception. If something raises an exception in a `on_finish` +# method, then nothing is guaranteed. +# +# pkg:gem/rack#lib/rack/events.rb:62 +class Rack::Events + # pkg:gem/rack#lib/rack/events.rb:121 + def initialize(app, handlers); end + + # pkg:gem/rack#lib/rack/events.rb:126 + def call(env); end + + private + + # pkg:gem/rack#lib/rack/events.rb:164 + def make_request(env); end + + # pkg:gem/rack#lib/rack/events.rb:168 + def make_response(status, headers, body); end + + # pkg:gem/rack#lib/rack/events.rb:152 + def on_commit(request, response); end + + # pkg:gem/rack#lib/rack/events.rb:148 + def on_error(request, response, e); end + + # pkg:gem/rack#lib/rack/events.rb:160 + def on_finish(request, response); end + + # pkg:gem/rack#lib/rack/events.rb:156 + def on_start(request, response); end +end + +# pkg:gem/rack#lib/rack/events.rb:63 +module Rack::Events::Abstract + # pkg:gem/rack#lib/rack/events.rb:67 + def on_commit(req, res); end + + # pkg:gem/rack#lib/rack/events.rb:76 + def on_error(req, res, e); end + + # pkg:gem/rack#lib/rack/events.rb:73 + def on_finish(req, res); end + + # pkg:gem/rack#lib/rack/events.rb:70 + def on_send(req, res); end + + # pkg:gem/rack#lib/rack/events.rb:64 + def on_start(req, res); end +end + +# pkg:gem/rack#lib/rack/events.rb:110 +class Rack::Events::BufferedResponse < ::Rack::Response::Raw + # pkg:gem/rack#lib/rack/events.rb:113 + def initialize(status, headers, body); end + + # pkg:gem/rack#lib/rack/events.rb:111 + def body; end + + # pkg:gem/rack#lib/rack/events.rb:118 + def to_a; end +end + +# pkg:gem/rack#lib/rack/events.rb:80 +class Rack::Events::EventedBodyProxy < ::Rack::BodyProxy + # pkg:gem/rack#lib/rack/events.rb:83 + def initialize(body, request, response, handlers, &block); end + + # pkg:gem/rack#lib/rack/events.rb:95 + def call(stream); end + + # pkg:gem/rack#lib/rack/events.rb:90 + def each; end + + # pkg:gem/rack#lib/rack/events.rb:81 + def request; end + + # pkg:gem/rack#lib/rack/events.rb:100 + def respond_to?(method_name, include_all = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/events.rb:81 + def response; end +end + +# Rack::Files serves files below the +root+ directory given, according to the +# path info of the Rack request. +# e.g. when Rack::Files.new("/etc") is used, you can access 'passwd' file +# as http://localhost:9292/passwd +# +# Handlers can detect if bodies are a Rack::Files, and use mechanisms +# like sendfile on the +path+. +# +# pkg:gem/rack#lib/rack/files.rb:20 +class Rack::Files + # pkg:gem/rack#lib/rack/files.rb:27 + def initialize(root, headers = T.unsafe(nil), default_mime = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/files.rb:34 + def call(env); end + + # pkg:gem/rack#lib/rack/files.rb:39 + def get(env); end + + # pkg:gem/rack#lib/rack/files.rb:25 + def root; end + + # pkg:gem/rack#lib/rack/files.rb:68 + def serving(request, path); end + + private + + # pkg:gem/rack#lib/rack/files.rb:190 + def fail(status, body, headers = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/files.rb:209 + def filesize(path); end + + # The MIME type for the contents of the file located at @path + # + # pkg:gem/rack#lib/rack/files.rb:205 + def mime_type(path, default_mime); end +end + +# pkg:gem/rack#lib/rack/files.rb:21 +Rack::Files::ALLOWED_VERBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rack#lib/rack/files.rb:22 +Rack::Files::ALLOW_HEADER = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/files.rb:121 +class Rack::Files::BaseIterator + # pkg:gem/rack#lib/rack/files.rb:124 + def initialize(path, ranges, options); end + + # pkg:gem/rack#lib/rack/files.rb:144 + def bytesize; end + + # pkg:gem/rack#lib/rack/files.rb:153 + def close; end + + # pkg:gem/rack#lib/rack/files.rb:130 + def each; end + + # pkg:gem/rack#lib/rack/files.rb:122 + def options; end + + # pkg:gem/rack#lib/rack/files.rb:122 + def path; end + + # pkg:gem/rack#lib/rack/files.rb:122 + def ranges; end + + private + + # pkg:gem/rack#lib/rack/files.rb:171 + def each_range_part(file, range); end + + # pkg:gem/rack#lib/rack/files.rb:157 + def multipart?; end + + # pkg:gem/rack#lib/rack/files.rb:161 + def multipart_heading(range); end +end + +# pkg:gem/rack#lib/rack/files.rb:184 +class Rack::Files::Iterator < ::Rack::Files::BaseIterator + # pkg:gem/rack#lib/rack/files.rb:185 + def to_path; end +end + +# pkg:gem/rack#lib/rack/files.rb:23 +Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# Rack::ForwardRequest gets caught by Rack::Recursive and redirects +# the current request to the app at +url+. +# +# raise ForwardRequest.new("/not-found") +# +# pkg:gem/rack#lib/rack/recursive.rb:14 +class Rack::ForwardRequest < ::Exception + # pkg:gem/rack#lib/rack/recursive.rb:17 + def initialize(url, env = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/recursive.rb:15 + def env; end + + # pkg:gem/rack#lib/rack/recursive.rb:15 + def url; end +end + +# HTTP method verbs +# +# pkg:gem/rack#lib/rack/constants.rb:28 +Rack::GET = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:33 +Rack::HEAD = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:7 +Rack::HTTPS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:16 +Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String) + +# Request env keys +# +# pkg:gem/rack#lib/rack/constants.rb:5 +Rack::HTTP_HOST = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:6 +Rack::HTTP_PORT = T.let(T.unsafe(nil), String) + +# Rack::Head returns an empty body for all HEAD requests. It leaves +# all other requests unchanged. +# +# pkg:gem/rack#lib/rack/head.rb:9 +class Rack::Head + # pkg:gem/rack#lib/rack/head.rb:10 + def initialize(app); end + + # pkg:gem/rack#lib/rack/head.rb:14 + def call(env); end +end + +# Rack::Headers is a Hash subclass that downcases all keys. It's designed +# to be used by rack applications that don't implement the Rack 3 SPEC +# (by using non-lowercase response header keys), automatically handling +# the downcasing of keys. +# +# pkg:gem/rack#lib/rack/headers.rb:8 +class Rack::Headers < ::Hash + # pkg:gem/rack#lib/rack/headers.rb:110 + def [](key); end + + # pkg:gem/rack#lib/rack/headers.rb:114 + def []=(key, value); end + + # pkg:gem/rack#lib/rack/headers.rb:119 + def assoc(key); end + + # pkg:gem/rack#lib/rack/headers.rb:123 + def compare_by_identity; end + + # pkg:gem/rack#lib/rack/headers.rb:127 + def delete(key); end + + # pkg:gem/rack#lib/rack/headers.rb:131 + def dig(key, *a); end + + # :nocov: + # + # pkg:gem/rack#lib/rack/headers.rb:227 + def except(*a); end + + # pkg:gem/rack#lib/rack/headers.rb:135 + def fetch(key, *default, &block); end + + # pkg:gem/rack#lib/rack/headers.rb:140 + def fetch_values(*a); end + + # pkg:gem/rack#lib/rack/headers.rb:144 + def has_key?(key); end + + # pkg:gem/rack#lib/rack/headers.rb:147 + def include?(key); end + + # pkg:gem/rack#lib/rack/headers.rb:151 + def invert; end + + # pkg:gem/rack#lib/rack/headers.rb:148 + def key?(key); end + + # pkg:gem/rack#lib/rack/headers.rb:149 + def member?(key); end + + # pkg:gem/rack#lib/rack/headers.rb:157 + def merge(hash, &block); end + + # pkg:gem/rack#lib/rack/headers.rb:196 + def merge!(hash, &block); end + + # pkg:gem/rack#lib/rack/headers.rb:161 + def reject(&block); end + + # pkg:gem/rack#lib/rack/headers.rb:167 + def replace(hash); end + + # pkg:gem/rack#lib/rack/headers.rb:172 + def select(&block); end + + # :nocov: + # + # pkg:gem/rack#lib/rack/headers.rb:205 + def slice(*a); end + + # pkg:gem/rack#lib/rack/headers.rb:117 + def store(key, value); end + + # pkg:gem/rack#lib/rack/headers.rb:178 + def to_proc; end + + # pkg:gem/rack#lib/rack/headers.rb:211 + def transform_keys(&block); end + + # pkg:gem/rack#lib/rack/headers.rb:215 + def transform_keys!; end + + # pkg:gem/rack#lib/rack/headers.rb:182 + def transform_values(&block); end + + # pkg:gem/rack#lib/rack/headers.rb:186 + def update(hash, &block); end + + # pkg:gem/rack#lib/rack/headers.rb:198 + def values_at(*keys); end + + private + + # pkg:gem/rack#lib/rack/headers.rb:234 + def downcase_key(key); end + + class << self + # pkg:gem/rack#lib/rack/headers.rb:91 + def [](*items); end + end +end + +# pkg:gem/rack#lib/rack/headers.rb:9 +Rack::Headers::KNOWN_HEADERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/constants.rb:36 +Rack::LINK = T.let(T.unsafe(nil), String) + +# Validates your application and the requests and responses according to the Rack spec. See SPEC.rdoc for details. +# +# pkg:gem/rack#lib/rack/lint.rb:10 +class Rack::Lint + # N.B. The empty `##` comments creates paragraphs in the output. A trailing "\" is used to escape the newline character, which combines the comments into a single paragraph. + # + # = Rack Specification + # + # This specification aims to formalize the Rack protocol. You can (and should) use +Rack::Lint+ to enforce it. When you develop middleware, be sure to test with +Rack::Lint+ to catch possible violations of this specification. + # + # == The Application + # + # A Rack application is a Ruby object that responds to +call+. \ + # + # pkg:gem/rack#lib/rack/lint.rb:65 + def initialize(app); end + + # Invoke the application, validating the request and response according to the Rack spec. + # + # pkg:gem/rack#lib/rack/lint.rb:15 + def call(env = T.unsafe(nil)); end +end + +# :stopdoc: +# +# pkg:gem/rack#lib/rack/lint.rb:21 +Rack::Lint::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array) + +# Match a host name, according to RFC3986. Copied from `URI::RFC3986_Parser::HOST` because older Ruby versions (< 3.3) don't expose it. +# +# pkg:gem/rack#lib/rack/lint.rb:29 +Rack::Lint::HOST_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/lint.rb:52 +Rack::Lint::HTTP_HOST_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Represents a failure to meet the Rack specification. +# +# pkg:gem/rack#lib/rack/lint.rb:12 +class Rack::Lint::LintError < ::RuntimeError; end + +# pkg:gem/rack#lib/rack/lint.rb:24 +Rack::Lint::REQUEST_PATH_ABSOLUTE_FORM = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/lint.rb:26 +Rack::Lint::REQUEST_PATH_ASTERISK_FORM = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/lint.rb:25 +Rack::Lint::REQUEST_PATH_AUTHORITY_FORM = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/lint.rb:23 +Rack::Lint::REQUEST_PATH_ORIGIN_FORM = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/lint.rb:51 +Rack::Lint::SERVER_NAME_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/lint.rb:71 +class Rack::Lint::Wrapper + # pkg:gem/rack#lib/rack/lint.rb:72 + def initialize(app, env); end + + # ==== Streaming Body + # + # pkg:gem/rack#lib/rack/lint.rb:918 + def call(stream); end + + # ==== The content-length Header + # + # pkg:gem/rack#lib/rack/lint.rb:768 + def check_content_length_header(status, headers); end + + # ==== The content-type Header + # + # pkg:gem/rack#lib/rack/lint.rb:753 + def check_content_type_header(status, headers); end + + # === Early Hints + # + # The application or any middleware may call the rack.early_hints with an object which would be valid as the headers of a Rack response. + # + # pkg:gem/rack#lib/rack/lint.rb:670 + def check_early_hints(env); end + + # == The Request Environment + # + # Incoming HTTP requests are represented using an environment. \ + # + # pkg:gem/rack#lib/rack/lint.rb:136 + def check_environment(env); end + + # === The Error Stream + # + # pkg:gem/rack#lib/rack/lint.rb:571 + def check_error_stream(error); end + + # pkg:gem/rack#lib/rack/lint.rb:743 + def check_header_value(key, value); end + + # === The Headers + # + # pkg:gem/rack#lib/rack/lint.rb:704 + def check_headers(headers); end + + # === Hijacking + # + # The hijacking interfaces provides a means for an application to take control of the HTTP connection. There are two distinct hijack interfaces: full hijacking where the application takes over the raw connection, and partial hijacking where the application takes over just the response body stream. In both cases, the application is responsible for closing the hijacked stream. + # + # Full hijacking only works with HTTP/1. Partial hijacking is functionally equivalent to streaming bodies, and is still optionally supported for backwards compatibility with older Rack versions. + # + # ==== Full Hijack + # + # Full hijack is used to completely take over an HTTP/1 connection. It occurs before any headers are written and causes the server to ignore any response generated by the application. It is intended to be used when applications need access to the raw HTTP/1 connection. + # + # pkg:gem/rack#lib/rack/lint.rb:618 + def check_hijack(env); end + + # ==== Partial Hijack + # + # Partial hijack is used for bi-directional streaming of the request and response body. It occurs after the status and headers are written by the server and causes the server to ignore the Body of the response. It is intended to be used when applications need bi-directional streaming. + # + # pkg:gem/rack#lib/rack/lint.rb:639 + def check_hijack_response(headers, env); end + + # === The Input Stream + # + # The input stream is an +IO+-like object which contains the raw HTTP request data. \ + # + # pkg:gem/rack#lib/rack/lint.rb:478 + def check_input_stream(input); end + + # ==== The rack.protocol Header + # + # pkg:gem/rack#lib/rack/lint.rb:795 + def check_rack_protocol_header(status, headers); end + + # == The Response + # + # Outgoing HTTP responses are generated from the response tuple generated by the application. The response tuple is an +Array+ of three elements, which are: the HTTP status, the headers, and the response body. The Rack application is responsible for ensuring that the response tuple is well-formed and should follow the rules set out in this specification. + # + # === The Status + # + # pkg:gem/rack#lib/rack/lint.rb:694 + def check_status(status); end + + # Setting this value informs the server that it should perform a connection upgrade. In HTTP/1, this is done using the +upgrade+ header. In HTTP/2+, this is done by accepting the request. + # + # === The Body + # + # The Body is typically an +Array+ of +String+ values, an enumerable that yields +String+ values, a +Proc+, or an +IO+-like object. + # + # The Body must respond to +each+ or +call+. It may optionally respond to +to_path+ or +to_ary+. A Body that responds to +each+ is considered to be an Enumerable Body. A Body that responds to +call+ is considered to be a Streaming Body. + # + # A Body that responds to both +each+ and +call+ must be treated as an Enumerable Body, not a Streaming Body. If it responds to +each+, you must call +each+ and not +call+. If the Body doesn't respond to +each+, then you can assume it responds to +call+. + # + # The Body must either be consumed or returned. The Body is consumed by optionally calling either +each+ or +call+. Then, if the Body responds to +close+, it must be called to release any resources associated with the generation of the body. In other words, +close+ must always be called at least once; typically after the web server has sent the response to the client, but also in cases where the Rack application makes internal/virtual requests and discards the response. + # + # pkg:gem/rack#lib/rack/lint.rb:821 + def close; end + + # ==== Enumerable Body + # + # pkg:gem/rack#lib/rack/lint.rb:852 + def each; end + + # pkg:gem/rack#lib/rack/lint.rb:895 + def respond_to?(name, *); end + + # pkg:gem/rack#lib/rack/lint.rb:87 + def response; end + + # If the Body responds to +to_ary+, it must return an +Array+ whose contents are identical to that produced by calling +each+. Middleware may call +to_ary+ directly on the Body and return a new Body in its place. In other words, middleware can only process the Body directly if it responds to +to_ary+. If the Body responds to both +to_ary+ and +close+, its implementation of +to_ary+ must call +close+. + # + # pkg:gem/rack#lib/rack/lint.rb:905 + def to_ary; end + + # pkg:gem/rack#lib/rack/lint.rb:891 + def to_path; end + + # pkg:gem/rack#lib/rack/lint.rb:780 + def verify_content_length(size); end + + # pkg:gem/rack#lib/rack/lint.rb:835 + def verify_to_path; end + + private + + # pkg:gem/rack#lib/rack/lint.rb:126 + def assert_required(key); end +end + +# pkg:gem/rack#lib/rack/lint.rb:889 +Rack::Lint::Wrapper::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/lint.rb:580 +class Rack::Lint::Wrapper::ErrorWrapper + # pkg:gem/rack#lib/rack/lint.rb:581 + def initialize(error); end + + # * +close+ must never be called on the error stream. + # + # pkg:gem/rack#lib/rack/lint.rb:602 + def close(*args); end + + # * +flush+ must be called without arguments and must be called in order to make the error appear for sure. + # + # pkg:gem/rack#lib/rack/lint.rb:597 + def flush; end + + # * +puts+ must be called with a single argument that responds to +to_s+. + # + # pkg:gem/rack#lib/rack/lint.rb:586 + def puts(str); end + + # * +write+ must be called with a single argument that is a +String+. + # + # pkg:gem/rack#lib/rack/lint.rb:591 + def write(str); end +end + +# pkg:gem/rack#lib/rack/lint.rb:495 +class Rack::Lint::Wrapper::InputWrapper + # pkg:gem/rack#lib/rack/lint.rb:496 + def initialize(input); end + + # * +close+ can be called on the input stream to indicate that any remaining input is not needed. + # + # pkg:gem/rack#lib/rack/lint.rb:563 + def close(*args); end + + # * +each+ must be called without arguments and only yield +String+ values. + # + # pkg:gem/rack#lib/rack/lint.rb:552 + def each(*args); end + + # * +gets+ must be called without arguments and return a +String+, or +nil+ on EOF (end-of-file). + # + # pkg:gem/rack#lib/rack/lint.rb:501 + def gets(*args); end + + # * +read+ behaves like IO#read. Its signature is read([length, [buffer]]). + # * If given, +length+ must be a non-negative Integer (>= 0) or +nil+, and +buffer+ must be a +String+ and may not be +nil+. + # * If +length+ is given and not +nil+, then this method reads at most +length+ bytes from the input stream. + # * If +length+ is not given or +nil+, then this method reads all data until EOF. + # * When EOF is reached, this method returns +nil+ if +length+ is given and not +nil+, or +""+ if +length+ is not given or is +nil+. + # * If +buffer+ is given, then the read data will be placed into +buffer+ instead of a newly created +String+. + # + # pkg:gem/rack#lib/rack/lint.rb:519 + def read(*args); end +end + +# pkg:gem/rack#lib/rack/lint.rb:936 +class Rack::Lint::Wrapper::StreamWrapper + extend ::Forwardable + + # pkg:gem/rack#lib/rack/lint.rb:947 + def initialize(stream); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def <<(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def close(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def close_read(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def close_write(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def closed?(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def flush(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def read(*, **, &); end + + # pkg:gem/rack#lib/rack/lint.rb:945 + def write(*, **, &); end +end + +# The semantics of these +IO+ methods must be a best effort match to those of a normal Ruby +IO+ or +Socket+ object, using standard arguments and raising standard exceptions. Servers may simply pass on real +IO+ objects to the Streaming Body. In some cases (e.g. when using transfer-encoding or HTTP/2+), the server may need to provide a wrapper that implements the required methods, in order to provide the correct semantics. +# +# pkg:gem/rack#lib/rack/lint.rb:940 +Rack::Lint::Wrapper::StreamWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array) + +# Rack::Lock locks every request inside a mutex, so that every request +# will effectively be executed synchronously. +# +# pkg:gem/rack#lib/rack/lock.rb:8 +class Rack::Lock + # pkg:gem/rack#lib/rack/lock.rb:9 + def initialize(app, mutex = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/lock.rb:13 + def call(env); end + + private + + # pkg:gem/rack#lib/rack/lock.rb:25 + def unlock; end +end + +# Rack::MediaType parse media type and parameters out of content_type string +# +# pkg:gem/rack#lib/rack/media_type.rb:6 +class Rack::MediaType + class << self + # The media type parameters provided in CONTENT_TYPE as a Hash, or + # an empty Hash if no CONTENT_TYPE or media-type parameters were + # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8", + # this method responds with the following Hash: + # { 'charset' => 'utf-8' } + # + # This will pass back parameters with empty strings in the hash if they + # lack a value (e.g., "text/plain;charset=" will return { 'charset' => '' }, + # and "text/plain;charset" will return { 'charset' => '' }, similarly to + # the query params parser (barring the latter case, which returns nil instead)). + # + # pkg:gem/rack#lib/rack/media_type.rb:34 + def params(content_type); end + + # The media type (type/subtype) portion of the CONTENT_TYPE header + # without any media type parameters. e.g., when CONTENT_TYPE is + # "text/plain;charset=utf-8", the media-type is "text/plain". + # + # For more information on the use of media types in HTTP, see: + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 + # + # pkg:gem/rack#lib/rack/media_type.rb:16 + def type(content_type); end + + private + + # pkg:gem/rack#lib/rack/media_type.rb:47 + def strip_doublequotes(str); end + end +end + +# pkg:gem/rack#lib/rack/media_type.rb:7 +Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/method_override.rb:8 +class Rack::MethodOverride + # pkg:gem/rack#lib/rack/method_override.rb:15 + def initialize(app); end + + # pkg:gem/rack#lib/rack/method_override.rb:19 + def call(env); end + + # pkg:gem/rack#lib/rack/method_override.rb:31 + def method_override(env); end + + private + + # pkg:gem/rack#lib/rack/method_override.rb:44 + def allowed_methods; end + + # pkg:gem/rack#lib/rack/method_override.rb:48 + def method_override_param(req); end +end + +# pkg:gem/rack#lib/rack/method_override.rb:13 +Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rack#lib/rack/method_override.rb:9 +Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rack#lib/rack/method_override.rb:12 +Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/method_override.rb:11 +Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/mime.rb:4 +module Rack::Mime + private + + # Returns true if the given value is a mime match for the given mime match + # specification, false otherwise. + # + # Rack::Mime.match?('text/html', 'text/*') => true + # Rack::Mime.match?('text/plain', '*') => true + # Rack::Mime.match?('text/html', 'application/json') => false + # + # pkg:gem/rack#lib/rack/mime.rb:30 + def match?(value, matcher); end + + # Returns String with mime type if found, otherwise use +fallback+. + # +ext+ should be filename extension in the '.ext' format that + # File.extname(file) returns. + # +fallback+ may be any object + # + # Also see the documentation for MIME_TYPES + # + # Usage: + # Rack::Mime.mime_type('.foo') + # + # This is a shortcut for: + # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream') + # + # pkg:gem/rack#lib/rack/mime.rb:18 + def mime_type(ext, fallback = T.unsafe(nil)); end + + class << self + # pkg:gem/rack#lib/rack/mime.rb:36 + def match?(value, matcher); end + + # pkg:gem/rack#lib/rack/mime.rb:21 + def mime_type(ext, fallback = T.unsafe(nil)); end + end +end + +# List of most common mime-types, selected various sources +# according to their usefulness in a webserving scope for Ruby +# users. +# +# To amend this list with your local mime.types list you can use: +# +# require 'webrick/httputils' +# list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types') +# Rack::Mime::MIME_TYPES.merge!(list) +# +# N.B. On Ubuntu the mime.types file does not include the leading period, so +# users may need to modify the data before merging into the hash. +# +# pkg:gem/rack#lib/rack/mime.rb:51 +Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash) + +# Rack::MockRequest helps testing your Rack application without +# actually using HTTP. +# +# After performing a request on a URL with get/post/put/patch/delete, it +# returns a MockResponse with useful helper methods for effective +# testing. +# +# You can pass a hash with additional configuration to the +# get/post/put/patch/delete. +# :input:: A String or IO-like to be used as rack.input. +# :fatal:: Raise a FatalWarning if the app writes to rack.errors. +# :lint:: If true, wrap the application in a Rack::Lint. +# +# pkg:gem/rack#lib/rack/mock_request.rb:23 +class Rack::MockRequest + # pkg:gem/rack#lib/rack/mock_request.rb:44 + def initialize(app); end + + # Make a DELETE request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:57 + def delete(uri, opts = T.unsafe(nil)); end + + # Make a GET request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:49 + def get(uri, opts = T.unsafe(nil)); end + + # Make a HEAD request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:59 + def head(uri, opts = T.unsafe(nil)); end + + # Make an OPTIONS request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:61 + def options(uri, opts = T.unsafe(nil)); end + + # Make a PATCH request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:55 + def patch(uri, opts = T.unsafe(nil)); end + + # Make a POST request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:51 + def post(uri, opts = T.unsafe(nil)); end + + # Make a PUT request and return a MockResponse. See #request. + # + # pkg:gem/rack#lib/rack/mock_request.rb:53 + def put(uri, opts = T.unsafe(nil)); end + + # Make a request using the given request method for the given + # uri to the rack application and return a MockResponse. + # Options given are passed to MockRequest.env_for. + # + # pkg:gem/rack#lib/rack/mock_request.rb:66 + def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end + + class << self + # Return the Rack environment used for a request to +uri+. + # All options that are strings are added to the returned environment. + # Options: + # :fatal :: Whether to raise an exception if request outputs to rack.errors + # :input :: The rack.input to set + # :http_version :: The SERVER_PROTOCOL to set + # :method :: The HTTP request method to use + # :params :: The params to use + # :script_name :: The SCRIPT_NAME to set + # + # pkg:gem/rack#lib/rack/mock_request.rb:98 + def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end + + # For historical reasons, we're pinning to RFC 2396. + # URI::Parser = URI::RFC2396_Parser + # + # pkg:gem/rack#lib/rack/mock_request.rb:84 + def parse_uri_rfc2396(uri); end + end +end + +# pkg:gem/rack#lib/rack/mock_request.rb:27 +class Rack::MockRequest::FatalWarner + # pkg:gem/rack#lib/rack/mock_request.rb:36 + def flush; end + + # pkg:gem/rack#lib/rack/mock_request.rb:28 + def puts(warning); end + + # pkg:gem/rack#lib/rack/mock_request.rb:39 + def string; end + + # pkg:gem/rack#lib/rack/mock_request.rb:32 + def write(warning); end +end + +# pkg:gem/rack#lib/rack/mock_request.rb:24 +class Rack::MockRequest::FatalWarning < ::RuntimeError; end + +# Rack::MockResponse provides useful helpers for testing your apps. +# Usually, you don't create the MockResponse on your own, but use +# MockRequest. +# +# pkg:gem/rack#lib/rack/mock_response.rb:13 +class Rack::MockResponse < ::Rack::Response + # pkg:gem/rack#lib/rack/mock_response.rb:48 + def initialize(status, headers, body, errors = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/mock_response.rb:63 + def =~(other); end + + # pkg:gem/rack#lib/rack/mock_response.rb:71 + def body; end + + # pkg:gem/rack#lib/rack/mock_response.rb:105 + def cookie(name); end + + # Headers + # + # pkg:gem/rack#lib/rack/mock_response.rb:43 + def cookies; end + + # pkg:gem/rack#lib/rack/mock_response.rb:101 + def empty?; end + + # Errors + # + # pkg:gem/rack#lib/rack/mock_response.rb:46 + def errors; end + + # Errors + # + # pkg:gem/rack#lib/rack/mock_response.rb:46 + def errors=(_arg0); end + + # pkg:gem/rack#lib/rack/mock_response.rb:67 + def match(other); end + + # Headers + # + # pkg:gem/rack#lib/rack/mock_response.rb:43 + def original_headers; end + + private + + # pkg:gem/rack#lib/rack/mock_response.rb:132 + def identify_cookie_attributes(cookie_filling); end + + # pkg:gem/rack#lib/rack/mock_response.rb:111 + def parse_cookies_from_header; end + + class << self + # pkg:gem/rack#lib/rack/mock_response.rb:39 + def [](*_arg0); end + end +end + +# pkg:gem/rack#lib/rack/mock_response.rb:14 +class Rack::MockResponse::Cookie + # pkg:gem/rack#lib/rack/mock_response.rb:17 + def initialize(args); end + + # pkg:gem/rack#lib/rack/mock_response.rb:15 + def domain; end + + # pkg:gem/rack#lib/rack/mock_response.rb:15 + def expires; end + + # pkg:gem/rack#lib/rack/mock_response.rb:26 + def method_missing(method_name, *args, **, &block); end + + # pkg:gem/rack#lib/rack/mock_response.rb:15 + def name; end + + # pkg:gem/rack#lib/rack/mock_response.rb:15 + def path; end + + # pkg:gem/rack#lib/rack/mock_response.rb:15 + def secure; end + + # pkg:gem/rack#lib/rack/mock_response.rb:15 + def value; end + + private + + # :nocov: + # + # pkg:gem/rack#lib/rack/mock_response.rb:33 + def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end +end + +# A multipart form data parser, adapted from IOWA. +# +# Usually, Rack::Request#POST takes care of calling this. +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:9 +module Rack::Multipart + class << self + # pkg:gem/rack#lib/rack/multipart.rb:72 + def build_multipart(params, first = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/multipart.rb:68 + def extract_multipart(request, params = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/multipart.rb:48 + def parse_multipart(env, params = T.unsafe(nil)); end + end +end + +# Base class for multipart exceptions that do not subclass from +# other exception classes for backwards compatibility. +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:26 +class Rack::Multipart::BoundaryTooLongError < ::StandardError + include ::Rack::BadRequest +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:33 +Rack::Multipart::EOL = T.let(T.unsafe(nil), String) + +# Use specific error class when parsing multipart request +# that ends early. +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:20 +class Rack::Multipart::EmptyContentError < ::EOFError + include ::Rack::BadRequest +end + +# Prefer to use the BoundaryTooLongError class or Rack::BadRequest. +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:31 +Rack::Multipart::Error = Rack::Multipart::BoundaryTooLongError + +# pkg:gem/rack#lib/rack/multipart/parser.rb:34 +Rack::Multipart::FWS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/multipart/generator.rb:7 +class Rack::Multipart::Generator + # pkg:gem/rack#lib/rack/multipart/generator.rb:8 + def initialize(params, first = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/multipart/generator.rb:16 + def dump; end + + private + + # pkg:gem/rack#lib/rack/multipart/generator.rb:89 + def content_for_other(file, name); end + + # pkg:gem/rack#lib/rack/multipart/generator.rb:77 + def content_for_tempfile(io, file, name); end + + # pkg:gem/rack#lib/rack/multipart/generator.rb:52 + def flattened_params; end + + # pkg:gem/rack#lib/rack/multipart/generator.rb:37 + def multipart?; end +end + +# whitespace with optional folding +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:35 +Rack::Multipart::HEADER_VALUE = T.let(T.unsafe(nil), String) + +# anything but a non-folding CRLF +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:36 +Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/multipart.rb:16 +Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:38 +Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:39 +Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:37 +Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/multipart.rb:18 +class Rack::Multipart::MissingInputError < ::StandardError + include ::Rack::BadRequest +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:10 +class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE + include ::Rack::BadRequest +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:14 +class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError + include ::Rack::BadRequest +end + +# Accumulator for multipart form data, conforming to the QueryParser API. +# In future, the Parser could return the pair list directly, but that would +# change its API. +# +# pkg:gem/rack#lib/rack/multipart.rb:25 +class Rack::Multipart::ParamList + # pkg:gem/rack#lib/rack/multipart.rb:34 + def initialize; end + + # pkg:gem/rack#lib/rack/multipart.rb:38 + def <<(pair); end + + # pkg:gem/rack#lib/rack/multipart.rb:42 + def to_params_hash; end + + class << self + # pkg:gem/rack#lib/rack/multipart.rb:26 + def make_params; end + + # pkg:gem/rack#lib/rack/multipart.rb:30 + def normalize_params(params, key, value); end + end +end + +# Rack::Multipart::Parser handles parsing of multipart/form-data requests. +# +# File Parameter Contents +# +# When processing file uploads, the parser returns a hash containing +# information about uploaded files. For +file+ parameters, the hash includes: +# +# * +:filename+ - The original filename, already URL decoded by the parser +# * +:type+ - The content type of the uploaded file +# * +:name+ - The parameter name from the form +# * +:tempfile+ - A Tempfile object containing the uploaded data +# * +:head+ - The raw header content for this part +# +# pkg:gem/rack#lib/rack/multipart/parser.rb:53 +class Rack::Multipart::Parser + # pkg:gem/rack#lib/rack/multipart/parser.rb:254 + def initialize(boundary, tempfile, bufsize, query_parser); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:275 + def parse(io); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:299 + def result; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:252 + def state; end + + private + + # Scan until the we find the start or end of the boundary. + # If we find it, return the appropriate symbol for the start or + # end of the boundary. If we don't find the start or end of the + # boundary, clear the buffer and return nil. + # + # pkg:gem/rack#lib/rack/multipart/parser.rb:534 + def consume_boundary; end + + # Return the related Encoding object. However, because + # enc is submitted by the user, it may be invalid, so + # use a binary encoding in that case. + # + # pkg:gem/rack#lib/rack/multipart/parser.rb:589 + def find_encoding(enc); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:358 + def handle_consume_token; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:604 + def handle_dummy_encoding(name, body); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:614 + def handle_empty_content!(content); end + + # This handles the initial parser state. We read until we find the starting + # boundary, then we can transition to the next state. If we find the ending + # boundary, this is an invalid multipart upload, but keep scanning for opening + # boundary in that case. If no boundary found, we need to keep reading data + # and retry. It's highly unlikely the initial read will not consume the + # boundary. The client would have to deliberately craft a response + # with the opening boundary beyond the buffer size for that to happen. + # + # pkg:gem/rack#lib/rack/multipart/parser.rb:331 + def handle_fast_forward; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:501 + def handle_mime_body; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:373 + def handle_mime_head; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:543 + def normalize_filename(filename); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:312 + def read_data(io, outbuf); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:556 + def tag_multipart_encoding(filename, content_type, name, body); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:523 + def update_retained_size(size); end + + class << self + # pkg:gem/rack#lib/rack/multipart/parser.rb:137 + def parse(io, content_length, content_type, tmpfile, bufsize, qp); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:122 + def parse_boundary(content_type); end + end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:62 +Rack::Multipart::Parser::BOUNDARY_START_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:80 +Rack::Multipart::Parser::BUFFERED_UPLOAD_BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:54 +Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:90 +class Rack::Multipart::Parser::BoundedIO + # pkg:gem/rack#lib/rack/multipart/parser.rb:91 + def initialize(io, content_length); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:97 + def read(size, outbuf = T.unsafe(nil)); end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:553 +Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:369 +Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_BYTES = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:368 +Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_PARAMS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:87 +Rack::Multipart::Parser::CONTENT_DISPOSITION_QUOTED_ESCAPES_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:161 +class Rack::Multipart::Parser::Collector + include ::Enumerable + + # pkg:gem/rack#lib/rack/multipart/parser.rb:197 + def initialize(tempfile); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:203 + def each; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:223 + def on_mime_body(mime_index, content); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:227 + def on_mime_finish(mime_index); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:207 + def on_mime_head(mime_index, head, filename, content_type, name); end + + private + + # pkg:gem/rack#lib/rack/multipart/parser.rb:232 + def check_part_limits; end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:185 +class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart + # pkg:gem/rack#lib/rack/multipart/parser.rb:187 + def close; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:186 + def file?; end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:162 +class Rack::Multipart::Parser::Collector::MimePart < ::Struct + # pkg:gem/rack#lib/rack/multipart/parser.rb:163 + def get_data; end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:190 +class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart + # pkg:gem/rack#lib/rack/multipart/parser.rb:192 + def close; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:191 + def file?; end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:120 +Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:65 +Rack::Multipart::Parser::MIME_HEADER_BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:119 +class Rack::Multipart::Parser::MultipartInfo < ::Struct + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def params; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def params=(_); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def tmp_files; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def tmp_files=(_); end + + class << self + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def [](*_arg0); end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def inspect; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def keyword_init?; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def members; end + + # pkg:gem/rack#lib/rack/multipart/parser.rb:119 + def new(*_arg0); end + end +end + +# pkg:gem/rack#lib/rack/multipart/parser.rb:370 +Rack::Multipart::Parser::OBS_UNFOLD = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:84 +Rack::Multipart::Parser::PARSER_BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:595 +Rack::Multipart::Parser::REENCODE_DUMMY_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:56 +Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc) + +# pkg:gem/rack#lib/rack/multipart/parser.rb:55 +Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String) + +# Despite the misleading name, UploadedFile is designed for use for +# preparing multipart file upload bodies, generally for use in tests. +# It is not designed for and should not be used for handling uploaded +# files (there is no need for that, since Rack's multipart parser +# already creates Tempfiles for that). Using this with non-trusted +# filenames can create a security vulnerability. +# +# You should only use this class if you plan on passing the instances +# to Rack::MockRequest for use in creating multipart request bodies. +# +# UploadedFile delegates most methods to the tempfile it contains. +# +# pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:19 +class Rack::Multipart::UploadedFile + # Create a new UploadedFile. For backwards compatibility, this accepts + # both positional and keyword versions of the same arguments: + # + # filepath/path :: The path to the file + # ct/content_type :: The content_type of the file + # bin/binary :: Whether to set binmode on the file before copying data into it. + # + # If both positional and keyword arguments are present, the keyword arguments + # take precedence. + # + # The following keyword-only arguments are also accepted: + # + # filename :: Override the filename to use for the file. This is so the + # filename for the upload does not need to match the basename of + # the file path. This should not contain slashes, unless you are + # trying to test how an application handles invalid filenames in + # multipart upload bodies. + # io :: Use the given IO-like instance as the tempfile, instead of creating + # a Tempfile instance. This is useful for building multipart file + # upload bodies without a file being present on the filesystem. If you are + # providing this, you should also provide the filename argument. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:49 + def initialize(filepath = T.unsafe(nil), ct = T.unsafe(nil), bin = T.unsafe(nil), path: T.unsafe(nil), content_type: T.unsafe(nil), binary: T.unsafe(nil), filename: T.unsafe(nil), io: T.unsafe(nil)); end + + # The content type of the instance. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:26 + def content_type; end + + # The content type of the instance. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:26 + def content_type=(_arg0); end + + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:69 + def local_path; end + + # Delegate method missing calls to the tempfile. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:77 + def method_missing(method_name, *args, &block); end + + # The provided name of the file. This generally is the basename of + # path provided during initialization, but it can contain slashes if they + # were present in the filename argument when the instance was created. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:23 + def original_filename; end + + # The path of the tempfile for the instance, if the tempfile has a path. + # nil if the tempfile does not have a path. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:66 + def path; end + + private + + # Return true if the tempfile responds to the method. + # + # pkg:gem/rack#lib/rack/multipart/uploaded_file.rb:72 + def respond_to_missing?(*args); end +end + +# pkg:gem/rack#lib/rack/null_logger.rb:6 +class Rack::NullLogger + # pkg:gem/rack#lib/rack/null_logger.rb:7 + def initialize(app); end + + # pkg:gem/rack#lib/rack/null_logger.rb:45 + def <<(msg); end + + # pkg:gem/rack#lib/rack/null_logger.rb:43 + def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:11 + def call(env); end + + # pkg:gem/rack#lib/rack/null_logger.rb:42 + def close; end + + # pkg:gem/rack#lib/rack/null_logger.rb:34 + def datetime_format; end + + # pkg:gem/rack#lib/rack/null_logger.rb:39 + def datetime_format=(datetime_format); end + + # pkg:gem/rack#lib/rack/null_logger.rb:17 + def debug(progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:27 + def debug!; end + + # pkg:gem/rack#lib/rack/null_logger.rb:23 + def debug?; end + + # pkg:gem/rack#lib/rack/null_logger.rb:19 + def error(progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:28 + def error!; end + + # pkg:gem/rack#lib/rack/null_logger.rb:25 + def error?; end + + # pkg:gem/rack#lib/rack/null_logger.rb:20 + def fatal(progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:29 + def fatal!; end + + # pkg:gem/rack#lib/rack/null_logger.rb:26 + def fatal?; end + + # pkg:gem/rack#lib/rack/null_logger.rb:35 + def formatter; end + + # pkg:gem/rack#lib/rack/null_logger.rb:40 + def formatter=(formatter); end + + # pkg:gem/rack#lib/rack/null_logger.rb:16 + def info(progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:30 + def info!; end + + # pkg:gem/rack#lib/rack/null_logger.rb:22 + def info?; end + + # pkg:gem/rack#lib/rack/null_logger.rb:32 + def level; end + + # pkg:gem/rack#lib/rack/null_logger.rb:37 + def level=(level); end + + # pkg:gem/rack#lib/rack/null_logger.rb:44 + def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:33 + def progname; end + + # pkg:gem/rack#lib/rack/null_logger.rb:38 + def progname=(progname); end + + # pkg:gem/rack#lib/rack/null_logger.rb:46 + def reopen(logdev = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/null_logger.rb:36 + def sev_threshold; end + + # pkg:gem/rack#lib/rack/null_logger.rb:41 + def sev_threshold=(sev_threshold); end + + # pkg:gem/rack#lib/rack/null_logger.rb:21 + def unknown(progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:18 + def warn(progname = T.unsafe(nil), &block); end + + # pkg:gem/rack#lib/rack/null_logger.rb:31 + def warn!; end + + # pkg:gem/rack#lib/rack/null_logger.rb:24 + def warn?; end +end + +# pkg:gem/rack#lib/rack/constants.rb:34 +Rack::OPTIONS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:31 +Rack::PATCH = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:8 +Rack::PATH_INFO = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:29 +Rack::POST = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:30 +Rack::PUT = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:12 +Rack::QUERY_STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/query_parser.rb:7 +class Rack::QueryParser + # pkg:gem/rack#lib/rack/query_parser.rb:62 + def initialize(params_class, param_depth_limit, bytesize_limit: T.unsafe(nil), params_limit: T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/query_parser.rb:60 + def bytesize_limit; end + + # pkg:gem/rack#lib/rack/query_parser.rb:196 + def make_params; end + + # pkg:gem/rack#lib/rack/query_parser.rb:200 + def new_depth_limit(param_depth_limit); end + + # normalize_params recursively expands parameters into structural types. If + # the structural types represented by two different parameter names are in + # conflict, a ParameterTypeError is raised. The depth argument is deprecated + # and should no longer be used, it is kept for backwards compatibility with + # earlier versions of rack. + # + # pkg:gem/rack#lib/rack/query_parser.rb:124 + def normalize_params(params, name, v, _depth = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/query_parser.rb:40 + def param_depth_limit; end + + # parse_nested_query expands a query string into structural types. Supported + # types are Arrays, Hashes and basic value types. It is possible to supply + # query strings with parameters of conflicting types, in this case a + # ParameterTypeError is raised. Users are encouraged to return a 400 in this + # case. + # + # pkg:gem/rack#lib/rack/query_parser.rb:109 + def parse_nested_query(qs, separator = T.unsafe(nil)); end + + # Stolen from Mongrel, with some small modifications: + # Parses a query string by breaking it up at the '&'. You can also use this + # to parse cookies by changing the characters used in the second parameter + # (which defaults to '&'). + # + # pkg:gem/rack#lib/rack/query_parser.rb:73 + def parse_query(qs, separator = T.unsafe(nil), &unescaper); end + + # Parses a query string by breaking it up at the '&', returning all key-value + # pairs as an array of [key, value] arrays. Unlike parse_query, this preserves + # all duplicate keys rather than collapsing them. + # + # pkg:gem/rack#lib/rack/query_parser.rb:94 + def parse_query_pairs(qs, separator = T.unsafe(nil)); end + + private + + # pkg:gem/rack#lib/rack/query_parser.rb:128 + def _normalize_params(params, name, v, depth); end + + # pkg:gem/rack#lib/rack/query_parser.rb:222 + def each_query_pair(qs, separator, unescaper = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/query_parser.rb:210 + def params_hash_has_key?(hash, key); end + + # pkg:gem/rack#lib/rack/query_parser.rb:206 + def params_hash_type?(obj); end + + # pkg:gem/rack#lib/rack/query_parser.rb:253 + def unescape(string, encoding = T.unsafe(nil)); end + + class << self + # pkg:gem/rack#lib/rack/query_parser.rb:36 + def make_default(param_depth_limit, **options); end + end +end + +# pkg:gem/rack#lib/rack/query_parser.rb:54 +Rack::QueryParser::BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/query_parser.rb:9 +Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/query_parser.rb:8 +Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# InvalidParameterError is the error that is raised when incoming structural +# parameters (parsed by parse_nested_query) contain invalid format or byte +# sequence. +# +# pkg:gem/rack#lib/rack/query_parser.rb:20 +class Rack::QueryParser::InvalidParameterError < ::ArgumentError + include ::Rack::BadRequest +end + +# pkg:gem/rack#lib/rack/query_parser.rb:57 +Rack::QueryParser::PARAMS_LIMIT = T.let(T.unsafe(nil), Integer) + +# ParameterTypeError is the error that is raised when incoming structural +# parameters (parsed by parse_nested_query) contain conflicting types. +# +# pkg:gem/rack#lib/rack/query_parser.rb:13 +class Rack::QueryParser::ParameterTypeError < ::TypeError + include ::Rack::BadRequest +end + +# pkg:gem/rack#lib/rack/query_parser.rb:257 +class Rack::QueryParser::Params < ::Hash + # pkg:gem/rack#lib/rack/query_parser.rb:258 + def to_params_hash; end +end + +# ParamsTooDeepError is the old name for the error that is raised when params +# are recursively nested over the specified limit. Make it the same as +# as QueryLimitError, so that code that rescues ParamsTooDeepError error +# to handle bad query strings also now handles other limits. +# +# pkg:gem/rack#lib/rack/query_parser.rb:34 +Rack::QueryParser::ParamsTooDeepError = Rack::QueryParser::QueryLimitError + +# QueryLimitError is for errors raised when the query provided exceeds one +# of the query parser limits. +# +# pkg:gem/rack#lib/rack/query_parser.rb:26 +class Rack::QueryParser::QueryLimitError < ::RangeError + include ::Rack::BadRequest +end + +# pkg:gem/rack#lib/rack/constants.rb:43 +Rack::RACK_EARLY_HINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:44 +Rack::RACK_ERRORS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:51 +Rack::RACK_HIJACK = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:46 +Rack::RACK_INPUT = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:52 +Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:45 +Rack::RACK_LOGGER = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:67 +Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:54 +Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:55 +Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:57 +Rack::RACK_PROTOCOL = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:53 +Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:63 +Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:64 +Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:62 +Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:59 +Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:58 +Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:60 +Rack::RACK_REQUEST_FORM_PAIRS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:61 +Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:65 +Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:66 +Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:56 +Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:47 +Rack::RACK_SESSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:48 +Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:49 +Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:42 +Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:50 +Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String) + +# Rack environment variables +# +# pkg:gem/rack#lib/rack/constants.rb:41 +Rack::RACK_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/version.rb:11 +Rack::RELEASE = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:9 +Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:10 +Rack::REQUEST_PATH = T.let(T.unsafe(nil), String) + +# Rack::Recursive allows applications called down the chain to +# include data from other applications (by using +# rack['rack.recursive.include'][...] or raise a +# ForwardRequest to redirect internally. +# +# pkg:gem/rack#lib/rack/recursive.rb:36 +class Rack::Recursive + # pkg:gem/rack#lib/rack/recursive.rb:37 + def initialize(app); end + + # pkg:gem/rack#lib/rack/recursive.rb:45 + def _call(env); end + + # pkg:gem/rack#lib/rack/recursive.rb:41 + def call(env); end + + # pkg:gem/rack#lib/rack/recursive.rb:52 + def include(env, path); end +end + +# High performant source reloader +# +# This class acts as Rack middleware. +# +# What makes it especially suited for use in a production environment is that +# any file will only be checked once and there will only be made one system +# call stat(2). +# +# Please note that this will not reload files in the background, it does so +# only when actively called. +# +# It is performing a check/reload cycle at the start of every request, but +# also respects a cool down time, during which nothing will be done. +# +# pkg:gem/rack#lib/rack/reloader.rb:24 +class Rack::Reloader + # pkg:gem/rack#lib/rack/reloader.rb:25 + def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/reloader.rb:36 + def call(env); end + + # pkg:gem/rack#lib/rack/reloader.rb:50 + def reload!(stderr = T.unsafe(nil)); end + + # A safe Kernel::load, issuing the hooks depending on the results + # + # pkg:gem/rack#lib/rack/reloader.rb:58 + def safe_load(file, mtime, stderr = T.unsafe(nil)); end +end + +# pkg:gem/rack#lib/rack/reloader.rb:68 +module Rack::Reloader::Stat + # Takes a relative or absolute +file+ name, a couple possible +paths+ that + # the +file+ might reside in. Returns the full path and File::Stat for the + # path. + # + # pkg:gem/rack#lib/rack/reloader.rb:88 + def figure_path(file, paths); end + + # pkg:gem/rack#lib/rack/reloader.rb:69 + def rotation; end + + # pkg:gem/rack#lib/rack/reloader.rb:103 + def safe_stat(file); end +end + +# Rack::Request provides a convenient interface to a Rack +# environment. It is stateless, the environment +env+ passed to the +# constructor will be directly modified. +# +# req = Rack::Request.new(env) +# req.post? +# req.params["data"] +# +# pkg:gem/rack#lib/rack/request.rb:16 +class Rack::Request + include ::Rack::Request::Env + include ::Rack::Request::Helpers + + # pkg:gem/rack#lib/rack/request.rb:62 + def initialize(env); end + + # pkg:gem/rack#lib/rack/request.rb:81 + def delete_param(k); end + + # pkg:gem/rack#lib/rack/request.rb:68 + def ip; end + + # pkg:gem/rack#lib/rack/request.rb:72 + def params; end + + # pkg:gem/rack#lib/rack/request.rb:76 + def update_param(k, v); end + + class << self + # The priority when checking forwarded headers. The default + # is [:forwarded, :x_forwarded], which means, check the + # +Forwarded+ header first, followed by the appropriate + # X-Forwarded-* header. You can revert the priority by + # reversing the priority, or remove checking of either + # or both headers by removing elements from the array. + # + # This should be set as appropriate in your environment + # based on what reverse proxies are in use. If you are not + # using reverse proxies, you should probably use an empty + # array. + # + # pkg:gem/rack#lib/rack/request.rb:31 + def forwarded_priority; end + + # The priority when checking forwarded headers. The default + # is [:forwarded, :x_forwarded], which means, check the + # +Forwarded+ header first, followed by the appropriate + # X-Forwarded-* header. You can revert the priority by + # reversing the priority, or remove checking of either + # or both headers by removing elements from the array. + # + # This should be set as appropriate in your environment + # based on what reverse proxies are in use. If you are not + # using reverse proxies, you should probably use an empty + # array. + # + # pkg:gem/rack#lib/rack/request.rb:31 + def forwarded_priority=(_arg0); end + + # pkg:gem/rack#lib/rack/request.rb:18 + def ip_filter; end + + # pkg:gem/rack#lib/rack/request.rb:18 + def ip_filter=(_arg0); end + + # The priority when checking either the X-Forwarded-Proto + # or X-Forwarded-Scheme header for the forwarded protocol. + # The default is [:proto, :scheme], to try the + # X-Forwarded-Proto header before the + # X-Forwarded-Scheme header. Rack 2 had behavior + # similar to [:scheme, :proto]. You can remove either or + # both of the entries in array to ignore that respective header. + # + # pkg:gem/rack#lib/rack/request.rb:40 + def x_forwarded_proto_priority; end + + # The priority when checking either the X-Forwarded-Proto + # or X-Forwarded-Scheme header for the forwarded protocol. + # The default is [:proto, :scheme], to try the + # X-Forwarded-Proto header before the + # X-Forwarded-Scheme header. Rack 2 had behavior + # similar to [:scheme, :proto]. You can remove either or + # both of the entries in array to ignore that respective header. + # + # pkg:gem/rack#lib/rack/request.rb:40 + def x_forwarded_proto_priority=(_arg0); end + end +end + +# pkg:gem/rack#lib/rack/request.rb:60 +Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rack#lib/rack/request.rb:87 +module Rack::Request::Env + # pkg:gem/rack#lib/rack/request.rb:91 + def initialize(env); end + + # Add a header that may have multiple values. + # + # Example: + # request.add_header 'Accept', 'image/png' + # request.add_header 'Accept', '*/*' + # + # assert_equal 'image/png,*/*', request.get_header('Accept') + # + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 + # + # pkg:gem/rack#lib/rack/request.rb:134 + def add_header(key, v); end + + # Delete a request specific value for `name`. + # + # pkg:gem/rack#lib/rack/request.rb:145 + def delete_header(name); end + + # Loops through each key / value pair in the request specific data. + # + # pkg:gem/rack#lib/rack/request.rb:116 + def each_header(&block); end + + # The environment of the request. + # + # pkg:gem/rack#lib/rack/request.rb:89 + def env; end + + # If a block is given, it yields to the block if the value hasn't been set + # on the request. + # + # pkg:gem/rack#lib/rack/request.rb:111 + def fetch_header(name, &block); end + + # Get a request specific value for `name`. + # + # pkg:gem/rack#lib/rack/request.rb:105 + def get_header(name); end + + # Predicate method to test to see if `name` has been set as request + # specific data + # + # pkg:gem/rack#lib/rack/request.rb:100 + def has_header?(name); end + + # Set a request specific value for `name` to `v` + # + # pkg:gem/rack#lib/rack/request.rb:121 + def set_header(name, v); end + + private + + # pkg:gem/rack#lib/rack/request.rb:149 + def initialize_copy(other); end +end + +# pkg:gem/rack#lib/rack/request.rb:154 +module Rack::Request::Helpers + # Returns the data received in the query string. + # + # pkg:gem/rack#lib/rack/request.rb:491 + def GET; end + + # Returns the data received in the request body. + # + # This method support both application/x-www-form-urlencoded and + # multipart/form-data. + # + # pkg:gem/rack#lib/rack/request.rb:542 + def POST; end + + # pkg:gem/rack#lib/rack/request.rb:611 + def accept_encoding; end + + # pkg:gem/rack#lib/rack/request.rb:615 + def accept_language; end + + # The authority of the incoming request as defined by RFC3976. + # https://tools.ietf.org/html/rfc3986#section-3.2 + # + # In HTTP/1, this is the `host` header. + # In HTTP/2, this is the `:authority` pseudo-header. + # + # pkg:gem/rack#lib/rack/request.rb:271 + def authority; end + + # pkg:gem/rack#lib/rack/request.rb:594 + def base_url; end + + # pkg:gem/rack#lib/rack/request.rb:195 + def body; end + + # The character set of the request body if a "charset" media type + # parameter was given, or nil if no "charset" was specified. Note + # that, per RFC2616, text/* media types that specify no explicit + # charset are to be considered ISO-8859-1. + # + # pkg:gem/rack#lib/rack/request.rb:465 + def content_charset; end + + # pkg:gem/rack#lib/rack/request.rb:204 + def content_length; end + + # pkg:gem/rack#lib/rack/request.rb:313 + def content_type; end + + # pkg:gem/rack#lib/rack/request.rb:298 + def cookies; end + + # Checks the HTTP request method (or verb) to see if it was of type DELETE + # + # pkg:gem/rack#lib/rack/request.rb:225 + def delete?; end + + # Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter. + # + # If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works. + # + # env['rack.input'] is not touched. + # + # pkg:gem/rack#lib/rack/request.rb:589 + def delete_param(k); end + + # Determine whether the request body contains form-data by checking + # the request content-type for one of the media-types: + # "application/x-www-form-urlencoded" or "multipart/form-data". The + # list of form-data media types can be modified through the + # +FORM_DATA_MEDIA_TYPES+ array. + # + # A request body is also assumed to contain form-data when no + # content-type header is provided and the request_method is POST. + # + # pkg:gem/rack#lib/rack/request.rb:477 + def form_data?; end + + # Returns the form data pairs received in the request body. + # + # This method support both application/x-www-form-urlencoded and + # multipart/form-data. + # + # pkg:gem/rack#lib/rack/request.rb:499 + def form_pairs; end + + # pkg:gem/rack#lib/rack/request.rb:398 + def forwarded_authority; end + + # pkg:gem/rack#lib/rack/request.rb:358 + def forwarded_for; end + + # pkg:gem/rack#lib/rack/request.rb:379 + def forwarded_port; end + + # pkg:gem/rack#lib/rack/request.rb:607 + def fullpath; end + + # Checks the HTTP request method (or verb) to see if it was of type GET + # + # pkg:gem/rack#lib/rack/request.rb:228 + def get?; end + + # Checks the HTTP request method (or verb) to see if it was of type HEAD + # + # pkg:gem/rack#lib/rack/request.rb:231 + def head?; end + + # Returns a formatted host, suitable for being used in a URI. + # + # pkg:gem/rack#lib/rack/request.rb:338 + def host; end + + # The `HTTP_HOST` header. + # + # pkg:gem/rack#lib/rack/request.rb:323 + def host_authority; end + + # pkg:gem/rack#lib/rack/request.rb:327 + def host_with_port(authority = T.unsafe(nil)); end + + # Returns an address suitable for being to resolve to an address. + # In the case of a domain name or IPv4 address, the result is the same + # as +host+. In the case of IPv6 or future address formats, the square + # brackets are removed. + # + # pkg:gem/rack#lib/rack/request.rb:346 + def hostname; end + + # pkg:gem/rack#lib/rack/request.rb:419 + def ip; end + + # Checks the HTTP request method (or verb) to see if it was of type LINK + # + # pkg:gem/rack#lib/rack/request.rb:237 + def link?; end + + # pkg:gem/rack#lib/rack/request.rb:205 + def logger; end + + # The media type (type/subtype) portion of the CONTENT_TYPE header + # without any media type parameters. e.g., when CONTENT_TYPE is + # "text/plain;charset=utf-8", the media-type is "text/plain". + # + # For more information on the use of media types in HTTP, see: + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 + # + # pkg:gem/rack#lib/rack/request.rb:448 + def media_type; end + + # The media type parameters provided in CONTENT_TYPE as a Hash, or + # an empty Hash if no CONTENT_TYPE or media-type parameters were + # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8", + # this method responds with the following Hash: + # { 'charset' => 'utf-8' } + # + # pkg:gem/rack#lib/rack/request.rb:457 + def media_type_params; end + + # Checks the HTTP request method (or verb) to see if it was of type OPTIONS + # + # pkg:gem/rack#lib/rack/request.rb:234 + def options?; end + + # The union of GET and POST data. + # + # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params. + # + # pkg:gem/rack#lib/rack/request.rb:556 + def params; end + + # Determine whether the request body contains data by checking + # the request media_type against registered parse-data media-types + # + # pkg:gem/rack#lib/rack/request.rb:486 + def parseable_data?; end + + # Checks the HTTP request method (or verb) to see if it was of type PATCH + # + # pkg:gem/rack#lib/rack/request.rb:240 + def patch?; end + + # pkg:gem/rack#lib/rack/request.rb:603 + def path; end + + # pkg:gem/rack#lib/rack/request.rb:199 + def path_info; end + + # pkg:gem/rack#lib/rack/request.rb:200 + def path_info=(s); end + + # pkg:gem/rack#lib/rack/request.rb:350 + def port; end + + # Checks the HTTP request method (or verb) to see if it was of type POST + # + # pkg:gem/rack#lib/rack/request.rb:243 + def post?; end + + # Checks the HTTP request method (or verb) to see if it was of type PUT + # + # pkg:gem/rack#lib/rack/request.rb:246 + def put?; end + + # Allow overriding the query parser that the receiver will use. + # By default Rack::Utils.default_query_parser is used. + # + # pkg:gem/rack#lib/rack/request.rb:562 + def query_parser=(_arg0); end + + # pkg:gem/rack#lib/rack/request.rb:203 + def query_string; end + + # the referer of the client + # + # pkg:gem/rack#lib/rack/request.rb:209 + def referer; end + + # pkg:gem/rack#lib/rack/request.rb:210 + def referrer; end + + # pkg:gem/rack#lib/rack/request.rb:202 + def request_method; end + + # pkg:gem/rack#lib/rack/request.rb:254 + def scheme; end + + # pkg:gem/rack#lib/rack/request.rb:196 + def script_name; end + + # pkg:gem/rack#lib/rack/request.rb:197 + def script_name=(s); end + + # The authority as defined by the `SERVER_NAME` and `SERVER_PORT` + # variables. + # + # pkg:gem/rack#lib/rack/request.rb:277 + def server_authority; end + + # pkg:gem/rack#lib/rack/request.rb:290 + def server_name; end + + # pkg:gem/rack#lib/rack/request.rb:294 + def server_port; end + + # pkg:gem/rack#lib/rack/request.rb:212 + def session; end + + # pkg:gem/rack#lib/rack/request.rb:218 + def session_options; end + + # pkg:gem/rack#lib/rack/request.rb:415 + def ssl?; end + + # Checks the HTTP request method (or verb) to see if it was of type TRACE + # + # pkg:gem/rack#lib/rack/request.rb:249 + def trace?; end + + # pkg:gem/rack#lib/rack/request.rb:619 + def trusted_proxy?(ip); end + + # Checks the HTTP request method (or verb) to see if it was of type UNLINK + # + # pkg:gem/rack#lib/rack/request.rb:252 + def unlink?; end + + # Destructively update a parameter, whether it's in GET and/or POST. Returns nil. + # + # The parameter is updated wherever it was previous defined, so GET, POST, or both. If it wasn't previously defined, it's inserted into GET. + # + # env['rack.input'] is not touched. + # + # pkg:gem/rack#lib/rack/request.rb:569 + def update_param(k, v); end + + # Tries to return a remake of the original request URL as a string. + # + # pkg:gem/rack#lib/rack/request.rb:599 + def url; end + + # pkg:gem/rack#lib/rack/request.rb:206 + def user_agent; end + + # pkg:gem/rack#lib/rack/request.rb:318 + def xhr?; end + + private + + # pkg:gem/rack#lib/rack/request.rb:770 + def allowed_scheme(header); end + + # pkg:gem/rack#lib/rack/request.rb:625 + def default_session; end + + # pkg:gem/rack#lib/rack/request.rb:682 + def expand_param_pairs(pairs, query_parser = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/request.rb:774 + def forwarded_priority; end + + # pkg:gem/rack#lib/rack/request.rb:746 + def forwarded_scheme; end + + # Get an array of values set in the RFC 7239 `Forwarded` request header. + # + # pkg:gem/rack#lib/rack/request.rb:665 + def get_http_forwarded(token); end + + # pkg:gem/rack#lib/rack/request.rb:641 + def parse_http_accept_header(header); end + + # pkg:gem/rack#lib/rack/request.rb:677 + def parse_multipart; end + + # pkg:gem/rack#lib/rack/request.rb:673 + def parse_query(qs, d = T.unsafe(nil)); end + + # Allow overriding the query parser that the receiver will use. + # By default Rack::Utils.default_query_parser is used. + # + # pkg:gem/rack#lib/rack/request.rb:669 + def query_parser; end + + # pkg:gem/rack#lib/rack/request.rb:735 + def split_authority(authority); end + + # pkg:gem/rack#lib/rack/request.rb:692 + def split_header(value); end + + # Assist with compatibility when processing `X-Forwarded-For`. + # + # pkg:gem/rack#lib/rack/request.rb:628 + def wrap_ipv6(host); end + + # pkg:gem/rack#lib/rack/request.rb:778 + def x_forwarded_proto_priority; end +end + +# pkg:gem/rack#lib/rack/request.rb:720 +Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp) + +# Default ports depending on scheme. Used to decide whether or not +# to include the port in a generated URI. +# +# pkg:gem/rack#lib/rack/request.rb:173 +Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash) + +# The set of form-data media-types. Requests that do not indicate +# one of the media types present in this list will not be eligible +# for form-data / param parsing. +# +# pkg:gem/rack#lib/rack/request.rb:158 +Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rack#lib/rack/request.rb:741 +Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/request.rb:181 +Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String) + +# The address of the client which connected to the proxy. +# +# pkg:gem/rack#lib/rack/request.rb:176 +Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String) + +# The contents of the host/:authority header sent to the proxy. +# +# pkg:gem/rack#lib/rack/request.rb:179 +Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String) + +# The port used to connect to the proxy. +# +# pkg:gem/rack#lib/rack/request.rb:190 +Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String) + +# The protocol used to connect to the proxy. +# +# pkg:gem/rack#lib/rack/request.rb:187 +Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String) + +# The value of the scheme sent to the proxy. +# +# pkg:gem/rack#lib/rack/request.rb:184 +Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String) + +# Another way for specifying https scheme was used. +# +# pkg:gem/rack#lib/rack/request.rb:193 +Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String) + +# The set of media-types. Requests that do not indicate +# one of the media types present in this list will not be eligible +# for param parsing like soap attachments or generic multiparts +# +# pkg:gem/rack#lib/rack/request.rb:166 +Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array) + +# Rack::Response provides a convenient interface to create a Rack +# response. +# +# It allows setting of headers and cookies, and provides useful +# defaults (an OK response with empty headers and body). +# +# You can use Response#write to iteratively generate your response, +# but note that this is buffered by Rack::Response until you call +# +finish+. +finish+ however can take a block inside which calls to +# +write+ are synchronous with the Rack response. +# +# Your application's +call+ should end returning Response#finish. +# +# pkg:gem/rack#lib/rack/response.rb:23 +class Rack::Response + include ::Rack::Response::Helpers + + # Initialize the response object with the specified +body+, +status+ + # and +headers+. + # + # If the +body+ is +nil+, construct an empty response object with internal + # buffering. + # + # If the +body+ responds to +to_str+, assume it's a string-like object and + # construct a buffered response object containing using that string as the + # initial contents of the buffer. + # + # Otherwise it is expected +body+ conforms to the normal requirements of a + # Rack response body, typically implementing one of +each+ (enumerable + # body) or +call+ (streaming body). + # + # The +status+ defaults to +200+ which is the "OK" HTTP status code. You + # can provide any other valid status code. + # + # The +headers+ must be a +Hash+ of key-value header pairs which conform to + # the Rack specification for response headers. The key must be a +String+ + # instance and the value can be either a +String+ or +Array+ instance. + # + # pkg:gem/rack#lib/rack/response.rb:54 + def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/response.rb:177 + def [](key); end + + # pkg:gem/rack#lib/rack/response.rb:178 + def []=(key, value); end + + # pkg:gem/rack#lib/rack/response.rb:31 + def body; end + + # pkg:gem/rack#lib/rack/response.rb:31 + def body=(_arg0); end + + # pkg:gem/rack#lib/rack/response.rb:95 + def chunked?; end + + # pkg:gem/rack#lib/rack/response.rb:152 + def close; end + + # pkg:gem/rack#lib/rack/response.rb:172 + def delete_header(key); end + + # For *response + # + # pkg:gem/rack#lib/rack/response.rb:130 + def each(&callback); end + + # pkg:gem/rack#lib/rack/response.rb:156 + def empty?; end + + # Generate a response array consistent with the requirements of the SPEC. + # @return [Array] a 3-tuple suitable of `[status, headers, body]` + # which is suitable to be returned from the middleware `#call(env)` method. + # + # pkg:gem/rack#lib/rack/response.rb:107 + def finish(&block); end + + # pkg:gem/rack#lib/rack/response.rb:164 + def get_header(key); end + + # pkg:gem/rack#lib/rack/response.rb:160 + def has_header?(key); end + + # pkg:gem/rack#lib/rack/response.rb:32 + def headers; end + + # pkg:gem/rack#lib/rack/response.rb:31 + def length; end + + # pkg:gem/rack#lib/rack/response.rb:31 + def length=(_arg0); end + + # pkg:gem/rack#lib/rack/response.rb:99 + def no_entity_body?; end + + # pkg:gem/rack#lib/rack/response.rb:90 + def redirect(target, status = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/response.rb:168 + def set_header(key, value); end + + # pkg:gem/rack#lib/rack/response.rb:31 + def status; end + + # pkg:gem/rack#lib/rack/response.rb:31 + def status=(_arg0); end + + # pkg:gem/rack#lib/rack/response.rb:128 + def to_a(&block); end + + # Append a chunk to the response body. + # + # Converts the response into a buffered response if it wasn't already. + # + # NOTE: Do not mix #write and direct #body access! + # + # pkg:gem/rack#lib/rack/response.rb:146 + def write(chunk); end + + class << self + # pkg:gem/rack#lib/rack/response.rb:24 + def [](status, headers, body); end + end +end + +# pkg:gem/rack#lib/rack/response.rb:28 +Rack::Response::CHUNKED = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/response.rb:180 +module Rack::Response::Helpers + # pkg:gem/rack#lib/rack/response.rb:191 + def accepted?; end + + # Add a header that may have multiple values. + # + # Example: + # response.add_header 'vary', 'accept-encoding' + # response.add_header 'vary', 'cookie' + # + # assert_equal 'accept-encoding,cookie', response.get_header('vary') + # + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 + # + # pkg:gem/rack#lib/rack/response.rb:219 + def add_header(key, value); end + + # pkg:gem/rack#lib/rack/response.rb:194 + def bad_request?; end + + # Specify that the content should be cached. + # @param duration [Integer] The number of seconds until the cache expires. + # @option directive [String] The cache control directive, one of "public", "private", "no-cache" or "no-store". + # + # pkg:gem/rack#lib/rack/response.rb:307 + def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/response.rb:290 + def cache_control; end + + # pkg:gem/rack#lib/rack/response.rb:294 + def cache_control=(value); end + + # pkg:gem/rack#lib/rack/response.rb:186 + def client_error?; end + + # pkg:gem/rack#lib/rack/response.rb:257 + def content_length; end + + # Get the content type of the response. + # + # pkg:gem/rack#lib/rack/response.rb:240 + def content_type; end + + # Set the content type of the response. + # + # pkg:gem/rack#lib/rack/response.rb:245 + def content_type=(content_type); end + + # pkg:gem/rack#lib/rack/response.rb:190 + def created?; end + + # pkg:gem/rack#lib/rack/response.rb:274 + def delete_cookie(key, value = T.unsafe(nil)); end + + # Specifies that the content shouldn't be cached. Overrides `cache!` if already called. + # + # pkg:gem/rack#lib/rack/response.rb:299 + def do_not_cache!; end + + # pkg:gem/rack#lib/rack/response.rb:314 + def etag; end + + # pkg:gem/rack#lib/rack/response.rb:318 + def etag=(value); end + + # pkg:gem/rack#lib/rack/response.rb:196 + def forbidden?; end + + # pkg:gem/rack#lib/rack/response.rb:206 + def include?(header); end + + # pkg:gem/rack#lib/rack/response.rb:183 + def informational?; end + + # pkg:gem/rack#lib/rack/response.rb:181 + def invalid?; end + + # pkg:gem/rack#lib/rack/response.rb:262 + def location; end + + # pkg:gem/rack#lib/rack/response.rb:266 + def location=(location); end + + # pkg:gem/rack#lib/rack/response.rb:249 + def media_type; end + + # pkg:gem/rack#lib/rack/response.rb:253 + def media_type_params; end + + # pkg:gem/rack#lib/rack/response.rb:198 + def method_not_allowed?; end + + # pkg:gem/rack#lib/rack/response.rb:193 + def moved_permanently?; end + + # pkg:gem/rack#lib/rack/response.rb:192 + def no_content?; end + + # pkg:gem/rack#lib/rack/response.rb:199 + def not_acceptable?; end + + # pkg:gem/rack#lib/rack/response.rb:197 + def not_found?; end + + # pkg:gem/rack#lib/rack/response.rb:189 + def ok?; end + + # pkg:gem/rack#lib/rack/response.rb:201 + def precondition_failed?; end + + # pkg:gem/rack#lib/rack/response.rb:204 + def redirect?; end + + # pkg:gem/rack#lib/rack/response.rb:185 + def redirection?; end + + # pkg:gem/rack#lib/rack/response.rb:200 + def request_timeout?; end + + # pkg:gem/rack#lib/rack/response.rb:187 + def server_error?; end + + # pkg:gem/rack#lib/rack/response.rb:270 + def set_cookie(key, value); end + + # pkg:gem/rack#lib/rack/response.rb:282 + def set_cookie_header; end + + # pkg:gem/rack#lib/rack/response.rb:286 + def set_cookie_header=(value); end + + # pkg:gem/rack#lib/rack/response.rb:184 + def successful?; end + + # pkg:gem/rack#lib/rack/response.rb:195 + def unauthorized?; end + + # pkg:gem/rack#lib/rack/response.rb:202 + def unprocessable?; end + + protected + + # pkg:gem/rack#lib/rack/response.rb:359 + def append(chunk); end + + # Convert the body of this response into an internally buffered Array if possible. + # + # `@buffered` is a ternary value which indicates whether the body is buffered. It can be: + # * `nil` - The body has not been buffered yet. + # * `true` - The body is buffered as an Array instance. + # * `false` - The body is not buffered and cannot be buffered. + # + # @return [Boolean] whether the body is buffered as an Array instance. + # + # pkg:gem/rack#lib/rack/response.rb:332 + def buffered_body!; end +end + +# pkg:gem/rack#lib/rack/response.rb:375 +class Rack::Response::Raw + include ::Rack::Response::Helpers + + # pkg:gem/rack#lib/rack/response.rb:381 + def initialize(status, headers); end + + # pkg:gem/rack#lib/rack/response.rb:398 + def delete_header(key); end + + # pkg:gem/rack#lib/rack/response.rb:390 + def get_header(key); end + + # pkg:gem/rack#lib/rack/response.rb:386 + def has_header?(key); end + + # pkg:gem/rack#lib/rack/response.rb:378 + def headers; end + + # pkg:gem/rack#lib/rack/response.rb:394 + def set_header(key, value); end + + # pkg:gem/rack#lib/rack/response.rb:379 + def status; end + + # pkg:gem/rack#lib/rack/response.rb:379 + def status=(_arg0); end +end + +# pkg:gem/rack#lib/rack/response.rb:29 +Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) + +# Class which can make any IO object rewindable, including non-rewindable ones. It does +# this by buffering the data into a tempfile, which is rewindable. +# +# Don't forget to call #close when you're done. This frees up temporary resources that +# RewindableInput uses, though it does *not* close the original IO object. +# +# pkg:gem/rack#lib/rack/rewindable_input.rb:14 +class Rack::RewindableInput + # pkg:gem/rack#lib/rack/rewindable_input.rb:32 + def initialize(io); end + + # Closes this RewindableInput object without closing the originally + # wrapped IO object. Cleans up any temporary resources that this RewindableInput + # has created. + # + # This method may be called multiple times. It does nothing on subsequent calls. + # + # pkg:gem/rack#lib/rack/rewindable_input.rb:68 + def close; end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:48 + def each(&block); end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:38 + def gets; end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:43 + def read(*args); end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:53 + def rewind; end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:58 + def size; end + + private + + # pkg:gem/rack#lib/rack/rewindable_input.rb:112 + def filesystem_has_posix_semantics?; end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:81 + def make_rewindable; end +end + +# Makes rack.input rewindable, for compatibility with applications and middleware +# designed for earlier versions of Rack (where rack.input was required to be +# rewindable). +# +# pkg:gem/rack#lib/rack/rewindable_input.rb:18 +class Rack::RewindableInput::Middleware + # pkg:gem/rack#lib/rack/rewindable_input.rb:19 + def initialize(app); end + + # pkg:gem/rack#lib/rack/rewindable_input.rb:23 + def call(env); end +end + +# Sets an "x-runtime" response header, indicating the response +# time of the request, in seconds +# +# You can put it right before the application to see the processing +# time, or before all the other middlewares to include time for them, +# too. +# +# pkg:gem/rack#lib/rack/runtime.rb:12 +class Rack::Runtime + # pkg:gem/rack#lib/rack/runtime.rb:16 + def initialize(app, name = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/runtime.rb:22 + def call(env); end +end + +# pkg:gem/rack#lib/rack/runtime.rb:13 +Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/runtime.rb:14 +Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:11 +Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:14 +Rack::SERVER_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:15 +Rack::SERVER_PORT = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:13 +Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:24 +Rack::SET_COOKIE = T.let(T.unsafe(nil), String) + +# = Sendfile +# +# The Sendfile middleware intercepts responses whose body is being +# served from a file and replaces it with a server specific x-sendfile +# header. The web server is then responsible for writing the file contents +# to the client. This can dramatically reduce the amount of work required +# by the Ruby backend and takes advantage of the web server's optimized file +# delivery code. +# +# In order to take advantage of this middleware, the response body must +# respond to +to_path+ and the request must include an `x-sendfile-type` +# header. Rack::Files and other components implement +to_path+ so there's +# rarely anything you need to do in your application. The `x-sendfile-type` +# header is typically set in your web servers configuration. The following +# sections attempt to document +# +# === Nginx +# +# Nginx supports the `x-accel-redirect` header. This is similar to `x-sendfile` +# but requires parts of the filesystem to be mapped into a private URL +# hierarchy. +# +# The following example shows the Nginx configuration required to create +# a private "/files/" area, enable `x-accel-redirect`, and pass the special +# `x-accel-mapping` header to the backend: +# +# location ~ /files/(.*) { +# internal; +# alias /var/www/$1; +# } +# +# location / { +# proxy_redirect off; +# +# proxy_set_header Host $host; +# proxy_set_header X-Real-IP $remote_addr; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# +# proxy_set_header x-accel-mapping /var/www/=/files/; +# +# proxy_pass http://127.0.0.1:8080/; +# } +# +# The `x-accel-mapping` header should specify the location on the file system, +# followed by an equals sign (=), followed name of the private URL pattern +# that it maps to. The middleware performs a case-insensitive substitution on the +# resulting path. +# +# To enable `x-accel-redirect`, you must configure the middleware explicitly: +# +# use Rack::Sendfile, "x-accel-redirect" +# +# For security reasons, the `x-sendfile-type` header from requests is ignored. +# The sendfile variation must be set via the middleware constructor. +# +# See Also: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile +# +# === lighttpd +# +# Lighttpd has supported some variation of the `x-sendfile` header for some +# time, although only recent version support `x-sendfile` in a reverse proxy +# configuration. +# +# $HTTP["host"] == "example.com" { +# proxy-core.protocol = "http" +# proxy-core.balancer = "round-robin" +# proxy-core.backends = ( +# "127.0.0.1:8000", +# "127.0.0.1:8001", +# ... +# ) +# +# proxy-core.allow-x-sendfile = "enable" +# proxy-core.rewrite-request = ( +# "x-sendfile-type" => (".*" => "x-sendfile") +# ) +# } +# +# See Also: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModProxyCore +# +# === Apache +# +# `x-sendfile` is supported under Apache 2.x using a separate module: +# +# https://tn123.org/mod_xsendfile/ +# +# Once the module is compiled and installed, you can enable it using +# XSendFile config directive: +# +# RequestHeader Set x-sendfile-type x-sendfile +# ProxyPassReverse / http://localhost:8001/ +# XSendFile on +# +# === Mapping parameter +# +# The third parameter allows for an overriding extension of the +# `x-accel-mapping` header. Mappings should be provided in tuples of internal to +# external. The internal values may contain regular expression syntax, they +# will be matched with case indifference. +# +# When `x-accel-redirect` is explicitly enabled via the variation parameter, +# and no application-level mappings are provided, the middleware will read +# the `x-accel-mapping` header from the proxy. This allows nginx to control +# the path mapping without requiring application-level configuration. +# +# === Security +# +# For security reasons, the `x-sendfile-type` header from HTTP requests is +# ignored. The sendfile variation must be explicitly configured via the +# middleware constructor to prevent information disclosure vulnerabilities +# where attackers could bypass proxy restrictions. +# +# pkg:gem/rack#lib/rack/sendfile.rb:121 +class Rack::Sendfile + # pkg:gem/rack#lib/rack/sendfile.rb:122 + def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/sendfile.rb:130 + def call(env); end + + private + + # pkg:gem/rack#lib/rack/sendfile.rb:182 + def map_accel_path(env, path); end + + # pkg:gem/rack#lib/rack/sendfile.rb:166 + def variation(env); end + + # pkg:gem/rack#lib/rack/sendfile.rb:172 + def x_accel_mapping(env); end +end + +# Rack::ShowExceptions catches all exceptions raised from the app it +# wraps. It shows a useful backtrace with the sourcefile and +# clickable context, the whole Rack environment and the request +# data. +# +# Be careful when you use this on public-facing sites as it could +# reveal information helpful to attackers. +# +# pkg:gem/rack#lib/rack/show_exceptions.rb:18 +class Rack::ShowExceptions + # pkg:gem/rack#lib/rack/show_exceptions.rb:26 + def initialize(app); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:30 + def call(env); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:65 + def dump_exception(exception); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:120 + def h(obj); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:56 + def prefers_plaintext?(env); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:80 + def pretty(env, exception); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:116 + def template; end + + private + + # pkg:gem/rack#lib/rack/show_exceptions.rb:60 + def accepts_html?(env); end +end + +# pkg:gem/rack#lib/rack/show_exceptions.rb:19 +Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rack#lib/rack/show_exceptions.rb:21 +class Rack::ShowExceptions::Frame < ::Struct + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def context_line; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def context_line=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def filename; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def filename=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def function; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def function=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def lineno; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def lineno=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def post_context; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def post_context=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def post_context_lineno; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def post_context_lineno=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def pre_context; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def pre_context=(_); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def pre_context_lineno; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def pre_context_lineno=(_); end + + class << self + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def [](*_arg0); end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def inspect; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def keyword_init?; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def members; end + + # pkg:gem/rack#lib/rack/show_exceptions.rb:21 + def new(*_arg0); end + end +end + +# adapted from Django +# Copyright (c) Django Software Foundation and individual contributors. +# Used under the modified BSD license: +# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5 +# +# pkg:gem/rack#lib/rack/show_exceptions.rb:135 +Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB) + +# Rack::ShowStatus catches all empty responses and replaces them +# with a site explaining the error. +# +# Additional details can be put into rack.showstatus.detail +# and will be shown as HTML. If such details exist, the error page +# is always rendered, even if the reply was not empty. +# +# pkg:gem/rack#lib/rack/show_status.rb:18 +class Rack::ShowStatus + # pkg:gem/rack#lib/rack/show_status.rb:19 + def initialize(app); end + + # pkg:gem/rack#lib/rack/show_status.rb:24 + def call(env); end + + # pkg:gem/rack#lib/rack/show_status.rb:54 + def h(obj); end +end + +# adapted from Django +# Copyright (c) Django Software Foundation and individual contributors. +# Used under the modified BSD license: +# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5 +# +# pkg:gem/rack#lib/rack/show_status.rb:69 +Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String) + +# The Rack::Static middleware intercepts requests for static files +# (javascript files, images, stylesheets, etc) based on the url prefixes or +# route mappings passed in the options, and serves them using a Rack::Files +# object. This allows a Rack stack to serve both static and dynamic content. +# +# Examples: +# +# Serve all requests beginning with /media from the "media" folder located +# in the current directory (ie media/*): +# +# use Rack::Static, :urls => ["/media"] +# +# Same as previous, but instead of returning 404 for missing files under +# /media, call the next middleware: +# +# use Rack::Static, :urls => ["/media"], :cascade => true +# +# Serve all requests beginning with /css or /images from the folder "public" +# in the current directory (ie public/css/* and public/images/*): +# +# use Rack::Static, :urls => ["/css", "/images"], :root => "public" +# +# Serve all requests to / with "index.html" from the folder "public" in the +# current directory (ie public/index.html): +# +# use Rack::Static, :urls => {"/" => 'index.html'}, :root => 'public' +# +# Serve all requests normally from the folder "public" in the current +# directory but uses index.html as default route for "/" +# +# use Rack::Static, :urls => [""], :root => 'public', :index => +# 'index.html' +# +# Set custom HTTP Headers for based on rules: +# +# use Rack::Static, :root => 'public', +# :header_rules => [ +# [rule, {header_field => content, header_field => content}], +# [rule, {header_field => content}] +# ] +# +# Rules for selecting files: +# +# 1) All files +# Provide the :all symbol +# :all => Matches every file +# +# 2) Folders +# Provide the folder path as a string +# '/folder' or '/folder/subfolder' => Matches files in a certain folder +# +# 3) File Extensions +# Provide the file extensions as an array +# ['css', 'js'] or %w(css js) => Matches files ending in .css or .js +# +# 4) Regular Expressions / Regexp +# Provide a regular expression +# %r{\.(?:css|js)\z} => Matches files ending in .css or .js +# /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in +# the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg) +# Note: This Regexp is available as a shortcut, using the :fonts rule +# +# 5) Font Shortcut +# Provide the :fonts symbol +# :fonts => Uses the Regexp rule stated right above to match all common web font endings +# +# Rule Ordering: +# Rules are applied in the order that they are provided. +# List rather general rules above special ones. +# +# Complete example use case including HTTP header rules: +# +# use Rack::Static, :root => 'public', +# :header_rules => [ +# # Cache all static files in public caches (e.g. Rack::Cache) +# # as well as in the browser +# [:all, {'cache-control' => 'public, max-age=31536000'}], +# +# # Provide web fonts with cross-origin access-control-headers +# # Firefox requires this when serving assets using a Content Delivery Network +# [:fonts, {'access-control-allow-origin' => '*'}] +# ] +# +# pkg:gem/rack#lib/rack/static.rb:92 +class Rack::Static + # pkg:gem/rack#lib/rack/static.rb:93 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/static.rb:112 + def add_index_root?(path); end + + # Convert HTTP header rules to HTTP headers + # + # pkg:gem/rack#lib/rack/static.rb:170 + def applicable_rules(path); end + + # pkg:gem/rack#lib/rack/static.rb:128 + def call(env); end + + # pkg:gem/rack#lib/rack/static.rb:124 + def can_serve(path); end + + # pkg:gem/rack#lib/rack/static.rb:116 + def overwrite_file_path(path); end + + # pkg:gem/rack#lib/rack/static.rb:120 + def route_file(path); end +end + +# pkg:gem/rack#lib/rack/constants.rb:38 +Rack::TRACE = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/constants.rb:25 +Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) + +# Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart) +# Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter +# https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ +# +# pkg:gem/rack#lib/rack/tempfile_reaper.rb:11 +class Rack::TempfileReaper + # pkg:gem/rack#lib/rack/tempfile_reaper.rb:12 + def initialize(app); end + + # pkg:gem/rack#lib/rack/tempfile_reaper.rb:16 + def call(env); end +end + +# pkg:gem/rack#lib/rack/constants.rb:37 +Rack::UNLINK = T.let(T.unsafe(nil), String) + +# Rack::URLMap takes a hash mapping urls or paths to apps, and +# dispatches accordingly. Support for HTTP/1.1 host names exists if +# the URLs start with http:// or https://. +# +# URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part +# relevant for dispatch is in the SCRIPT_NAME, and the rest in the +# PATH_INFO. This should be taken care of when you need to +# reconstruct the URL in order to create links. +# +# URLMap dispatches in such a way that the longest paths are tried +# first, since they are most specific. +# +# pkg:gem/rack#lib/rack/urlmap.rb:20 +class Rack::URLMap + # pkg:gem/rack#lib/rack/urlmap.rb:21 + def initialize(map = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/urlmap.rb:48 + def call(env); end + + # pkg:gem/rack#lib/rack/urlmap.rb:25 + def remap(map); end + + private + + # pkg:gem/rack#lib/rack/urlmap.rb:87 + def casecmp?(v1, v2); end +end + +# Rack::Utils contains a grab-bag of useful methods for writing web +# applications adopted from all kinds of Ruby libraries. +# +# pkg:gem/rack#lib/rack/utils.rb:20 +module Rack::Utils + private + + # Return best accept value to use, based on the algorithm + # in RFC 2616 Section 14. If there are multiple best + # matches (same specificity and quality), the value returned + # is arbitrary. + # + # pkg:gem/rack#lib/rack/utils.rb:227 + def best_q_match(q_value_header, available_mimes); end + + # pkg:gem/rack#lib/rack/utils.rb:120 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:110 + def build_query(params); end + + # Parses the "Range:" header, if present, into an array of Range objects. + # Returns nil if the header is missing or syntactically invalid. + # Returns an empty array if none of the ranges are satisfiable. + # + # pkg:gem/rack#lib/rack/utils.rb:492 + def byte_ranges(env, size, max_ranges: T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:692 + def clean_path_info(path_info); end + + # :nocov: + # + # pkg:gem/rack#lib/rack/utils.rb:91 + def clock_time; end + + # pkg:gem/rack#lib/rack/utils.rb:450 + def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header(key, value = {}) -> encoded string + # + # Generate an encoded string based on the given +key+ and +value+ using + # set_cookie_header for the purpose of causing the specified cookie to be + # deleted. The +value+ may be an instance of +Hash+ and can include + # attributes as outlined by set_cookie_header. The encoded cookie will have + # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty + # +value+. When used with the +set-cookie+ header, it will cause the client + # to *remove* any matching cookie. + # + # delete_set_cookie_header("myname") + # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # pkg:gem/rack#lib/rack/utils.rb:446 + def delete_set_cookie_header(key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header!(header, key, value = {}) -> header value + # + # Set an expired cookie in the specified headers with the given cookie + # +key+ and +value+ using delete_set_cookie_header. This causes + # the client to immediately delete the specified cookie. + # + # delete_set_cookie_header!(nil, "mycookie") + # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # If the header is non-nil, it will be modified in place. + # + # header = [] + # delete_set_cookie_header!(header, "mycookie") + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # header + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # + # pkg:gem/rack#lib/rack/utils.rb:474 + def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end + + # URI escapes. (CGI style space to +) + # + # pkg:gem/rack#lib/rack/utils.rb:40 + def escape(s); end + + # Escape ampersands, brackets and quotes to their HTML/XML entities. + # + # pkg:gem/rack#lib/rack/utils.rb:243 + def escape_html(_arg0); end + + # Like URI escaping, but with %20 instead of +. Strictly speaking this is + # true URI escaping. + # + # pkg:gem/rack#lib/rack/utils.rb:46 + def escape_path(s); end + + # pkg:gem/rack#lib/rack/utils.rb:152 + def forwarded_values(forwarded_header); end + + # pkg:gem/rack#lib/rack/utils.rb:496 + def get_byte_ranges(http_range, size, max_ranges: T.unsafe(nil)); end + + # :call-seq: + # parse_cookies(env) -> hash + # + # Parse cookies from the provided request environment using + # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+. + # + # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'}) + # # => {'myname' => 'myvalue'} + # + # pkg:gem/rack#lib/rack/utils.rb:347 + def parse_cookies(env); end + + # :call-seq: + # parse_cookies_header(value) -> hash + # + # Parse cookies from the provided header +value+ according to RFC6265. The + # syntax for cookie headers only supports semicolons. Returns a map of + # cookie +key+ to cookie +value+. + # + # parse_cookies_header('myname=myvalue; max-age=0') + # # => {"myname"=>"myvalue", "max-age"=>"0"} + # + # pkg:gem/rack#lib/rack/utils.rb:328 + def parse_cookies_header(value); end + + # pkg:gem/rack#lib/rack/utils.rb:106 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:102 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + # pkg:gem/rack#lib/rack/utils.rb:138 + def q_values(q_value_header); end + + # pkg:gem/rack#lib/rack/utils.rb:485 + def rfc2822(time); end + + # Constant time string comparison. + # + # NOTE: the values compared should be of fixed length, such as strings + # that have already been processed by HMAC. This should not be used + # on variable length plaintext strings because it could leak length info + # via timing attacks. + # + # pkg:gem/rack#lib/rack/utils.rb:540 + def secure_compare(a, b); end + + # Given an array of available encoding strings, and an array of + # acceptable encodings for a request, where each element of the + # acceptable encodings array is an array where the first element + # is an encoding name and the second element is the numeric + # priority for the encoding, return the available encoding with + # the highest priority. + # + # The accept_encoding argument is typically generated by calling + # Request#accept_encoding. + # + # Example: + # + # select_best_encoding(%w(compress gzip identity), + # [["compress", 0.5], ["gzip", 1.0]]) + # # => "gzip" + # + # To reduce denial of service potential, only the first 16 + # acceptable encodings are considered. + # + # pkg:gem/rack#lib/rack/utils.rb:274 + def select_best_encoding(available_encodings, accept_encoding); end + + # :call-seq: + # set_cookie_header(key, value) -> encoded string + # + # Generate an encoded string using the provided +key+ and +value+ suitable + # for the +set-cookie+ header according to RFC6265. The +value+ may be an + # instance of either +String+ or +Hash+. If the cookie key is invalid (as + # defined by RFC6265), an +ArgumentError+ will be raised. + # + # If the cookie +value+ is an instance of +Hash+, it considers the following + # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance + # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more + # details about the interpretation of these fields, consult + # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2). + # + # set_cookie_header("myname", "myvalue") + # # => "myname=myvalue" + # + # set_cookie_header("myname", {value: "myvalue", max_age: 10}) + # # => "myname=myvalue; max-age=10" + # + # pkg:gem/rack#lib/rack/utils.rb:376 + def set_cookie_header(key, value); end + + # :call-seq: + # set_cookie_header!(headers, key, value) -> header value + # + # Append a cookie in the specified headers with the given cookie +key+ and + # +value+ using set_cookie_header. + # + # If the headers already contains a +set-cookie+ key, it will be converted + # to an +Array+ if not already, and appended to. + # + # pkg:gem/rack#lib/rack/utils.rb:420 + def set_cookie_header!(headers, key, value); end + + # pkg:gem/rack#lib/rack/utils.rb:674 + def status_code(status); end + + # Unescapes a URI escaped string with +encoding+. +encoding+ will be the + # target encoding of the string returned, and it defaults to UTF-8 + # + # pkg:gem/rack#lib/rack/utils.rb:58 + def unescape(s, encoding = T.unsafe(nil)); end + + # Unescapes the **path** component of a URI. See Rack::Utils.unescape for + # unescaping query parameters or form components. + # + # pkg:gem/rack#lib/rack/utils.rb:52 + def unescape_path(s); end + + # pkg:gem/rack#lib/rack/utils.rb:709 + def valid_path?(path); end + + class << self + # Return best accept value to use, based on the algorithm + # in RFC 2616 Section 14. If there are multiple best + # matches (same specificity and quality), the value returned + # is arbitrary. + # + # pkg:gem/rack#lib/rack/utils.rb:227 + def best_q_match(q_value_header, available_mimes); end + + # pkg:gem/rack#lib/rack/utils.rb:120 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:110 + def build_query(params); end + + # Parses the "Range:" header, if present, into an array of Range objects. + # Returns nil if the header is missing or syntactically invalid. + # Returns an empty array if none of the ranges are satisfiable. + # + # pkg:gem/rack#lib/rack/utils.rb:492 + def byte_ranges(env, size, max_ranges: T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:692 + def clean_path_info(path_info); end + + # :nocov: + # + # pkg:gem/rack#lib/rack/utils.rb:91 + def clock_time; end + + # pkg:gem/rack#lib/rack/utils.rb:30 + def default_query_parser; end + + # pkg:gem/rack#lib/rack/utils.rb:30 + def default_query_parser=(_arg0); end + + # pkg:gem/rack#lib/rack/utils.rb:450 + def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header(key, value = {}) -> encoded string + # + # Generate an encoded string based on the given +key+ and +value+ using + # set_cookie_header for the purpose of causing the specified cookie to be + # deleted. The +value+ may be an instance of +Hash+ and can include + # attributes as outlined by set_cookie_header. The encoded cookie will have + # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty + # +value+. When used with the +set-cookie+ header, it will cause the client + # to *remove* any matching cookie. + # + # delete_set_cookie_header("myname") + # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # pkg:gem/rack#lib/rack/utils.rb:446 + def delete_set_cookie_header(key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header!(header, key, value = {}) -> header value + # + # Set an expired cookie in the specified headers with the given cookie + # +key+ and +value+ using delete_set_cookie_header. This causes + # the client to immediately delete the specified cookie. + # + # delete_set_cookie_header!(nil, "mycookie") + # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # If the header is non-nil, it will be modified in place. + # + # header = [] + # delete_set_cookie_header!(header, "mycookie") + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # header + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # + # pkg:gem/rack#lib/rack/utils.rb:474 + def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end + + # URI escapes. (CGI style space to +) + # + # pkg:gem/rack#lib/rack/utils.rb:40 + def escape(s); end + + # Escape ampersands, brackets and quotes to their HTML/XML entities. + # + # pkg:gem/rack#lib/rack/utils.rb:243 + def escape_html(_arg0); end + + # Like URI escaping, but with %20 instead of +. Strictly speaking this is + # true URI escaping. + # + # pkg:gem/rack#lib/rack/utils.rb:46 + def escape_path(s); end + + # pkg:gem/rack#lib/rack/utils.rb:152 + def forwarded_values(forwarded_header); end + + # pkg:gem/rack#lib/rack/utils.rb:496 + def get_byte_ranges(http_range, size, max_ranges: T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:65 + def multipart_file_limit; end + + # pkg:gem/rack#lib/rack/utils.rb:65 + def multipart_file_limit=(_arg0); end + + # multipart_part_limit is the original name of multipart_file_limit, but + # the limit only counts parts with filenames. + # + # pkg:gem/rack#lib/rack/utils.rb:69 + def multipart_part_limit; end + + # pkg:gem/rack#lib/rack/utils.rb:70 + def multipart_part_limit=(_arg0); end + + # pkg:gem/rack#lib/rack/utils.rb:63 + def multipart_total_part_limit; end + + # pkg:gem/rack#lib/rack/utils.rb:63 + def multipart_total_part_limit=(_arg0); end + + # pkg:gem/rack#lib/rack/utils.rb:82 + def param_depth_limit; end + + # pkg:gem/rack#lib/rack/utils.rb:86 + def param_depth_limit=(v); end + + # :call-seq: + # parse_cookies(env) -> hash + # + # Parse cookies from the provided request environment using + # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+. + # + # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'}) + # # => {'myname' => 'myvalue'} + # + # pkg:gem/rack#lib/rack/utils.rb:347 + def parse_cookies(env); end + + # :call-seq: + # parse_cookies_header(value) -> hash + # + # Parse cookies from the provided header +value+ according to RFC6265. The + # syntax for cookie headers only supports semicolons. Returns a map of + # cookie +key+ to cookie +value+. + # + # parse_cookies_header('myname=myvalue; max-age=0') + # # => {"myname"=>"myvalue", "max-age"=>"0"} + # + # pkg:gem/rack#lib/rack/utils.rb:328 + def parse_cookies_header(value); end + + # pkg:gem/rack#lib/rack/utils.rb:106 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:102 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + # pkg:gem/rack#lib/rack/utils.rb:138 + def q_values(q_value_header); end + + # pkg:gem/rack#lib/rack/utils.rb:485 + def rfc2822(time); end + + # Constant time string comparison. + # + # NOTE: the values compared should be of fixed length, such as strings + # that have already been processed by HMAC. This should not be used + # on variable length plaintext strings because it could leak length info + # via timing attacks. + # + # pkg:gem/rack#lib/rack/utils.rb:540 + def secure_compare(a, b); end + + # Given an array of available encoding strings, and an array of + # acceptable encodings for a request, where each element of the + # acceptable encodings array is an array where the first element + # is an encoding name and the second element is the numeric + # priority for the encoding, return the available encoding with + # the highest priority. + # + # The accept_encoding argument is typically generated by calling + # Request#accept_encoding. + # + # Example: + # + # select_best_encoding(%w(compress gzip identity), + # [["compress", 0.5], ["gzip", 1.0]]) + # # => "gzip" + # + # To reduce denial of service potential, only the first 16 + # acceptable encodings are considered. + # + # pkg:gem/rack#lib/rack/utils.rb:274 + def select_best_encoding(available_encodings, accept_encoding); end + + # :call-seq: + # set_cookie_header(key, value) -> encoded string + # + # Generate an encoded string using the provided +key+ and +value+ suitable + # for the +set-cookie+ header according to RFC6265. The +value+ may be an + # instance of either +String+ or +Hash+. If the cookie key is invalid (as + # defined by RFC6265), an +ArgumentError+ will be raised. + # + # If the cookie +value+ is an instance of +Hash+, it considers the following + # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance + # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more + # details about the interpretation of these fields, consult + # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2). + # + # set_cookie_header("myname", "myvalue") + # # => "myname=myvalue" + # + # set_cookie_header("myname", {value: "myvalue", max_age: 10}) + # # => "myname=myvalue; max-age=10" + # + # pkg:gem/rack#lib/rack/utils.rb:376 + def set_cookie_header(key, value); end + + # :call-seq: + # set_cookie_header!(headers, key, value) -> header value + # + # Append a cookie in the specified headers with the given cookie +key+ and + # +value+ using set_cookie_header. + # + # If the headers already contains a +set-cookie+ key, it will be converted + # to an +Array+ if not already, and appended to. + # + # pkg:gem/rack#lib/rack/utils.rb:420 + def set_cookie_header!(headers, key, value); end + + # pkg:gem/rack#lib/rack/utils.rb:674 + def status_code(status); end + + # Unescapes a URI escaped string with +encoding+. +encoding+ will be the + # target encoding of the string returned, and it defaults to UTF-8 + # + # pkg:gem/rack#lib/rack/utils.rb:58 + def unescape(s, encoding = T.unsafe(nil)); end + + # Unescapes the **path** component of a URI. See Rack::Utils.unescape for + # unescaping query parameters or form components. + # + # pkg:gem/rack#lib/rack/utils.rb:52 + def unescape_path(s); end + + # pkg:gem/rack#lib/rack/utils.rb:709 + def valid_path?(path); end + end +end + +# pkg:gem/rack#lib/rack/utils.rb:149 +Rack::Utils::ALLOWED_FORWARDED_PARAMS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/utils.rb:25 +Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# Context allows the use of a compatible middleware at different points +# in a request handling stack. A compatible middleware must define +# #context which should take the arguments env and app. The first of which +# would be the request environment. The second of which would be the rack +# application that the request would be forwarded to. +# +# pkg:gem/rack#lib/rack/utils.rb:563 +class Rack::Utils::Context + # pkg:gem/rack#lib/rack/utils.rb:566 + def initialize(app_f, app_r); end + + # pkg:gem/rack#lib/rack/utils.rb:564 + def app; end + + # pkg:gem/rack#lib/rack/utils.rb:571 + def call(env); end + + # pkg:gem/rack#lib/rack/utils.rb:579 + def context(env, app = T.unsafe(nil)); end + + # pkg:gem/rack#lib/rack/utils.rb:564 + def for; end + + # pkg:gem/rack#lib/rack/utils.rb:575 + def recontext(app); end +end + +# pkg:gem/rack#lib/rack/utils.rb:24 +Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# Every standard HTTP code mapped to the appropriate message. +# Generated with: +# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv \ +# | ruby -rcsv -e "puts CSV.parse(STDIN, headers: true) \ +# .reject {|v| v['Description'] == 'Unassigned' or v['Description'].include? '(' } \ +# .map {|v| %Q/#{v['Value']} => '#{v['Description']}'/ }.join(','+?\n)" +# +# pkg:gem/rack#lib/rack/utils.rb:590 +Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/utils.rb:22 +Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError + +# pkg:gem/rack#lib/rack/utils.rb:26 +Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params + +# pkg:gem/rack#lib/rack/utils.rb:707 +Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String) + +# pkg:gem/rack#lib/rack/utils.rb:660 +Rack::Utils::OBSOLETE_SYMBOLS_TO_STATUS_CODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/utils.rb:668 +Rack::Utils::OBSOLETE_SYMBOL_MAPPINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/utils.rb:690 +Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/utils.rb:21 +Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError + +# pkg:gem/rack#lib/rack/utils.rb:23 +Rack::Utils::ParamsTooDeepError = Rack::QueryParser::QueryLimitError + +# Responses with HTTP status codes that should not have an entity body +# +# pkg:gem/rack#lib/rack/utils.rb:654 +Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/utils.rb:656 +Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rack#lib/rack/utils.rb:27 +Rack::Utils::URI_PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser) + +# A valid cookie key according to RFC6265 and RFC2616. +# A can be any US-ASCII characters, except control characters, spaces, or tabs. It also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }. +# +# pkg:gem/rack#lib/rack/utils.rb:353 +Rack::Utils::VALID_COOKIE_KEY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rack#lib/rack/version.rb:9 +Rack::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rackup@2.3.1.rbi b/sorbet/rbi/gems/rackup@2.3.1.rbi new file mode 100644 index 0000000..f556867 --- /dev/null +++ b/sorbet/rbi/gems/rackup@2.3.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rackup` gem. +# Please instead update this file by running `bin/tapioca gem rackup`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi b/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi new file mode 100644 index 0000000..6fa5a76 --- /dev/null +++ b/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi @@ -0,0 +1,517 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rails-dom-testing` gem. +# Please instead update this file by running `bin/tapioca gem rails-dom-testing`. + + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:3 +module Rails; end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:4 +module Rails::Dom; end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:5 +module Rails::Dom::Testing + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:12 + def default_html_version; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:12 + def default_html_version=(val); end + + class << self + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:12 + def default_html_version; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:12 + def default_html_version=(val); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:15 + def html5_support?; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:19 + def html_document(html_version: T.unsafe(nil)); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:26 + def html_document_fragment(html_version: T.unsafe(nil)); end + + private + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing.rb:34 + def choose_html_parser(parser_classes, html_version: T.unsafe(nil)); end + end +end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:6 +module Rails::Dom::Testing::Assertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions +end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:7 +module Rails::Dom::Testing::Assertions::DomAssertions + # \Test two HTML strings for equivalency (e.g., equal even when attributes are in another order) + # + # # assert that the referenced method generates the appropriate HTML string + # assert_dom_equal( + # 'Apples', + # link_to("Apples", "http://www.example.com"), + # ) + # + # By default, the matcher will not pay attention to whitespace in text nodes (e.g., spaces + # and newlines). If you want stricter matching with exact matching for whitespace, pass + # strict: true: + # + # # these assertions will both pass + # assert_dom_equal "
    \nfoo\n\
    ", "
    foo
    ", strict: false + # assert_dom_not_equal "
    \nfoo\n\
    ", "
    foo
    ", strict: true + # + # The DOMs are created using an HTML parser specified by + # Rails::Dom::Testing.default_html_version (either :html4 or :html5). + # + # When testing in a Rails application, the parser default can also be set by setting + # +Rails.application.config.dom_testing_default_html_version+. + # + # If you want to specify the HTML parser just for a particular assertion, pass + # html_version: :html4 or html_version: :html5 keyword arguments: + # + # assert_dom_equal expected, actual, html_version: :html5 + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:35 + def assert_dom_equal(expected, actual, message = T.unsafe(nil), strict: T.unsafe(nil), html_version: T.unsafe(nil)); end + + # The negated form of +assert_dom_equal+. + # + # # assert that the referenced method does not generate the specified HTML string + # assert_dom_not_equal( + # 'Apples', + # link_to("Oranges", "http://www.example.com"), + # ) + # + # By default, the matcher will not pay attention to whitespace in text nodes (e.g., spaces + # and newlines). If you want stricter matching with exact matching for whitespace, pass + # strict: true: + # + # # these assertions will both pass + # assert_dom_equal "
    \nfoo\n\
    ", "
    foo
    ", strict: false + # assert_dom_not_equal "
    \nfoo\n\
    ", "
    foo
    ", strict: true + # + # The DOMs are created using an HTML parser specified by + # Rails::Dom::Testing.default_html_version (either :html4 or :html5). + # + # When testing in a Rails application, the parser default can also be set by setting + # +Rails.application.config.dom_testing_default_html_version+. + # + # If you want to specify the HTML parser just for a particular assertion, pass + # html_version: :html4 or html_version: :html5 keyword arguments: + # + # assert_dom_not_equal expected, actual, html_version: :html5 + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:68 + def assert_dom_not_equal(expected, actual, message = T.unsafe(nil), strict: T.unsafe(nil), html_version: T.unsafe(nil)); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:73 + def refute_dom_equal(expected, actual, message = T.unsafe(nil), strict: T.unsafe(nil), html_version: T.unsafe(nil)); end + + protected + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:76 + def compare_doms(expected, actual, strict); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:129 + def equal_attribute?(attr, other_attr); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:116 + def equal_attribute_nodes?(nodes, other_nodes); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:108 + def equal_child?(child, other_child, strict); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:96 + def equal_children?(child, other_child, strict); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:88 + def extract_children(node, strict); end + + private + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/dom_assertions.rb:134 + def fragment(text, html_version: T.unsafe(nil)); end +end + +# Adds the +assert_dom+ method for use in Rails functional +# test cases, which can be used to make assertions on the response HTML of a controller +# action. You can also call +assert_dom+ within another +assert_dom+ to +# make assertions on elements selected by the enclosing assertion. +# +# Use +css_select+ to select elements without making an assertions, either +# from the response HTML or elements selected by the enclosing assertion. +# +# In addition to HTML responses, you can make the following assertions: +# +# * +assert_dom_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions. +# * +assert_dom_email+ - Assertions on the HTML body of an e-mail. +# +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:7 +module Rails::Dom::Testing::Assertions::SelectorAssertions + # An assertion that selects elements and makes one or more equality tests. + # + # If the first argument is an element, selects all matching elements + # starting from (and including) that element and all its children in + # depth-first order. + # + # If no element is specified +assert_dom+ selects from + # the element returned in +document_root_element+ + # unless +assert_dom+ is called from within an +assert_dom+ block. + # Override +document_root_element+ to tell +assert_dom+ what to select from. + # The default implementation raises an exception explaining this. + # + # When called with a block +assert_dom+ passes an array of selected elements + # to the block. Calling +assert_dom+ from the block, with no element specified, + # runs the assertion on the complete set of elements selected by the enclosing assertion. + # Alternatively the array may be iterated through so that +assert_dom+ can be called + # separately for each element. + # + # + # ==== Example + # If the response contains two ordered lists, each with four list elements then: + # assert_dom "ol" do |elements| + # elements.each do |element| + # assert_dom element, "li", 4 + # end + # end + # + # will pass, as will: + # assert_dom "ol" do + # assert_dom "li", 8 + # end + # + # The selector may be a CSS selector expression (String, Symbol, or Numeric) or an expression + # with substitution values (Array). + # Substitution uses a custom pseudo class match. Pass in whatever attribute you want to match (enclosed in quotes) and a ? for the substitution. + # assert_dom returns nil if called with an invalid css selector. + # + # assert_dom "div:match('id', ?)", "id_string" + # assert_dom "div:match('id', ?)", :id_string + # assert_dom "div:match('id', ?)", 1 + # assert_dom "div:match('id', ?)", /\d+/ + # + # === Equality Tests + # + # The equality test may be one of the following: + # * true - Assertion is true if at least one element selected. + # * false - Assertion is true if no element selected. + # * String/Regexp - Assertion is true if the text value of at least + # one element matches the string or regular expression. + # * Integer - Assertion is true if exactly that number of + # elements are selected. + # * Range - Assertion is true if the number of selected + # elements fit the range. + # If no equality test specified, the assertion is true if at least one + # element selected. + # + # To perform more than one equality tests, use a hash with the following keys: + # * :text - Narrow the selection to elements that have this text + # value (string or regexp). + # * :html - Narrow the selection to elements that have this HTML + # content (string or regexp). + # * :count - Assertion is true if the number of selected elements + # is equal to this value. + # * :minimum - Assertion is true if the number of selected + # elements is at least this value. + # * :maximum - Assertion is true if the number of selected + # elements is at most this value. + # + # If the method is called with a block, once all equality tests are + # evaluated the block is called with an array of all matched elements. + # + # # At least one form element + # assert_dom "form" + # + # # Form element includes four input fields + # assert_dom "form input", 4 + # + # # Page title is "Welcome" + # assert_dom "title", "Welcome" + # + # # Page title is "Welcome" and there is only one title element + # assert_dom "title", {count: 1, text: "Welcome"}, + # "Wrong title or more than one title element" + # + # # Page contains no forms + # assert_dom "form", false, "This page must contain no forms" + # + # # Test the content and style + # assert_dom "body div.header ul.menu" + # + # # Use substitution values + # assert_dom "ol>li:match('id', ?)", /item-\d+/ + # + # # All input fields in the form have a name + # assert_dom "form input" do + # assert_dom ":match('name', ?)", /.+/ # Not empty + # end + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:163 + def assert_dom(*args, &block); end + + # Extracts the body of an email and runs nested assertions on it. + # + # You must enable deliveries for this assertion to work, use: + # ActionMailer::Base.perform_deliveries = true + # + # Example usage: + # + # assert_dom_email do + # assert_dom "h1", "Email alert" + # end + # + # assert_dom_email do + # items = assert_dom "ol>li" + # items.each do + # # Work with items here... + # end + # end + # + # The DOM is created using an HTML parser specified by + # Rails::Dom::Testing.default_html_version (either :html4 or :html5). + # + # When testing in a Rails application, the parser default can also be set by setting + # +Rails.application.config.dom_testing_default_html_version+. + # + # If you want to specify the HTML parser just for a particular assertion, pass + # html_version: :html4 or html_version: :html5 keyword arguments: + # + # assert_dom_email(html_version: :html5) do + # assert_dom "h1", "Email alert" + # end + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:318 + def assert_dom_email(html_version: T.unsafe(nil), &block); end + + # Extracts the content of an element, treats it as encoded HTML and runs + # nested assertion on it. + # + # You typically call this method within another assertion to operate on + # all currently selected elements. You can also pass an element or array + # of elements. + # + # The content of each element is un-encoded, and wrapped in the root + # element +encoded+. It then calls the block with all un-encoded elements. + # + # # Selects all bold tags from within the title of an Atom feed's entries (perhaps to nab a section name prefix) + # assert_dom "feed[xmlns='http://www.w3.org/2005/Atom']" do + # # Select each entry item and then the title item + # assert_dom "entry>title" do + # # Run assertions on the encoded title elements + # assert_dom_encoded do + # assert_dom "b" + # end + # end + # end + # + # + # # Selects all paragraph tags from within the description of an RSS feed + # assert_dom "rss[version=2.0]" do + # # Select description element of each feed item. + # assert_dom "channel>item>description" do + # # Run assertions on the encoded elements. + # assert_dom_encoded do + # assert_dom "p" + # end + # end + # end + # + # The DOM is created using an HTML parser specified by + # Rails::Dom::Testing.default_html_version (either :html4 or :html5). + # + # When testing in a Rails application, the parser default can also be set by setting + # +Rails.application.config.dom_testing_default_html_version+. + # + # If you want to specify the HTML parser just for a particular assertion, pass + # html_version: :html4 or html_version: :html5 keyword arguments: + # + # assert_dom "feed[xmlns='http://www.w3.org/2005/Atom']" do + # assert_dom "entry>title" do + # assert_dom_encoded(html_version: :html5) do + # assert_dom "b" + # end + # end + # end + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:265 + def assert_dom_encoded(element = T.unsafe(nil), html_version: T.unsafe(nil), &block); end + + # The negated form of +assert_dom+. + # + # === Equality Tests + # + # Supports the same equality tests as +assert_dom+ except for: + # * true + # * false + # * Integer + # * Range + # * :count + # * :minimum + # * :maximum + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:183 + def assert_not_dom(*args, &block); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:190 + def assert_not_select(*args, &block); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:169 + def assert_select(*args, &block); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:331 + def assert_select_email(html_version: T.unsafe(nil), &block); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:285 + def assert_select_encoded(element = T.unsafe(nil), html_version: T.unsafe(nil), &block); end + + # Select and return all matching elements. + # + # If called with a single argument, uses that argument as a selector. + # Called without an element +css_select+ selects from + # the element returned in +document_root_element+ + # + # The default implementation of +document_root_element+ raises an exception explaining this. + # + # Returns an empty Nokogiri::XML::NodeSet if no match is found. + # + # If called with two arguments, uses the first argument as the root + # element and the second argument as the selector. Attempts to match the + # root element and any of its children. + # Returns an empty Nokogiri::XML::NodeSet if no match is found. + # + # The selector may be a CSS selector expression (String). + # css_select returns nil if called with an invalid css selector. + # + # # Selects all div tags + # divs = css_select("div") + # + # # Selects all paragraph tags and does something interesting + # pars = css_select("p") + # pars.each do |par| + # # Do something fun with paragraphs here... + # end + # + # # Selects all list items in unordered lists + # items = css_select("ul>li") + # + # # Selects all form tags and then all inputs inside the form + # forms = css_select("form") + # forms.each do |form| + # inputs = css_select(form, "input") + # ... + # end + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:58 + def css_select(*args); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:189 + def refute_dom(*args, &block); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:191 + def refute_select(*args, &block); end + + private + + # +equals+ must contain :minimum, :maximum and :count keys + # + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:340 + def assert_size_match!(size, equals, css_selector, message = T.unsafe(nil)); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:352 + def count_description(min, max, count); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:334 + def document_root_element; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:193 + def dom_assertions(selector, &block); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:368 + def nest_selection(selection); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:377 + def nodeset(node); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions.rb:364 + def pluralize_element(quantity); end +end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:12 +class Rails::Dom::Testing::Assertions::SelectorAssertions::HTMLSelector + include ::Minitest::Assertions + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:17 + def initialize(values, previous_selection = T.unsafe(nil), refute: T.unsafe(nil), &root_fallback); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:46 + def context; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:13 + def css_selector; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:13 + def message; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:39 + def select; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:33 + def selecting_no_body?; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:13 + def tests; end + + private + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:146 + def collapse_html_whitespace!(text); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:102 + def extract_equality_tests(refute); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:74 + def extract_root(previous_selection, root_fallback); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:91 + def extract_selectors; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:48 + def filter(matches); end + + class << self + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:46 + def context; end + end +end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:44 +Rails::Dom::Testing::Assertions::SelectorAssertions::HTMLSelector::NO_STRIP = T.let(T.unsafe(nil), Array) + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:8 +class Rails::Dom::Testing::Assertions::SelectorAssertions::SubstitutionContext + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:9 + def initialize; end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:20 + def match(matches, attribute, matcher); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:13 + def substitute!(selector, values, format_for_presentation = T.unsafe(nil)); end + + private + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:25 + def matcher_for(value, format_for_presentation); end + + # pkg:gem/rails-dom-testing#lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb:36 + def substitutable?(value); end +end + +# pkg:gem/rails-dom-testing#lib/rails/dom/testing/railtie.rb:6 +class Rails::Dom::Testing::Railtie < ::Rails::Railtie; end diff --git a/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi b/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi new file mode 100644 index 0000000..0d719d5 --- /dev/null +++ b/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi @@ -0,0 +1,620 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rails-html-sanitizer` gem. +# Please instead update this file by running `bin/tapioca gem rails-html-sanitizer`. + + +# pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:14 +module ActionView; end + +# pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:15 +module ActionView::Helpers + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end + +# pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:16 +module ActionView::Helpers::SanitizeHelper + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end + +# pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:17 +module ActionView::Helpers::SanitizeHelper::ClassMethods + # Replaces the allowed HTML attributes for the +sanitize+ helper. + # + # class Application < Rails::Application + # config.action_view.sanitized_allowed_attributes = ['onclick', 'longdesc'] + # end + # + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:34 + def sanitized_allowed_attributes=(attributes); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_allowed_css_keywords; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_allowed_css_keywords=(_); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_allowed_css_properties; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_allowed_css_properties=(_); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_allowed_protocols; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_allowed_protocols=(_); end + + # Replaces the allowed tags for the +sanitize+ helper. + # + # class Application < Rails::Application + # config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td' + # end + # + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:24 + def sanitized_allowed_tags=(tags); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_bad_tags; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_bad_tags=(_); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_protocol_separator; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_protocol_separator=(_); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_shorthand_css_properties; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_shorthand_css_properties=(_); end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:47 + def sanitized_uri_attributes; end + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:48 + def sanitized_uri_attributes=(_); end + + private + + # pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:52 + def deprecate_option(name); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer/version.rb:3 +module Rails; end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer/version.rb:4 +module Rails::HTML; end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:198 +module Rails::HTML4; end + +# == Rails::HTML4::FullSanitizer +# +# Removes all tags from HTML4 but strips out scripts, forms and comments. +# +# full_sanitizer = Rails::HTML4::FullSanitizer.new +# full_sanitizer.sanitize("Bold no more! See more here...") +# # => "Bold no more! See more here..." +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:229 +class Rails::HTML4::FullSanitizer < ::Rails::HTML::Sanitizer + include ::Rails::HTML::Concern::ComposedSanitize + include ::Rails::HTML::Concern::Parser::HTML4 + include ::Rails::HTML::Concern::Scrubber::Full + include ::Rails::HTML::Concern::Serializer::UTF8Encode +end + +# == Rails::HTML4::LinkSanitizer +# +# Removes +a+ tags and +href+ attributes from HTML4 leaving only the link text. +# +# link_sanitizer = Rails::HTML4::LinkSanitizer.new +# link_sanitizer.sanitize('Only the link text will be kept.') +# # => "Only the link text will be kept." +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:244 +class Rails::HTML4::LinkSanitizer < ::Rails::HTML::Sanitizer + include ::Rails::HTML::Concern::ComposedSanitize + include ::Rails::HTML::Concern::Parser::HTML4 + include ::Rails::HTML::Concern::Scrubber::Link + include ::Rails::HTML::Concern::Serializer::UTF8Encode +end + +# == Rails::HTML4::SafeListSanitizer +# +# Sanitizes HTML4 and CSS from an extensive safe list. +# +# === Whitespace +# +# We can't make any guarantees about whitespace being kept or stripped. Loofah uses Nokogiri, +# which wraps either a C or Java parser for the respective Ruby implementation. Those two +# parsers determine how whitespace is ultimately handled. +# +# When the stripped markup will be rendered the users browser won't take whitespace into account +# anyway. It might be better to suggest your users wrap their whitespace sensitive content in +# pre tags or that you do so automatically. +# +# === Options +# +# Sanitizes both html and css via the safe lists found in +# Rails::HTML::Concern::Scrubber::SafeList +# +# SafeListSanitizer also accepts options to configure the safe list used when sanitizing html. +# There's a class level option: +# +# Rails::HTML4::SafeListSanitizer.allowed_tags = %w(table tr td) +# Rails::HTML4::SafeListSanitizer.allowed_attributes = %w(id class style) +# +# Tags and attributes can also be passed to +sanitize+. Passed options take precedence over the +# class level options. +# +# === Examples +# +# safe_list_sanitizer = Rails::HTML4::SafeListSanitizer.new +# +# # default: sanitize via a extensive safe list of allowed elements +# safe_list_sanitizer.sanitize(@article.body) +# +# # sanitize via the supplied tags and attributes +# safe_list_sanitizer.sanitize( +# @article.body, +# tags: %w(table tr td), +# attributes: %w(id class style), +# ) +# +# # sanitize via a custom Loofah scrubber +# safe_list_sanitizer.sanitize(@article.body, scrubber: ArticleScrubber.new) +# +# # prune nodes from the tree instead of stripping tags and leaving inner content +# safe_list_sanitizer = Rails::HTML4::SafeListSanitizer.new(prune: true) +# +# # the sanitizer can also sanitize CSS +# safe_list_sanitizer.sanitize_css('background-color: #000;') +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:302 +class Rails::HTML4::SafeListSanitizer < ::Rails::HTML::Sanitizer + include ::Rails::HTML::Concern::ComposedSanitize + include ::Rails::HTML::Concern::Parser::HTML4 + include ::Rails::HTML::Concern::Scrubber::SafeList + include ::Rails::HTML::Concern::Serializer::UTF8Encode + + class << self + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:149 + def allowed_attributes; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:149 + def allowed_attributes=(_arg0); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:148 + def allowed_tags; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:148 + def allowed_tags=(_arg0); end + end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:199 +module Rails::HTML4::Sanitizer + extend ::Rails::HTML4::Sanitizer::VendorMethods +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:200 +module Rails::HTML4::Sanitizer::VendorMethods + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:201 + def full_sanitizer; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:205 + def link_sanitizer; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:209 + def safe_list_sanitizer; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:213 + def white_list_sanitizer; end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:310 +module Rails::HTML5; end + +# == Rails::HTML5::FullSanitizer +# +# Removes all tags from HTML5 but strips out scripts, forms and comments. +# +# full_sanitizer = Rails::HTML5::FullSanitizer.new +# full_sanitizer.sanitize("Bold no more! See more here...") +# # => "Bold no more! See more here..." +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:339 +class Rails::HTML5::FullSanitizer < ::Rails::HTML::Sanitizer + include ::Rails::HTML::Concern::ComposedSanitize + include ::Rails::HTML::Concern::Parser::HTML5 + include ::Rails::HTML::Concern::Scrubber::Full + include ::Rails::HTML::Concern::Serializer::UTF8Encode +end + +# == Rails::HTML5::LinkSanitizer +# +# Removes +a+ tags and +href+ attributes from HTML5 leaving only the link text. +# +# link_sanitizer = Rails::HTML5::LinkSanitizer.new +# link_sanitizer.sanitize('Only the link text will be kept.') +# # => "Only the link text will be kept." +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:354 +class Rails::HTML5::LinkSanitizer < ::Rails::HTML::Sanitizer + include ::Rails::HTML::Concern::ComposedSanitize + include ::Rails::HTML::Concern::Parser::HTML5 + include ::Rails::HTML::Concern::Scrubber::Link + include ::Rails::HTML::Concern::Serializer::UTF8Encode +end + +# == Rails::HTML5::SafeListSanitizer +# +# Sanitizes HTML5 and CSS from an extensive safe list. +# +# === Whitespace +# +# We can't make any guarantees about whitespace being kept or stripped. Loofah uses Nokogiri, +# which wraps either a C or Java parser for the respective Ruby implementation. Those two +# parsers determine how whitespace is ultimately handled. +# +# When the stripped markup will be rendered the users browser won't take whitespace into account +# anyway. It might be better to suggest your users wrap their whitespace sensitive content in +# pre tags or that you do so automatically. +# +# === Options +# +# Sanitizes both html and css via the safe lists found in +# Rails::HTML::Concern::Scrubber::SafeList +# +# SafeListSanitizer also accepts options to configure the safe list used when sanitizing html. +# There's a class level option: +# +# Rails::HTML5::SafeListSanitizer.allowed_tags = %w(table tr td) +# Rails::HTML5::SafeListSanitizer.allowed_attributes = %w(id class style) +# +# Tags and attributes can also be passed to +sanitize+. Passed options take precedence over the +# class level options. +# +# === Examples +# +# safe_list_sanitizer = Rails::HTML5::SafeListSanitizer.new +# +# # default: sanitize via a extensive safe list of allowed elements +# safe_list_sanitizer.sanitize(@article.body) +# +# # sanitize via the supplied tags and attributes +# safe_list_sanitizer.sanitize( +# @article.body, +# tags: %w(table tr td), +# attributes: %w(id class style), +# ) +# +# # sanitize via a custom Loofah scrubber +# safe_list_sanitizer.sanitize(@article.body, scrubber: ArticleScrubber.new) +# +# # prune nodes from the tree instead of stripping tags and leaving inner content +# safe_list_sanitizer = Rails::HTML5::SafeListSanitizer.new(prune: true) +# +# # the sanitizer can also sanitize CSS +# safe_list_sanitizer.sanitize_css('background-color: #000;') +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:412 +class Rails::HTML5::SafeListSanitizer < ::Rails::HTML::Sanitizer + include ::Rails::HTML::Concern::ComposedSanitize + include ::Rails::HTML::Concern::Parser::HTML5 + include ::Rails::HTML::Concern::Scrubber::SafeList + include ::Rails::HTML::Concern::Serializer::UTF8Encode + + class << self + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:149 + def allowed_attributes; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:149 + def allowed_attributes=(_arg0); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:148 + def allowed_tags; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:148 + def allowed_tags=(_arg0); end + end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:311 +class Rails::HTML5::Sanitizer + class << self + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:313 + def full_sanitizer; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:317 + def link_sanitizer; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:321 + def safe_list_sanitizer; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:325 + def white_list_sanitizer; end + end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:37 +module Rails::HTML::Concern; end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:38 +module Rails::HTML::Concern::ComposedSanitize + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:39 + def sanitize(html, options = T.unsafe(nil)); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:47 +module Rails::HTML::Concern::Parser; end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:48 +module Rails::HTML::Concern::Parser::HTML4 + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:49 + def parse_fragment(html); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:54 +module Rails::HTML::Concern::Parser::HTML5 + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:55 + def parse_fragment(html); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:61 +module Rails::HTML::Concern::Scrubber; end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:62 +module Rails::HTML::Concern::Scrubber::Full + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:63 + def scrub(fragment, options = T.unsafe(nil)); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:68 +module Rails::HTML::Concern::Scrubber::Link + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:69 + def initialize; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:76 + def scrub(fragment, options = T.unsafe(nil)); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:81 +module Rails::HTML::Concern::Scrubber::SafeList + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:156 + def initialize(prune: T.unsafe(nil)); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:173 + def sanitize_css(style_string); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:160 + def scrub(fragment, options = T.unsafe(nil)); end + + private + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:182 + def allowed_attributes(options); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:178 + def allowed_tags(options); end + + class << self + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:146 + def included(klass); end + end +end + +# The default safe list for attributes +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:130 +Rails::HTML::Concern::Scrubber::SafeList::DEFAULT_ALLOWED_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# The default safe list for tags +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:83 +Rails::HTML::Concern::Scrubber::SafeList::DEFAULT_ALLOWED_TAGS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:188 +module Rails::HTML::Concern::Serializer; end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:189 +module Rails::HTML::Concern::Serializer::UTF8Encode + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:190 + def serialize(fragment); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:422 +Rails::HTML::FullSanitizer = Rails::HTML4::FullSanitizer + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:423 +Rails::HTML::LinkSanitizer = Rails::HTML4::LinkSanitizer + +# === Rails::HTML::PermitScrubber +# +# +Rails::HTML::PermitScrubber+ allows you to permit only your own tags and/or attributes. +# +# +Rails::HTML::PermitScrubber+ can be subclassed to determine: +# - When a node should be skipped via +skip_node?+. +# - When a node is allowed via +allowed_node?+. +# - When an attribute should be scrubbed via +scrub_attribute?+. +# +# Subclasses don't need to worry if tags or attributes are set or not. +# If tags or attributes are not set, Loofah's behavior will be used. +# If you override +allowed_node?+ and no tags are set, it will not be called. +# Instead Loofahs behavior will be used. +# Likewise for +scrub_attribute?+ and attributes respectively. +# +# Text and CDATA nodes are skipped by default. +# Unallowed elements will be stripped, i.e. element is removed but its subtree kept. +# Supplied tags and attributes should be Enumerables. +# +# +tags=+ +# If set, elements excluded will be stripped. +# If not, elements are stripped based on Loofahs +HTML5::Scrub.allowed_element?+. +# +# +attributes=+ +# If set, attributes excluded will be removed. +# If not, attributes are removed based on Loofahs +HTML5::Scrub.scrub_attributes+. +# +# class CommentScrubber < Rails::HTML::PermitScrubber +# def initialize +# super +# self.tags = %w(form script comment blockquote) +# end +# +# def skip_node?(node) +# node.text? +# end +# +# def scrub_attribute?(name) +# name == "style" +# end +# end +# +# See the documentation for +Nokogiri::XML::Node+ to understand what's possible +# with nodes: https://nokogiri.org/rdoc/Nokogiri/XML/Node.html +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:49 +class Rails::HTML::PermitScrubber < ::Loofah::Scrubber + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:52 + def initialize(prune: T.unsafe(nil)); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:50 + def attributes; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:62 + def attributes=(attributes); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:50 + def prune; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:66 + def scrub(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:50 + def tags; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:58 + def tags=(tags); end + + protected + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:83 + def allowed_node?(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:95 + def keep_node?(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:162 + def scrub_attribute(node, attr_node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:91 + def scrub_attribute?(name); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:112 + def scrub_attributes(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:128 + def scrub_css_attribute(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:103 + def scrub_node(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:87 + def skip_node?(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:137 + def validate!(var, name); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:424 +Rails::HTML::SafeListSanitizer = Rails::HTML4::SafeListSanitizer + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer/version.rb:5 +class Rails::HTML::Sanitizer + extend ::Rails::HTML4::Sanitizer::VendorMethods + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:22 + def sanitize(html, options = T.unsafe(nil)); end + + private + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:32 + def properly_encode(fragment, options); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:27 + def remove_xpaths(node, xpaths); end + + class << self + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:17 + def allowed_uri?(uri_string); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:13 + def best_supported_vendor; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:7 + def html5_support?; end + end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer/version.rb:6 +Rails::HTML::Sanitizer::VERSION = T.let(T.unsafe(nil), String) + +# === Rails::HTML::TargetScrubber +# +# Where +Rails::HTML::PermitScrubber+ picks out tags and attributes to permit in +# sanitization, +Rails::HTML::TargetScrubber+ targets them for removal. +# +# +tags=+ +# If set, elements included will be stripped. +# +# +attributes=+ +# If set, attributes included will be removed. +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:195 +class Rails::HTML::TargetScrubber < ::Rails::HTML::PermitScrubber + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:196 + def allowed_node?(node); end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:200 + def scrub_attribute?(name); end +end + +# === Rails::HTML::TextOnlyScrubber +# +# +Rails::HTML::TextOnlyScrubber+ allows you to permit text nodes. +# +# Unallowed elements will be stripped, i.e. element is removed but its subtree kept. +# +# pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:210 +class Rails::HTML::TextOnlyScrubber < ::Loofah::Scrubber + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:211 + def initialize; end + + # pkg:gem/rails-html-sanitizer#lib/rails/html/scrubbers.rb:215 + def scrub(node); end +end + +# pkg:gem/rails-html-sanitizer#lib/rails/html/sanitizer.rb:425 +Rails::HTML::WhiteListSanitizer = Rails::HTML4::SafeListSanitizer + +# pkg:gem/rails-html-sanitizer#lib/rails-html-sanitizer.rb:11 +Rails::Html = Rails::HTML diff --git a/sorbet/rbi/gems/railties@8.1.4.rbi b/sorbet/rbi/gems/railties@8.1.4.rbi new file mode 100644 index 0000000..406ce65 --- /dev/null +++ b/sorbet/rbi/gems/railties@8.1.4.rbi @@ -0,0 +1,3539 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `railties` gem. +# Please instead update this file by running `bin/tapioca gem railties`. + + +# :include: ../README.rdoc +# :enddoc: +# +# pkg:gem/railties#lib/rails/gem_version.rb:3 +module Rails + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::Benchmarkable + + class << self + # pkg:gem/railties#lib/rails.rb:43 + def app_class; end + + # pkg:gem/railties#lib/rails.rb:43 + def app_class=(_arg0); end + + # pkg:gem/railties#lib/rails.rb:44 + def application; end + + # pkg:gem/railties#lib/rails.rb:42 + def application=(_arg0); end + + # Provides access to the application autoloaders. + # + # The autoloader that manages `autoload_paths` is reachable as + # + # Rails.autoloaders.main + # + # This autoloader manages the constants that are reloaded when reloading is + # enabled. + # + # The autoloader that manages `autoload_once_paths` is reachable as + # + # Rails.autoloaders.once + # + # This autoloader manages constants that are autoloaded, but not reloaded. + # + # You can use these objects to customize their behavior, defining custom + # root namespaces, collapsing directories, configuring callbacks, etc. + # + # # config/environments/development.rb + # Rails.autoloaders.main.on_load("MyGateway") do + # MyGateway.endpoint = "https://my-gateway.localhost" + # end + # + # # config/environments/production.rb + # Rails.autoloaders.main.on_load("MyGateway") do + # MyGateway.endpoint = "https://my-gateway.example.com" + # end + # + # The +each+ iterator allows you to iterate over both loaders: + # + # Rails.autoloaders.each do |loader| + # loader.log! + # end + # + # which may be handy if you want to run the same code for both of them. + # + # Indeed, there is a shortcut for that common use case: + # + # Rails.autoloaders.log! + # + # which is handy to watch the activity of the autoloaders. + # + # Finally, +zeitwerk_enabled?+ allows you to check if autoloading is powered + # by Zeitwerk. This predicate returns a hard-coded true since Rails 7, but + # it is still in place for engines that support Rails 6. + # + # The autoloaders are available really early, you can access them in the + # application class body, environment configuration, initializers, etc. + # + # Please check the {Autoloading and Reloading + # Constants}[https://guides.rubyonrails.org/autoloading_and_reloading_constants.html] + # guide and the documentation of {Zeitwerk}[https://github.com/fxn/zeitwerk] + # itself for more details and usage patterns. + # + # pkg:gem/railties#lib/rails.rb:186 + def autoloaders; end + + # pkg:gem/railties#lib/rails.rb:55 + def backtrace_cleaner; end + + # pkg:gem/railties#lib/rails.rb:43 + def cache; end + + # pkg:gem/railties#lib/rails.rb:43 + def cache=(_arg0); end + + # The Configuration instance used to configure the \Rails environment + # + # pkg:gem/railties#lib/rails.rb:51 + def configuration; end + + # pkg:gem/railties#lib/rails/deprecator.rb:4 + def deprecator; end + + # Returns the current \Rails environment. + # + # Rails.env # => "development" + # Rails.env.development? # => true + # Rails.env.production? # => false + # Rails.env.local? # => true true for "development" and "test", false for anything else + # + # pkg:gem/railties#lib/rails.rb:74 + def env; end + + # Sets the \Rails environment. + # + # Rails.env = "staging" # => "staging" + # + # pkg:gem/railties#lib/rails.rb:81 + def env=(environment); end + + # Returns the ActiveSupport::ErrorReporter of the current \Rails project, + # otherwise it returns +nil+ if there is no project. + # + # Rails.error.handle(IOError) do + # # ... + # end + # Rails.error.report(error) + # + # pkg:gem/railties#lib/rails.rb:92 + def error; end + + # Returns the ActiveSupport::EventReporter of the current \Rails project, + # otherwise it returns +nil+ if there is no project. + # + # Rails.event.notify("my_event", { message: "Hello, world!" }) + # + # pkg:gem/railties#lib/rails.rb:100 + def event; end + + # Returns the currently loaded version of \Rails as a +Gem::Version+. + # + # pkg:gem/railties#lib/rails/gem_version.rb:5 + def gem_version; end + + # Returns all \Rails groups for loading based on: + # + # * The \Rails environment; + # * The environment variable RAILS_GROUPS; + # * The optional envs given as argument and the hash with group dependencies; + # + # Rails.groups assets: [:development, :test] + # # => [:default, "development", :assets] for Rails.env == "development" + # # => [:default, "production"] for Rails.env == "production" + # + # pkg:gem/railties#lib/rails.rb:113 + def groups(*groups); end + + # pkg:gem/railties#lib/rails.rb:48 + def initialize!(*, **, &); end + + # pkg:gem/railties#lib/rails.rb:48 + def initialized?(*, **, &); end + + # pkg:gem/railties#lib/rails.rb:43 + def logger; end + + # pkg:gem/railties#lib/rails.rb:43 + def logger=(_arg0); end + + # Returns a Pathname object of the public folder of the current + # \Rails project, otherwise it returns +nil+ if there is no project: + # + # Rails.public_path + # # => # + # + # pkg:gem/railties#lib/rails.rb:129 + def public_path; end + + # Returns a Pathname object of the current \Rails project, + # otherwise it returns +nil+ if there is no project: + # + # Rails.root + # # => # + # + # pkg:gem/railties#lib/rails.rb:64 + def root; end + + # Returns the currently loaded version of \Rails as a string. + # + # pkg:gem/railties#lib/rails/version.rb:7 + def version; end + end +end + +# An Engine with the responsibility of coordinating the whole boot process. +# +# == Initialization +# +# Rails::Application is responsible for executing all railties and engines +# initializers. It also executes some bootstrap initializers (check +# Rails::Application::Bootstrap) and finishing initializers, after all the others +# are executed (check Rails::Application::Finisher). +# +# == \Configuration +# +# Besides providing the same configuration as Rails::Engine and Rails::Railtie, +# the application object has several specific configurations, for example +# +enable_reloading+, +consider_all_requests_local+, +filter_parameters+, +# +logger+, and so forth. +# +# Check Rails::Application::Configuration to see them all. +# +# == Routes +# +# The application object is also responsible for holding the routes and reloading routes +# whenever the files change in development. +# +# == Middlewares +# +# The Application is also responsible for building the middleware stack. +# +# == Booting process +# +# The application is also responsible for setting up and executing the booting +# process. From the moment you require config/application.rb in your app, +# the booting process goes like this: +# +# 1. require "config/boot.rb" to set up load paths. +# 2. +require+ railties and engines. +# 3. Define +Rails.application+ as class MyApp::Application < Rails::Application. +# 4. Run +config.before_configuration+ callbacks. +# 5. Load config/environments/ENV.rb. +# 6. Run +config.before_initialize+ callbacks. +# 7. Run Railtie#initializer defined by railties, engines, and application. +# One by one, each engine sets up its load paths and routes, and runs its config/initializers/* files. +# 8. Custom Railtie#initializers added by railties, engines, and applications are executed. +# 9. Build the middleware stack and run +to_prepare+ callbacks. +# 10. Run +config.before_eager_load+ and +eager_load!+ if +eager_load+ is +true+. +# 11. Run +config.after_initialize+ callbacks. +# +# pkg:gem/railties#lib/rails/application.rb:60 +class Rails::Application < ::Rails::Engine + # pkg:gem/railties#lib/rails/application.rb:107 + def initialize(initial_variable_values = T.unsafe(nil), &block); end + + # pkg:gem/railties#lib/rails/application.rb:98 + def assets; end + + # pkg:gem/railties#lib/rails/application.rb:98 + def assets=(_arg0); end + + # pkg:gem/railties#lib/rails/application.rb:100 + def autoloaders; end + + # pkg:gem/railties#lib/rails/application.rb:556 + def build_middleware_stack; end + + # pkg:gem/railties#lib/rails/application.rb:449 + def config; end + + # pkg:gem/railties#lib/rails/application.rb:453 + def config=(_arg0); end + + # Convenience for loading config/foo.yml for the current \Rails env. + # Example: + # + # # config/exception_notification.yml: + # production: + # url: http://127.0.0.1:8080 + # namespace: my_app_production + # + # development: + # url: http://localhost:3001 + # namespace: my_app_development + # + # + # + # # config/environments/production.rb + # Rails.application.configure do + # config.middleware.use ExceptionNotifier, config_for(:exception_notification) + # end + # + # You can also store configurations in a shared section which will be merged + # with the environment configuration + # + # # config/example.yml + # shared: + # foo: + # bar: + # baz: 1 + # + # development: + # foo: + # bar: + # qux: 2 + # + # + # + # # development environment + # Rails.application.config_for(:example)[:foo][:bar] + # # => { baz: 1, qux: 2 } + # + # pkg:gem/railties#lib/rails/application.rb:286 + def config_for(name, env: T.unsafe(nil)); end + + # Sends any console called in the instance of a new application up + # to the +console+ method defined in Rails::Railtie. + # + # pkg:gem/railties#lib/rails/application.rb:369 + def console(&blk); end + + # Returns an ActiveSupport::EncryptedConfiguration instance for the + # credentials file specified by +config.credentials.content_path+. + # + # By default, +config.credentials.content_path+ will point to either + # config/credentials/#{environment}.yml.enc for the current + # environment (for example, +config/credentials/production.yml.enc+ for the + # +production+ environment), or +config/credentials.yml.enc+ if that file + # does not exist. + # + # The encryption key is taken from either ENV["RAILS_MASTER_KEY"], + # or from the file specified by +config.credentials.key_path+. By default, + # +config.credentials.key_path+ will point to either + # config/credentials/#{environment}.key for the current + # environment, or +config/master.key+ if that file does not exist. + # + # pkg:gem/railties#lib/rails/application.rb:493 + def credentials; end + + # Returns an ActiveSupport::EncryptedConfiguration instance for the + # credentials file specified by +config.credentials.content_path+. + # + # By default, +config.credentials.content_path+ will point to either + # config/credentials/#{environment}.yml.enc for the current + # environment (for example, +config/credentials/production.yml.enc+ for the + # +production+ environment), or +config/credentials.yml.enc+ if that file + # does not exist. + # + # The encryption key is taken from either ENV["RAILS_MASTER_KEY"], + # or from the file specified by +config.credentials.key_path+. By default, + # +config.credentials.key_path+ will point to either + # config/credentials/#{environment}.key for the current + # environment, or +config/master.key+ if that file does not exist. + # + # pkg:gem/railties#lib/rails/application.rb:454 + def credentials=(_arg0); end + + # pkg:gem/railties#lib/rails/application.rb:102 + def default_url_options(*, **, &); end + + # pkg:gem/railties#lib/rails/application.rb:102 + def default_url_options=(arg); end + + # A managed collection of deprecators (ActiveSupport::Deprecation::Deprecators). + # The collection's configuration methods affect all deprecators in the + # collection. Additionally, the collection's +silence+ method silences all + # deprecators in the collection for the duration of a given block. + # + # pkg:gem/railties#lib/rails/application.rb:242 + def deprecators; end + + # Eager loads the application code. + # + # pkg:gem/railties#lib/rails/application.rb:551 + def eager_load!; end + + # Returns an ActiveSupport::EncryptedConfiguration instance for an encrypted + # file. By default, the encryption key is taken from either + # ENV["RAILS_MASTER_KEY"], or from the +config/master.key+ file. + # + # my_config = Rails.application.encrypted("config/my_config.enc") + # + # my_config.read + # # => "foo:\n bar: 123\n" + # + # my_config.foo.bar + # # => 123 + # + # Encrypted files can be edited with the bin/rails encrypted:edit + # command. (See the output of bin/rails encrypted:edit --help for + # more information.) + # + # pkg:gem/railties#lib/rails/application.rb:512 + def encrypted(path, key_path: T.unsafe(nil), env_key: T.unsafe(nil)); end + + # Stores some of the \Rails initial environment parameters which + # will be used by middlewares and engines to configure themselves. + # + # pkg:gem/railties#lib/rails/application.rb:315 + def env_config; end + + # pkg:gem/railties#lib/rails/application.rb:100 + def executor; end + + # Sends any generators called in the instance of a new application up + # to the +generators+ method defined in Rails::Railtie. + # + # pkg:gem/railties#lib/rails/application.rb:375 + def generators(&blk); end + + # pkg:gem/railties#lib/rails/application.rb:525 + def helpers_paths; end + + # Initialize the application passing the given group. By default, the + # group is :default + # + # pkg:gem/railties#lib/rails/application.rb:436 + def initialize!(group = T.unsafe(nil)); end + + # Returns true if the application is initialized. + # + # pkg:gem/railties#lib/rails/application.rb:132 + def initialized?; end + + # Sends the initializers to the +initializer+ method defined in the + # Rails::Initializable module. Each Rails::Application class has its own + # set of initializers, as defined by the Initializable module. + # + # pkg:gem/railties#lib/rails/application.rb:357 + def initializer(name, opts = T.unsafe(nil), &block); end + + # pkg:gem/railties#lib/rails/application.rb:443 + def initializers; end + + # Sends the +isolate_namespace+ method up to the class method. + # + # pkg:gem/railties#lib/rails/application.rb:386 + def isolate_namespace(mod); end + + # Returns a key generator (ActiveSupport::CachingKeyGenerator) for a + # specified +secret_key_base+. The return value is memoized, so additional + # calls with the same +secret_key_base+ will return the same key generator + # instance. + # + # pkg:gem/railties#lib/rails/application.rb:170 + def key_generator(secret_key_base = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/application.rb:545 + def load_generators(app = T.unsafe(nil)); end + + # Returns a message verifier object. + # + # This verifier can be used to generate and verify signed messages in the application. + # + # It is recommended not to use the same verifier for different things, so you can get different + # verifiers passing the +verifier_name+ argument. + # + # For instance, +ActiveStorage::Blob.signed_id_verifier+ is implemented using this feature, which assures that + # the IDs strings haven't been tampered with and are safe to use in a finder. + # + # See the ActiveSupport::MessageVerifier documentation for more information. + # + # ==== Parameters + # + # * +verifier_name+ - the name of the message verifier. + # + # ==== Examples + # + # message = Rails.application.message_verifier('my_purpose').generate('data to sign against tampering') + # Rails.application.message_verifier('my_purpose').verify(message) + # # => 'data to sign against tampering' + # + # pkg:gem/railties#lib/rails/application.rb:234 + def message_verifier(verifier_name); end + + # Returns a message verifier factory (ActiveSupport::MessageVerifiers). This + # factory can be used as a central point to configure and create message + # verifiers (ActiveSupport::MessageVerifier) for your application. + # + # By default, message verifiers created by this factory will generate + # messages using the default ActiveSupport::MessageVerifier options. You can + # override these options with a combination of + # ActiveSupport::MessageVerifiers#clear_rotations and + # ActiveSupport::MessageVerifiers#rotate. However, this must be done prior + # to building any message verifier instances. For example, in a + # +before_initialize+ block: + # + # # Use `url_safe: true` when generating messages + # config.before_initialize do |app| + # app.message_verifiers.clear_rotations + # app.message_verifiers.rotate(url_safe: true) + # end + # + # Message verifiers created by this factory will always use a secret derived + # from #secret_key_base when generating messages. +clear_rotations+ will not + # affect this behavior. However, older +secret_key_base+ values can be + # rotated for verifying messages: + # + # # Fall back to old `secret_key_base` when verifying messages + # config.before_initialize do |app| + # app.message_verifiers.rotate(secret_key_base: "old secret_key_base") + # end + # + # pkg:gem/railties#lib/rails/application.rb:206 + def message_verifiers; end + + # Return an array of railties respecting the order they're loaded + # and the order specified by the +railties_order+ config. + # + # While running initializers we need engines in reverse order here when + # copying migrations from railties ; we need them in the order given by + # +railties_order+. + # + # pkg:gem/railties#lib/rails/application.rb:541 + def migration_railties; end + + # Returns the dasherized application name. + # + # MyApp::Application.new.name => "my-app" + # + # pkg:gem/railties#lib/rails/application.rb:139 + def name; end + + # If you try to define a set of Rake tasks on the instance, these will get + # passed up to the Rake tasks defined on the application's class. + # + # pkg:gem/railties#lib/rails/application.rb:350 + def rake_tasks(&block); end + + # Reload application routes regardless if they changed or not. + # + # pkg:gem/railties#lib/rails/application.rb:158 + def reload_routes!; end + + # pkg:gem/railties#lib/rails/application.rb:162 + def reload_routes_unless_loaded; end + + # pkg:gem/railties#lib/rails/application.rb:100 + def reloader; end + + # pkg:gem/railties#lib/rails/application.rb:100 + def reloaders; end + + # pkg:gem/railties#lib/rails/application.rb:412 + def require_environment!; end + + # pkg:gem/railties#lib/rails/application.rb:417 + def routes_reloader; end + + # pkg:gem/railties#lib/rails/application.rb:143 + def run_load_hooks!; end + + # Sends any runner called in the instance of a new application up + # to the +runner+ method defined in Rails::Railtie. + # + # pkg:gem/railties#lib/rails/application.rb:363 + def runner(&blk); end + + # pkg:gem/railties#lib/rails/application.rb:98 + def sandbox; end + + # pkg:gem/railties#lib/rails/application.rb:98 + def sandbox=(_arg0); end + + # pkg:gem/railties#lib/rails/application.rb:99 + def sandbox?; end + + # The secret_key_base is used as the input secret to the application's key generator, which in turn + # is used to create all ActiveSupport::MessageVerifier and ActiveSupport::MessageEncryptor instances, + # including the ones that sign and encrypt cookies. + # + # We look for it first in ENV["SECRET_KEY_BASE"], then in + # +credentials.secret_key_base+. For most applications, the correct place + # to store it is in the encrypted credentials file. + # + # In development and test, if the secret_key_base is still empty, it is + # randomly generated and stored in a temporary file in + # tmp/local_secret.txt. + # + # Generating a random secret_key_base and storing it in + # tmp/local_secret.txt can also be triggered by setting + # ENV["SECRET_KEY_BASE_DUMMY"]. This is useful when precompiling + # assets for production as part of a build step that otherwise does not + # need access to the production secrets. + # + # Dockerfile example: RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile. + # + # pkg:gem/railties#lib/rails/application.rb:475 + def secret_key_base; end + + # Sends any server called in the instance of a new application up + # to the +server+ method defined in Rails::Railtie. + # + # pkg:gem/railties#lib/rails/application.rb:381 + def server(&blk); end + + # pkg:gem/railties#lib/rails/application.rb:521 + def to_app; end + + # Returns an array of file paths appended with a hash of + # directories-extensions suitable for ActiveSupport::FileUpdateChecker + # API. + # + # pkg:gem/railties#lib/rails/application.rb:424 + def watchable_args; end + + protected + + # pkg:gem/railties#lib/rails/application.rb:624 + def default_middleware_stack; end + + # pkg:gem/railties#lib/rails/application.rb:629 + def ensure_generator_templates_added; end + + # Returns the ordered railties for this application considering railties_order. + # + # pkg:gem/railties#lib/rails/application.rb:590 + def ordered_railties; end + + # pkg:gem/railties#lib/rails/application.rb:612 + def railties_initializers(current); end + + # pkg:gem/railties#lib/rails/application.rb:579 + def run_console_blocks(app); end + + # pkg:gem/railties#lib/rails/application.rb:569 + def run_generators_blocks(app); end + + # pkg:gem/railties#lib/rails/application.rb:574 + def run_runner_blocks(app); end + + # pkg:gem/railties#lib/rails/application.rb:584 + def run_server_blocks(app); end + + # pkg:gem/railties#lib/rails/application.rb:558 + def run_tasks_blocks(app); end + + private + + # pkg:gem/railties#lib/rails/application.rb:642 + def build_middleware; end + + # pkg:gem/railties#lib/rails/application.rb:635 + def build_request(env); end + + # pkg:gem/railties#lib/rails/application.rb:646 + def coerce_same_site_protection(protection); end + + # pkg:gem/railties#lib/rails/application.rb:650 + def filter_parameters; end + + class << self + # This method is called just after an application inherits from Rails::Application, + # allowing the developer to load classes in lib and use them during application + # configuration. + # + # class MyApplication < Rails::Application + # require "my_backend" # in lib/my_backend + # config.i18n.backend = MyBackend + # end + # + # Notice this method takes into consideration the default root path. So if you + # are changing config.root inside your application definition or having a custom + # Rails application, you will need to add lib to $LOAD_PATH on your own in case + # you need to load files in lib/ during the application configuration as well. + # + # pkg:gem/railties#lib/rails/application.rb:405 + def add_lib_to_load_path!(root); end + + # pkg:gem/railties#lib/rails/application.rb:82 + def create(initial_variable_values = T.unsafe(nil), &block); end + + # pkg:gem/railties#lib/rails/application.rb:86 + def find_root(from); end + + # pkg:gem/railties#lib/rails/application.rb:69 + def inherited(base); end + + # pkg:gem/railties#lib/rails/application.rb:78 + def instance; end + + # pkg:gem/railties#lib/rails/application.rb:95 + def new(*_arg0); end + end +end + +# pkg:gem/railties#lib/rails/application/bootstrap.rb:10 +module Rails::Application::Bootstrap + include ::Rails::Initializable + extend ::Rails::Initializable::ClassMethods +end + +# pkg:gem/railties#lib/rails/application/configuration.rb:13 +class Rails::Application::Configuration < ::Rails::Engine::Configuration + # pkg:gem/railties#lib/rails/application/configuration.rb:31 + def initialize(*); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def add_autoload_paths_to_load_path; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def add_autoload_paths_to_load_path=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def allow_concurrency; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def allow_concurrency=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:582 + def annotations; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:29 + def api_only; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:395 + def api_only=(value); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def asset_host; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def asset_host=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def assume_ssl; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def assume_ssl=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def autoflush_log; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def autoflush_log=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:490 + def autoload_lib(ignore:); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:502 + def autoload_lib_once(ignore:); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def beginning_of_week; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def beginning_of_week=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:407 + def broadcast_log_level; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def cache_classes; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def cache_classes=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def cache_store; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def cache_store=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:514 + def colorize_logging; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:518 + def colorize_logging=(val); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def consider_all_requests_local; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def consider_all_requests_local=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def console; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def console=(_arg0); end + + # Configures the ActionDispatch::ContentSecurityPolicy. + # + # pkg:gem/railties#lib/rails/application/configuration.rb:587 + def content_security_policy(&block); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_nonce_auto; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_nonce_auto=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_nonce_directives; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_nonce_directives=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_nonce_generator; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_nonce_generator=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_report_only; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def content_security_policy_report_only=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def credentials; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def credentials=(_arg0); end + + # Loads and returns the entire raw configuration of database from + # values stored in config/database.yml. + # + # pkg:gem/railties#lib/rails/application/configuration.rb:453 + def database_configuration; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:409 + def debug_exception_response_format; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:413 + def debug_exception_response_format=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:604 + def default_log_file; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def disable_sandbox; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def disable_sandbox=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def dom_testing_default_html_version; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def dom_testing_default_html_version=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def eager_load; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def eager_load=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:379 + def enable_reloading; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:383 + def enable_reloading=(value); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:29 + def encoding; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:387 + def encoding=(value); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def exceptions_app; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def exceptions_app=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def file_watcher; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def file_watcher=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def filter_parameters; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def filter_parameters=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def filter_redirect; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def filter_redirect=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def force_ssl; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def force_ssl=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def helpers_paths; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def helpers_paths=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def host_authorization; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def host_authorization=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def hosts; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def hosts=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:616 + def inspect; end + + # Load the config/database.yml to create the Rake tasks for + # multiple databases without loading the environment and filling in the + # environment specific configuration values. + # + # Do not use this method, use #database_configuration instead. + # + # pkg:gem/railties#lib/rails/application/configuration.rb:435 + def load_database_yaml; end + + # Loads default configuration values for a target version. This includes + # defaults for versions prior to the target version. See the + # {configuration guide}[https://guides.rubyonrails.org/configuring.html#versioned-default-values] + # for the default values associated with a particular version. + # + # pkg:gem/railties#lib/rails/application/configuration.rb:94 + def load_defaults(target_version); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:29 + def loaded_config_version; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def log_file_size; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def log_file_size=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def log_formatter; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def log_formatter=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:29 + def log_level; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:402 + def log_level=(level); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def log_tags; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def log_tags=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def logger; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def logger=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:415 + def paths; end + + # Configures the ActionDispatch::PermissionsPolicy. + # + # pkg:gem/railties#lib/rails/application/configuration.rb:596 + def permissions_policy(&block); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def precompile_filter_parameters; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def precompile_filter_parameters=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def public_file_server; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def public_file_server=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def railties_order; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def railties_order=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def rake_eager_load; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def rake_eager_load=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def relative_url_root; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def relative_url_root=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def reload_classes_only_on_change; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def reload_classes_only_on_change=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:375 + def reloading_enabled?; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def require_master_key; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def require_master_key=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def sandbox_by_default; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def sandbox_by_default=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:523 + def secret_key_base; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:535 + def secret_key_base=(new_secret_key_base); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def server_timing; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def server_timing=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def session_options; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def session_options=(_arg0); end + + # Specifies what class to use to store the session. Possible values + # are +:cache_store+, +:cookie_store+, +:mem_cache_store+, a custom + # store, or +:disabled+. +:disabled+ tells \Rails not to deal with + # sessions. + # + # Additional options will be set as +session_options+: + # + # config.session_store :cookie_store, key: "_your_app_session" + # config.session_options # => {key: "_your_app_session"} + # + # If a custom store is specified as a symbol, it will be resolved to + # the +ActionDispatch::Session+ namespace: + # + # # use ActionDispatch::Session::MyCustomStore as the session store + # config.session_store :my_custom_store + # + # pkg:gem/railties#lib/rails/application/configuration.rb:562 + def session_store(new_session_store = T.unsafe(nil), **options); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:578 + def session_store?; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def silence_healthcheck_path; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def silence_healthcheck_path=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def ssl_options; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def ssl_options=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def time_zone; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def time_zone=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def x; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def x=(_arg0); end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def yjit; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:14 + def yjit=(_arg0); end + + private + + # pkg:gem/railties#lib/rails/application/configuration.rb:643 + def credentials_defaults; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:653 + def generate_local_secret; end +end + +# pkg:gem/railties#lib/rails/application/configuration.rb:620 +class Rails::Application::Configuration::Custom + # pkg:gem/railties#lib/rails/application/configuration.rb:621 + def initialize; end + + # pkg:gem/railties#lib/rails/application/configuration.rb:625 + def method_missing(method, *args); end + + private + + # pkg:gem/railties#lib/rails/application/configuration.rb:637 + def respond_to_missing?(symbol, _); end +end + +# pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:5 +class Rails::Application::DefaultMiddlewareStack + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:8 + def initialize(app, config, paths); end + + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:6 + def app; end + + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:14 + def build_stack; end + + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:6 + def config; end + + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:6 + def paths; end + + private + + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:113 + def load_rack_cache; end + + # pkg:gem/railties#lib/rails/application/default_middleware_stack.rb:135 + def show_exceptions_app; end +end + +# pkg:gem/railties#lib/rails/application/finisher.rb:10 +module Rails::Application::Finisher + include ::Rails::Initializable + extend ::Rails::Initializable::ClassMethods +end + +# pkg:gem/railties#lib/rails/application/finisher.rb:110 +module Rails::Application::Finisher::InterlockHook + class << self + # pkg:gem/railties#lib/rails/application/finisher.rb:115 + def complete(_state); end + + # pkg:gem/railties#lib/rails/application/finisher.rb:111 + def run; end + end +end + +# pkg:gem/railties#lib/rails/application/finisher.rb:96 +class Rails::Application::Finisher::MonitorHook + # pkg:gem/railties#lib/rails/application/finisher.rb:97 + def initialize(monitor = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/application/finisher.rb:105 + def complete(_state); end + + # pkg:gem/railties#lib/rails/application/finisher.rb:101 + def run; end +end + +# pkg:gem/railties#lib/rails/application.rb:104 +Rails::Application::INITIAL_VARIABLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/railties#lib/rails/application/routes_reloader.rb:7 +class Rails::Application::RoutesReloader + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:15 + def initialize(file_watcher: T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:8 + def __callbacks; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:11 + def eager_load; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:11 + def eager_load=(_arg0); end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:43 + def execute; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:13 + def execute_if_updated(*, **, &); end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:50 + def execute_unless_loaded; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:10 + def external_routes; end + + # Returns +true+ if the routes are loaded. + # + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:26 + def loaded; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:10 + def paths; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:30 + def reload!; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:10 + def route_sets; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:12 + def run_once_after_load_paths=(_arg0); end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:13 + def updated?(*, **, &); end + + private + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:92 + def clear!; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:111 + def finalize!; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:99 + def load_paths; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:115 + def revert; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:104 + def run_after_load_paths_callback; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:82 + def updater; end + + class << self + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:8 + def __callbacks; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:8 + def __callbacks=(value); end + + private + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:8 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/application/routes_reloader.rb:8 + def __class_attr___callbacks=(new_value); end + end +end + +# pkg:gem/railties#lib/rails/application_controller.rb:5 +class Rails::ApplicationController < ::ActionController::Base + # pkg:gem/railties#lib/rails/application_controller.rb:9 + def _run_process_action_callbacks(&block); end + + private + + # pkg:gem/railties#lib/rails/application_controller.rb:5 + def _layout(lookup_context, formats, keys); end + + # pkg:gem/railties#lib/rails/application_controller.rb:27 + def disable_content_security_policy_nonce!; end + + # pkg:gem/railties#lib/rails/application_controller.rb:23 + def local_request?; end + + # pkg:gem/railties#lib/rails/application_controller.rb:17 + def require_local!; end + + class << self + private + + # pkg:gem/railties#lib/rails/application_controller.rb:9 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/application_controller.rb:9 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/railties#lib/rails/application_controller.rb:7 + def __class_attr__layout; end + + # pkg:gem/railties#lib/rails/application_controller.rb:7 + def __class_attr__layout=(new_value); end + + # pkg:gem/railties#lib/rails/application_controller.rb:7 + def __class_attr__layout_conditions; end + + # pkg:gem/railties#lib/rails/application_controller.rb:7 + def __class_attr__layout_conditions=(new_value); end + + # pkg:gem/railties#lib/rails/application_controller.rb:5 + def __class_attr_config; end + + # pkg:gem/railties#lib/rails/application_controller.rb:5 + def __class_attr_config=(new_value); end + + # pkg:gem/railties#lib/rails/application_controller.rb:5 + def __class_attr_middleware_stack; end + + # pkg:gem/railties#lib/rails/application_controller.rb:5 + def __class_attr_middleware_stack=(new_value); end + end +end + +# pkg:gem/railties#lib/rails/autoloaders.rb:4 +class Rails::Autoloaders + include ::Enumerable + + # pkg:gem/railties#lib/rails/autoloaders.rb:11 + def initialize; end + + # pkg:gem/railties#lib/rails/autoloaders.rb:31 + def each; end + + # pkg:gem/railties#lib/rails/autoloaders.rb:40 + def log!; end + + # pkg:gem/railties#lib/rails/autoloaders.rb:36 + def logger=(logger); end + + # pkg:gem/railties#lib/rails/autoloaders.rb:9 + def main; end + + # pkg:gem/railties#lib/rails/autoloaders.rb:9 + def once; end + + # pkg:gem/railties#lib/rails/autoloaders.rb:44 + def zeitwerk_enabled?; end +end + +# pkg:gem/railties#lib/rails/autoloaders/inflector.rb:7 +module Rails::Autoloaders::Inflector + class << self + # pkg:gem/railties#lib/rails/autoloaders/inflector.rb:12 + def camelize(basename, _abspath); end + + # pkg:gem/railties#lib/rails/autoloaders/inflector.rb:16 + def inflect(overrides); end + end +end + +# pkg:gem/railties#lib/rails/backtrace_cleaner.rb:7 +class Rails::BacktraceCleaner < ::ActiveSupport::BacktraceCleaner + # pkg:gem/railties#lib/rails/backtrace_cleaner.rb:11 + def initialize; end + + # pkg:gem/railties#lib/rails/backtrace_cleaner.rb:29 + def clean(backtrace, kind = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/backtrace_cleaner.rb:36 + def clean_frame(frame, kind = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/backtrace_cleaner.rb:34 + def filter(backtrace, kind = T.unsafe(nil)); end +end + +# pkg:gem/railties#lib/rails/backtrace_cleaner.rb:8 +Rails::BacktraceCleaner::APP_DIRS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/railties#lib/rails/backtrace_cleaner.rb:9 +Rails::BacktraceCleaner::RENDER_TEMPLATE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/railties#lib/rails/configuration.rb:9 +module Rails::Configuration; end + +# pkg:gem/railties#lib/rails/configuration.rb:104 +class Rails::Configuration::Generators + # pkg:gem/railties#lib/rails/configuration.rb:108 + def initialize; end + + # pkg:gem/railties#lib/rails/configuration.rb:130 + def after_generate(&block); end + + # pkg:gem/railties#lib/rails/configuration.rb:106 + def after_generate_callbacks; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def aliases; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def aliases=(_arg0); end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def api_only; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def api_only=(_arg0); end + + # pkg:gem/railties#lib/rails/configuration.rb:134 + def apply_rubocop_autocorrect_after_generate!; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def colorize_logging; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def colorize_logging=(_arg0); end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def fallbacks; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def fallbacks=(_arg0); end + + # pkg:gem/railties#lib/rails/configuration.rb:106 + def hidden_namespaces; end + + # pkg:gem/railties#lib/rails/configuration.rb:126 + def hide_namespace(namespace); end + + # pkg:gem/railties#lib/rails/configuration.rb:143 + def method_missing(method, *args); end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def options; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def options=(_arg0); end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def templates; end + + # pkg:gem/railties#lib/rails/configuration.rb:105 + def templates=(_arg0); end + + private + + # pkg:gem/railties#lib/rails/configuration.rb:119 + def initialize_copy(source); end +end + +# MiddlewareStackProxy is a proxy for the \Rails middleware stack that allows +# you to configure middlewares in your application. It works basically as a +# command recorder, saving each command to be applied after initialization +# over the default middleware stack, so you can add, swap, or remove any +# middleware in \Rails. +# +# You can add your own middlewares by using the +config.middleware.use+ method: +# +# config.middleware.use Magical::Unicorns +# +# This will put the +Magical::Unicorns+ middleware on the end of the stack. +# You can use +insert_before+ if you wish to add a middleware before another: +# +# config.middleware.insert_before Rack::Head, Magical::Unicorns +# +# There's also +insert_after+ which will insert a middleware after another: +# +# config.middleware.insert_after Rack::Head, Magical::Unicorns +# +# Middlewares can also be completely swapped out and replaced with others: +# +# config.middleware.swap ActionDispatch::Flash, Magical::Unicorns +# +# Middlewares can be moved from one place to another: +# +# config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns +# +# This will move the +Magical::Unicorns+ middleware before the +# +ActionDispatch::Flash+. You can also move it after: +# +# config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns +# +# And finally they can also be removed from the stack completely: +# +# config.middleware.delete ActionDispatch::Flash +# +# pkg:gem/railties#lib/rails/configuration.rb:46 +class Rails::Configuration::MiddlewareStackProxy + # pkg:gem/railties#lib/rails/configuration.rb:47 + def initialize(operations = T.unsafe(nil), delete_operations = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/configuration.rb:96 + def +(other); end + + # pkg:gem/railties#lib/rails/configuration.rb:70 + def delete(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:56 + def insert(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:58 + def insert_after(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:52 + def insert_before(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:88 + def merge_into(other); end + + # pkg:gem/railties#lib/rails/configuration.rb:78 + def move(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:80 + def move_after(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:74 + def move_before(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:62 + def swap(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:84 + def unshift(*, **, &); end + + # pkg:gem/railties#lib/rails/configuration.rb:66 + def use(*, **, &); end + + protected + + # pkg:gem/railties#lib/rails/configuration.rb:101 + def delete_operations; end + + # pkg:gem/railties#lib/rails/configuration.rb:101 + def operations; end +end + +# +Rails::Engine+ allows you to wrap a specific \Rails application or subset of +# functionality and share it with other applications or within a larger packaged application. +# Every Rails::Application is just an engine, which allows for simple +# feature and application sharing. +# +# Any +Rails::Engine+ is also a Rails::Railtie, so the same +# methods (like {rake_tasks}[rdoc-ref:Rails::Railtie::rake_tasks] and +# {generators}[rdoc-ref:Rails::Railtie::generators]) and configuration +# options that are available in railties can also be used in engines. +# +# == Creating an Engine +# +# If you want a gem to behave as an engine, you have to specify an +Engine+ +# for it somewhere inside your plugin's +lib+ folder (similar to how we +# specify a +Railtie+): +# +# # lib/my_engine.rb +# module MyEngine +# class Engine < Rails::Engine +# end +# end +# +# Then ensure that this file is loaded at the top of your config/application.rb +# (or in your +Gemfile+), and it will automatically load models, controllers, and helpers +# inside +app+, load routes at config/routes.rb, load locales at +# config/locales/**/*, and load tasks at lib/tasks/**/*. +# +# == Configuration +# +# Like railties, engines can access a config object which contains configuration shared by +# all railties and the application. +# Additionally, each engine can access autoload_paths, eager_load_paths and +# autoload_once_paths settings which are scoped to that engine. +# +# class MyEngine < Rails::Engine +# # Add a load path for this specific Engine +# config.autoload_paths << File.expand_path("lib/some/path", __dir__) +# +# initializer "my_engine.add_middleware" do |app| +# app.middleware.use MyEngine::Middleware +# end +# end +# +# == Generators +# +# You can set up generators for engines with config.generators method: +# +# class MyEngine < Rails::Engine +# config.generators do |g| +# g.orm :active_record +# g.template_engine :erb +# g.test_framework :test_unit +# end +# end +# +# You can also set generators for an application by using config.app_generators: +# +# class MyEngine < Rails::Engine +# # note that you can also pass block to app_generators in the same way you +# # can pass it to generators method +# config.app_generators.orm :datamapper +# end +# +# == Paths +# +# Applications and engines have flexible path configuration, meaning that you +# are not required to place your controllers at app/controllers, but +# in any place which you find convenient. +# +# For example, let's suppose you want to place your controllers in lib/controllers. +# You can set that as an option: +# +# class MyEngine < Rails::Engine +# paths["app/controllers"] = "lib/controllers" +# end +# +# You can also have your controllers loaded from both app/controllers and +# lib/controllers: +# +# class MyEngine < Rails::Engine +# paths["app/controllers"] << "lib/controllers" +# end +# +# The available paths in an engine are: +# +# class MyEngine < Rails::Engine +# paths["app"] # => ["app"] +# paths["app/controllers"] # => ["app/controllers"] +# paths["app/helpers"] # => ["app/helpers"] +# paths["app/models"] # => ["app/models"] +# paths["app/views"] # => ["app/views"] +# paths["lib"] # => ["lib"] +# paths["lib/tasks"] # => ["lib/tasks"] +# paths["config"] # => ["config"] +# paths["config/initializers"] # => ["config/initializers"] +# paths["config/locales"] # => ["config/locales"] +# paths["config/routes.rb"] # => ["config/routes.rb"] +# end +# +# The Application class adds a couple more paths to this set. And as in your +# Application, all folders under +app+ are automatically added to the load path. +# If you have an app/services folder for example, it will be added by default. +# +# == Endpoint +# +# An engine can also be a Rack application. It can be useful if you have a Rack application that +# you would like to provide with some of the +Engine+'s features. +# +# To do that, use the ::endpoint method: +# +# module MyEngine +# class Engine < Rails::Engine +# endpoint MyRackApplication +# end +# end +# +# Now you can mount your engine in application's routes: +# +# Rails.application.routes.draw do +# mount MyEngine::Engine => "/engine" +# end +# +# == Middleware stack +# +# As an engine can now be a Rack endpoint, it can also have a middleware +# stack. The usage is exactly the same as in Application: +# +# module MyEngine +# class Engine < Rails::Engine +# middleware.use SomeMiddleware +# end +# end +# +# == Routes +# +# If you don't specify an endpoint, routes will be used as the default +# endpoint. You can use them just like you use an application's routes: +# +# # ENGINE/config/routes.rb +# MyEngine::Engine.routes.draw do +# get "/" => "posts#index" +# end +# +# == Mount priority +# +# Note that now there can be more than one router in your application, and it's better to avoid +# passing requests through many routers. Consider this situation: +# +# Rails.application.routes.draw do +# mount MyEngine::Engine => "/blog" +# get "/blog/omg" => "main#omg" +# end +# +# +MyEngine+ is mounted at /blog, and /blog/omg points to application's +# controller. In such a situation, requests to /blog/omg will go through +MyEngine+, +# and if there is no such route in +Engine+'s routes, it will be dispatched to main#omg. +# It's much better to swap that: +# +# Rails.application.routes.draw do +# get "/blog/omg" => "main#omg" +# mount MyEngine::Engine => "/blog" +# end +# +# Now, +Engine+ will get only requests that were not handled by +Application+. +# +# == Engine name +# +# There are some places where an Engine's name is used: +# +# * routes: when you mount an Engine with mount(MyEngine::Engine => '/my_engine'), +# it's used as default :as option +# * rake task for installing migrations my_engine:install:migrations +# +# Engine name is set by default based on class name. For +MyEngine::Engine+ it will be +# my_engine_engine. You can change it manually using the engine_name method: +# +# module MyEngine +# class Engine < Rails::Engine +# engine_name "my_engine" +# end +# end +# +# == Isolated Engine +# +# Normally when you create controllers, helpers, and models inside an engine, they are treated +# as if they were created inside the application itself. This means that all helpers and +# named routes from the application will be available to your engine's controllers as well. +# +# However, sometimes you want to isolate your engine from the application, especially if your engine +# has its own router. To do that, you simply need to call ::isolate_namespace. This method requires +# you to pass a module where all your controllers, helpers, and models should be nested to: +# +# module MyEngine +# class Engine < Rails::Engine +# isolate_namespace MyEngine +# end +# end +# +# With such an engine, everything that is inside the +MyEngine+ module will be isolated from +# the application. +# +# Consider this controller: +# +# module MyEngine +# class FooController < ActionController::Base +# end +# end +# +# If the +MyEngine+ engine is marked as isolated, +FooController+ only has +# access to helpers from +MyEngine+, and url_helpers from +# MyEngine::Engine.routes. +# +# The next thing that changes in isolated engines is the behavior of routes. +# Normally, when you namespace your controllers, you also need to namespace +# the related routes. With an isolated engine, the engine's namespace is +# automatically applied, so you don't need to specify it explicitly in your +# routes: +# +# MyEngine::Engine.routes.draw do +# resources :articles +# end +# +# If +MyEngine+ is isolated, the routes above will point to +# +MyEngine::ArticlesController+. You also don't need to use longer +# URL helpers like +my_engine_articles_path+. Instead, you should simply use +# +articles_path+, like you would do with your main application. +# +# To make this behavior consistent with other parts of the framework, +# isolated engines also have an effect on ActiveModel::Naming. In a +# normal \Rails app, when you use a namespaced model such as +# +Namespace::Article+, ActiveModel::Naming will generate +# names with the prefix "namespace". In an isolated engine, the prefix will +# be omitted in URL helpers and form fields, for convenience. +# +# polymorphic_url(MyEngine::Article.new) +# # => "articles_path" # not "my_engine_articles_path" +# +# form_with(model: MyEngine::Article.new) do +# text_field :title # => +# end +# +# Additionally, an isolated engine will set its own name according to its +# namespace, so MyEngine::Engine.engine_name will return +# "my_engine". It will also set +MyEngine.table_name_prefix+ to "my_engine_", +# meaning for example that +MyEngine::Article+ will use the +# +my_engine_articles+ database table by default. +# +# == Using Engine's routes outside Engine +# +# Since you can now mount an engine inside application's routes, you do not have direct access to +Engine+'s +# url_helpers inside +Application+. When you mount an engine in an application's routes, a special helper is +# created to allow you to do that. Consider such a scenario: +# +# # config/routes.rb +# Rails.application.routes.draw do +# mount MyEngine::Engine => "/my_engine", as: "my_engine" +# get "/foo" => "foo#index" +# end +# +# Now, you can use the my_engine helper inside your application: +# +# class FooController < ApplicationController +# def index +# my_engine.root_url # => /my_engine/ +# end +# end +# +# There is also a main_app helper that gives you access to application's routes inside Engine: +# +# module MyEngine +# class BarController +# def index +# main_app.foo_path # => /foo +# end +# end +# end +# +# Note that the :as option given to mount takes the engine_name as default, so most of the time +# you can simply omit it. +# +# Finally, if you want to generate a URL to an engine's route using +# polymorphic_url, you also need to pass the engine helper. Let's +# say that you want to create a form pointing to one of the engine's routes. +# All you need to do is pass the helper as the first element in array with +# attributes for URL: +# +# form_with(model: [my_engine, @user]) +# +# This code will use my_engine.user_path(@user) to generate the proper route. +# +# == Isolated engine's helpers +# +# Sometimes you may want to isolate an engine, but use helpers that are defined for it. +# If you want to share just a few specific helpers you can add them to application's +# helpers in ApplicationController: +# +# class ApplicationController < ActionController::Base +# helper MyEngine::SharedEngineHelper +# end +# +# If you want to include all of the engine's helpers, you can use the #helpers method on an engine's +# instance: +# +# class ApplicationController < ActionController::Base +# helper MyEngine::Engine.helpers +# end +# +# It will include all of the helpers from engine's directory. Take into account this does +# not include helpers defined in controllers with helper_method or other similar solutions, +# only helpers defined in the helpers directory will be included. +# +# == Migrations & seed data +# +# Engines can have their own migrations. The default path for migrations is exactly the same +# as in application: db/migrate +# +# To use engine's migrations in application you can use the rake task below, which copies them to +# application's dir: +# +# $ rake ENGINE_NAME:install:migrations +# +# Note that some of the migrations may be skipped if a migration with the same name already exists +# in application. In such a situation you must decide whether to leave that migration or rename the +# migration in the application and rerun copying migrations. +# +# If your engine has migrations, you may also want to prepare data for the database in +# the db/seeds.rb file. You can load that data using the load_seed method, e.g. +# +# MyEngine::Engine.load_seed +# +# == Loading priority +# +# In order to change engine's priority you can use +config.railties_order+ in the main application. +# It will affect the priority of loading views, helpers, assets, and all the other files +# related to engine or application. +# +# # load Blog::Engine with highest priority, followed by application and other railties +# config.railties_order = [Blog::Engine, :main_app, :all] +# +# pkg:gem/railties#lib/rails/engine/railties.rb:4 +class Rails::Engine < ::Rails::Railtie + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + + # pkg:gem/railties#lib/rails/engine.rb:439 + def initialize; end + + # pkg:gem/railties#lib/rails/engine.rb:433 + def __callbacks; end + + # pkg:gem/railties#lib/rails/engine.rb:434 + def _load_seed_callbacks; end + + # pkg:gem/railties#lib/rails/engine.rb:434 + def _run_load_seed_callbacks; end + + # pkg:gem/railties#lib/rails/engine.rb:434 + def _run_load_seed_callbacks!(&block); end + + # Returns the underlying Rack application for this engine. + # + # pkg:gem/railties#lib/rails/engine.rb:515 + def app; end + + # Define the Rack API for this engine. + # + # pkg:gem/railties#lib/rails/engine.rb:532 + def call(env); end + + # Define the configuration object for the engine. + # + # pkg:gem/railties#lib/rails/engine.rb:551 + def config; end + + # pkg:gem/railties#lib/rails/engine.rb:489 + def eager_load!; end + + # Returns the endpoint for this engine. If none is registered, + # defaults to an ActionDispatch::Routing::RouteSet. + # + # pkg:gem/railties#lib/rails/engine.rb:527 + def endpoint; end + + # pkg:gem/railties#lib/rails/engine.rb:437 + def engine_name(*, **, &); end + + # Defines additional Rack env configuration that is added on each call. + # + # pkg:gem/railties#lib/rails/engine.rb:538 + def env_config; end + + # Returns a module with all the helpers defined for the engine. + # + # pkg:gem/railties#lib/rails/engine.rb:499 + def helpers; end + + # Returns all registered helpers paths. + # + # pkg:gem/railties#lib/rails/engine.rb:510 + def helpers_paths; end + + # pkg:gem/railties#lib/rails/engine.rb:437 + def isolated?(&); end + + # Load console and invoke the registered hooks. + # Check Rails::Railtie.console for more info. + # + # pkg:gem/railties#lib/rails/engine.rb:453 + def load_console(app = T.unsafe(nil)); end + + # Load \Rails generators and invoke the registered hooks. + # Check Rails::Railtie.generators for more info. + # + # pkg:gem/railties#lib/rails/engine.rb:475 + def load_generators(app = T.unsafe(nil)); end + + # Load \Rails runner and invoke the registered hooks. + # Check Rails::Railtie.runner for more info. + # + # pkg:gem/railties#lib/rails/engine.rb:460 + def load_runner(app = T.unsafe(nil)); end + + # Load data from db/seeds.rb file. It can be used in to load engines' + # seeds, e.g.: + # + # Blog::Engine.load_seed + # + # pkg:gem/railties#lib/rails/engine.rb:559 + def load_seed; end + + # Invoke the server registered hooks. + # Check Rails::Railtie.server for more info. + # + # pkg:gem/railties#lib/rails/engine.rb:484 + def load_server(app = T.unsafe(nil)); end + + # Load Rake and railties tasks, and invoke the registered hooks. + # Check Rails::Railtie.rake_tasks for more info. + # + # pkg:gem/railties#lib/rails/engine.rb:467 + def load_tasks(app = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine.rb:436 + def middleware(*, **, &); end + + # pkg:gem/railties#lib/rails/engine.rb:436 + def paths(*, **, &); end + + # pkg:gem/railties#lib/rails/engine.rb:494 + def railties; end + + # pkg:gem/railties#lib/rails/engine.rb:436 + def root(*, **, &); end + + # Defines the routes for this engine. If a block is given to + # routes, it is appended to the engine. + # + # pkg:gem/railties#lib/rails/engine.rb:544 + def routes(&block); end + + # pkg:gem/railties#lib/rails/engine.rb:679 + def routes?; end + + protected + + # pkg:gem/railties#lib/rails/engine.rb:684 + def run_tasks_blocks(*); end + + private + + # pkg:gem/railties#lib/rails/engine.rb:716 + def _all_autoload_once_paths; end + + # pkg:gem/railties#lib/rails/engine.rb:720 + def _all_autoload_paths; end + + # pkg:gem/railties#lib/rails/engine.rb:729 + def _all_load_paths(add_autoload_paths_to_load_path); end + + # pkg:gem/railties#lib/rails/engine.rb:754 + def build_middleware; end + + # pkg:gem/railties#lib/rails/engine.rb:746 + def build_request(env); end + + # pkg:gem/railties#lib/rails/engine.rb:712 + def default_middleware_stack; end + + # pkg:gem/railties#lib/rails/engine.rb:740 + def fixtures_in_root_and_not_in_vendor_or_dot_dir?(fixtures); end + + # pkg:gem/railties#lib/rails/engine.rb:696 + def has_migrations?; end + + # pkg:gem/railties#lib/rails/engine.rb:690 + def load_config_initializer(initializer); end + + class << self + # pkg:gem/railties#lib/rails/engine.rb:433 + def __callbacks; end + + # pkg:gem/railties#lib/rails/engine.rb:433 + def __callbacks=(value); end + + # pkg:gem/railties#lib/rails/engine.rb:434 + def _load_seed_callbacks; end + + # pkg:gem/railties#lib/rails/engine.rb:434 + def _load_seed_callbacks=(value); end + + # pkg:gem/railties#lib/rails/engine.rb:353 + def called_from; end + + # pkg:gem/railties#lib/rails/engine.rb:353 + def called_from=(_arg0); end + + # pkg:gem/railties#lib/rails/engine.rb:358 + def eager_load!(*, **, &); end + + # pkg:gem/railties#lib/rails/engine.rb:378 + def endpoint(endpoint = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine.rb:356 + def engine_name(name = T.unsafe(nil)); end + + # Finds engine with given path. + # + # pkg:gem/railties#lib/rails/engine.rb:423 + def find(path); end + + # pkg:gem/railties#lib/rails/engine.rb:374 + def find_root(from); end + + # pkg:gem/railties#lib/rails/engine.rb:700 + def find_root_with_flag(flag, root_path, default = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine.rb:360 + def inherited(base); end + + # pkg:gem/railties#lib/rails/engine.rb:384 + def isolate_namespace(mod); end + + # pkg:gem/railties#lib/rails/engine.rb:353 + def isolated; end + + # pkg:gem/railties#lib/rails/engine.rb:353 + def isolated=(_arg0); end + + # pkg:gem/railties#lib/rails/engine.rb:355 + def isolated?; end + + private + + # pkg:gem/railties#lib/rails/engine.rb:433 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/engine.rb:433 + def __class_attr___callbacks=(new_value); end + end +end + +# pkg:gem/railties#lib/rails/engine/configuration.rb:7 +class Rails::Engine::Configuration < ::Rails::Railtie::Configuration + # pkg:gem/railties#lib/rails/engine/configuration.rb:41 + def initialize(root = T.unsafe(nil)); end + + # Private method that adds custom autoload once paths to the ones defined + # by +paths+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:127 + def all_autoload_once_paths; end + + # Private method that adds custom autoload paths to the ones defined by + # +paths+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:121 + def all_autoload_paths; end + + # Private method that adds custom eager load paths to the ones defined by + # +paths+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:133 + def all_eager_load_paths; end + + # An array of custom autoload once paths. These won't be eager loaded + # unless you push them to +eager_load_paths+ too, which is recommended. + # + # This collection is empty by default, it accepts strings and +Pathname+ + # objects. + # + # If you'd like to add +lib+ to it, please see +autoload_lib_once+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:29 + def autoload_once_paths; end + + # An array of custom autoload once paths. These won't be eager loaded + # unless you push them to +eager_load_paths+ too, which is recommended. + # + # This collection is empty by default, it accepts strings and +Pathname+ + # objects. + # + # If you'd like to add +lib+ to it, please see +autoload_lib_once+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:10 + def autoload_once_paths=(_arg0); end + + # An array of custom autoload paths to be added to the ones defined + # automatically by Rails. These won't be eager loaded, unless you push + # them to +eager_load_paths+ too, which is recommended. + # + # This collection is empty by default, it accepts strings and +Pathname+ + # objects. + # + # If you'd like to add +lib+ to it, please see +autoload_lib+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:20 + def autoload_paths; end + + # An array of custom autoload paths to be added to the ones defined + # automatically by Rails. These won't be eager loaded, unless you push + # them to +eager_load_paths+ too, which is recommended. + # + # This collection is empty by default, it accepts strings and +Pathname+ + # objects. + # + # If you'd like to add +lib+ to it, please see +autoload_lib+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:10 + def autoload_paths=(_arg0); end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def default_scope; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def default_scope=(_arg0); end + + # An array of custom eager load paths to be added to the ones defined + # automatically by Rails. Anything in this collection is considered to be + # an autoload path regardless of whether it was added to +autoload_paths+. + # + # This collection is empty by default, it accepts strings and +Pathname+ + # objects. + # + # If you'd like to add +lib+ to it, please see +autoload_lib+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:39 + def eager_load_paths; end + + # An array of custom eager load paths to be added to the ones defined + # automatically by Rails. Anything in this collection is considered to be + # an autoload path regardless of whether it was added to +autoload_paths+. + # + # This collection is empty by default, it accepts strings and +Pathname+ + # objects. + # + # If you'd like to add +lib+ to it, please see +autoload_lib+. + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:10 + def eager_load_paths=(_arg0); end + + # Holds generators configuration: + # + # config.generators do |g| + # g.orm :data_mapper, migration: true + # g.template_engine :haml + # g.test_framework :rspec + # end + # + # If you want to disable color in console, do: + # + # config.generators.colorize_logging = false + # + # pkg:gem/railties#lib/rails/engine/configuration.rb:67 + def generators; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def javascript_path; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def javascript_path=(_arg0); end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def middleware; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def middleware=(_arg0); end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:73 + def paths; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:8 + def root; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:115 + def root=(value); end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def route_set_class; end + + # pkg:gem/railties#lib/rails/engine/configuration.rb:9 + def route_set_class=(_arg0); end +end + +# pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:11 +class Rails::Engine::LazyRouteSet < ::ActionDispatch::Routing::RouteSet + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:74 + def initialize(config = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:91 + def call(req); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:125 + def define_mounted_helper(name, script_namer = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:101 + def draw(&block); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:81 + def generate_extras(options, recall = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:87 + def generate_url_helpers(supports_path); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:121 + def mounted_helpers; end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:96 + def polymorphic_mappings; end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:106 + def recognize_path(path, environment = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:111 + def recognize_path_with_request(*, **, &); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:116 + def routes; end + + private + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:136 + def method_missing_module; end +end + +# Mounted helpers are only defined when `mount` runs during the route +# draw. _path/_url names are left to method_missing_module, which owns +# them and relies on reload_routes_unless_loaded returning true only to +# the caller that performed the load. +# +# pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:45 +module Rails::Engine::LazyRouteSet::MountedHelpers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::RouteSet::MountedHelpers + + mixes_in_class_methods GeneratedClassMethods + + private + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:51 + def method_missing(method_name, *, **, &); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:64 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); 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 + +# pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:12 +class Rails::Engine::LazyRouteSet::NamedRouteCollection < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:13 + def route_defined?(name); end +end + +# pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:19 +module Rails::Engine::LazyRouteSet::ProxyUrlHelpers + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:25 + def full_url_for(options); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:35 + def optimize_routes_generation?; end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:30 + def route_for(name, *args); end + + # pkg:gem/railties#lib/rails/engine/lazy_route_set.rb:20 + def url_for(options); end +end + +# pkg:gem/railties#lib/rails/engine/railties.rb:5 +class Rails::Engine::Railties + include ::Enumerable + + # pkg:gem/railties#lib/rails/engine/railties.rb:9 + def initialize; end + + # pkg:gem/railties#lib/rails/engine/railties.rb:18 + def -(others); end + + # pkg:gem/railties#lib/rails/engine/railties.rb:7 + def _all; end + + # pkg:gem/railties#lib/rails/engine/railties.rb:14 + def each(*args, &block); end +end + +# Built-in Health Check Endpoint +# +# \Rails also comes with a built-in health check endpoint that is reachable at +# the +/up+ path. This endpoint will return a 200 status code if the app has +# booted with no exceptions, and a 500 status code otherwise. +# +# In production, many applications are required to report their status upstream, +# whether it's to an uptime monitor that will page an engineer when things go +# wrong, or a load balancer or Kubernetes controller used to determine a pod's +# health. This health check is designed to be a one-size fits all that will work +# in many situations. +# +# While any newly generated \Rails applications will have the health check at +# +/up+, you can configure the path to be anything you'd like in your +# "config/routes.rb": +# +# Rails.application.routes.draw do +# get "healthz" => "rails/health#show", as: :rails_health_check +# end +# +# The health check will now be accessible via the +/healthz+ path. +# +# NOTE: This endpoint does not reflect the status of all of your application's +# dependencies, such as the database or Redis cluster. Replace +# "rails/health#show" with your own controller action if you have +# application specific needs. +# +# Think carefully about what you want to check as it can lead to situations +# where your application is being restarted due to a third-party service going +# bad. Ideally, you should design your application to handle those outages +# gracefully. +# +# pkg:gem/railties#lib/rails/health_controller.rb:37 +class Rails::HealthController < ::ActionController::Base + # pkg:gem/railties#lib/rails/health_controller.rb:40 + def show; end + + private + + # pkg:gem/railties#lib/rails/health_controller.rb:37 + def _layout(lookup_context, formats, keys); end + + # pkg:gem/railties#lib/rails/health_controller.rb:59 + def html_status(color:); end + + # pkg:gem/railties#lib/rails/health_controller.rb:52 + def render_down; end + + # pkg:gem/railties#lib/rails/health_controller.rb:45 + def render_up; end + + class << self + private + + # pkg:gem/railties#lib/rails/health_controller.rb:37 + def __class_attr_config; end + + # pkg:gem/railties#lib/rails/health_controller.rb:37 + def __class_attr_config=(new_value); end + + # pkg:gem/railties#lib/rails/health_controller.rb:37 + def __class_attr_middleware_stack; end + + # pkg:gem/railties#lib/rails/health_controller.rb:37 + def __class_attr_middleware_stack=(new_value); end + + # pkg:gem/railties#lib/rails/health_controller.rb:38 + def __class_attr_rescue_handlers; end + + # pkg:gem/railties#lib/rails/health_controller.rb:38 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# This module helps build the runtime properties that are displayed in +# Rails::InfoController responses. These include the active \Rails version, +# Ruby version, Rack version, and so on. +# +# pkg:gem/railties#lib/rails/info.rb:9 +module Rails::Info + # pkg:gem/railties#lib/rails/info.rb:10 + def properties; end + + # pkg:gem/railties#lib/rails/info.rb:10 + def properties=(val); end + + class << self + # pkg:gem/railties#lib/rails/info.rb:41 + def inspect; end + + # pkg:gem/railties#lib/rails/info.rb:10 + def properties; end + + # pkg:gem/railties#lib/rails/info.rb:10 + def properties=(val); end + + # pkg:gem/railties#lib/rails/info.rb:25 + def property(name, value = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/info.rb:43 + def to_html; end + + # pkg:gem/railties#lib/rails/info.rb:31 + def to_s; end + end +end + +# pkg:gem/railties#lib/rails/info_controller.rb:6 +class Rails::InfoController < ::Rails::ApplicationController + # pkg:gem/railties#lib/rails/info_controller.rb:12 + def index; end + + # pkg:gem/railties#lib/rails/info_controller.rb:35 + def notes; end + + # pkg:gem/railties#lib/rails/info_controller.rb:16 + def properties; end + + # pkg:gem/railties#lib/rails/info_controller.rb:21 + def routes; end + + private + + # pkg:gem/railties#lib/rails/info_controller.rb:6 + def _layout(lookup_context, formats, keys); end + + # pkg:gem/railties#lib/rails/info_controller.rb:8 + def _layout_from_proc; end + + # pkg:gem/railties#lib/rails/info_controller.rb:43 + def matching_routes(query:, exact_match:); end + + class << self + private + + # pkg:gem/railties#lib/rails/info_controller.rb:10 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/info_controller.rb:10 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/railties#lib/rails/info_controller.rb:8 + def __class_attr__layout; end + + # pkg:gem/railties#lib/rails/info_controller.rb:8 + def __class_attr__layout=(new_value); end + + # pkg:gem/railties#lib/rails/info_controller.rb:8 + def __class_attr__layout_conditions; end + + # pkg:gem/railties#lib/rails/info_controller.rb:8 + def __class_attr__layout_conditions=(new_value); end + + # pkg:gem/railties#lib/rails/info_controller.rb:6 + def __class_attr_config; end + + # pkg:gem/railties#lib/rails/info_controller.rb:6 + def __class_attr_config=(new_value); end + + # pkg:gem/railties#lib/rails/info_controller.rb:6 + def __class_attr_middleware_stack; end + + # pkg:gem/railties#lib/rails/info_controller.rb:6 + def __class_attr_middleware_stack=(new_value); end + end +end + +# pkg:gem/railties#lib/rails/initializable.rb:6 +module Rails::Initializable + mixes_in_class_methods ::Rails::Initializable::ClassMethods + + # pkg:gem/railties#lib/rails/initializable.rb:108 + def initializers; end + + # pkg:gem/railties#lib/rails/initializable.rb:100 + def run_initializers(group = T.unsafe(nil), *args); end + + class << self + # pkg:gem/railties#lib/rails/initializable.rb:7 + def included(base); end + end +end + +# pkg:gem/railties#lib/rails/initializable.rb:112 +module Rails::Initializable::ClassMethods + # pkg:gem/railties#lib/rails/initializable.rb:130 + def initializer(name, opts = T.unsafe(nil), &blk); end + + # pkg:gem/railties#lib/rails/initializable.rb:113 + def initializers; end + + # pkg:gem/railties#lib/rails/initializable.rb:117 + def initializers_chain; end + + # pkg:gem/railties#lib/rails/initializable.rb:126 + def initializers_for(binding); end +end + +# pkg:gem/railties#lib/rails/initializable.rb:37 +class Rails::Initializable::Collection + include ::Enumerable + include ::TSort + + # pkg:gem/railties#lib/rails/initializable.rb:43 + def initialize(initializers = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/initializable.rb:69 + def +(other); end + + # pkg:gem/railties#lib/rails/initializable.rb:73 + def <<(initializer); end + + # pkg:gem/railties#lib/rails/initializable.rb:86 + def append(*initializers); end + + # pkg:gem/railties#lib/rails/initializable.rb:88 + def concat(*initializer_collections); end + + # pkg:gem/railties#lib/rails/initializable.rb:58 + def each(&block); end + + # pkg:gem/railties#lib/rails/initializable.rb:95 + def has?(name); end + + # pkg:gem/railties#lib/rails/initializable.rb:54 + def last; end + + # pkg:gem/railties#lib/rails/initializable.rb:41 + def method_missing(method, *, **, &); end + + # pkg:gem/railties#lib/rails/initializable.rb:81 + def push(*initializers); end + + # pkg:gem/railties#lib/rails/initializable.rb:50 + def to_a; end + + # pkg:gem/railties#lib/rails/initializable.rb:63 + def tsort_each_child(initializer, &block); end + + # pkg:gem/railties#lib/rails/initializable.rb:62 + def tsort_each_node(&block); end + + private + + # pkg:gem/railties#lib/rails/initializable.rb:41 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/railties#lib/rails/initializable.rb:11 +class Rails::Initializable::Initializer + # pkg:gem/railties#lib/rails/initializable.rb:14 + def initialize(name, context, before:, after:, group: T.unsafe(nil), &block); end + + # pkg:gem/railties#lib/rails/initializable.rb:12 + def after; end + + # pkg:gem/railties#lib/rails/initializable.rb:12 + def before; end + + # pkg:gem/railties#lib/rails/initializable.rb:19 + def belongs_to?(group); end + + # pkg:gem/railties#lib/rails/initializable.rb:27 + def bind(context); end + + # pkg:gem/railties#lib/rails/initializable.rb:12 + def block; end + + # pkg:gem/railties#lib/rails/initializable.rb:32 + def context_class; end + + # pkg:gem/railties#lib/rails/initializable.rb:12 + def name; end + + # pkg:gem/railties#lib/rails/initializable.rb:23 + def run(*args); end +end + +# pkg:gem/railties#lib/rails/mailers_controller.rb:6 +class Rails::MailersController < ::Rails::ApplicationController + # pkg:gem/railties#lib/rails/mailers_controller.rb:22 + def download; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:17 + def index; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:32 + def preview; end + + private + + # pkg:gem/railties#lib/rails/mailers_controller.rb:6 + def _layout(lookup_context, formats, keys); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:107 + def attachment_url(attachment); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:101 + def attachments_for(email); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:93 + def find_part(format); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:81 + def find_preferred_part(*formats); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:69 + def find_preview; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:115 + def locale_query(locale); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:111 + def part_query(mime_type); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:119 + def set_locale(&block); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:65 + def show_previews?; end + + class << self + private + + # pkg:gem/railties#lib/rails/mailers_controller.rb:9 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:9 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:13 + def __class_attr__helper_methods; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:13 + def __class_attr__helper_methods=(new_value); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:6 + def __class_attr_config; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:6 + def __class_attr_config=(new_value); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:6 + def __class_attr_middleware_stack; end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:6 + def __class_attr_middleware_stack=(new_value); end + end +end + +# pkg:gem/railties#lib/rails/mailers_controller.rb:13 +module Rails::MailersController::HelperMethods + include ::ActionController::Base::HelperMethods + + # pkg:gem/railties#lib/rails/mailers_controller.rb:13 + def attachment_url(*, **, &); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:13 + def locale_query(*, **, &); end + + # pkg:gem/railties#lib/rails/mailers_controller.rb:13 + def part_query(*, **, &); end +end + +# pkg:gem/railties#lib/rails/paths.rb:6 +module Rails::Paths; end + +# pkg:gem/railties#lib/rails/paths.rb:114 +class Rails::Paths::Path + include ::Enumerable + + # pkg:gem/railties#lib/rails/paths.rb:119 + def initialize(root, current, paths, options = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/paths.rb:171 + def <<(path); end + + # pkg:gem/railties#lib/rails/paths.rb:132 + def absolute_current; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def autoload!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def autoload?; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def autoload_once!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def autoload_once?; end + + # pkg:gem/railties#lib/rails/paths.rb:136 + def children; end + + # pkg:gem/railties#lib/rails/paths.rb:176 + def concat(paths); end + + # pkg:gem/railties#lib/rails/paths.rb:167 + def each(&block); end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def eager_load!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def eager_load?; end + + # Returns all expanded paths but only if they exist in the filesystem. + # + # pkg:gem/railties#lib/rails/paths.rb:220 + def existent; end + + # pkg:gem/railties#lib/rails/paths.rb:231 + def existent_directories; end + + # Expands all paths against the root and return all unique values. + # + # pkg:gem/railties#lib/rails/paths.rb:201 + def expanded; end + + # pkg:gem/railties#lib/rails/paths.rb:196 + def extensions; end + + # pkg:gem/railties#lib/rails/paths.rb:143 + def first; end + + # pkg:gem/railties#lib/rails/paths.rb:117 + def glob; end + + # pkg:gem/railties#lib/rails/paths.rb:117 + def glob=(_arg0); end + + # pkg:gem/railties#lib/rails/paths.rb:147 + def last; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def load_path!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def load_path?; end + + # pkg:gem/railties#lib/rails/paths.rb:188 + def paths; end + + # pkg:gem/railties#lib/rails/paths.rb:174 + def push(path); end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def skip_autoload!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def skip_autoload_once!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def skip_eager_load!; end + + # pkg:gem/railties#lib/rails/paths.rb:152 + def skip_load_path!; end + + # pkg:gem/railties#lib/rails/paths.rb:235 + def to_a; end + + # pkg:gem/railties#lib/rails/paths.rb:184 + def to_ary; end + + # pkg:gem/railties#lib/rails/paths.rb:180 + def unshift(*paths); end + + private + + # pkg:gem/railties#lib/rails/paths.rb:238 + def files_in(path); end +end + +# This object is an extended hash that behaves as root of the Rails::Paths system. +# It allows you to collect information about how you want to structure your application +# paths through a Hash-like \API. It requires you to give a physical path on initialization. +# +# root = Root.new "/rails" +# root.add "app/controllers", eager_load: true +# +# The above command creates a new root object and adds "app/controllers" as a path. +# This means we can get a Rails::Paths::Path object back like below: +# +# path = root["app/controllers"] +# path.eager_load? # => true +# path.is_a?(Rails::Paths::Path) # => true +# +# The Path[rdoc-ref:Rails::Paths::Path] object is simply an enumerable and +# allows you to easily add extra paths: +# +# path.is_a?(Enumerable) # => true +# path.to_ary # => ["app/controllers"] +# +# path << "lib/controllers" +# path.to_ary # => ["app/controllers", "lib/controllers"] +# +# Notice that when you add a path using #add, the +# Path[rdoc-ref:Rails::Paths::Path] object created already contains the path +# with the same path value given to #add. In some situations, you may not +# want this behavior, so you can give :with as option. +# +# root.add "config/routes", with: "config/routes.rb" +# root["config/routes"].to_ary # => ["config/routes.rb"] +# +# The #add method accepts the following options as arguments: +# +eager_load+, +autoload+, +autoload_once+, and +glob+. +# +# Finally, the Path[rdoc-ref:Rails::Paths::Path] object also provides a few +# helpers: +# +# root = Root.new "/rails" +# root.add "app/controllers" +# +# root["app/controllers"].expanded # => ["/rails/app/controllers"] +# root["app/controllers"].existent # => ["/rails/app/controllers"] +# +# Check the Rails::Paths::Path documentation for more information. +# +# pkg:gem/railties#lib/rails/paths.rb:51 +class Rails::Paths::Root + # pkg:gem/railties#lib/rails/paths.rb:54 + def initialize(path); end + + # pkg:gem/railties#lib/rails/paths.rb:69 + def [](path); end + + # pkg:gem/railties#lib/rails/paths.rb:59 + def []=(path, value); end + + # pkg:gem/railties#lib/rails/paths.rb:64 + def add(path, options = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/paths.rb:85 + def all_paths; end + + # pkg:gem/railties#lib/rails/paths.rb:89 + def autoload_once; end + + # pkg:gem/railties#lib/rails/paths.rb:97 + def autoload_paths; end + + # pkg:gem/railties#lib/rails/paths.rb:93 + def eager_load; end + + # pkg:gem/railties#lib/rails/paths.rb:77 + def keys; end + + # pkg:gem/railties#lib/rails/paths.rb:101 + def load_paths; end + + # pkg:gem/railties#lib/rails/paths.rb:52 + def path; end + + # pkg:gem/railties#lib/rails/paths.rb:52 + def path=(_arg0); end + + # pkg:gem/railties#lib/rails/paths.rb:73 + def values; end + + # pkg:gem/railties#lib/rails/paths.rb:81 + def values_at(*list); end + + private + + # pkg:gem/railties#lib/rails/paths.rb:106 + def filter_by(&block); end +end + +# pkg:gem/railties#lib/rails/pwa_controller.rb:5 +class Rails::PwaController < ::Rails::ApplicationController + # pkg:gem/railties#lib/rails/pwa_controller.rb:12 + def manifest; end + + # pkg:gem/railties#lib/rails/pwa_controller.rb:8 + def service_worker; end + + private + + # pkg:gem/railties#lib/rails/pwa_controller.rb:5 + def _layout(lookup_context, formats, keys); end + + class << self + private + + # pkg:gem/railties#lib/rails/pwa_controller.rb:6 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/pwa_controller.rb:6 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/railties#lib/rails/pwa_controller.rb:5 + def __class_attr_config; end + + # pkg:gem/railties#lib/rails/pwa_controller.rb:5 + def __class_attr_config=(new_value); end + + # pkg:gem/railties#lib/rails/pwa_controller.rb:5 + def __class_attr_middleware_stack; end + + # pkg:gem/railties#lib/rails/pwa_controller.rb:5 + def __class_attr_middleware_stack=(new_value); end + end +end + +# pkg:gem/railties#lib/rails/rack.rb:4 +module Rails::Rack; end + +# Sets log tags, logs the request, calls the app, and flushes the logs. +# +# Log tags (+taggers+) can be an Array containing: methods that the +request+ +# object responds to, objects that respond to +to_s+ or Proc objects that accept +# an instance of the +request+ object. +# +# pkg:gem/railties#lib/rails/rack/logger.rb:14 +class Rails::Rack::Logger < ::ActiveSupport::LogSubscriber + # pkg:gem/railties#lib/rails/rack/logger.rb:15 + def initialize(app, taggers = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/rack/logger.rb:20 + def call(env); end + + private + + # pkg:gem/railties#lib/rails/rack/logger.rb:33 + def call_app(request, env); end + + # pkg:gem/railties#lib/rails/rack/logger.rb:64 + def compute_tags(request); end + + # pkg:gem/railties#lib/rails/rack/logger.rb:81 + def finish_request_instrumentation(handle, logger_tag_pop_count); end + + # pkg:gem/railties#lib/rails/rack/logger.rb:77 + def logger; end + + # Started GET "/session/new" for 127.0.0.1 at 2012-09-26 14:51:42 -0700 + # + # pkg:gem/railties#lib/rails/rack/logger.rb:56 + def started_request_message(request); end +end + +# Allows you to silence requests made to a specific path. +# This is useful for preventing recurring requests like health checks from clogging the logging. +# This middleware is used to do just that against the path /up in production by default. +# +# Examples: +# +# config.middleware.insert_before \ +# Rails::Rack::Logger, Rails::Rack::SilenceRequest, path: "/up" +# +# config.middleware.insert_before \ +# Rails::Rack::Logger, Rails::Rack::SilenceRequest, path: /test$/ +# +# This middleware can also be configured using `config.silence_healthcheck_path = "/up"` in Rails. +# +# pkg:gem/railties#lib/rails/rack/silence_request.rb:22 +class Rails::Rack::SilenceRequest + # pkg:gem/railties#lib/rails/rack/silence_request.rb:23 + def initialize(app, path:); end + + # pkg:gem/railties#lib/rails/rack/silence_request.rb:27 + def call(env); end +end + +# +Rails::Railtie+ is the core of the \Rails framework and provides +# several hooks to extend \Rails and/or modify the initialization process. +# +# Every major component of \Rails (Action Mailer, Action Controller, Active +# Record, etc.) implements a railtie. Each of them is responsible for their +# own initialization. This makes \Rails itself absent of any component hooks, +# allowing other components to be used in place of any of the \Rails defaults. +# +# Developing a \Rails extension does _not_ require implementing a railtie, but +# if you need to interact with the \Rails framework during or after boot, then +# a railtie is needed. +# +# For example, an extension doing any of the following would need a railtie: +# +# * creating initializers +# * configuring a \Rails framework for the application, like setting a generator +# * adding config.* keys to the environment +# * setting up a subscriber with ActiveSupport::Notifications +# * adding Rake tasks +# +# == Creating a Railtie +# +# To extend \Rails using a railtie, create a subclass of +Rails::Railtie+. +# This class must be loaded during the \Rails boot process, and is conventionally +# called +MyNamespace::Railtie+. +# +# The following example demonstrates an extension which can be used with or +# without \Rails. +# +# # lib/my_gem/railtie.rb +# module MyGem +# class Railtie < Rails::Railtie +# end +# end +# +# # lib/my_gem.rb +# require "my_gem/railtie" if defined?(Rails::Railtie) +# +# == Initializers +# +# To add an initialization step to the \Rails boot process from your railtie, just +# define the initialization code with the +initializer+ macro: +# +# class MyGem::Railtie < Rails::Railtie +# initializer "my_gem.configure_rails_initialization" do +# # some initialization behavior +# end +# end +# +# If specified, the block can also receive the application object, in case you +# need to access some application-specific configuration, like middleware: +# +# class MyGem::Railtie < Rails::Railtie +# initializer "my_gem.configure_rails_initialization" do |app| +# app.middleware.use MyGem::Middleware +# end +# end +# +# Finally, you can also pass :before and :after as options to +# +initializer+, in case you want to couple it with a specific step in the +# initialization process. +# +# == Configuration +# +# Railties can access a config object which contains configuration shared by all +# railties and the application: +# +# class MyGem::Railtie < Rails::Railtie +# # Customize the ORM +# config.app_generators.orm :my_gem_orm +# +# # Add a to_prepare block which is executed once in production +# # and before each request in development. +# config.to_prepare do +# MyGem.setup! +# end +# end +# +# == Loading Rake Tasks and Generators +# +# If your railtie has Rake tasks, you can tell \Rails to load them through the method +# +rake_tasks+: +# +# class MyGem::Railtie < Rails::Railtie +# rake_tasks do +# load "path/to/my_gem.tasks" +# end +# end +# +# By default, \Rails loads generators from your load path. However, if you want to place +# your generators at a different location, you can specify in your railtie a block which +# will load them during normal generators lookup: +# +# class MyGem::Railtie < Rails::Railtie +# generators do +# require "path/to/my_gem_generator" +# end +# end +# +# Since filenames on the load path are shared across gems, be sure that files you load +# through a railtie have unique names. +# +# == Run another program when the \Rails server starts +# +# In development, it's very usual to have to run another process next to the \Rails Server. In example +# you might want to start the Webpack or React server. Or maybe you need to run your job scheduler process +# like Sidekiq. This is usually done by opening a new shell and running the program from here. +# +# \Rails allow you to specify a +server+ block which will get called when a \Rails server starts. +# This way, your users don't need to remember to have to open a new shell and run another program, making +# this less confusing for everyone. +# It can be used like this: +# +# class MyGem::Railtie < Rails::Railtie +# server do +# WebpackServer.start +# end +# end +# +# == Application and Engine +# +# An engine is nothing more than a railtie with some initializers already set. And since +# Rails::Application is an engine, the same configuration described here can be +# used in both. +# +# Be sure to look at the documentation of those specific classes for more information. +# +# pkg:gem/railties#lib/rails/railtie.rb:135 +class Rails::Railtie + include ::Rails::Initializable + extend ::ActiveSupport::DescendantsTracker + extend ::Rails::Initializable::ClassMethods + + # pkg:gem/railties#lib/rails/railtie.rb:244 + def initialize; end + + # This is used to create the config object on Railties, an instance of + # Railtie::Configuration, that is used by Railties and Application to store + # related configuration. + # + # pkg:gem/railties#lib/rails/railtie.rb:261 + def config; end + + # pkg:gem/railties#lib/rails/railtie.rb:254 + def configure(&block); end + + # pkg:gem/railties#lib/rails/railtie.rb:250 + def inspect; end + + # pkg:gem/railties#lib/rails/railtie.rb:242 + def railtie_name(*, **, &); end + + # pkg:gem/railties#lib/rails/railtie.rb:265 + def railtie_namespace; end + + protected + + # pkg:gem/railties#lib/rails/railtie.rb:270 + def run_console_blocks(app); end + + # pkg:gem/railties#lib/rails/railtie.rb:274 + def run_generators_blocks(app); end + + # pkg:gem/railties#lib/rails/railtie.rb:278 + def run_runner_blocks(app); end + + # pkg:gem/railties#lib/rails/railtie.rb:287 + def run_server_blocks(app); end + + # pkg:gem/railties#lib/rails/railtie.rb:282 + def run_tasks_blocks(app); end + + private + + # run `&block` in every registered block in `#register_block_for` + # + # pkg:gem/railties#lib/rails/railtie.rb:293 + def each_registered_block(type, &block); end + + class << self + # pkg:gem/railties#lib/rails/railtie.rb:193 + def <=>(other); end + + # pkg:gem/railties#lib/rails/railtie.rb:171 + def abstract_railtie?; end + + # This is used to create the config object on Railties, an instance of + # Railtie::Configuration, that is used by Railties and Application to store + # related configuration. + # + # pkg:gem/railties#lib/rails/railtie.rb:145 + def config(*, **, &); end + + # Allows you to configure the railtie. This is the same method seen in + # Railtie::Configurable, but this module is no longer required for all + # subclasses of Railtie so we provide the class method here. + # + # pkg:gem/railties#lib/rails/railtie.rb:189 + def configure(&block); end + + # pkg:gem/railties#lib/rails/railtie.rb:155 + def console(&blk); end + + # pkg:gem/railties#lib/rails/railtie.rb:163 + def generators(&blk); end + + # pkg:gem/railties#lib/rails/railtie.rb:197 + def inherited(subclass); end + + # Since Rails::Railtie cannot be instantiated, any methods that call + # +instance+ are intended to be called only on subclasses of a Railtie. + # + # pkg:gem/railties#lib/rails/railtie.rb:182 + def instance; end + + # pkg:gem/railties#lib/rails/railtie.rb:175 + def railtie_name(name = T.unsafe(nil)); end + + # pkg:gem/railties#lib/rails/railtie.rb:151 + def rake_tasks(&blk); end + + # pkg:gem/railties#lib/rails/railtie.rb:159 + def runner(&blk); end + + # pkg:gem/railties#lib/rails/railtie.rb:167 + def server(&blk); end + + # pkg:gem/railties#lib/rails/railtie.rb:147 + def subclasses; end + + protected + + # pkg:gem/railties#lib/rails/railtie.rb:205 + def increment_load_index; end + + # pkg:gem/railties#lib/rails/railtie.rb:203 + def load_index; end + + private + + # pkg:gem/railties#lib/rails/railtie.rb:211 + def generate_railtie_name(string); end + + # If the class method does not have a method, then send the method call + # to the Railtie instance. + # + # pkg:gem/railties#lib/rails/railtie.rb:223 + def method_missing(name, *, **, &); end + + # pkg:gem/railties#lib/rails/railtie.rb:144 + def new(*_arg0); end + + # receives an instance variable identifier, set the variable value if is + # blank and append given block to value, which will be used later in + # `#each_registered_block(type, &block)` + # + # pkg:gem/railties#lib/rails/railtie.rb:234 + def register_block_for(type, &blk); end + + # pkg:gem/railties#lib/rails/railtie.rb:215 + def respond_to_missing?(name, _); end + end +end + +# pkg:gem/railties#lib/rails/railtie.rb:141 +Rails::Railtie::ABSTRACT_RAILTIES = T.let(T.unsafe(nil), Array) + +# pkg:gem/railties#lib/rails/railtie/configuration.rb:7 +class Rails::Railtie::Configuration + # pkg:gem/railties#lib/rails/railtie/configuration.rb:8 + def initialize; end + + # Last configurable block to run. Called after frameworks initialize. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:70 + def after_initialize(&block); end + + # Called after application routes have been loaded. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:75 + def after_routes_loaded(&block); end + + # This allows you to modify application's generators from Railties. + # + # Values set on app_generators will become defaults for application, unless + # application overwrites them. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:47 + def app_generators; end + + # This allows you to modify the application's middlewares from Engines. + # + # All operations you run on the app_middleware will be replayed on the + # application once it is defined and the default_middlewares are + # created + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:39 + def app_middleware; end + + # First configurable block to run. Called before any initializers are run. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:54 + def before_configuration(&block); end + + # Third configurable block to run. Does not run if +config.eager_load+ + # set to false. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:60 + def before_eager_load(&block); end + + # Second configurable block to run. Called before frameworks initialize. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:65 + def before_initialize(&block); end + + # All namespaces that are eager loaded + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:18 + def eager_load_namespaces; end + + # pkg:gem/railties#lib/rails/railtie/configuration.rb:90 + def respond_to?(name, include_private = T.unsafe(nil)); end + + # Defines generic callbacks to run before #after_initialize. Useful for + # Rails::Railtie subclasses. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:86 + def to_prepare(&blk); end + + # Array of callbacks defined by #to_prepare. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:80 + def to_prepare_blocks; end + + # Add directories that should be watched for change. + # The key of the hashes should be directories and the values should + # be an array of extensions to match in each directory. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:30 + def watchable_dirs; end + + # Add files that should be watched for change. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:23 + def watchable_files; end + + private + + # pkg:gem/railties#lib/rails/railtie/configuration.rb:95 + def actual_method?(key); end + + # pkg:gem/railties#lib/rails/railtie/configuration.rb:99 + def method_missing(name, *args, &blk); end + + class << self + # Expose the eager_load_namespaces at "module" level for convenience. + # + # pkg:gem/railties#lib/rails/railtie/configuration.rb:13 + def eager_load_namespaces; end + end +end + +# Implements the logic behind +Rails::Command::NotesCommand+. See rails notes --help for usage information. +# +# Annotation objects are triplets :line, :tag, :text that +# represent the line where the annotation lives, its tag, and its text. Note +# the filename is not stored. +# +# Annotations are looked for in comments and modulus whitespace they have to +# start with the tag optionally followed by a colon. Everything up to the end +# of the line (or closing ERB comment tag) is considered to be their text. +# +# pkg:gem/railties#lib/rails/source_annotation_extractor.rb:21 +class Rails::SourceAnnotationExtractor + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:158 + def initialize(tag); end + + # Prints the mapping from filenames to annotations in +results+ ordered by filename. + # The +options+ hash is passed to each annotation's +to_s+. + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:207 + def display(results, options = T.unsafe(nil)); end + + # Returns a hash that maps filenames under +dirs+ (recursively) to arrays + # with their annotations. + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:164 + def find(dirs); end + + # Returns a hash that maps filenames under +dir+ (recursively) to arrays + # with their annotations. Files with extensions registered in + # Rails::SourceAnnotationExtractor::Annotation.extensions are + # taken into account. Only files with annotations are included. + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:172 + def find_in(dir); end + + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:156 + def tag; end + + class << self + # Prints all annotations with tag +tag+ under the root directories +app+, + # +config+, +db+, +lib+, and +test+ (recursively). + # + # If +tag+ is nil, annotations with either default or registered tags are printed. + # + # Specific directories can be explicitly set using the :dirs key in +options+. + # + # Rails::SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true + # + # If +options+ has a :tag flag, it will be passed to each annotation's +to_s+. + # + # See SourceAnnotationExtractor#find_in for a list of file extensions that will be taken into account. + # + # This class method is the single entry point for the rails notes command. + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:149 + def enumerate(tag = T.unsafe(nil), options = T.unsafe(nil)); end + end +end + +# pkg:gem/railties#lib/rails/source_annotation_extractor.rb:71 +class Rails::SourceAnnotationExtractor::Annotation < ::Struct + # Returns a representation of the annotation that looks like this: + # + # [126] [TODO] This algorithm is simple and clearly correct, make it faster. + # + # If +options+ has a flag :tag the tag is shown as in the example above. + # Otherwise the string contains just line and text. + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:128 + def to_s(options = T.unsafe(nil)); end + + class << self + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:72 + def directories; end + + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:92 + def extensions; end + + # Registers additional directories to be included + # Rails::SourceAnnotationExtractor::Annotation.register_directories("spec", "another") + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:78 + def register_directories(*dirs); end + + # Registers new Annotations File Extensions + # Rails::SourceAnnotationExtractor::Annotation.register_extensions("css", "scss", "sass", "less", "js") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ } + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:98 + def register_extensions(*exts, &block); end + + # Registers additional tags + # Rails::SourceAnnotationExtractor::Annotation.register_tags("TESTME", "DEPRECATEME") + # + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:88 + def register_tags(*additional_tags); end + + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:82 + def tags; end + end +end + +# Wraps a regular expression that will be tested against each of the source +# file's comments. +# +# pkg:gem/railties#lib/rails/source_annotation_extractor.rb:24 +class Rails::SourceAnnotationExtractor::ParserExtractor < ::Struct + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:26 + def annotations(file); end +end + +# Wraps a regular expression that will iterate through a file's lines and +# test each one for the given pattern. +# +# pkg:gem/railties#lib/rails/source_annotation_extractor.rb:59 +class Rails::SourceAnnotationExtractor::PatternExtractor < ::Struct + # pkg:gem/railties#lib/rails/source_annotation_extractor.rb:60 + def annotations(file); end +end + +# pkg:gem/railties#lib/rails/gem_version.rb:9 +module Rails::VERSION; end + +# pkg:gem/railties#lib/rails/gem_version.rb:10 +Rails::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/railties#lib/rails/gem_version.rb:11 +Rails::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/railties#lib/rails/gem_version.rb:13 +Rails::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/railties#lib/rails/gem_version.rb:15 +Rails::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/railties#lib/rails/gem_version.rb:12 +Rails::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/railties#lib/rails/welcome_controller.rb:5 +class Rails::WelcomeController < ::Rails::ApplicationController + # pkg:gem/railties#lib/rails/welcome_controller.rb:9 + def index; end + + private + + # pkg:gem/railties#lib/rails/welcome_controller.rb:5 + def _layout(lookup_context, formats, keys); end + + class << self + private + + # pkg:gem/railties#lib/rails/welcome_controller.rb:6 + def __class_attr___callbacks; end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:6 + def __class_attr___callbacks=(new_value); end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:7 + def __class_attr__layout; end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:7 + def __class_attr__layout=(new_value); end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:7 + def __class_attr__layout_conditions; end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:7 + def __class_attr__layout_conditions=(new_value); end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:5 + def __class_attr_config; end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:5 + def __class_attr_config=(new_value); end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:5 + def __class_attr_middleware_stack; end + + # pkg:gem/railties#lib/rails/welcome_controller.rb:5 + def __class_attr_middleware_stack=(new_value); end + end +end diff --git a/sorbet/rbi/gems/rainbow@3.1.1.rbi b/sorbet/rbi/gems/rainbow@3.1.1.rbi new file mode 100644 index 0000000..8e11eec --- /dev/null +++ b/sorbet/rbi/gems/rainbow@3.1.1.rbi @@ -0,0 +1,362 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rainbow` gem. +# Please instead update this file by running `bin/tapioca gem rainbow`. + + +class Object < ::BasicObject + include ::Kernel + include ::PP::ObjectMixin + + private + + # pkg:gem/rainbow#lib/rainbow/global.rb:23 + def Rainbow(string); end +end + +# pkg:gem/rainbow#lib/rainbow/string_utils.rb:3 +module Rainbow + class << self + # pkg:gem/rainbow#lib/rainbow/global.rb:10 + def enabled; end + + # pkg:gem/rainbow#lib/rainbow/global.rb:14 + def enabled=(value); end + + # pkg:gem/rainbow#lib/rainbow/global.rb:6 + def global; end + + # pkg:gem/rainbow#lib/rainbow.rb:6 + def new; end + + # pkg:gem/rainbow#lib/rainbow/global.rb:18 + def uncolor(string); end + end +end + +# pkg:gem/rainbow#lib/rainbow/color.rb:4 +class Rainbow::Color + # pkg:gem/rainbow#lib/rainbow/color.rb:5 + def ground; end + + class << self + # pkg:gem/rainbow#lib/rainbow/color.rb:7 + def build(ground, values); end + + # pkg:gem/rainbow#lib/rainbow/color.rb:40 + def parse_hex_color(hex); end + end +end + +# pkg:gem/rainbow#lib/rainbow/color.rb:54 +class Rainbow::Color::Indexed < ::Rainbow::Color + # pkg:gem/rainbow#lib/rainbow/color.rb:57 + def initialize(ground, num); end + + # pkg:gem/rainbow#lib/rainbow/color.rb:62 + def codes; end + + # pkg:gem/rainbow#lib/rainbow/color.rb:55 + def num; end +end + +# pkg:gem/rainbow#lib/rainbow/color.rb:69 +class Rainbow::Color::Named < ::Rainbow::Color::Indexed + # pkg:gem/rainbow#lib/rainbow/color.rb:90 + def initialize(ground, name); end + + class << self + # pkg:gem/rainbow#lib/rainbow/color.rb:82 + def color_names; end + + # pkg:gem/rainbow#lib/rainbow/color.rb:86 + def valid_names; end + end +end + +# pkg:gem/rainbow#lib/rainbow/color.rb:70 +Rainbow::Color::Named::NAMES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rainbow#lib/rainbow/color.rb:100 +class Rainbow::Color::RGB < ::Rainbow::Color::Indexed + # pkg:gem/rainbow#lib/rainbow/color.rb:107 + def initialize(ground, *values); end + + # pkg:gem/rainbow#lib/rainbow/color.rb:101 + def b; end + + # pkg:gem/rainbow#lib/rainbow/color.rb:116 + def codes; end + + # pkg:gem/rainbow#lib/rainbow/color.rb:101 + def g; end + + # pkg:gem/rainbow#lib/rainbow/color.rb:101 + def r; end + + private + + # pkg:gem/rainbow#lib/rainbow/color.rb:122 + def code_from_rgb; end + + class << self + # pkg:gem/rainbow#lib/rainbow/color.rb:103 + def to_ansi_domain(value); end + end +end + +# pkg:gem/rainbow#lib/rainbow/color.rb:129 +class Rainbow::Color::X11Named < ::Rainbow::Color::RGB + include ::Rainbow::X11ColorNames + + # pkg:gem/rainbow#lib/rainbow/color.rb:140 + def initialize(ground, name); end + + class << self + # pkg:gem/rainbow#lib/rainbow/color.rb:132 + def color_names; end + + # pkg:gem/rainbow#lib/rainbow/color.rb:136 + def valid_names; end + end +end + +# pkg:gem/rainbow#lib/rainbow/null_presenter.rb:4 +class Rainbow::NullPresenter < ::String + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:9 + def background(*_values); end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:95 + def bg(*_values); end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:49 + def black; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:33 + def blink; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:65 + def blue; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:96 + def bold; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:17 + def bright; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:5 + def color(*_values); end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:45 + def cross_out; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:73 + def cyan; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:97 + def dark; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:21 + def faint; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:94 + def fg(*_values); end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:93 + def foreground(*_values); end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:57 + def green; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:41 + def hide; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:37 + def inverse; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:25 + def italic; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:69 + def magenta; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:81 + def method_missing(method_name, *args); end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:53 + def red; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:13 + def reset; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:98 + def strike; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:29 + def underline; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:77 + def white; end + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:61 + def yellow; end + + private + + # pkg:gem/rainbow#lib/rainbow/null_presenter.rb:89 + def respond_to_missing?(method_name, *args); end +end + +# pkg:gem/rainbow#lib/rainbow/presenter.rb:8 +class Rainbow::Presenter < ::String + # Sets background color of this text. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:30 + def background(*values); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:34 + def bg(*values); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:92 + def black; end + + # Turns on blinking attribute for this text (not well supported by terminal + # emulators). + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:72 + def blink; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:108 + def blue; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:49 + def bold; end + + # Turns on bright/bold for this text. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:45 + def bright; end + + # Sets color of this text. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:22 + def color(*values); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:86 + def cross_out; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:116 + def cyan; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:57 + def dark; end + + # Turns on faint/dark for this text (not well supported by terminal + # emulators). + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:53 + def faint; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:27 + def fg(*values); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:26 + def foreground(*values); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:100 + def green; end + + # Hides this text (set its color to the same as background). + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:82 + def hide; end + + # Inverses current foreground/background colors. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:77 + def inverse; end + + # Turns on italic style for this text (not well supported by terminal + # emulators). + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:61 + def italic; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:112 + def magenta; end + + # We take care of X11 color method call here. + # Such as #aqua, #ghostwhite. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:126 + def method_missing(method_name, *args); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:96 + def red; end + + # Resets terminal to default colors/backgrounds. + # + # It shouldn't be needed to use this method because all methods + # append terminal reset code to end of string. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:40 + def reset; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:90 + def strike; end + + # Turns on underline decoration for this text. + # + # pkg:gem/rainbow#lib/rainbow/presenter.rb:66 + def underline; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:120 + def white; end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:104 + def yellow; end + + private + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:134 + def respond_to_missing?(method_name, *args); end + + # pkg:gem/rainbow#lib/rainbow/presenter.rb:140 + def wrap_with_sgr(codes); end +end + +# pkg:gem/rainbow#lib/rainbow/presenter.rb:9 +Rainbow::Presenter::TERM_EFFECTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rainbow#lib/rainbow/string_utils.rb:4 +class Rainbow::StringUtils + class << self + # pkg:gem/rainbow#lib/rainbow/string_utils.rb:17 + def uncolor(string); end + + # pkg:gem/rainbow#lib/rainbow/string_utils.rb:5 + def wrap_with_sgr(string, codes); end + end +end + +# pkg:gem/rainbow#lib/rainbow/wrapper.rb:7 +class Rainbow::Wrapper + # pkg:gem/rainbow#lib/rainbow/wrapper.rb:10 + def initialize(enabled = T.unsafe(nil)); end + + # pkg:gem/rainbow#lib/rainbow/wrapper.rb:8 + def enabled; end + + # pkg:gem/rainbow#lib/rainbow/wrapper.rb:8 + def enabled=(_arg0); end + + # pkg:gem/rainbow#lib/rainbow/wrapper.rb:14 + def wrap(string); end +end + +# pkg:gem/rainbow#lib/rainbow/x11_color_names.rb:4 +module Rainbow::X11ColorNames; end + +# pkg:gem/rainbow#lib/rainbow/x11_color_names.rb:5 +Rainbow::X11ColorNames::NAMES = T.let(T.unsafe(nil), Hash) diff --git a/sorbet/rbi/gems/rake@13.4.2.rbi b/sorbet/rbi/gems/rake@13.4.2.rbi new file mode 100644 index 0000000..d8d1ba2 --- /dev/null +++ b/sorbet/rbi/gems/rake@13.4.2.rbi @@ -0,0 +1,3130 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rake` gem. +# Please instead update this file by running `bin/tapioca gem rake`. + + +# :stopdoc: +# +# Some top level Constants. +# +# pkg:gem/rake#lib/rake.rb:68 +FileList = Rake::FileList + +# -- +# This a FileUtils extension that defines several additional commands to be +# added to the FileUtils utility functions. +# +# pkg:gem/rake#lib/rake/file_utils.rb:8 +module FileUtils + # Run a Ruby interpreter with the given arguments. + # + # Example: + # ruby %{-pe '$_.upcase!' ; rm # -rf /. + # + # If a block is given, upon command completion the block is called with an + # OK flag (true on a zero exit status) and a Process::Status object. + # Without a block a RuntimeError is raised when the command exits non-zero. + # + # Examples: + # + # sh 'ls -ltr' + # + # sh 'ls', 'file with spaces' + # + # # check exit status after command runs + # sh %{grep pattern file} do |ok, res| + # if !ok + # puts "pattern not found (status = #{res.exitstatus})" + # end + # end + # + # pkg:gem/rake#lib/rake/file_utils.rb:43 + def sh(*cmd, &block); end + + # Split a file path into individual directory names. + # + # Example: + # split_all("a/b/c") => ['a', 'b', 'c'] + # + # pkg:gem/rake#lib/rake/file_utils.rb:131 + def split_all(path); end + + private + + # pkg:gem/rake#lib/rake/file_utils.rb:61 + def create_shell_runner(cmd); end + + # pkg:gem/rake#lib/rake/file_utils.rb:89 + def set_verbose_option(options); end + + # pkg:gem/rake#lib/rake/file_utils.rb:71 + def sh_show_command(cmd, options = T.unsafe(nil)); end +end + +# pkg:gem/rake#lib/rake/file_utils.rb:111 +FileUtils::LN_SUPPORTED = T.let(T.unsafe(nil), Array) + +# Path to the currently running Ruby program +# +# pkg:gem/rake#lib/rake/file_utils.rb:10 +FileUtils::RUBY = T.let(T.unsafe(nil), String) + +# pkg:gem/rake#lib/rake/ext/core.rb:2 +class Module + # Check for an existing method in the current class before extending. If + # the method already exists, then a warning is printed and the extension is + # not added. Otherwise the block is yielded and any definitions in the + # block will take effect. + # + # Usage: + # + # class String + # rake_extension("xyz") do + # def xyz + # ... + # end + # end + # end + # + # pkg:gem/rake#lib/rake/ext/core.rb:18 + def rake_extension(method); end +end + +# -- +# Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# ++ +# :stopdoc: +# +# pkg:gem/rake#lib/rake.rb:24 +module Rake + extend ::FileUtils::StreamUtils_ + extend ::FileUtils + extend ::Rake::FileUtilsExt + + class << self + # Add files to the rakelib list + # + # pkg:gem/rake#lib/rake/rake_module.rb:33 + def add_rakelib(*files); end + + # Current Rake Application + # + # pkg:gem/rake#lib/rake/rake_module.rb:8 + def application; end + + # Set the current Rake application object. + # + # pkg:gem/rake#lib/rake/rake_module.rb:13 + def application=(app); end + + # Yield each file or directory component. + # + # pkg:gem/rake#lib/rake/file_list.rb:418 + def each_dir_parent(dir); end + + # Convert Pathname and Pathname-like objects to strings; + # leave everything else alone + # + # pkg:gem/rake#lib/rake/file_list.rb:429 + def from_pathname(path); end + + # Load a rakefile. + # + # pkg:gem/rake#lib/rake/rake_module.rb:28 + def load_rakefile(path); end + + # Return the original directory where the Rake application was started. + # + # pkg:gem/rake#lib/rake/rake_module.rb:23 + def original_dir; end + + # pkg:gem/rake#lib/rake/rake_module.rb:17 + def suggested_thread_count; end + + # Make +block_application+ the default rake application inside a block so + # you can load rakefiles into a different application. + # + # This is useful when you want to run rake tasks inside a library without + # running rake in a sub-shell. + # + # Example: + # + # Dir.chdir 'other/directory' + # + # other_rake = Rake.with_application do |rake| + # rake.load_rakefile + # end + # + # puts other_rake.tasks + # + # pkg:gem/rake#lib/rake/rake_module.rb:54 + def with_application(block_application = T.unsafe(nil)); end + end +end + +# Rake main application object. When invoking +rake+ from the +# command line, a Rake::Application object is created and run. +# +# pkg:gem/rake#lib/rake/application.rb:20 +class Rake::Application + include ::Rake::TaskManager + include ::Rake::TraceOutput + + # Initialize a Rake::Application object. + # + # pkg:gem/rake#lib/rake/application.rb:50 + def initialize; end + + # Add a file to the list of files to be imported. + # + # pkg:gem/rake#lib/rake/application.rb:793 + def add_import(fn); end + + # Add a loader to handle imported files ending in the extension + # +ext+. + # + # pkg:gem/rake#lib/rake/application.rb:162 + def add_loader(ext, loader); end + + # Collect the list of tasks on the command line. If no tasks are + # given, return a list containing only the default task. + # Environmental assignments are processed at this time as well. + # + # `args` is the list of arguments to peruse to get the list of tasks. + # It should be the command line that was given to rake, less any + # recognised command-line options, which OptionParser.parse will + # have taken care of already. + # + # pkg:gem/rake#lib/rake/application.rb:774 + def collect_command_line_tasks(args); end + + # Default task name ("default"). + # (May be overridden by subclasses) + # + # pkg:gem/rake#lib/rake/application.rb:788 + def default_task_name; end + + # Warn about deprecated usage. + # + # Example: + # Rake.application.deprecate("import", "Rake.import", caller.first) + # + # pkg:gem/rake#lib/rake/application.rb:283 + def deprecate(old_usage, new_usage, call_site); end + + # pkg:gem/rake#lib/rake/application.rb:245 + def display_cause_details(ex); end + + # Display the error message that caused the exception. + # + # pkg:gem/rake#lib/rake/application.rb:229 + def display_error_message(ex); end + + # pkg:gem/rake#lib/rake/application.rb:270 + def display_exception_backtrace(ex); end + + # pkg:gem/rake#lib/rake/application.rb:237 + def display_exception_details(ex); end + + # pkg:gem/rake#lib/rake/application.rb:252 + def display_exception_details_seen; end + + # pkg:gem/rake#lib/rake/application.rb:260 + def display_exception_message_details(ex); end + + # Display the tasks and prerequisites + # + # pkg:gem/rake#lib/rake/application.rb:406 + def display_prerequisites; end + + # Display the tasks and comments. + # + # pkg:gem/rake#lib/rake/application.rb:323 + def display_tasks_and_comments; end + + # Calculate the dynamic width of the + # + # pkg:gem/rake#lib/rake/application.rb:374 + def dynamic_width; end + + # pkg:gem/rake#lib/rake/application.rb:378 + def dynamic_width_stty; end + + # pkg:gem/rake#lib/rake/application.rb:382 + def dynamic_width_tput; end + + # Exit the program because of an unhandled exception. + # (may be overridden by subclasses) + # + # pkg:gem/rake#lib/rake/application.rb:224 + def exit_because_of_exception(ex); end + + # pkg:gem/rake#lib/rake/application.rb:703 + def find_rakefile_location; end + + # Read and handle the command line options. Returns the command line + # arguments that we didn't understand, which should (in theory) be just + # task names and env vars. + # + # pkg:gem/rake#lib/rake/application.rb:669 + def handle_options(argv); end + + # pkg:gem/rake#lib/rake/application.rb:256 + def has_cause?(ex); end + + # True if one of the files in RAKEFILES is in the current directory. + # If a match is found, it is copied into @rakefile. + # + # pkg:gem/rake#lib/rake/application.rb:299 + def have_rakefile; end + + # Initialize the command line parameters and app name. + # + # pkg:gem/rake#lib/rake/application.rb:89 + def init(app_name = T.unsafe(nil), argv = T.unsafe(nil)); end + + # Invokes a task with arguments that are extracted from +task_string+ + # + # pkg:gem/rake#lib/rake/application.rb:180 + def invoke_task(task_string); end + + # Load the pending list of imported files. + # + # pkg:gem/rake#lib/rake/application.rb:798 + def load_imports; end + + # Find the rakefile and then load it and any pending imports. + # + # pkg:gem/rake#lib/rake/application.rb:125 + def load_rakefile; end + + # The name of the application (typically 'rake') + # + # pkg:gem/rake#lib/rake/application.rb:25 + def name; end + + # Application options from the command line + # + # pkg:gem/rake#lib/rake/application.rb:168 + def options; end + + # The original directory where rake was invoked. + # + # pkg:gem/rake#lib/rake/application.rb:28 + def original_dir; end + + # pkg:gem/rake#lib/rake/application.rb:186 + def parse_task_string(string); end + + # pkg:gem/rake#lib/rake/application.rb:715 + def print_rakefile_directory(location); end + + # Similar to the regular Ruby +require+ command, but will check + # for *.rake files in addition to *.rb files. + # + # pkg:gem/rake#lib/rake/application.rb:689 + def rake_require(file_name, paths = T.unsafe(nil), loaded = T.unsafe(nil)); end + + # Name of the actual rakefile used. + # + # pkg:gem/rake#lib/rake/application.rb:31 + def rakefile; end + + # pkg:gem/rake#lib/rake/application.rb:814 + def rakefile_location(backtrace = T.unsafe(nil)); end + + # pkg:gem/rake#lib/rake/application.rb:720 + def raw_load_rakefile; end + + # Run the Rake application. The run method performs the following + # three steps: + # + # * Initialize the command line options (+init+). + # * Define the tasks (+load_rakefile+). + # * Run the top level tasks (+top_level+). + # + # If you wish to build a custom rake command, you should call + # +init+ on your application. Then define any tasks. Finally, + # call +top_level+ to run your top level tasks. + # + # pkg:gem/rake#lib/rake/application.rb:80 + def run(argv = T.unsafe(nil)); end + + # Run the given block with the thread startup and shutdown. + # + # pkg:gem/rake#lib/rake/application.rb:145 + def run_with_threads; end + + # pkg:gem/rake#lib/rake/application.rb:823 + def set_default_options; end + + # Provide standard exception handling for the given block. + # + # pkg:gem/rake#lib/rake/application.rb:208 + def standard_exception_handling; end + + # A list of all the standard options used in rake, suitable for + # passing to OptionParser. + # + # pkg:gem/rake#lib/rake/application.rb:427 + def standard_rake_options; end + + # The directory path containing the system wide rakefiles. + # + # pkg:gem/rake#lib/rake/application.rb:752 + def system_dir; end + + # Number of columns on the terminal + # + # pkg:gem/rake#lib/rake/application.rb:34 + def terminal_columns; end + + # Number of columns on the terminal + # + # pkg:gem/rake#lib/rake/application.rb:34 + def terminal_columns=(_arg0); end + + # pkg:gem/rake#lib/rake/application.rb:362 + def terminal_width; end + + # Return the thread pool used for multithreaded processing. + # + # pkg:gem/rake#lib/rake/application.rb:173 + def thread_pool; end + + # Run the top level tasks of a Rake application. + # + # pkg:gem/rake#lib/rake/application.rb:132 + def top_level; end + + # List of the top level task names (task names from the command line). + # + # pkg:gem/rake#lib/rake/application.rb:37 + def top_level_tasks; end + + # pkg:gem/rake#lib/rake/application.rb:413 + def trace(*strings); end + + # pkg:gem/rake#lib/rake/application.rb:395 + def truncate(string, width); end + + # We will truncate output if we are outputting to a TTY or if we've been + # given an explicit column width to honor + # + # pkg:gem/rake#lib/rake/application.rb:318 + def truncate_output?; end + + # Override the detected TTY output state (mostly for testing) + # + # pkg:gem/rake#lib/rake/application.rb:40 + def tty_output=(_arg0); end + + # True if we are outputting to TTY, false otherwise + # + # pkg:gem/rake#lib/rake/application.rb:312 + def tty_output?; end + + # pkg:gem/rake#lib/rake/application.rb:386 + def unix?; end + + # pkg:gem/rake#lib/rake/application.rb:391 + def windows?; end + + private + + # pkg:gem/rake#lib/rake/application.rb:746 + def glob(path, &block); end + + # Does the exception have a task invocation chain? + # + # pkg:gem/rake#lib/rake/application.rb:292 + def has_chain?(exception); end + + # pkg:gem/rake#lib/rake/application.rb:103 + def load_debug_at_stop_feature; end + + # pkg:gem/rake#lib/rake/application.rb:645 + def select_tasks_to_show(options, show_tasks, value); end + + # pkg:gem/rake#lib/rake/application.rb:652 + def select_trace_output(options, trace_option, value); end + + # pkg:gem/rake#lib/rake/application.rb:418 + def sort_options(options); end + + # The standard directory containing system wide rake files. + # + # pkg:gem/rake#lib/rake/application.rb:757 + def standard_system_dir; end +end + +# pkg:gem/rake#lib/rake/application.rb:42 +Rake::Application::DEFAULT_RAKEFILES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/backtrace.rb:3 +module Rake::Backtrace + class << self + # pkg:gem/rake#lib/rake/backtrace.rb:19 + def collapse(backtrace); end + end +end + +# pkg:gem/rake#lib/rake/backtrace.rb:8 +Rake::Backtrace::SUPPRESSED_PATHS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/backtrace.rb:12 +Rake::Backtrace::SUPPRESSED_PATHS_RE = T.let(T.unsafe(nil), String) + +# pkg:gem/rake#lib/rake/backtrace.rb:17 +Rake::Backtrace::SUPPRESS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rake#lib/rake/backtrace.rb:4 +Rake::Backtrace::SYS_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/backtrace.rb:5 +Rake::Backtrace::SYS_PATHS = T.let(T.unsafe(nil), Array) + +# Mixin for creating easily cloned objects. +# +# pkg:gem/rake#lib/rake/cloneable.rb:6 +module Rake::Cloneable + private + + # The hook that is invoked by 'clone' and 'dup' methods. + # + # pkg:gem/rake#lib/rake/cloneable.rb:8 + def initialize_copy(source); end +end + +# pkg:gem/rake#lib/rake/application.rb:14 +class Rake::CommandLineOptionError < ::StandardError; end + +# Based on a script at: +# http://stackoverflow.com/questions/891537/ruby-detect-number-of-cpus-installed +# +# pkg:gem/rake#lib/rake/cpu_counter.rb:6 +class Rake::CpuCounter + # pkg:gem/rake#lib/rake/cpu_counter.rb:22 + def count; end + + # pkg:gem/rake#lib/rake/cpu_counter.rb:11 + def count_with_default(default = T.unsafe(nil)); end + + class << self + # pkg:gem/rake#lib/rake/cpu_counter.rb:7 + def count; end + end +end + +# DSL is a module that provides #task, #desc, #namespace, etc. Use this +# when you'd like to use rake outside the top level scope. +# +# For a Rakefile you run from the command line this module is automatically +# included. +# +# pkg:gem/rake#lib/rake/dsl_definition.rb:14 +module Rake::DSL + include ::FileUtils::StreamUtils_ + include ::FileUtils + include ::Rake::FileUtilsExt + + private + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def cd(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def chdir(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def chmod(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def chmod_R(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def chown(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def chown_R(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def copy(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def cp(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def cp_lr(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def cp_r(*args, **options, &block); end + + # Describes the next rake task. Duplicate descriptions are discarded. + # Descriptions are shown with rake -T (up to the first + # sentence) and rake -D (the entire description). + # + # Example: + # desc "Run the Unit Tests" + # task test: [:build] do + # # ... run tests + # end + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:166 + def desc(description); end + + # Declare a set of files tasks to create the given directories on + # demand. + # + # Example: + # directory "testdata/doc" + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:92 + def directory(*args, &block); end + + # Declare a file task. + # + # Example: + # file "config.cfg" => ["config.template"] do + # open("config.cfg", "w") do |outfile| + # open("config.template") do |infile| + # while line = infile.gets + # outfile.puts line + # end + # end + # end + # end + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:76 + def file(*args, &block); end + + # Declare a file creation task. + # (Mainly used for the directory command). + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:82 + def file_create(*args, &block); end + + # Import the partial Rakefiles +fn+. Imported files are loaded + # _after_ the current file is completely loaded. This allows the + # import statement to appear anywhere in the importing file, and yet + # allowing the imported files to depend on objects defined in the + # importing file. + # + # A common use of the import statement is to include files + # containing dependency declarations. + # + # See also the --rakelibdir command line option. + # + # Example: + # import ".depend", "my_rules" + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:184 + def import(*fns); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def install(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def link(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def ln(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def ln_s(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def ln_sf(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def ln_sr(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def makedirs(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def mkdir(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def mkdir_p(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def mkpath(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def move(*args, **options, &block); end + + # Declare a task that performs its prerequisites in + # parallel. Multitasks does *not* guarantee that its prerequisites + # will execute in any given order (which is obvious when you think + # about it) + # + # Example: + # multitask deploy: %w[deploy_gem deploy_rdoc] + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:113 + def multitask(*args, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def mv(*args, **options, &block); end + + # Create a new rake namespace and use it for evaluating the given + # block. Returns a NameSpace object that can be used to lookup + # tasks defined in the namespace. + # + # Example: + # + # ns = namespace "nested" do + # # the "nested:run" task + # task :run + # end + # task_run = ns[:run] # find :run in the given namespace. + # + # Tasks can also be defined in a namespace by using a ":" in the task + # name: + # + # task "nested:test" do + # # ... + # end + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:136 + def namespace(name = T.unsafe(nil), &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def nowrite(value = T.unsafe(nil)); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rake_check_options(options, *optdecl); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rake_output_message(message); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def remove(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rm(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rm_f(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rm_r(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rm_rf(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rmdir(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def rmtree(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:23 + def ruby(*args, **options, &block); end + + # Declare a rule for auto-tasks. + # + # Example: + # rule '.o' => '.c' do |t| + # sh 'cc', '-c', '-o', t.name, t.source + # end + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:152 + def rule(*args, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:23 + def safe_ln(*args, **options); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def safe_unlink(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:23 + def sh(*cmd, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:23 + def split_all(path); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def symlink(*args, **options, &block); end + + # :call-seq: + # task(task_name) + # task(task_name: dependencies) + # task(task_name, arguments => dependencies) + # + # Declare a basic task. The +task_name+ is always the first argument. If + # the task name contains a ":" it is defined in that namespace. + # + # The +dependencies+ may be a single task name or an Array of task names. + # The +argument+ (a single name) or +arguments+ (an Array of names) define + # the arguments provided to the task. + # + # The task, argument and dependency names may be either symbols or + # strings. + # + # A task with a single dependency: + # + # task clobber: %w[clean] do + # rm_rf "html" + # end + # + # A task with an argument and a dependency: + # + # task :package, [:version] => :test do |t, args| + # # ... + # end + # + # To invoke this task from the command line: + # + # $ rake package[1.2.3] + # + # pkg:gem/rake#lib/rake/dsl_definition.rb:59 + def task(*args, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def touch(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def verbose(value = T.unsafe(nil)); end + + # pkg:gem/rake#lib/rake/dsl_definition.rb:24 + def when_writing(msg = T.unsafe(nil)); end +end + +# Default Rakefile loader used by +import+. +# +# pkg:gem/rake#lib/rake/default_loader.rb:5 +class Rake::DefaultLoader + # Loads a rakefile into the current application from +fn+ + # + # pkg:gem/rake#lib/rake/default_loader.rb:10 + def load(fn); end +end + +# pkg:gem/rake#lib/rake/early_time.rb:21 +Rake::EARLY = T.let(T.unsafe(nil), Rake::EarlyTime) + +# pkg:gem/rake#lib/rake/task_arguments.rb:112 +Rake::EMPTY_TASK_ARGS = T.let(T.unsafe(nil), Rake::TaskArguments) + +# EarlyTime is a fake timestamp that occurs _before_ any other time value. +# +# pkg:gem/rake#lib/rake/early_time.rb:5 +class Rake::EarlyTime + include ::Comparable + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # The EarlyTime always comes before +other+! + # + # pkg:gem/rake#lib/rake/early_time.rb:12 + def <=>(other); end + + # pkg:gem/rake#lib/rake/early_time.rb:16 + def to_s; end + + class << self + private + + # pkg:gem/rake#lib/rake/early_time.rb:7 + def allocate; end + + # pkg:gem/rake#lib/rake/early_time.rb:7 + def new(*_arg0); end + end +end + +# A FileCreationTask is a file task that when used as a dependency will be +# needed if and only if the file has not been created. Once created, it is +# not re-triggered if any of its dependencies are newer, nor does trigger +# any rebuilds of tasks that depend on it whenever it is updated. +# +# pkg:gem/rake#lib/rake/file_creation_task.rb:12 +class Rake::FileCreationTask < ::Rake::FileTask + # Is this file task needed? Yes if it doesn't exist. + # + # pkg:gem/rake#lib/rake/file_creation_task.rb:14 + def needed?; end + + # Time stamp for file creation task. This time stamp is earlier + # than any other time stamp. + # + # pkg:gem/rake#lib/rake/file_creation_task.rb:20 + def timestamp; end +end + +# A FileList is essentially an array with a few helper methods defined to +# make file manipulation a bit easier. +# +# FileLists are lazy. When given a list of glob patterns for possible files +# to be included in the file list, instead of searching the file structures +# to find the files, a FileList holds the pattern for latter use. +# +# This allows us to define a number of FileList to match any number of +# files, but only search out the actual files when then FileList itself is +# actually used. The key is that the first time an element of the +# FileList/Array is requested, the pending patterns are resolved into a real +# list of file names. +# +# pkg:gem/rake#lib/rake/file_list.rb:22 +class Rake::FileList + include ::Rake::Cloneable + + # Create a file list from the globbable patterns given. If you wish to + # perform multiple includes or excludes at object build time, use the + # "yield self" pattern. + # + # Example: + # file_list = FileList.new('lib/**/*.rb', 'test/test*.rb') + # + # pkg_files = FileList.new('lib/**/*') do |fl| + # fl.exclude(/\bCVS\b/) + # end + # + # pkg:gem/rake#lib/rake/file_list.rb:99 + def initialize(*patterns); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def &(*args, &block); end + + # Redefine * to return either a string or a new file list. + # + # pkg:gem/rake#lib/rake/file_list.rb:193 + def *(other); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def +(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def -(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:203 + def <<(obj); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def <=>(*args, &block); end + + # A FileList is equal through array equality. + # + # pkg:gem/rake#lib/rake/file_list.rb:171 + def ==(array); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def [](*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def []=(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:128 + def add(*filenames); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def all?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def any?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def append(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def assoc(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def at(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def bsearch(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def bsearch_index(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def chain(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def chunk(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def chunk_while(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def clear(*args, &block); end + + # Clear all the exclude patterns so that we exclude nothing. + # + # pkg:gem/rake#lib/rake/file_list.rb:164 + def clear_exclude; end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def collect(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def collect!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def collect_concat(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def combination(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def compact(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def compact!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def concat(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def count(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def cycle(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def deconstruct(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def delete(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def delete_at(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def delete_if(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def detect(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def difference(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def dig(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def drop(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def drop_while(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each_cons(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each_entry(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each_index(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each_slice(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each_with_index(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def each_with_object(*args, &block); end + + # Grep each of the files in the filelist using the given pattern. If a + # block is given, call the block on each matching line, passing the file + # name, line number, and the matching line of text. If no block is given, + # a standard emacs style file:linenumber:line message will be printed to + # standard out. Returns the number of matched items. + # + # pkg:gem/rake#lib/rake/file_list.rb:293 + def egrep(pattern, *options); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def empty?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def entries(*args, &block); end + + # Register a list of file name patterns that should be excluded from the + # list. Patterns may be regular expressions, glob patterns or regular + # strings. In addition, a block given to exclude will remove entries that + # return true when given to the block. + # + # Note that glob patterns are expanded against the file system. If a file + # is explicitly added to a file list, but does not exist in the file + # system, then an glob pattern in the exclude list will not exclude the + # file. + # + # Examples: + # FileList['a.c', 'b.c'].exclude("a.c") => ['b.c'] + # FileList['a.c', 'b.c'].exclude(/^a/) => ['b.c'] + # + # If "a.c" is a file, then ... + # FileList['a.c', 'b.c'].exclude("a.*") => ['b.c'] + # + # If "a.c" is not a file, then ... + # FileList['a.c', 'b.c'].exclude("a.*") => ['a.c', 'b.c'] + # + # pkg:gem/rake#lib/rake/file_list.rb:150 + def exclude(*patterns, &block); end + + # Should the given file name be excluded from the list? + # + # NOTE: This method was formerly named "exclude?", but Rails + # introduced an exclude? method as an array method and setup a + # conflict with file list. We renamed the method to avoid + # confusion. If you were using "FileList#exclude?" in your user + # code, you will need to update. + # + # pkg:gem/rake#lib/rake/file_list.rb:364 + def excluded_from_list?(fn); end + + # Return a new file list that only contains file names from the current + # file list that exist on the file system. + # + # pkg:gem/rake#lib/rake/file_list.rb:320 + def existing; end + + # Modify the current file list so that it contains only file name that + # exist on the file system. + # + # pkg:gem/rake#lib/rake/file_list.rb:326 + def existing!; end + + # Return a new FileList with String#ext method applied to + # each member of the array. + # + # This method is a shortcut for: + # + # array.collect { |item| item.ext(newext) } + # + # +ext+ is a user added method for the Array class. + # + # pkg:gem/rake#lib/rake/file_list.rb:284 + def ext(newext = T.unsafe(nil)); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def fetch(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def fetch_values(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def fill(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def filter(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def filter!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def filter_map(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def find(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def find_all(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def find_index(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def first(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def flat_map(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def flatten(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def flatten!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def grep(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def grep_v(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def group_by(*args, &block); end + + # Return a new FileList with the results of running +gsub+ against each + # element of the original list. + # + # Example: + # FileList['lib/test/file', 'x/y'].gsub(/\//, "\\") + # => ['lib\\test\\file', 'x\\y'] + # + # pkg:gem/rake#lib/rake/file_list.rb:253 + def gsub(pat, rep); end + + # Same as +gsub+ except that the original file list is modified. + # + # pkg:gem/rake#lib/rake/file_list.rb:264 + def gsub!(pat, rep); end + + # pkg:gem/rake#lib/rake/file_list.rb:391 + def import(array); end + + # Add file names defined by glob patterns to the file list. If an array + # is given, add each element of the array. + # + # Example: + # file_list.include("*.java", "*.cfg") + # file_list.include %w( math.c lib.h *.o ) + # + # pkg:gem/rake#lib/rake/file_list.rb:116 + def include(*filenames); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def include?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def index(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def inject(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def insert(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def inspect(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def intersect?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def intersection(*args, &block); end + + # Lie about our class. + # + # pkg:gem/rake#lib/rake/file_list.rb:187 + def is_a?(klass); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def join(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def keep_if(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:190 + def kind_of?(klass); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def last(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def lazy(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def length(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def map(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def map!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def max(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def max_by(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def member?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def min(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def min_by(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def minmax(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def minmax_by(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def none?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def one?(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def pack(*args, &block); end + + # FileList version of partition. Needed because the nested arrays should + # be FileLists in this version. + # + # pkg:gem/rake#lib/rake/file_list.rb:334 + def partition(&block); end + + # Apply the pathmap spec to each of the included file names, returning a + # new file list with the modified paths. (See String#pathmap for + # details.) + # + # pkg:gem/rake#lib/rake/file_list.rb:272 + def pathmap(spec = T.unsafe(nil), &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def permutation(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def pop(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def prepend(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def product(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def push(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def rassoc(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def reduce(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def reject(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def reject!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def repeated_combination(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def repeated_permutation(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def replace(*args, &block); end + + # Resolve all the pending adds now. + # + # pkg:gem/rake#lib/rake/file_list.rb:210 + def resolve; end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def reverse(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def reverse!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def reverse_each(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def rfind(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def rindex(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def rotate(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def rotate!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def sample(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def select(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def select!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def shelljoin(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def shift(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def shuffle(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def shuffle!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def size(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def slice(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def slice!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def slice_after(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def slice_before(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def slice_when(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def sort(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def sort!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def sort_by(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def sort_by!(*args, &block); end + + # Return a new FileList with the results of running +sub+ against each + # element of the original list. + # + # Example: + # FileList['a.c', 'b.c'].sub(/\.c$/, '.o') => ['a.o', 'b.o'] + # + # pkg:gem/rake#lib/rake/file_list.rb:242 + def sub(pat, rep); end + + # Same as +sub+ except that the original file list is modified. + # + # pkg:gem/rake#lib/rake/file_list.rb:258 + def sub!(pat, rep); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def sum(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def take(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def take_while(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def tally(*args, &block); end + + # Return the internal array object. + # + # pkg:gem/rake#lib/rake/file_list.rb:176 + def to_a; end + + # Return the internal array object. + # + # pkg:gem/rake#lib/rake/file_list.rb:182 + def to_ary; end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def to_h(*args, &block); end + + # Convert a FileList to a string by joining all elements with a space. + # + # pkg:gem/rake#lib/rake/file_list.rb:344 + def to_s; end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def to_set(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def transpose(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def union(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def uniq(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def uniq!(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def unshift(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def values_at(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:76 + def zip(*args, &block); end + + # pkg:gem/rake#lib/rake/file_list.rb:67 + def |(*args, &block); end + + private + + # Add matching glob patterns. + # + # pkg:gem/rake#lib/rake/file_list.rb:350 + def add_matching(pattern); end + + # pkg:gem/rake#lib/rake/file_list.rb:220 + def resolve_add(fn); end + + # pkg:gem/rake#lib/rake/file_list.rb:230 + def resolve_exclude; end + + class << self + # Create a new file list including the files listed. Similar to: + # + # FileList.new(*args) + # + # pkg:gem/rake#lib/rake/file_list.rb:400 + def [](*args); end + + # Get a sorted list of files matching the pattern. This method + # should be preferred to Dir[pattern] and Dir.glob(pattern) because + # the files returned are guaranteed to be sorted. + # + # pkg:gem/rake#lib/rake/file_list.rb:407 + def glob(pattern, *args); end + end +end + +# List of array methods (that are not in +Object+) that need to be +# delegated. +# +# pkg:gem/rake#lib/rake/file_list.rb:44 +Rake::FileList::ARRAY_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/file_list.rb:381 +Rake::FileList::DEFAULT_IGNORE_PATTERNS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/file_list.rb:387 +Rake::FileList::DEFAULT_IGNORE_PROCS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/file_list.rb:61 +Rake::FileList::DELEGATING_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/file_list.rb:86 +Rake::FileList::GLOB_PATTERN = T.let(T.unsafe(nil), Regexp) + +# List of additional methods that must be delegated. +# +# pkg:gem/rake#lib/rake/file_list.rb:47 +Rake::FileList::MUST_DEFINE = T.let(T.unsafe(nil), Array) + +# List of methods that should not be delegated here (we define special +# versions of them explicitly below). +# +# pkg:gem/rake#lib/rake/file_list.rb:51 +Rake::FileList::MUST_NOT_DEFINE = T.let(T.unsafe(nil), Array) + +# List of delegated methods that return new array values which need +# wrapping. +# +# pkg:gem/rake#lib/rake/file_list.rb:55 +Rake::FileList::SPECIAL_RETURN = T.let(T.unsafe(nil), Array) + +# A FileTask is a task that includes time based dependencies. If any of a +# FileTask's prerequisites have a timestamp that is later than the file +# represented by this task, then the file must be rebuilt (using the +# supplied actions). +# +# pkg:gem/rake#lib/rake/file_task.rb:12 +class Rake::FileTask < ::Rake::Task + # Is this file task needed? Yes if it doesn't exist, or if its time stamp + # is out of date. + # + # pkg:gem/rake#lib/rake/file_task.rb:16 + def needed?; end + + # Time stamp for file task. + # + # pkg:gem/rake#lib/rake/file_task.rb:25 + def timestamp; end + + private + + # Are there any prerequisites with a later time than the given time stamp? + # + # pkg:gem/rake#lib/rake/file_task.rb:36 + def out_of_date?(stamp); end + + class << self + # Apply the scope to the task name according to the rules for this kind + # of task. File based tasks ignore the scope when creating the name. + # + # pkg:gem/rake#lib/rake/file_task.rb:53 + def scope_name(scope, task_name); end + end +end + +# FileUtilsExt provides a custom version of the FileUtils methods +# that respond to the verbose and nowrite +# commands. +# +# pkg:gem/rake#lib/rake/file_utils_ext.rb:10 +module Rake::FileUtilsExt + include ::FileUtils::StreamUtils_ + include ::FileUtils + extend ::FileUtils::StreamUtils_ + extend ::FileUtils + extend ::Rake::FileUtilsExt + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def cd(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def chdir(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def chmod(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def chmod_R(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def chown(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def chown_R(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def copy(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def cp(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def cp_lr(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def cp_r(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def install(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def link(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def ln(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def ln_s(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def ln_sf(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def ln_sr(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def makedirs(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def mkdir(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def mkdir_p(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def mkpath(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def move(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def mv(*args, **options, &block); end + + # Get/set the nowrite flag controlling output from the FileUtils + # utilities. If verbose is true, then the utility method is + # echoed to standard output. + # + # Examples: + # nowrite # return the current value of the + # # nowrite flag + # nowrite(v) # set the nowrite flag to _v_. + # nowrite(v) { code } # Execute code with the nowrite flag set + # # temporarily to _v_. Return to the + # # original value when code is done. + # + # pkg:gem/rake#lib/rake/file_utils_ext.rb:78 + def nowrite(value = T.unsafe(nil)); end + + # Check that the options do not contain options not listed in + # +optdecl+. An ArgumentError exception is thrown if non-declared + # options are found. + # + # pkg:gem/rake#lib/rake/file_utils_ext.rb:124 + def rake_check_options(options, *optdecl); end + + # Send the message to the default rake output (which is $stderr). + # + # pkg:gem/rake#lib/rake/file_utils_ext.rb:117 + def rake_output_message(message); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def remove(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def rm(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def rm_f(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def rm_r(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def rm_rf(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def rmdir(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def rmtree(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def safe_unlink(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def symlink(*args, **options, &block); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:33 + def touch(*args, **options, &block); end + + # Get/set the verbose flag controlling output from the FileUtils + # utilities. If verbose is true, then the utility method is + # echoed to standard output. + # + # Examples: + # verbose # return the current value of the + # # verbose flag + # verbose(v) # set the verbose flag to _v_. + # verbose(v) { code } # Execute code with the verbose flag set + # # temporarily to _v_. Return to the + # # original value when code is done. + # + # pkg:gem/rake#lib/rake/file_utils_ext.rb:53 + def verbose(value = T.unsafe(nil)); end + + # Use this function to prevent potentially destructive ruby code + # from running when the :nowrite flag is set. + # + # Example: + # + # when_writing("Building Project") do + # project.build + # end + # + # The following code will build the project under normal + # conditions. If the nowrite(true) flag is set, then the example + # will print: + # + # DRYRUN: Building Project + # + # instead of actually building the project. + # + # pkg:gem/rake#lib/rake/file_utils_ext.rb:108 + def when_writing(msg = T.unsafe(nil)); end + + class << self + # pkg:gem/rake#lib/rake/file_utils_ext.rb:14 + def nowrite_flag; end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:14 + def nowrite_flag=(_arg0); end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:14 + def verbose_flag; end + + # pkg:gem/rake#lib/rake/file_utils_ext.rb:14 + def verbose_flag=(_arg0); end + end +end + +# pkg:gem/rake#lib/rake/file_utils_ext.rb:17 +Rake::FileUtilsExt::DEFAULT = T.let(T.unsafe(nil), Object) + +# InvocationChain tracks the chain of task invocations to detect +# circular dependencies. +# +# pkg:gem/rake#lib/rake/invocation_chain.rb:6 +class Rake::InvocationChain < ::Rake::LinkedList + # Append an invocation to the chain of invocations. It is an error + # if the invocation already listed. + # + # pkg:gem/rake#lib/rake/invocation_chain.rb:15 + def append(invocation); end + + # Is the invocation already in the chain? + # + # pkg:gem/rake#lib/rake/invocation_chain.rb:9 + def member?(invocation); end + + # Convert to string, ie: TOP => invocation => invocation + # + # pkg:gem/rake#lib/rake/invocation_chain.rb:23 + def to_s; end + + private + + # pkg:gem/rake#lib/rake/invocation_chain.rb:34 + def prefix; end + + class << self + # Class level append. + # + # pkg:gem/rake#lib/rake/invocation_chain.rb:28 + def append(invocation, chain); end + end +end + +# pkg:gem/rake#lib/rake/invocation_chain.rb:55 +Rake::InvocationChain::EMPTY = T.let(T.unsafe(nil), Rake::InvocationChain::EmptyInvocationChain) + +# Null object for an empty chain. +# +# pkg:gem/rake#lib/rake/invocation_chain.rb:39 +class Rake::InvocationChain::EmptyInvocationChain < ::Rake::LinkedList::EmptyLinkedList + # pkg:gem/rake#lib/rake/invocation_chain.rb:46 + def append(invocation); end + + # pkg:gem/rake#lib/rake/invocation_chain.rb:42 + def member?(obj); end + + # pkg:gem/rake#lib/rake/invocation_chain.rb:50 + def to_s; end +end + +# pkg:gem/rake#lib/rake/invocation_exception_mixin.rb:3 +module Rake::InvocationExceptionMixin + # Return the invocation chain (list of Rake tasks) that were in + # effect when this exception was detected by rake. May be null if + # no tasks were active. + # + # pkg:gem/rake#lib/rake/invocation_exception_mixin.rb:7 + def chain; end + + # Set the invocation chain in effect when this exception was + # detected. + # + # pkg:gem/rake#lib/rake/invocation_exception_mixin.rb:13 + def chain=(value); end +end + +# pkg:gem/rake#lib/rake/late_time.rb:17 +Rake::LATE = T.let(T.unsafe(nil), Rake::LateTime) + +# LateTime is a fake timestamp that occurs _after_ any other time value. +# +# pkg:gem/rake#lib/rake/late_time.rb:4 +class Rake::LateTime + include ::Comparable + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/rake#lib/rake/late_time.rb:8 + def <=>(other); end + + # pkg:gem/rake#lib/rake/late_time.rb:12 + def to_s; end + + class << self + private + + # pkg:gem/rake#lib/rake/late_time.rb:6 + def allocate; end + + # pkg:gem/rake#lib/rake/late_time.rb:6 + def new(*_arg0); end + end +end + +# Polylithic linked list structure used to implement several data +# structures in Rake. +# +# pkg:gem/rake#lib/rake/linked_list.rb:6 +class Rake::LinkedList + include ::Enumerable + + # pkg:gem/rake#lib/rake/linked_list.rb:84 + def initialize(head, tail = T.unsafe(nil)); end + + # Lists are structurally equivalent. + # + # pkg:gem/rake#lib/rake/linked_list.rb:25 + def ==(other); end + + # Polymorphically add a new element to the head of a list. The + # type of head node will be the same list type as the tail. + # + # pkg:gem/rake#lib/rake/linked_list.rb:12 + def conj(item); end + + # For each item in the list. + # + # pkg:gem/rake#lib/rake/linked_list.rb:48 + def each; end + + # Is the list empty? + # .make guards against a list being empty making any instantiated LinkedList + # object not empty by default + # You should consider overriding this method if you implement your own .make method + # + # pkg:gem/rake#lib/rake/linked_list.rb:20 + def empty?; end + + # pkg:gem/rake#lib/rake/linked_list.rb:8 + def head; end + + # Same as +to_s+, but with inspected items. + # + # pkg:gem/rake#lib/rake/linked_list.rb:42 + def inspect; end + + # pkg:gem/rake#lib/rake/linked_list.rb:8 + def tail; end + + # Convert to string: LL(item, item...) + # + # pkg:gem/rake#lib/rake/linked_list.rb:36 + def to_s; end + + class << self + # Cons a new head onto the tail list. + # + # pkg:gem/rake#lib/rake/linked_list.rb:73 + def cons(head, tail); end + + # The standard empty list class for the given LinkedList class. + # + # pkg:gem/rake#lib/rake/linked_list.rb:78 + def empty; end + + # Make a list out of the given arguments. This method is + # polymorphic + # + # pkg:gem/rake#lib/rake/linked_list.rb:59 + def make(*args); end + end +end + +# pkg:gem/rake#lib/rake/linked_list.rb:110 +Rake::LinkedList::EMPTY = T.let(T.unsafe(nil), Rake::LinkedList::EmptyLinkedList) + +# Represent an empty list, using the Null Object Pattern. +# +# When inheriting from the LinkedList class, you should implement +# a type specific Empty class as well. Make sure you set the class +# instance variable @parent to the associated list class (this +# allows conj, cons and make to work polymorphically). +# +# pkg:gem/rake#lib/rake/linked_list.rb:95 +class Rake::LinkedList::EmptyLinkedList < ::Rake::LinkedList + # pkg:gem/rake#lib/rake/linked_list.rb:98 + def initialize; end + + # pkg:gem/rake#lib/rake/linked_list.rb:101 + def empty?; end + + class << self + # pkg:gem/rake#lib/rake/linked_list.rb:105 + def cons(head, tail); end + end +end + +# Same as a regular task, but the immediate prerequisites are done in +# parallel using Ruby threads. +# +# pkg:gem/rake#lib/rake/multi_task.rb:7 +class Rake::MultiTask < ::Rake::Task + private + + # pkg:gem/rake#lib/rake/multi_task.rb:10 + def invoke_prerequisites(task_args, invocation_chain); end +end + +# The NameSpace class will lookup task names in the scope defined by a +# +namespace+ command. +# +# pkg:gem/rake#lib/rake/name_space.rb:6 +class Rake::NameSpace + # Create a namespace lookup object using the given task manager + # and the list of scopes. + # + # pkg:gem/rake#lib/rake/name_space.rb:12 + def initialize(task_manager, scope_list); end + + # Lookup a task named +name+ in the namespace. + # + # pkg:gem/rake#lib/rake/name_space.rb:20 + def [](name); end + + # The scope of the namespace (a LinkedList) + # + # pkg:gem/rake#lib/rake/name_space.rb:27 + def scope; end + + # Return the list of tasks defined in this and nested namespaces. + # + # pkg:gem/rake#lib/rake/name_space.rb:34 + def tasks; end +end + +# Options used by the Rake command line application. +# +# pkg:gem/rake#lib/rake/options.rb:8 +class Rake::Options + # pkg:gem/rake#lib/rake/options.rb:9 + def always_multitask; end + + # pkg:gem/rake#lib/rake/options.rb:9 + def always_multitask=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:10 + def backtrace; end + + # pkg:gem/rake#lib/rake/options.rb:10 + def backtrace=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:11 + def build_all; end + + # pkg:gem/rake#lib/rake/options.rb:11 + def build_all=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:12 + def dryrun; end + + # pkg:gem/rake#lib/rake/options.rb:12 + def dryrun=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:13 + def ignore_deprecate; end + + # pkg:gem/rake#lib/rake/options.rb:13 + def ignore_deprecate=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:14 + def ignore_system; end + + # pkg:gem/rake#lib/rake/options.rb:14 + def ignore_system=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:15 + def job_stats; end + + # pkg:gem/rake#lib/rake/options.rb:15 + def job_stats=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:16 + def load_system; end + + # pkg:gem/rake#lib/rake/options.rb:16 + def load_system=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:17 + def nosearch; end + + # pkg:gem/rake#lib/rake/options.rb:17 + def nosearch=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:18 + def rakelib; end + + # pkg:gem/rake#lib/rake/options.rb:18 + def rakelib=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:19 + def show_all_tasks; end + + # pkg:gem/rake#lib/rake/options.rb:19 + def show_all_tasks=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:20 + def show_prereqs; end + + # pkg:gem/rake#lib/rake/options.rb:20 + def show_prereqs=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:21 + def show_task_pattern; end + + # pkg:gem/rake#lib/rake/options.rb:21 + def show_task_pattern=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:22 + def show_tasks; end + + # pkg:gem/rake#lib/rake/options.rb:22 + def show_tasks=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:23 + def silent; end + + # pkg:gem/rake#lib/rake/options.rb:23 + def silent=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:24 + def suppress_backtrace_pattern; end + + # pkg:gem/rake#lib/rake/options.rb:24 + def suppress_backtrace_pattern=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:25 + def thread_pool_size; end + + # pkg:gem/rake#lib/rake/options.rb:25 + def thread_pool_size=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:26 + def trace; end + + # pkg:gem/rake#lib/rake/options.rb:26 + def trace=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:27 + def trace_output; end + + # pkg:gem/rake#lib/rake/options.rb:27 + def trace_output=(_arg0); end + + # pkg:gem/rake#lib/rake/options.rb:28 + def trace_rules; end + + # pkg:gem/rake#lib/rake/options.rb:28 + def trace_rules=(_arg0); end +end + +# Include PrivateReader to use +private_reader+. +# +# pkg:gem/rake#lib/rake/private_reader.rb:5 +module Rake::PrivateReader + mixes_in_class_methods ::Rake::PrivateReader::ClassMethods + + class << self + # pkg:gem/rake#lib/rake/private_reader.rb:7 + def included(base); end + end +end + +# pkg:gem/rake#lib/rake/private_reader.rb:11 +module Rake::PrivateReader::ClassMethods + # Declare a list of private accessors + # + # pkg:gem/rake#lib/rake/private_reader.rb:14 + def private_reader(*names); end +end + +# A Promise object represents a promise to do work (a chore) in the +# future. The promise is created with a block and a list of +# arguments for the block. Calling value will return the value of +# the promised chore. +# +# Used by ThreadPool. +# +# pkg:gem/rake#lib/rake/promise.rb:11 +class Rake::Promise + # Create a promise to do the chore specified by the block. + # + # pkg:gem/rake#lib/rake/promise.rb:17 + def initialize(args, &block); end + + # pkg:gem/rake#lib/rake/promise.rb:14 + def recorder; end + + # pkg:gem/rake#lib/rake/promise.rb:14 + def recorder=(_arg0); end + + # Return the value of this promise. + # + # If the promised chore is not yet complete, then do the work + # synchronously. We will wait. + # + # pkg:gem/rake#lib/rake/promise.rb:29 + def value; end + + # If no one else is working this promise, go ahead and do the chore. + # + # pkg:gem/rake#lib/rake/promise.rb:42 + def work; end + + private + + # Perform the chore promised + # + # pkg:gem/rake#lib/rake/promise.rb:57 + def chore; end + + # Are we done with the promise + # + # pkg:gem/rake#lib/rake/promise.rb:83 + def complete?; end + + # free up these items for the GC + # + # pkg:gem/rake#lib/rake/promise.rb:88 + def discard; end + + # Did the promise throw an error + # + # pkg:gem/rake#lib/rake/promise.rb:78 + def error?; end + + # Do we have a result for the promise + # + # pkg:gem/rake#lib/rake/promise.rb:73 + def result?; end + + # Record execution statistics if there is a recorder + # + # pkg:gem/rake#lib/rake/promise.rb:94 + def stat(*args); end +end + +# pkg:gem/rake#lib/rake/promise.rb:12 +Rake::Promise::NOT_SET = T.let(T.unsafe(nil), Object) + +# Exit status class for times the system just gives us a nil. +# +# pkg:gem/rake#lib/rake/pseudo_status.rb:6 +class Rake::PseudoStatus + # pkg:gem/rake#lib/rake/pseudo_status.rb:9 + def initialize(code = T.unsafe(nil)); end + + # pkg:gem/rake#lib/rake/pseudo_status.rb:17 + def >>(n); end + + # pkg:gem/rake#lib/rake/pseudo_status.rb:25 + def exited?; end + + # pkg:gem/rake#lib/rake/pseudo_status.rb:7 + def exitstatus; end + + # pkg:gem/rake#lib/rake/pseudo_status.rb:21 + def stopped?; end + + # pkg:gem/rake#lib/rake/pseudo_status.rb:13 + def to_i; end +end + +# Error indicating a recursion overflow error in task selection. +# +# pkg:gem/rake#lib/rake/rule_recursion_overflow_error.rb:5 +class Rake::RuleRecursionOverflowError < ::StandardError + # pkg:gem/rake#lib/rake/rule_recursion_overflow_error.rb:6 + def initialize(*args); end + + # pkg:gem/rake#lib/rake/rule_recursion_overflow_error.rb:11 + def add_target(target); end + + # pkg:gem/rake#lib/rake/rule_recursion_overflow_error.rb:15 + def message; end +end + +# pkg:gem/rake#lib/rake/scope.rb:3 +class Rake::Scope < ::Rake::LinkedList + # Path for the scope. + # + # pkg:gem/rake#lib/rake/scope.rb:6 + def path; end + + # Path for the scope + the named path. + # + # pkg:gem/rake#lib/rake/scope.rb:11 + def path_with_task_name(task_name); end + + # Trim +n+ innermost scope levels from the scope. In no case will + # this trim beyond the toplevel scope. + # + # pkg:gem/rake#lib/rake/scope.rb:17 + def trim(n); end +end + +# Singleton null object for an empty scope. +# +# pkg:gem/rake#lib/rake/scope.rb:41 +Rake::Scope::EMPTY = T.let(T.unsafe(nil), Rake::Scope::EmptyScope) + +# Scope lists always end with an EmptyScope object. See Null +# Object Pattern) +# +# pkg:gem/rake#lib/rake/scope.rb:28 +class Rake::Scope::EmptyScope < ::Rake::LinkedList::EmptyLinkedList + # pkg:gem/rake#lib/rake/scope.rb:31 + def path; end + + # pkg:gem/rake#lib/rake/scope.rb:35 + def path_with_task_name(task_name); end +end + +# A Task is the basic unit of work in a Rakefile. Tasks have associated +# actions (possibly more than one) and a list of prerequisites. When +# invoked, a task will first ensure that all of its prerequisites have an +# opportunity to run and then it will execute its own actions. +# +# Tasks are not usually created directly using the new method, but rather +# use the +file+ and +task+ convenience methods. +# +# pkg:gem/rake#lib/rake/task.rb:15 +class Rake::Task + # Create a task named +task_name+ with no actions or prerequisites. Use + # +enhance+ to add actions and prerequisites. + # + # pkg:gem/rake#lib/rake/task.rb:99 + def initialize(task_name, app); end + + # List of actions attached to a task. + # + # pkg:gem/rake#lib/rake/task.rb:24 + def actions; end + + # Add a description to the task. The description can consist of an option + # argument list (enclosed brackets) and an optional comment. + # + # pkg:gem/rake#lib/rake/task.rb:298 + def add_description(description); end + + # List of all unique prerequisite tasks including prerequisite tasks' + # prerequisites. + # Includes self when cyclic dependencies are found. + # + # pkg:gem/rake#lib/rake/task.rb:77 + def all_prerequisite_tasks; end + + # Has this task already been invoked? Already invoked tasks + # will be skipped unless you reenable them. + # + # pkg:gem/rake#lib/rake/task.rb:39 + def already_invoked; end + + # Application owning this task. + # + # pkg:gem/rake#lib/rake/task.rb:27 + def application; end + + # Application owning this task. + # + # pkg:gem/rake#lib/rake/task.rb:27 + def application=(_arg0); end + + # Argument description (nil if none). + # + # pkg:gem/rake#lib/rake/task.rb:136 + def arg_description; end + + # Name of arguments for this task. + # + # pkg:gem/rake#lib/rake/task.rb:141 + def arg_names; end + + # Clear the existing prerequisites, actions, comments, and arguments of a rake task. + # + # pkg:gem/rake#lib/rake/task.rb:153 + def clear; end + + # Clear the existing actions on a rake task. + # + # pkg:gem/rake#lib/rake/task.rb:168 + def clear_actions; end + + # Clear the existing arguments on a rake task. + # + # pkg:gem/rake#lib/rake/task.rb:180 + def clear_args; end + + # Clear the existing comments on a rake task. + # + # pkg:gem/rake#lib/rake/task.rb:174 + def clear_comments; end + + # Clear the existing prerequisites of a rake task. + # + # pkg:gem/rake#lib/rake/task.rb:162 + def clear_prerequisites; end + + # First line (or sentence) of all comments. Multiple comments are + # separated by a "/". + # + # pkg:gem/rake#lib/rake/task.rb:322 + def comment; end + + # pkg:gem/rake#lib/rake/task.rb:304 + def comment=(comment); end + + # Enhance a task with prerequisites or actions. Returns self. + # + # pkg:gem/rake#lib/rake/task.rb:115 + def enhance(deps = T.unsafe(nil), &block); end + + # Execute the actions associated with this task. + # + # pkg:gem/rake#lib/rake/task.rb:270 + def execute(args = T.unsafe(nil)); end + + # Full collection of comments. Multiple comments are separated by + # newlines. + # + # pkg:gem/rake#lib/rake/task.rb:316 + def full_comment; end + + # pkg:gem/rake#lib/rake/task.rb:46 + def inspect; end + + # Return a string describing the internal state of a task. Useful for + # debugging. + # + # pkg:gem/rake#lib/rake/task.rb:354 + def investigation; end + + # Invoke the task if it is needed. Prerequisites are invoked first. + # + # pkg:gem/rake#lib/rake/task.rb:186 + def invoke(*args); end + + # Invoke all the prerequisites of a task. + # + # pkg:gem/rake#lib/rake/task.rb:237 + def invoke_prerequisites(task_args, invocation_chain); end + + # Invoke all the prerequisites of a task in parallel. + # + # pkg:gem/rake#lib/rake/task.rb:249 + def invoke_prerequisites_concurrently(task_args, invocation_chain); end + + # File/Line locations of each of the task definitions for this + # task (only valid if the task was defined with the detect + # location option set). + # + # pkg:gem/rake#lib/rake/task.rb:35 + def locations; end + + # Name of the task, including any namespace qualifiers. + # + # pkg:gem/rake#lib/rake/task.rb:122 + def name; end + + # Name of task with argument list description. + # + # pkg:gem/rake#lib/rake/task.rb:127 + def name_with_args; end + + # Is this task needed? + # + # pkg:gem/rake#lib/rake/task.rb:286 + def needed?; end + + # List of order only prerequisites for a task. + # + # pkg:gem/rake#lib/rake/task.rb:21 + def order_only_prerequisites; end + + # pkg:gem/rake#lib/rake/task.rb:18 + def prereqs; end + + # List of prerequisite tasks + # + # pkg:gem/rake#lib/rake/task.rb:61 + def prerequisite_tasks; end + + # List of prerequisites for a task. + # + # pkg:gem/rake#lib/rake/task.rb:17 + def prerequisites; end + + # Reenable the task, allowing its tasks to be executed if the task + # is invoked again. + # + # pkg:gem/rake#lib/rake/task.rb:147 + def reenable; end + + # Array of nested namespaces names used for task lookup by this task. + # + # pkg:gem/rake#lib/rake/task.rb:30 + def scope; end + + # Set the names of the arguments for this task. +args+ should be + # an array of symbols, one for each argument name. + # + # pkg:gem/rake#lib/rake/task.rb:348 + def set_arg_names(args); end + + # First source from a rule (nil if no sources) + # + # pkg:gem/rake#lib/rake/task.rb:93 + def source; end + + # List of sources for task. + # + # pkg:gem/rake#lib/rake/task.rb:52 + def sources; end + + # List of sources for task. + # + # pkg:gem/rake#lib/rake/task.rb:51 + def sources=(_arg0); end + + # Timestamp for this task. Basic tasks return the current time for their + # time stamp. Other tasks can be more sophisticated. + # + # pkg:gem/rake#lib/rake/task.rb:292 + def timestamp; end + + # Return task name + # + # pkg:gem/rake#lib/rake/task.rb:42 + def to_s; end + + # Add order only dependencies. + # + # pkg:gem/rake#lib/rake/task.rb:379 + def |(deps); end + + protected + + # pkg:gem/rake#lib/rake/task.rb:83 + def collect_prerequisites(seen); end + + # Same as invoke, but explicitly pass a call chain to detect + # circular dependencies. + # + # If multiple tasks depend on this + # one in parallel, they will all fail if the first execution of + # this task fails. + # + # pkg:gem/rake#lib/rake/task.rb:197 + def invoke_with_call_chain(task_args, invocation_chain); end + + private + + # pkg:gem/rake#lib/rake/task.rb:229 + def add_chain_to(exception, new_chain); end + + # pkg:gem/rake#lib/rake/task.rb:308 + def add_comment(comment); end + + # Get the first sentence in a string. The sentence is terminated + # by the first period, exclamation mark, or the end of the line. + # Decimal points do not count as periods. + # + # pkg:gem/rake#lib/rake/task.rb:341 + def first_sentence(string); end + + # Format the trace flags for display. + # + # pkg:gem/rake#lib/rake/task.rb:261 + def format_trace_flags; end + + # pkg:gem/rake#lib/rake/task.rb:65 + def lookup_prerequisite(prerequisite_name); end + + # Transform the list of comments as specified by the block and + # join with the separator. + # + # pkg:gem/rake#lib/rake/task.rb:328 + def transform_comments(separator, &block); end + + class << self + # Return a task with the given name. If the task is not currently + # known, try to synthesize one from the defined rules. If no rules are + # found, but an existing file matches the task name, assume it is a file + # task with no dependencies or actions. + # + # pkg:gem/rake#lib/rake/task.rb:404 + def [](task_name); end + + # Clear the task list. This cause rake to immediately forget all the + # tasks that have been assigned. (Normally used in the unit tests.) + # + # pkg:gem/rake#lib/rake/task.rb:391 + def clear; end + + # Define a rule for synthesizing tasks. + # + # pkg:gem/rake#lib/rake/task.rb:421 + def create_rule(*args, &block); end + + # Define a task given +args+ and an option block. If a rule with the + # given name already exists, the prerequisites and actions are added to + # the existing task. Returns the defined task. + # + # pkg:gem/rake#lib/rake/task.rb:416 + def define_task(*args, &block); end + + # Format dependencies parameter to pass to task. + # + # pkg:gem/rake#lib/rake/task.rb:373 + def format_deps(deps); end + + # Apply the scope to the task name according to the rules for + # this kind of task. Generic tasks will accept the scope as + # part of the name. + # + # pkg:gem/rake#lib/rake/task.rb:428 + def scope_name(scope, task_name); end + + # TRUE if the task name is already defined. + # + # pkg:gem/rake#lib/rake/task.rb:409 + def task_defined?(task_name); end + + # List of all defined tasks. + # + # pkg:gem/rake#lib/rake/task.rb:396 + def tasks; end + end +end + +# Error indicating an ill-formed task declaration. +# +# pkg:gem/rake#lib/rake/task_argument_error.rb:5 +class Rake::TaskArgumentError < ::ArgumentError; end + +# TaskArguments manage the arguments passed to a task. +# +# pkg:gem/rake#lib/rake/task_arguments.rb:7 +class Rake::TaskArguments + include ::Enumerable + + # Create a TaskArgument object with a list of argument +names+ and a set + # of associated +values+. +parent+ is the parent argument object. + # + # pkg:gem/rake#lib/rake/task_arguments.rb:15 + def initialize(names, values, parent = T.unsafe(nil)); end + + # Find an argument value by name or index. + # + # pkg:gem/rake#lib/rake/task_arguments.rb:44 + def [](index); end + + # pkg:gem/rake#lib/rake/task_arguments.rb:97 + def deconstruct_keys(keys); end + + # Enumerates the arguments and their values + # + # pkg:gem/rake#lib/rake/task_arguments.rb:56 + def each(&block); end + + # Retrieve the list of values not associated with named arguments + # + # pkg:gem/rake#lib/rake/task_arguments.rb:32 + def extras; end + + # pkg:gem/rake#lib/rake/task_arguments.rb:93 + def fetch(*args, &block); end + + # Returns true if +key+ is one of the arguments + # + # pkg:gem/rake#lib/rake/task_arguments.rb:88 + def has_key?(key); end + + # pkg:gem/rake#lib/rake/task_arguments.rb:79 + def inspect; end + + # pkg:gem/rake#lib/rake/task_arguments.rb:91 + def key?(key); end + + # Returns the value of the given argument via method_missing + # + # pkg:gem/rake#lib/rake/task_arguments.rb:66 + def method_missing(sym, *args); end + + # Argument names + # + # pkg:gem/rake#lib/rake/task_arguments.rb:11 + def names; end + + # Create a new argument scope using the prerequisite argument + # names. + # + # pkg:gem/rake#lib/rake/task_arguments.rb:38 + def new_scope(names); end + + # Retrieve the complete array of sequential values + # + # pkg:gem/rake#lib/rake/task_arguments.rb:27 + def to_a; end + + # Returns a Hash of arguments and their values + # + # pkg:gem/rake#lib/rake/task_arguments.rb:71 + def to_hash; end + + # pkg:gem/rake#lib/rake/task_arguments.rb:75 + def to_s; end + + # Extracts the argument values at +keys+ + # + # pkg:gem/rake#lib/rake/task_arguments.rb:61 + def values_at(*keys); end + + # Specify a hash of default values for task arguments. Use the + # defaults only if there is no specific value for the given + # argument. + # + # pkg:gem/rake#lib/rake/task_arguments.rb:51 + def with_defaults(defaults); end + + protected + + # pkg:gem/rake#lib/rake/task_arguments.rb:103 + def lookup(name); end +end + +# The TaskManager module is a mixin for managing tasks. +# +# pkg:gem/rake#lib/rake/task_manager.rb:5 +module Rake::TaskManager + # pkg:gem/rake#lib/rake/task_manager.rb:9 + def initialize; end + + # Find a matching task for +task_name+. + # + # pkg:gem/rake#lib/rake/task_manager.rb:54 + def [](task_name, scopes = T.unsafe(nil)); end + + # Clear all tasks in this application. + # + # pkg:gem/rake#lib/rake/task_manager.rb:182 + def clear; end + + # pkg:gem/rake#lib/rake/task_manager.rb:17 + def create_rule(*args, &block); end + + # Return the list of scope names currently active in the task + # manager. + # + # pkg:gem/rake#lib/rake/task_manager.rb:222 + def current_scope; end + + # pkg:gem/rake#lib/rake/task_manager.rb:23 + def define_task(task_class, *args, &block); end + + # If a rule can be found that matches the task name, enhance the + # task with the prerequisites and actions from the rule. Set the + # source attribute of the task appropriately for the rule. Return + # the enhanced task or nil of no rule was found. + # + # pkg:gem/rake#lib/rake/task_manager.rb:151 + def enhance_with_matching_rule(task_name, level = T.unsafe(nil)); end + + # pkg:gem/rake#lib/rake/task_manager.rb:68 + def generate_did_you_mean_suggestions(task_name); end + + # pkg:gem/rake#lib/rake/task_manager.rb:62 + def generate_message_for_undefined_task(task_name); end + + # Evaluate the block in a nested namespace named +name+. Create + # an anonymous namespace if +name+ is nil. + # + # pkg:gem/rake#lib/rake/task_manager.rb:228 + def in_namespace(name); end + + # Lookup a task. Return an existing task if found, otherwise + # create a task of the current type. + # + # pkg:gem/rake#lib/rake/task_manager.rb:49 + def intern(task_class, task_name); end + + # Track the last comment made in the Rakefile. + # + # pkg:gem/rake#lib/rake/task_manager.rb:7 + def last_description; end + + # Track the last comment made in the Rakefile. + # + # pkg:gem/rake#lib/rake/task_manager.rb:7 + def last_description=(_arg0); end + + # Lookup a task, using scope and the scope hints in the task name. + # This method performs straight lookups without trying to + # synthesize file tasks or rules. Special scope names (e.g. '^') + # are recognized. If no scope argument is supplied, use the + # current scope. Return nil if the task cannot be found. + # + # pkg:gem/rake#lib/rake/task_manager.rb:192 + def lookup(task_name, initial_scope = T.unsafe(nil)); end + + # Resolve the arguments for a task/rule. Returns a tuple of + # [task_name, arg_name_list, prerequisites, order_only_prerequisites]. + # + # pkg:gem/rake#lib/rake/task_manager.rb:88 + def resolve_args(args); end + + # pkg:gem/rake#lib/rake/task_manager.rb:81 + def synthesize_file_task(task_name); end + + # List of all defined tasks in this application. + # + # pkg:gem/rake#lib/rake/task_manager.rb:168 + def tasks; end + + # List of all the tasks defined in the given scope (and its + # sub-scopes). + # + # pkg:gem/rake#lib/rake/task_manager.rb:174 + def tasks_in_scope(scope); end + + private + + # Add a location to the locations field of the given task. + # + # pkg:gem/rake#lib/rake/task_manager.rb:241 + def add_location(task); end + + # Attempt to create a rule given the list of prerequisites. + # + # pkg:gem/rake#lib/rake/task_manager.rb:271 + def attempt_rule(task_name, task_pattern, args, extensions, block, level); end + + # Find the location that called into the dsl layer. + # + # pkg:gem/rake#lib/rake/task_manager.rb:248 + def find_location; end + + # Generate an anonymous namespace name. + # + # pkg:gem/rake#lib/rake/task_manager.rb:259 + def generate_name; end + + # Return the current description, clearing it in the process. + # + # pkg:gem/rake#lib/rake/task_manager.rb:321 + def get_description; end + + # Lookup the task name + # + # pkg:gem/rake#lib/rake/task_manager.rb:208 + def lookup_in_scope(name, scope); end + + # Make a list of sources from the list of file name extensions / + # translation procs. + # + # pkg:gem/rake#lib/rake/task_manager.rb:293 + def make_sources(task_name, task_pattern, extensions); end + + # Resolve task arguments for a task or rule when there are + # dependencies declared. + # + # The patterns recognized by this argument resolving function are: + # + # task :t, order_only: [:e] + # task :t => [:d] + # task :t => [:d], order_only: [:e] + # task :t, [a] => [:d] + # task :t, [a] => [:d], order_only: [:e] + # + # pkg:gem/rake#lib/rake/task_manager.rb:127 + def resolve_args_with_dependencies(args, hash); end + + # Resolve task arguments for a task or rule when there are no + # dependencies declared. + # + # The patterns recognized by this argument resolving function are: + # + # task :t + # task :t, [:a] + # + # pkg:gem/rake#lib/rake/task_manager.rb:105 + def resolve_args_without_dependencies(args); end + + # pkg:gem/rake#lib/rake/task_manager.rb:265 + def trace_rule(level, message); end + + class << self + # pkg:gem/rake#lib/rake/task_manager.rb:328 + def record_task_metadata; end + + # pkg:gem/rake#lib/rake/task_manager.rb:328 + def record_task_metadata=(_arg0); end + end +end + +# pkg:gem/rake#lib/rake/thread_history_display.rb:6 +class Rake::ThreadHistoryDisplay + include ::Rake::PrivateReader + extend ::Rake::PrivateReader::ClassMethods + + # pkg:gem/rake#lib/rake/thread_history_display.rb:11 + def initialize(stats); end + + # pkg:gem/rake#lib/rake/thread_history_display.rb:17 + def show; end + + private + + # pkg:gem/rake#lib/rake/thread_history_display.rb:9 + def items; end + + # pkg:gem/rake#lib/rake/thread_history_display.rb:35 + def rename(hash, key, renames); end + + # pkg:gem/rake#lib/rake/thread_history_display.rb:9 + def stats; end + + # pkg:gem/rake#lib/rake/thread_history_display.rb:9 + def threads; end +end + +# pkg:gem/rake#lib/rake/thread_pool.rb:8 +class Rake::ThreadPool + # Creates a ThreadPool object. The +thread_count+ parameter is the size + # of the pool. + # + # pkg:gem/rake#lib/rake/thread_pool.rb:12 + def initialize(thread_count); end + + # Creates a future executed by the +ThreadPool+. + # + # The args are passed to the block when executing (similarly to + # Thread#new) The return value is an object representing + # a future which has been created and added to the queue in the + # pool. Sending #value to the object will sleep the + # current thread until the future is finished and will return the + # result (or raise an exception thrown from the future) + # + # pkg:gem/rake#lib/rake/thread_pool.rb:33 + def future(*args, &block); end + + # Enable the gathering of history events. + # + # pkg:gem/rake#lib/rake/thread_pool.rb:68 + def gather_history; end + + # Return a array of history events for the thread pool. + # + # History gathering must be enabled to be able to see the events + # (see #gather_history). Best to call this when the job is + # complete (i.e. after ThreadPool#join is called). + # + # pkg:gem/rake#lib/rake/thread_pool.rb:77 + def history; end + + # Waits until the queue of futures is empty and all threads have exited. + # + # pkg:gem/rake#lib/rake/thread_pool.rb:44 + def join; end + + # Return a hash of always collected statistics for the thread pool. + # + # pkg:gem/rake#lib/rake/thread_pool.rb:84 + def statistics; end + + private + + # for testing only + # + # pkg:gem/rake#lib/rake/thread_pool.rb:152 + def __queue__; end + + # processes one item on the queue. Returns true if there was an + # item to process, false if there was no item + # + # pkg:gem/rake#lib/rake/thread_pool.rb:95 + def process_queue_item; end + + # pkg:gem/rake#lib/rake/thread_pool.rb:111 + def start_thread; end + + # pkg:gem/rake#lib/rake/thread_pool.rb:139 + def stat(event, data = T.unsafe(nil)); end +end + +# pkg:gem/rake#lib/rake/trace_output.rb:3 +module Rake::TraceOutput + # Write trace output to output stream +out+. + # + # The write is done as a single IO call (to print) to lessen the + # chance that the trace output is interrupted by other tasks also + # producing output. + # + # pkg:gem/rake#lib/rake/trace_output.rb:10 + def trace_on(out, *strings); end +end + +# pkg:gem/rake#lib/rake/version.rb:3 +Rake::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rake#lib/rake/version.rb:5 +module Rake::Version; end + +# pkg:gem/rake#lib/rake/version.rb:6 +Rake::Version::BUILD = T.let(T.unsafe(nil), String) + +# pkg:gem/rake#lib/rake/version.rb:6 +Rake::Version::MAJOR = T.let(T.unsafe(nil), String) + +# pkg:gem/rake#lib/rake/version.rb:6 +Rake::Version::MINOR = T.let(T.unsafe(nil), String) + +# pkg:gem/rake#lib/rake/version.rb:8 +Rake::Version::NUMBERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rake#lib/rake/version.rb:6 +Rake::Version::OTHER = T.let(T.unsafe(nil), Array) + +# Win 32 interface methods for Rake. Windows specific functionality +# will be placed here to collect that knowledge in one spot. +# +# pkg:gem/rake#lib/rake/win32.rb:7 +module Rake::Win32 + class << self + # True if running on a windows system. + # + # pkg:gem/rake#lib/rake/win32.rb:11 + def windows?; end + end +end + +# pkg:gem/rake#lib/rake.rb:69 +RakeFileUtils = Rake::FileUtilsExt + +# pkg:gem/rake#lib/rake/ext/string.rb:4 +class String + include ::Comparable + + # Replace the file extension with +newext+. If there is no extension on + # the string, append the new extension to the end. If the new extension + # is not given, or is the empty string, remove any existing extension. + # + # +ext+ is a user added method for the String class. + # + # This String extension comes from Rake + # + # pkg:gem/rake#lib/rake/ext/string.rb:14 + def ext(newext = T.unsafe(nil)); end + + # Map the path according to the given specification. The specification + # controls the details of the mapping. The following special patterns are + # recognized: + # + # %p :: The complete path. + # %f :: The base file name of the path, with its file extension, + # but without any directories. + # %n :: The file name of the path without its file extension. + # %d :: The directory list of the path. + # %x :: The file extension of the path. An empty string if there + # is no extension. + # %X :: Everything *but* the file extension. + # %s :: The alternate file separator if defined, otherwise use # + # the standard file separator. + # %% :: A percent sign. + # + # The %d specifier can also have a numeric prefix (e.g. '%2d'). + # If the number is positive, only return (up to) +n+ directories in the + # path, starting from the left hand side. If +n+ is negative, return (up + # to) +n+ directories from the right hand side of the path. + # + # Examples: + # + # 'a/b/c/d/file.txt'.pathmap("%2d") => 'a/b' + # 'a/b/c/d/file.txt'.pathmap("%-2d") => 'c/d' + # + # Also the %d, %p, %f, %n, + # %x, and %X operators can take a pattern/replacement + # argument to perform simple string substitutions on a particular part of + # the path. The pattern and replacement are separated by a comma and are + # enclosed by curly braces. The replacement spec comes after the % + # character but before the operator letter. (e.g. "%{old,new}d"). + # Multiple replacement specs should be separated by semi-colons (e.g. + # "%{old,new;src,bin}d"). + # + # Regular expressions may be used for the pattern, and back refs may be + # used in the replacement text. Curly braces, commas and semi-colons are + # excluded from both the pattern and replacement text (let's keep parsing + # reasonable). + # + # For example: + # + # "src/org/onestepback/proj/A.java".pathmap("%{^src,class}X.class") + # + # returns: + # + # "class/org/onestepback/proj/A.class" + # + # If the replacement text is '*', then a block may be provided to perform + # some arbitrary calculation for the replacement. + # + # For example: + # + # "/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext| + # ext.downcase + # } + # + # Returns: + # + # "/path/to/file.txt" + # + # This String extension comes from Rake + # + # pkg:gem/rake#lib/rake/ext/string.rb:138 + def pathmap(spec = T.unsafe(nil), &block); end + + protected + + # Explode a path into individual components. Used by +pathmap+. + # + # This String extension comes from Rake + # + # pkg:gem/rake#lib/rake/ext/string.rb:27 + def pathmap_explode; end + + # Extract a partial path from the path. Include +n+ directories from the + # front end (left hand side) if +n+ is positive. Include |+n+| + # directories from the back end (right hand side) if +n+ is negative. + # + # This String extension comes from Rake + # + # pkg:gem/rake#lib/rake/ext/string.rb:41 + def pathmap_partial(n); end + + # Perform the pathmap replacement operations on the given path. The + # patterns take the form 'pat1,rep1;pat2,rep2...'. + # + # This String extension comes from Rake + # + # pkg:gem/rake#lib/rake/ext/string.rb:59 + def pathmap_replace(patterns, &block); end +end diff --git a/sorbet/rbi/gems/rbi@0.4.3.rbi b/sorbet/rbi/gems/rbi@0.4.3.rbi new file mode 100644 index 0000000..6653035 --- /dev/null +++ b/sorbet/rbi/gems/rbi@0.4.3.rbi @@ -0,0 +1,5781 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rbi` gem. +# Please instead update this file by running `bin/tapioca gem rbi`. + + +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rbi` gem. +# Please instead update this file by running `bundle exec spoom srb sigs export`. + +# pkg:gem/rbi#lib/rbi.rb:7 +module RBI; end + +# pkg:gem/rbi#lib/rbi/model.rb:1011 +class RBI::Arg < ::RBI::Node + # pkg:gem/rbi#lib/rbi/model.rb:1016 + sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } + def initialize(value, loc: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:1022 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1027 + sig { returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:1013 + sig { returns(::String) } + def value; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:325 +class RBI::Attr < ::RBI::NodeWithComments + include ::RBI::Indexable + + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:353 + sig do + params( + name: ::Symbol, + names: T::Array[::Symbol], + visibility: ::RBI::Visibility, + sigs: T.nilable(T::Array[::RBI::Sig]), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]) + ).void + end + def initialize(name, names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:420 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:59 + sig { abstract.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/model.rb:362 + sig { abstract.returns(T::Array[::String]) } + def fully_qualified_names; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:104 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:429 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:327 + sig { returns(T::Array[::Symbol]) } + def names; end + + # pkg:gem/rbi#lib/rbi/model.rb:333 + sig { returns(T::Array[::RBI::Sig]) } + def sigs; end + + # pkg:gem/rbi#lib/rbi/model.rb:343 + sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Sig]) } + def sigs=(sigs); end + + # pkg:gem/rbi#lib/rbi/model.rb:338 + sig { returns(T::Boolean) } + def sigs?; end + + # pkg:gem/rbi#lib/rbi/model.rb:330 + sig { returns(::RBI::Visibility) } + def visibility; end + + # pkg:gem/rbi#lib/rbi/model.rb:330 + def visibility=(_arg0); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:80 + sig do + params( + name: ::String, + sig: T.nilable(::RBI::Sig), + visibility: ::RBI::Visibility, + loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment] + ).returns(::RBI::Method) + end + def create_getter_method(name, sig, visibility, loc, comments); end + + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:99 + sig do + params( + name: ::String, + sig: T.nilable(::RBI::Sig), + attribute_type: T.nilable(T.any(::RBI::Type, ::String)), + visibility: ::RBI::Visibility, + loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment] + ).returns(::RBI::Method) + end + def create_setter_method(name, sig, attribute_type, visibility, loc, comments); end + + # @final + # + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:65 + sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(T.any(::RBI::Type, ::String))]) } + def parse_sig; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:365 +class RBI::AttrAccessor < ::RBI::Attr + # pkg:gem/rbi#lib/rbi/model.rb:374 + sig do + params( + name: ::Symbol, + names: ::Symbol, + visibility: ::RBI::Visibility, + sigs: T.nilable(T::Array[::RBI::Sig]), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::AttrAccessor).void) + ).void + end + def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:458 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:131 + sig { override.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:381 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:388 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:394 +class RBI::AttrReader < ::RBI::Attr + # pkg:gem/rbi#lib/rbi/model.rb:403 + sig do + params( + name: ::Symbol, + names: ::Symbol, + visibility: ::RBI::Visibility, + sigs: T.nilable(T::Array[::RBI::Sig]), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::AttrReader).void) + ).void + end + def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:442 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:146 + sig { override.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:410 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:417 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:423 +class RBI::AttrWriter < ::RBI::Attr + # pkg:gem/rbi#lib/rbi/model.rb:432 + sig do + params( + name: ::Symbol, + names: ::Symbol, + visibility: ::RBI::Visibility, + sigs: T.nilable(T::Array[::RBI::Sig]), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::AttrWriter).void) + ).void + end + def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:450 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:156 + sig { override.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:439 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:446 + sig { override.returns(::String) } + def to_s; end +end + +# An arbitrary blank line that can be added both in trees and comments +# +# pkg:gem/rbi#lib/rbi/model.rb:70 +class RBI::BlankLine < ::RBI::Comment + # pkg:gem/rbi#lib/rbi/model.rb:72 + sig { params(loc: T.nilable(::RBI::Loc)).void } + def initialize(loc: T.unsafe(nil)); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:843 +class RBI::BlockParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:849 + sig do + params( + name: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::BlockParam).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:868 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:863 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:846 + sig { override.returns(T.nilable(::String)) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:857 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:217 +class RBI::Class < ::RBI::Scope + # pkg:gem/rbi#lib/rbi/model.rb:230 + sig do + params( + name: ::String, + superclass_name: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Class).void) + ).void + end + def initialize(name, superclass_name: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:388 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:239 + sig { override.returns(::String) } + def fully_qualified_name; end + + # pkg:gem/rbi#lib/rbi/model.rb:219 + sig { returns(::String) } + def name; end + + # pkg:gem/rbi#lib/rbi/model.rb:222 + sig { returns(T.nilable(::String)) } + def superclass_name; end + + # pkg:gem/rbi#lib/rbi/model.rb:222 + def superclass_name=(_arg0); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:51 +class RBI::Comment < ::RBI::Node + # pkg:gem/rbi#lib/rbi/model.rb:56 + sig { params(text: ::String, loc: T.nilable(::RBI::Loc)).void } + def initialize(text, loc: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:62 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:53 + sig { returns(::String) } + def text; end + + # pkg:gem/rbi#lib/rbi/model.rb:53 + def text=(_arg0); end +end + +# A tree showing incompatibles nodes +# +# Is rendered as a merge conflict between `left` and` right`: +# ~~~rb +# class Foo +# <<<<<<< left +# def m1; end +# def m2(a); end +# ======= +# def m1(a); end +# def m2; end +# >>>>>>> right +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:634 +class RBI::ConflictTree < ::RBI::Tree + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:642 + sig { params(left_name: ::String, right_name: ::String).void } + def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:636 + sig { returns(::RBI::Tree) } + def left; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:639 + sig { returns(::String) } + def left_name; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:636 + def right; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:639 + def right_name; end +end + +# Consts +# +# pkg:gem/rbi#lib/rbi/model.rb:296 +class RBI::Const < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:301 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Const).void) + ).void + end + def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:412 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:309 + sig { returns(::String) } + def fully_qualified_name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:94 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:298 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:317 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:298 + def value; end +end + +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:358 +class RBI::DuplicateNodeError < ::RBI::Error; end + +# pkg:gem/rbi#lib/rbi.rb:8 +class RBI::Error < ::StandardError; end + +# pkg:gem/rbi#lib/rbi/model.rb:901 +class RBI::Extend < ::RBI::Mixin + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:903 + sig do + params( + name: ::String, + names: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Extend).void) + ).void + end + def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:567 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:134 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:910 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:143 +class RBI::File + # pkg:gem/rbi#lib/rbi/model.rb:164 + sig do + params( + strictness: T.nilable(::String), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(file: ::RBI::File).void) + ).void + end + def initialize(strictness: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:172 + sig { params(node: ::RBI::Node).void } + def <<(node); end + + # pkg:gem/rbi#lib/rbi/model.rb:154 + sig { returns(T::Array[::RBI::Comment]) } + def comments; end + + # pkg:gem/rbi#lib/rbi/model.rb:151 + sig { params(comments: T::Array[::RBI::Comment]).returns(T::Array[::RBI::Comment]) } + def comments=(comments); end + + # pkg:gem/rbi#lib/rbi/model.rb:159 + sig { returns(T::Boolean) } + def comments?; end + + # pkg:gem/rbi#lib/rbi/model.rb:177 + sig { returns(T::Boolean) } + def empty?; end + + # pkg:gem/rbi#lib/rbi/printer.rb:866 + sig do + params( + out: T.any(::IO, ::StringIO), + indent: ::Integer, + print_locs: T::Boolean, + max_line_length: T.nilable(::Integer) + ).void + end + def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1218 + sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void } + def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1224 + sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) } + def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:145 + sig { returns(::RBI::Tree) } + def root; end + + # pkg:gem/rbi#lib/rbi/model.rb:145 + def root=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:148 + sig { returns(T.nilable(::String)) } + def strictness; end + + # pkg:gem/rbi#lib/rbi/model.rb:148 + def strictness=(_arg0); end + + # pkg:gem/rbi#lib/rbi/printer.rb:872 + sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } + def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end +end + +# pkg:gem/rbi#lib/rbi/formatter.rb:5 +class RBI::Formatter + # pkg:gem/rbi#lib/rbi/formatter.rb:18 + sig do + params( + add_sig_templates: T::Boolean, + group_nodes: T::Boolean, + max_line_length: T.nilable(::Integer), + nest_singleton_methods: T::Boolean, + nest_non_public_members: T::Boolean, + sort_nodes: T::Boolean, + replace_attributes_with_methods: T::Boolean + ).void + end + def initialize(add_sig_templates: T.unsafe(nil), group_nodes: T.unsafe(nil), max_line_length: T.unsafe(nil), nest_singleton_methods: T.unsafe(nil), nest_non_public_members: T.unsafe(nil), sort_nodes: T.unsafe(nil), replace_attributes_with_methods: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/formatter.rb:43 + sig { params(file: ::RBI::File).void } + def format_file(file); end + + # pkg:gem/rbi#lib/rbi/formatter.rb:48 + sig { params(tree: ::RBI::Tree).void } + def format_tree(tree); end + + # pkg:gem/rbi#lib/rbi/formatter.rb:7 + sig { returns(T.nilable(::Integer)) } + def max_line_length; end + + # pkg:gem/rbi#lib/rbi/formatter.rb:7 + def max_line_length=(_arg0); end + + # pkg:gem/rbi#lib/rbi/formatter.rb:37 + sig { params(file: ::RBI::File).returns(::String) } + def print_file(file); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:86 +class RBI::Group < ::RBI::Tree + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:91 + sig { params(kind: ::RBI::Group::Kind).void } + def initialize(kind); end + + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:88 + sig { returns(::RBI::Group::Kind) } + def kind; end +end + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:96 +class RBI::Group::Kind + class << self + private + + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:111 + def new(*_arg0); end + end +end + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:103 +RBI::Group::Kind::Attrs = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:109 +RBI::Group::Kind::Consts = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:99 +RBI::Group::Kind::Helpers = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:106 +RBI::Group::Kind::Inits = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:107 +RBI::Group::Kind::Methods = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:101 +RBI::Group::Kind::MixesInClassMethods = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:97 +RBI::Group::Kind::Mixins = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:98 +RBI::Group::Kind::RequiredAncestors = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:102 +RBI::Group::Kind::Sends = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:108 +RBI::Group::Kind::SingletonClasses = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:105 +RBI::Group::Kind::TEnums = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:104 +RBI::Group::Kind::TStructFields = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:100 +RBI::Group::Kind::TypeMembers = T.let(T.unsafe(nil), RBI::Group::Kind) + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:5 +class RBI::GroupNodesError < ::RBI::Error; end + +# Sorbet's misc. +# +# pkg:gem/rbi#lib/rbi/model.rb:1349 +class RBI::Helper < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1354 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Helper).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:583 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:164 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:1351 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1362 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:887 +class RBI::Include < ::RBI::Mixin + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:889 + sig do + params( + name: ::String, + names: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Include).void) + ).void + end + def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:559 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:124 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:896 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/index.rb:5 +class RBI::Index < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/index.rb:16 + sig { void } + def initialize; end + + # pkg:gem/rbi#lib/rbi/index.rb:27 + sig { params(id: ::String).returns(T::Array[::RBI::Node]) } + def [](id); end + + # pkg:gem/rbi#lib/rbi/index.rb:32 + sig { params(nodes: ::RBI::Node).void } + def index(*nodes); end + + # pkg:gem/rbi#lib/rbi/index.rb:22 + sig { returns(T::Array[::String]) } + def keys; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:38 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/index.rb:55 + sig { params(node: T.all(::RBI::Indexable, ::RBI::Node)).void } + def index_node(node); end + + class << self + # pkg:gem/rbi#lib/rbi/index.rb:8 + sig { params(node: ::RBI::Node).returns(::RBI::Index) } + def index(*node); end + end +end + +# A Node that can be referred to by a unique ID inside an index +# @interface +# +# pkg:gem/rbi#lib/rbi/index.rb:69 +module RBI::Indexable + interface! + + # Unique IDs that refer to this node. + # + # Some nodes can have multiple ids, for example an attribute accessor matches the ID of the + # getter and the setter. + # @abstract + # + # pkg:gem/rbi#lib/rbi/index.rb:76 + sig { abstract.returns(T::Array[::String]) } + def index_ids; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1032 +class RBI::KwArg < ::RBI::Arg + # pkg:gem/rbi#lib/rbi/model.rb:1037 + sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void } + def initialize(keyword, value, loc: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:1043 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1034 + sig { returns(::String) } + def keyword; end + + # pkg:gem/rbi#lib/rbi/model.rb:1048 + sig { returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:754 +class RBI::KwOptParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:763 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::KwOptParam).void) + ).void + end + def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:783 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:778 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:757 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:772 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:760 + sig { returns(::String) } + def value; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:724 +class RBI::KwParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:730 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::KwParam).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:749 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:744 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:727 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:738 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:788 +class RBI::KwRestParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:794 + sig do + params( + name: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::KwRestParam).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:813 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:808 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:791 + sig { override.returns(T.nilable(::String)) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:802 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/loc.rb:5 +class RBI::Loc + # pkg:gem/rbi#lib/rbi/loc.rb:32 + sig do + params( + file: T.nilable(::String), + begin_line: T.nilable(::Integer), + end_line: T.nilable(::Integer), + begin_column: T.nilable(::Integer), + end_column: T.nilable(::Integer) + ).void + end + def initialize(file: T.unsafe(nil), begin_line: T.unsafe(nil), end_line: T.unsafe(nil), begin_column: T.unsafe(nil), end_column: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/loc.rb:23 + def begin_column; end + + # pkg:gem/rbi#lib/rbi/loc.rb:23 + sig { returns(T.nilable(::Integer)) } + def begin_line; end + + # pkg:gem/rbi#lib/rbi/loc.rb:23 + def end_column; end + + # pkg:gem/rbi#lib/rbi/loc.rb:23 + def end_line; end + + # pkg:gem/rbi#lib/rbi/loc.rb:20 + sig { returns(T.nilable(::String)) } + def file; end + + # pkg:gem/rbi#lib/rbi/loc.rb:41 + sig { params(other: ::RBI::Loc).returns(::RBI::Loc) } + def join(other); end + + # pkg:gem/rbi#lib/rbi/loc.rb:52 + sig { returns(T::Boolean) } + def multiline?; end + + # pkg:gem/rbi#lib/rbi/loc.rb:68 + sig { returns(T.nilable(::String)) } + def source; end + + # pkg:gem/rbi#lib/rbi/loc.rb:59 + sig { returns(::String) } + def to_s; end + + class << self + # pkg:gem/rbi#lib/rbi/loc.rb:8 + sig { params(file: ::String, prism_location: ::Prism::Location).returns(::RBI::Loc) } + def from_prism(file, prism_location); end + end +end + +# A tree that _might_ contain conflicts +# +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:342 +class RBI::MergeTree < ::RBI::Tree + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:351 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment], + conflicts: T::Array[::RBI::Rewriters::Merge::Conflict], + block: T.nilable(T.proc.params(node: ::RBI::Tree).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), conflicts: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:344 + sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } + def conflicts; end +end + +# Methods and args +# +# pkg:gem/rbi#lib/rbi/model.rb:454 +class RBI::Method < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:491 + sig do + params( + name: ::String, + params: T.nilable(T::Array[::RBI::Param]), + is_singleton: T::Boolean, + visibility: ::RBI::Visibility, + sigs: T.nilable(T::Array[::RBI::Sig]), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Method).void) + ).void + end + def initialize(name, params: T.unsafe(nil), is_singleton: T.unsafe(nil), visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:511 + sig { params(param: ::RBI::Param).void } + def <<(param); end + + # pkg:gem/rbi#lib/rbi/model.rb:551 + sig { params(name: ::String).void } + def add_block_param(name); end + + # pkg:gem/rbi#lib/rbi/model.rb:536 + sig { params(name: ::String, default_value: ::String).void } + def add_kw_opt_param(name, default_value); end + + # pkg:gem/rbi#lib/rbi/model.rb:531 + sig { params(name: ::String).void } + def add_kw_param(name); end + + # pkg:gem/rbi#lib/rbi/model.rb:541 + sig { params(name: ::String).void } + def add_kw_rest_param(name); end + + # pkg:gem/rbi#lib/rbi/model.rb:546 + sig { void } + def add_no_kw_param; end + + # pkg:gem/rbi#lib/rbi/model.rb:521 + sig { params(name: ::String, default_value: ::String).void } + def add_opt_param(name, default_value); end + + # pkg:gem/rbi#lib/rbi/model.rb:516 + sig { params(name: ::String).void } + def add_param(name); end + + # pkg:gem/rbi#lib/rbi/model.rb:526 + sig { params(name: ::String).void } + def add_rest_param(name); end + + # pkg:gem/rbi#lib/rbi/model.rb:565 + sig do + params( + params: T.nilable(T::Array[::RBI::SigParam]), + return_type: T.any(::RBI::Type, ::String), + bind_type: T.nilable(T.any(::RBI::Type, ::String)), + is_abstract: T::Boolean, + is_override: T::Boolean, + is_overridable: T::Boolean, + is_final: T::Boolean, + type_params: T.nilable(T::Array[::String]), + checked: T.nilable(::Symbol), + block: T.nilable(T.proc.params(node: ::RBI::Sig).void) + ).void + end + def add_sig(params: T.unsafe(nil), return_type: T.unsafe(nil), bind_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:466 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:593 + sig { returns(::String) } + def fully_qualified_name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:114 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:464 + sig { returns(T::Boolean) } + def is_singleton; end + + # pkg:gem/rbi#lib/rbi/model.rb:464 + def is_singleton=(_arg0); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:482 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:456 + sig { returns(::String) } + def name; end + + # pkg:gem/rbi#lib/rbi/model.rb:459 + sig { returns(T::Array[::RBI::Param]) } + def params; end + + # pkg:gem/rbi#lib/rbi/model.rb:470 + sig { returns(T::Array[::RBI::Sig]) } + def sigs; end + + # pkg:gem/rbi#lib/rbi/model.rb:480 + sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Sig]) } + def sigs=(sigs); end + + # pkg:gem/rbi#lib/rbi/model.rb:475 + sig { returns(T::Boolean) } + def sigs?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:603 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:467 + sig { returns(::RBI::Visibility) } + def visibility; end + + # pkg:gem/rbi#lib/rbi/model.rb:467 + def visibility=(_arg0); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:504 + sig { params(other: ::RBI::Method).returns(T::Boolean) } + def compatible_params?(other); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:513 + sig { params(preferred: T::Array[::RBI::Param], fallback: T::Array[::RBI::Param]).returns(T::Array[::RBI::Param]) } + def merge_params(preferred, fallback); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:524 + sig { params(sigs: T::Array[::RBI::Sig], params: T::Array[::RBI::Param]).void } + def rename_sigs_params(sigs, params); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1393 +class RBI::MixesInClassMethods < ::RBI::Mixin + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1400 + sig do + params( + name: ::String, + names: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::MixesInClassMethods).void) + ).void + end + def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:575 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:144 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1407 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:876 +class RBI::Mixin < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:881 + sig do + params( + name: ::String, + names: T::Array[::String], + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]) + ).void + end + def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:551 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:878 + sig { returns(T::Array[::String]) } + def names; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:197 +class RBI::Module < ::RBI::Scope + # pkg:gem/rbi#lib/rbi/model.rb:202 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Module).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:396 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:210 + sig { override.returns(::String) } + def fully_qualified_name; end + + # pkg:gem/rbi#lib/rbi/model.rb:199 + sig { returns(::String) } + def name; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:818 +class RBI::NoKwParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:820 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::NoKwParam).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:838 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:833 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:827 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:8 +class RBI::Node + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:16 + sig { params(loc: T.nilable(::RBI::Loc)).void } + def initialize(loc: T.unsafe(nil)); end + + # Can `self` and `_other` be merged into a single definition? + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:302 + sig { params(_other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(_other); end + + # pkg:gem/rbi#lib/rbi/model.rb:22 + sig { void } + def detach; end + + # pkg:gem/rbi#lib/rbi/model.rb:13 + sig { returns(T.nilable(::RBI::Loc)) } + def loc; end + + # pkg:gem/rbi#lib/rbi/model.rb:13 + def loc=(_arg0); end + + # Merge `self` and `other` into a single definition + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:308 + sig { params(other: ::RBI::Node).void } + def merge_with(other); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:311 + sig { returns(T.nilable(::RBI::ConflictTree)) } + def parent_conflict_tree; end + + # pkg:gem/rbi#lib/rbi/model.rb:44 + sig { returns(T.nilable(::RBI::Scope)) } + def parent_scope; end + + # pkg:gem/rbi#lib/rbi/model.rb:10 + sig { returns(T.nilable(::RBI::Tree)) } + def parent_tree; end + + # pkg:gem/rbi#lib/rbi/model.rb:10 + def parent_tree=(_arg0); end + + # pkg:gem/rbi#lib/rbi/printer.rb:884 + sig do + params( + out: T.any(::IO, ::StringIO), + indent: ::Integer, + print_locs: T::Boolean, + max_line_length: T.nilable(::Integer) + ).void + end + def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1233 + sig do + params( + out: T.any(::IO, ::StringIO), + indent: ::Integer, + print_locs: T::Boolean, + positional_names: T::Boolean + ).void + end + def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1239 + sig { params(indent: ::Integer, print_locs: T::Boolean, positional_names: T::Boolean).returns(::String) } + def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:31 + sig { params(node: ::RBI::Node).void } + def replace(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:91 + sig { params(version: ::Gem::Version).returns(T::Boolean) } + def satisfies_version?(version); end + + # pkg:gem/rbi#lib/rbi/printer.rb:890 + sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } + def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:88 +class RBI::NodeWithComments < ::RBI::Node + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:105 + sig { params(loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:111 + sig { returns(T::Array[::String]) } + def annotations; end + + # pkg:gem/rbi#lib/rbi/model.rb:93 + sig { returns(T::Array[::RBI::Comment]) } + def comments; end + + # pkg:gem/rbi#lib/rbi/model.rb:90 + sig { params(comments: T::Array[::RBI::Comment]).returns(T::Array[::RBI::Comment]) } + def comments=(comments); end + + # Returns true if this node has any comments, without allocating + # an empty array for nodes that have never had comments set. + # + # pkg:gem/rbi#lib/rbi/model.rb:100 + sig { returns(T::Boolean) } + def comments?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:325 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:101 + sig { returns(T::Array[::Gem::Requirement]) } + def version_requirements; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:660 +class RBI::OptParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:669 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::OptParam).void) + ).void + end + def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:689 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:684 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:663 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:678 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:666 + sig { returns(::String) } + def value; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:609 +class RBI::Param < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:611 + sig { params(loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/model.rb:625 + sig { abstract.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:543 + sig { override.params(other: T.nilable(::RBI::Node)).returns(T::Boolean) } + def compatible_with?(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:616 + sig { returns(T.nilable(::String)) } + def name; end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:7 +class RBI::ParseError < ::RBI::Error + # pkg:gem/rbi#lib/rbi/parser.rb:12 + sig { params(message: ::String, location: ::RBI::Loc).void } + def initialize(message, location); end + + # pkg:gem/rbi#lib/rbi/parser.rb:9 + sig { returns(::RBI::Loc) } + def location; end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:49 +class RBI::Parser + # pkg:gem/rbi#lib/rbi/parser.rb:80 + sig { params(path: ::String).returns(::RBI::Tree) } + def parse_file(path); end + + # pkg:gem/rbi#lib/rbi/parser.rb:75 + sig { params(string: ::String).returns(::RBI::Tree) } + def parse_string(string); end + + private + + # pkg:gem/rbi#lib/rbi/parser.rb:87 + sig { params(source: ::String, file: ::String).returns(::RBI::Tree) } + def parse(source, file:); end + + class << self + # pkg:gem/rbi#lib/rbi/parser.rb:57 + sig { params(path: ::String).returns(::RBI::Tree) } + def parse_file(path); end + + # pkg:gem/rbi#lib/rbi/parser.rb:62 + sig { params(paths: T::Array[::String]).returns(T::Array[::RBI::Tree]) } + def parse_files(paths); end + + # pkg:gem/rbi#lib/rbi/parser.rb:52 + sig { params(string: ::String).returns(::RBI::Tree) } + def parse_string(string); end + + # pkg:gem/rbi#lib/rbi/parser.rb:68 + sig { params(strings: T::Array[::String]).returns(T::Array[::RBI::Tree]) } + def parse_strings(strings); end + end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:1044 +class RBI::Parser::HeredocLocationVisitor < ::Prism::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:1046 + sig { params(source: ::Prism::Source, begin_offset: ::Integer, end_offset: ::Integer).void } + def initialize(source, begin_offset, end_offset); end + + # pkg:gem/rbi#lib/rbi/parser.rb:1077 + sig { returns(::Prism::Location) } + def location; end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:1067 + sig { override.params(node: ::Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:1056 + sig { override.params(node: ::Prism::StringNode).void } + def visit_string_node(node); end + + private + + # pkg:gem/rbi#lib/rbi/parser.rb:1088 + sig { params(node: T.any(::Prism::InterpolatedStringNode, ::Prism::StringNode)).void } + def handle_string_node(node); end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:935 +class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:940 + sig { params(content: ::String, file: ::String).void } + def initialize(content, file:); end + + # pkg:gem/rbi#lib/rbi/parser.rb:1027 + sig { params(node: ::Prism::CallNode, value: ::String).returns(T::Boolean) } + def allow_incompatible_override?(node, value); end + + # pkg:gem/rbi#lib/rbi/parser.rb:937 + sig { returns(::RBI::Sig) } + def current; end + + # pkg:gem/rbi#lib/rbi/parser.rb:1017 + sig { params(node: ::Prism::Node).returns(::String) } + def sig_param_name(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:1006 + sig { params(node: ::Prism::CallNode).returns(T.nilable(::String)) } + def sig_type_argument(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:998 + sig { override.params(node: ::Prism::AssocNode).void } + def visit_assoc_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:948 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:179 +class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:187 + sig { params(source: ::String, comments: T::Array[::Prism::Comment], file: ::String).void } + def initialize(source, comments:, file:); end + + # pkg:gem/rbi#lib/rbi/parser.rb:184 + sig { returns(T.nilable(::Prism::Node)) } + def last_node; end + + # pkg:gem/rbi#lib/rbi/parser.rb:181 + sig { returns(::RBI::Tree) } + def tree; end + + # pkg:gem/rbi#lib/rbi/parser.rb:376 + sig { params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:200 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:251 + sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void } + def visit_constant_assign(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:244 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:236 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:306 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:328 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:347 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:359 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # Collect all the remaining comments within a node + # + # pkg:gem/rbi#lib/rbi/parser.rb:554 + sig { params(node: ::Prism::Node).void } + def collect_dangling_comments(node); end + + # Collect all the remaining comments after visiting the tree + # + # pkg:gem/rbi#lib/rbi/parser.rb:572 + sig { void } + def collect_orphan_comments; end + + # pkg:gem/rbi#lib/rbi/parser.rb:595 + sig { returns(::RBI::Tree) } + def current_scope; end + + # pkg:gem/rbi#lib/rbi/parser.rb:600 + sig { returns(T::Array[::RBI::Sig]) } + def current_sigs; end + + # pkg:gem/rbi#lib/rbi/parser.rb:607 + sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } + def detach_comments_from_sigs(sigs); end + + # pkg:gem/rbi#lib/rbi/parser.rb:619 + sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) } + def node_comments(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:681 + sig { params(node: ::Prism::Comment).returns(::RBI::Comment) } + def parse_comment(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:714 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) } + def parse_params(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:688 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Arg]) } + def parse_send_args(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:785 + sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) } + def parse_sig(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:794 + sig do + params( + node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode) + ).returns(T.nilable(::RBI::Struct)) + end + def parse_struct(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:842 + sig { params(send: ::Prism::CallNode).void } + def parse_tstruct_field(send); end + + # pkg:gem/rbi#lib/rbi/parser.rb:879 + sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) } + def parse_visibility(name, node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:893 + sig { void } + def separate_header_comments; end + + # pkg:gem/rbi#lib/rbi/parser.rb:903 + sig { void } + def set_root_tree_loc; end + + # pkg:gem/rbi#lib/rbi/parser.rb:922 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_enum_value?(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:917 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def type_variable_definition?(node); end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:114 +class RBI::Parser::Visitor < ::Prism::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:116 + sig { params(source: ::String, file: ::String).void } + def initialize(source, file:); end + + private + + # pkg:gem/rbi#lib/rbi/parser.rb:158 + sig { params(node: ::Prism::Node).returns(::Prism::Location) } + def adjust_prism_location_for_heredoc(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:149 + sig { params(node: ::Prism::Node).returns(T::Boolean) } + def braceless_shape?(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:126 + sig { params(node: ::Prism::Node).returns(::RBI::Loc) } + def node_loc(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:131 + sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::String)) } + def node_string(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:138 + sig { params(node: ::Prism::Node).returns(::String) } + def node_string!(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:169 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def self?(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:174 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_sig_without_runtime?(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:143 + sig { params(node: ::Prism::Node).returns(::String) } + def type_string(node); end +end + +# pkg:gem/rbi#lib/rbi/printer.rb:7 +class RBI::Printer < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/printer.rb:25 + sig do + params( + out: T.any(::IO, ::String, ::StringIO), + indent: ::Integer, + print_locs: T::Boolean, + max_line_length: T.nilable(::Integer) + ).void + end + def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/printer.rb:19 + sig { returns(::Integer) } + def current_indent; end + + # pkg:gem/rbi#lib/rbi/printer.rb:48 + sig { returns(::String) } + def current_indent_string; end + + # pkg:gem/rbi#lib/rbi/printer.rb:43 + sig { void } + def dedent; end + + # pkg:gem/rbi#lib/rbi/printer.rb:13 + def in_visibility_group; end + + # pkg:gem/rbi#lib/rbi/printer.rb:13 + def in_visibility_group=(_arg0); end + + # pkg:gem/rbi#lib/rbi/printer.rb:38 + sig { void } + def indent; end + + # pkg:gem/rbi#lib/rbi/printer.rb:22 + sig { returns(T.nilable(::Integer)) } + def max_line_length; end + + # pkg:gem/rbi#lib/rbi/printer.rb:16 + sig { returns(T.nilable(::RBI::Node)) } + def previous_node; end + + # Print a string without indentation nor `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/printer.rb:54 + sig { params(string: ::String).void } + def print(string); end + + # pkg:gem/rbi#lib/rbi/printer.rb:13 + sig { returns(T::Boolean) } + def print_locs; end + + # pkg:gem/rbi#lib/rbi/printer.rb:13 + def print_locs=(_arg0); end + + # Print a string with indentation and `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/printer.rb:76 + sig { params(string: ::String).void } + def printl(string); end + + # Print a string without indentation but with a `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/printer.rb:60 + sig { params(string: T.nilable(::String)).void } + def printn(string = T.unsafe(nil)); end + + # Print a string with indentation but without a `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/printer.rb:69 + sig { params(string: T.nilable(::String)).void } + def printt(string = T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:84 + sig { override.params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:98 + sig { override.params(file: ::RBI::File).void } + def visit_file(file); end + + private + + # pkg:gem/rbi#lib/rbi/printer.rb:708 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def oneline?(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:676 + sig { params(node: ::RBI::Node).void } + def print_blank_line_before(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:686 + sig { params(node: ::RBI::Node).void } + def print_loc(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:692 + sig { params(node: ::RBI::Param, last: T::Boolean).void } + def print_param_comment_leading_space(node, last:); end + + # pkg:gem/rbi#lib/rbi/printer.rb:767 + sig { params(node: ::RBI::Sig).void } + def print_sig_as_block(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:737 + sig { params(node: ::RBI::Sig).void } + def print_sig_as_line(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:700 + sig { params(node: ::RBI::SigParam, last: T::Boolean).void } + def print_sig_param_comment_leading_space(node, last:); end + + # pkg:gem/rbi#lib/rbi/printer.rb:837 + sig { params(node: ::RBI::Sig).returns(T::Array[::String]) } + def sig_modifiers(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:487 + sig { override.params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:280 + sig { params(node: ::RBI::Attr).void } + def visit_attr(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:263 + sig { override.params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:269 + sig { override.params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:275 + sig { override.params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:160 + sig { override.params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:407 + sig { override.params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:180 + sig { override.params(node: ::RBI::Class).void } + def visit_class(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:139 + sig { override.params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:652 + sig { override.params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:253 + sig { override.params(node: ::RBI::Const).void } + def visit_const(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:419 + sig { override.params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:621 + sig { override.params(node: ::RBI::Group).void } + def visit_group(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:605 + sig { override.params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:413 + sig { override.params(node: ::RBI::Include).void } + def visit_include(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:493 + sig { override.params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:389 + sig { override.params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:383 + sig { override.params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:395 + sig { override.params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:315 + sig { override.params(node: ::RBI::Method).void } + def visit_method(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:615 + sig { override.params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:424 + sig { params(node: ::RBI::Mixin).void } + def visit_mixin(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:174 + sig { override.params(node: ::RBI::Module).void } + def visit_module(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:401 + sig { override.params(node: ::RBI::NoKwParam).void } + def visit_no_kw_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:371 + sig { override.params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:454 + sig { override.params(node: ::RBI::Private).void } + def visit_private(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:448 + sig { override.params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:442 + sig { override.params(node: ::RBI::Public).void } + def visit_public(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:118 + sig { override.params(node: ::RBI::RBSComment).void } + def visit_rbs_comment(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:365 + sig { override.params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:642 + sig { override.params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:377 + sig { override.params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:197 + sig { params(node: ::RBI::Scope).void } + def visit_scope(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:242 + sig { params(node: ::RBI::Scope).void } + def visit_scope_body(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:662 + sig { override.params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:207 + sig { params(node: ::RBI::Scope).void } + def visit_scope_header(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:469 + sig { override.params(node: ::RBI::Send).void } + def visit_send(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:501 + sig { override.params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:522 + sig { override.params(node: ::RBI::SigParam).void } + def visit_sig_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:192 + sig { override.params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:186 + sig { override.params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:547 + sig { params(node: ::RBI::TStructField).void } + def visit_t_struct_field(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:566 + sig { override.params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:572 + sig { override.params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:585 + sig { override.params(node: ::RBI::TEnumValue).void } + def visit_tenum_value(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:166 + sig { override.params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:530 + sig { override.params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:536 + sig { override.params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:542 + sig { override.params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:595 + sig { override.params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:459 + sig { params(node: ::RBI::Visibility).void } + def visit_visibility(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:628 + sig { override.params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end +end + +# pkg:gem/rbi#lib/rbi/printer.rb:834 +RBI::Printer::EMPTY_MODIFIERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rbi#lib/rbi/printer.rb:10 +RBI::Printer::INDENT_CACHE = T.let(T.unsafe(nil), Array) + +# Pre-computed indentation strings to avoid allocating " " * indent on every line. +# +# pkg:gem/rbi#lib/rbi/printer.rb:9 +RBI::Printer::MAX_CACHED_INDENT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rbi#lib/rbi/printer.rb:5 +class RBI::PrinterError < ::RBI::Error; end + +# pkg:gem/rbi#lib/rbi/model.rb:970 +class RBI::Private < ::RBI::Visibility + # pkg:gem/rbi#lib/rbi/model.rb:972 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Private).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:962 +class RBI::Protected < ::RBI::Visibility + # pkg:gem/rbi#lib/rbi/model.rb:964 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Protected).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:951 +class RBI::Public < ::RBI::Visibility + # pkg:gem/rbi#lib/rbi/model.rb:953 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Public).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end +end + +# Shared default instance to avoid allocating a new Public on every Method/Attr creation. +# +# pkg:gem/rbi#lib/rbi/model.rb:959 +RBI::Public::DEFAULT = T.let(T.unsafe(nil), RBI::Public) + +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:5 +module RBI::RBS; end + +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:6 +class RBI::RBS::MethodTypeTranslator + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:38 + sig { params(method: ::RBI::Method, options: ::RBI::RBS::MethodTypeTranslator::Options).void } + def initialize(method, options: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:35 + sig { returns(::RBI::Sig) } + def result; end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:47 + sig { params(type: ::RBS::MethodType).void } + def visit(type); end + + private + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:136 + sig { params(param: ::RBI::Param).returns(T.nilable(::String)) } + def anonymous_param_name(param); end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:121 + sig { params(param: ::RBS::Types::Function::Param, index: ::Integer).returns(::RBI::SigParam) } + def translate_function_param(param, index); end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:148 + sig { params(type: T.untyped).returns(::RBI::Type) } + def translate_type(type); end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:63 + sig { params(type: ::RBS::Types::Block).void } + def visit_block_type(type); end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:78 + sig { params(type: ::RBS::Types::Function).void } + def visit_function_type(type); end + + class << self + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:11 + sig { params(method: ::RBI::Method, type: ::RBS::MethodType).returns(::RBI::Sig) } + def translate(method, type); end + end +end + +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:7 +class RBI::RBS::MethodTypeTranslator::Error < ::RBI::Error; end + +# pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:18 +class RBI::RBS::MethodTypeTranslator::Options + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:23 + sig { params(erase_generic_types: T::Boolean).void } + def initialize(erase_generic_types: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:20 + sig { returns(T::Boolean) } + def erase_generic_types; end + + class << self + # pkg:gem/rbi#lib/rbi/rbs/method_type_translator.rb:30 + sig { returns(::RBI::RBS::MethodTypeTranslator::Options) } + def default; end + end +end + +# pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:6 +class RBI::RBS::TypeTranslator + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:41 + sig { params(options: ::RBI::RBS::MethodTypeTranslator::Options).void } + def initialize(options: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:46 + sig do + params( + type: T.any(::RBS::Types::Alias, ::RBS::Types::Bases::Any, ::RBS::Types::Bases::Bool, ::RBS::Types::Bases::Bottom, ::RBS::Types::Bases::Class, ::RBS::Types::Bases::Instance, ::RBS::Types::Bases::Nil, ::RBS::Types::Bases::Self, ::RBS::Types::Bases::Top, ::RBS::Types::Bases::Void, ::RBS::Types::ClassInstance, ::RBS::Types::ClassSingleton, ::RBS::Types::Function, ::RBS::Types::Interface, ::RBS::Types::Intersection, ::RBS::Types::Literal, ::RBS::Types::Optional, ::RBS::Types::Proc, ::RBS::Types::Record, ::RBS::Types::Tuple, ::RBS::Types::Union, ::RBS::Types::UntypedFunction, ::RBS::Types::Variable) + ).returns(::RBI::Type) + end + def translate(type); end + + private + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:225 + sig { params(type_name: ::String).returns(::String) } + def erase_t_generic_type(type_name); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:138 + sig { params(type: ::RBS::Types::ClassInstance).returns(::RBI::Type) } + def translate_class_instance(type); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:152 + sig { params(type: ::RBS::Types::Function).returns(::RBI::Type) } + def translate_function(type); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:220 + sig { params(type_name: ::String).returns(::String) } + def translate_t_generic_type(type_name); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:126 + sig { params(type: ::RBS::Types::Alias).returns(::RBI::Type) } + def translate_type_alias(type); end + + class << self + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:33 + sig do + params( + type: T.any(::RBS::Types::Alias, ::RBS::Types::Bases::Any, ::RBS::Types::Bases::Bool, ::RBS::Types::Bases::Bottom, ::RBS::Types::Bases::Class, ::RBS::Types::Bases::Instance, ::RBS::Types::Bases::Nil, ::RBS::Types::Bases::Self, ::RBS::Types::Bases::Top, ::RBS::Types::Bases::Void, ::RBS::Types::ClassInstance, ::RBS::Types::ClassSingleton, ::RBS::Types::Function, ::RBS::Types::Interface, ::RBS::Types::Intersection, ::RBS::Types::Literal, ::RBS::Types::Optional, ::RBS::Types::Proc, ::RBS::Types::Record, ::RBS::Types::Tuple, ::RBS::Types::Union, ::RBS::Types::UntypedFunction, ::RBS::Types::Variable) + ).returns(::RBI::Type) + end + def translate(type); end + end +end + +# pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:211 +RBI::RBS::TypeTranslator::GENERIC_TYPE_TO_SORBET_GENERIC_TYPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:38 +RBI::RBS::TypeTranslator::Options = RBI::RBS::MethodTypeTranslator::Options + +# pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:198 +RBI::RBS::TypeTranslator::RUNTIME_GENERIC_TYPES = T.let(T.unsafe(nil), Array) + +RBI::RBS::TypeTranslator::RbsType = T.type_alias { T.any(::RBS::Types::Alias, ::RBS::Types::Bases::Any, ::RBS::Types::Bases::Bool, ::RBS::Types::Bases::Bottom, ::RBS::Types::Bases::Class, ::RBS::Types::Bases::Instance, ::RBS::Types::Bases::Nil, ::RBS::Types::Bases::Self, ::RBS::Types::Bases::Top, ::RBS::Types::Bases::Void, ::RBS::Types::ClassInstance, ::RBS::Types::ClassSingleton, ::RBS::Types::Function, ::RBS::Types::Interface, ::RBS::Types::Intersection, ::RBS::Types::Literal, ::RBS::Types::Optional, ::RBS::Types::Proc, ::RBS::Types::Record, ::RBS::Types::Tuple, ::RBS::Types::Union, ::RBS::Types::UntypedFunction, ::RBS::Types::Variable) } + +# pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:215 +RBI::RBS::TypeTranslator::SORBET_GENERIC_TYPE_TO_GENERIC_TYPE = T.let(T.unsafe(nil), Hash) + +# A comment representing a RBS type prefixed with `#:` +# +# pkg:gem/rbi#lib/rbi/model.rb:78 +class RBI::RBSComment < ::RBI::Comment + # pkg:gem/rbi#lib/rbi/model.rb:80 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end +end + +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:5 +class RBI::RBSPrinter < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:31 + sig do + params( + out: T.any(::IO, ::StringIO), + indent: ::Integer, + print_locs: T::Boolean, + positional_names: T::Boolean, + max_line_length: T.nilable(::Integer), + force_multiline_signatures: T::Boolean + ).void + end + def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil), force_multiline_signatures: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:15 + sig { returns(::Integer) } + def current_indent; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:58 + sig { void } + def dedent; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 + def in_visibility_group; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 + def in_visibility_group=(_arg0); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:53 + sig { void } + def indent; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:21 + sig { returns(T.nilable(::Integer)) } + def max_line_length; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:18 + sig { returns(T::Boolean) } + def positional_names; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:18 + def positional_names=(_arg0); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:12 + sig { returns(T.nilable(::RBI::Node)) } + def previous_node; end + + # Print a string without indentation nor `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:64 + sig { params(string: ::String).void } + def print(string); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:311 + sig { params(node: ::RBI::Attr, sig: ::RBI::Sig).void } + def print_attr_sig(node, sig); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 + sig { returns(T::Boolean) } + def print_locs; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:9 + def print_locs=(_arg0); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:409 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } + def print_method_sig(node, sig); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:491 + sig { params(sig_param: T.nilable(::RBI::SigParam)).void } + def print_method_sig_block(sig_param); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:426 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig, multiline: T::Boolean).void } + def print_method_sig_content(node, sig, multiline:); end + + # Print a string with indentation and `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:84 + sig { params(string: ::String).void } + def printl(string); end + + # Print a string without indentation but with a `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:70 + sig { params(string: T.nilable(::String)).void } + def printn(string = T.unsafe(nil)); end + + # Print a string with indentation but without a `\n` at the end. + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:77 + sig { params(string: T.nilable(::String)).void } + def printt(string = T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:91 + sig { override.params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:662 + sig { override.params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:279 + sig { params(node: ::RBI::Attr).void } + def visit_attr(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:262 + sig { override.params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:268 + sig { override.params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:274 + sig { override.params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:133 + sig { override.params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:594 + sig { override.params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:153 + sig { override.params(node: ::RBI::Class).void } + def visit_class(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:116 + sig { override.params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:798 + sig { override.params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:246 + sig { override.params(node: ::RBI::Const).void } + def visit_const(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:606 + sig { override.params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:103 + sig { override.params(file: ::RBI::File).void } + def visit_file(file); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:771 + sig { override.params(node: ::RBI::Group).void } + def visit_group(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:759 + sig { override.params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:600 + sig { override.params(node: ::RBI::Include).void } + def visit_include(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:668 + sig { override.params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:575 + sig { override.params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:569 + sig { override.params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:581 + sig { override.params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:334 + sig { override.params(node: ::RBI::Method).void } + def visit_method(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:765 + sig { override.params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:611 + sig { params(node: ::RBI::Mixin).void } + def visit_mixin(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:147 + sig { override.params(node: ::RBI::Module).void } + def visit_module(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:588 + sig { override.params(node: ::RBI::NoKwParam).void } + def visit_no_kw_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:552 + sig { override.params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:641 + sig { override.params(node: ::RBI::Private).void } + def visit_private(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:635 + sig { override.params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:629 + sig { override.params(node: ::RBI::Public).void } + def visit_public(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:542 + sig { override.params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:792 + sig { override.params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:562 + sig { override.params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:170 + sig { params(node: ::RBI::Scope).void } + def visit_scope(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:233 + sig { params(node: ::RBI::Scope).void } + def visit_scope_body(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:808 + sig { override.params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:180 + sig { params(node: ::RBI::Scope).void } + def visit_scope_header(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:656 + sig { override.params(node: ::RBI::Send).void } + def visit_send(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:523 + sig { params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:536 + sig { params(node: ::RBI::SigParam).void } + def visit_sig_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:165 + sig { override.params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:159 + sig { override.params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:725 + sig { override.params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:731 + sig { override.params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:737 + sig { override.params(node: ::RBI::TEnumValue).void } + def visit_tenum_value(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:139 + sig { override.params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:674 + sig { override.params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:709 + sig { override.params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:717 + sig { override.params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:753 + sig { override.params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:646 + sig { params(node: ::RBI::Visibility).void } + def visit_visibility(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:778 + sig { override.params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end + + private + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:908 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def oneline?(node); end + + # Parse a string containing a `T.let(x, X)` and extract the type + # + # Returns `nil` is the string is not a `T.let`. + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:942 + sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) } + def parse_t_let(code); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:930 + sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) } + def parse_type(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:824 + sig { params(node: ::RBI::Node).void } + def print_blank_line_before(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:843 + sig { params(node: ::RBI::Node).void } + def print_loc(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:892 + sig { params(node: ::RBI::Param, last: T::Boolean).void } + def print_param_comment_leading_space(node, last:); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:849 + sig { params(sig_param: ::RBI::SigParam, method_param: ::RBI::Param).void } + def print_sig_param(sig_param, method_param); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:900 + sig { params(node: ::RBI::SigParam, last: T::Boolean).void } + def print_sig_param_comment_leading_space(node, last:); end +end + +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:6 +class RBI::RBSPrinter::Error < ::RBI::Error; end + +# pkg:gem/rbi#lib/rbi/model.rb:5 +class RBI::ReplaceNodeError < ::RBI::Error; end + +# pkg:gem/rbi#lib/rbi/model.rb:630 +class RBI::ReqParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:636 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::ReqParam).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:655 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:650 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:633 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:644 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1412 +class RBI::RequiresAncestor < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1417 + sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:154 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:1414 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1424 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:694 +class RBI::RestParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:700 + sig do + params( + name: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::RestParam).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:719 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:714 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:697 + sig { override.returns(T.nilable(::String)) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:708 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:5 +module RBI::Rewriters; end + +# pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:6 +class RBI::Rewriters::AddSigTemplates < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:8 + sig { params(with_todo_comment: T::Boolean).void } + def initialize(with_todo_comment: T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:15 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:29 + sig { params(attr: ::RBI::Attr).void } + def add_attr_sig(attr); end + + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:44 + sig { params(method: ::RBI::Method).void } + def add_method_sig(method); end + + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:71 + sig { params(node: ::RBI::NodeWithComments).void } + def add_todo_comment(node); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:6 +class RBI::Rewriters::Annotate < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:8 + sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } + def initialize(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:17 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:30 + sig { params(node: ::RBI::NodeWithComments).void } + def annotate_node(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:37 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def root?(node); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:22 +class RBI::Rewriters::AttrToMethods < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:25 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:38 + sig { params(node: ::RBI::Node, with: T::Array[::RBI::Node]).void } + def replace(node, with:); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:6 +class RBI::Rewriters::Deannotate < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:8 + sig { params(annotation: ::String).void } + def initialize(annotation); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:15 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:26 + sig { params(node: ::RBI::NodeWithComments).void } + def deannotate_node(node); end +end + +# Take a gem version and filter out all RBI that is not relevant to that version based on @version annotations +# in comments. As an example: +# +# ~~~rb +# tree = Parser.parse_string(<<~RBI) +# class Foo +# # @version > 0.3.0 +# def bar +# end +# +# # @version <= 0.3.0 +# def bar(arg1) +# end +# end +# RBI +# +# Rewriters::FilterVersions.filter(tree, Gem::Version.new("0.3.1")) +# +# assert_equal(<<~RBI, tree.string) +# class Foo +# # @version > 0.3.0 +# def bar +# end +# end +# RBI +# ~~~ +# +# Supported operators: +# - equals `=` +# - not equals `!=` +# - greater than `>` +# - greater than or equal to `>=` +# - less than `<` +# - less than or equal to `<=` +# - pessimistic or twiddle-wakka`~>` +# +# And/or logic: +# - "And" logic: put multiple versions on the same line +# - e.g. `@version > 0.3.0, <1.0.0` means version must be greater than 0.3.0 AND less than 1.0.0 +# - "Or" logic: put multiple versions on subsequent lines +# - e.g. the following means version must be less than 0.3.0 OR greater than 1.0.0 +# ``` +# # @version < 0.3.0 +# # @version > 1.0.0 +# ``` +# Prerelease versions: +# - Prerelease versions are considered less than their non-prerelease counterparts +# - e.g. `0.4.0-prerelease` is less than `0.4.0` +# +# RBI with no versions: +# - RBI with no version annotations are automatically counted towards ALL versions +# +# pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:57 +class RBI::Rewriters::FilterVersions < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:69 + sig { params(version: ::Gem::Version).void } + def initialize(version); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:76 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + class << self + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:62 + sig { params(tree: ::RBI::Tree, version: ::Gem::Version).void } + def filter(tree, version); end + end +end + +# pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:58 +RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) + +# Rewrite non-singleton methods inside singleton classes to singleton methods +# +# Example: +# ~~~rb +# class << self +# def m1; end +# def self.m2; end +# +# class << self +# def m3; end +# end +# end +# ~~~ +# +# will be rewritten to: +# +# ~~~rb +# def self.m1; end +# +# class << self +# def self.m2; end +# def self.m3; end +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/flatten_singleton_methods.rb:30 +class RBI::Rewriters::FlattenSingletonMethods < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/flatten_singleton_methods.rb:33 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# Flattens visibility nodes into method nodes +# +# Example: +# ~~~rb +# class A +# def m1; end +# private +# def m2; end +# def m3; end +# end +# ~~~ +# +# will be transformed into: +# +# ~~~rb +# class A +# def m1; end +# private def m2; end +# private def m3; end +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:27 +class RBI::Rewriters::FlattenVisibilities < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:29 + sig { void } + def initialize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:37 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:8 +class RBI::Rewriters::GroupNodes < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:11 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:37 + sig { params(node: ::RBI::Node).returns(::RBI::Group::Kind) } + def group_kind(node); end +end + +# Merge two RBI trees together +# +# Be this `Tree`: +# ~~~rb +# class Foo +# attr_accessor :a +# def m; end +# C = 10 +# end +# ~~~ +# +# Merged with this one: +# ~~~rb +# class Foo +# attr_reader :a +# def m(x); end +# C = 10 +# end +# ~~~ +# +# Compatible definitions are merged together while incompatible definitions are moved into a `ConflictTree`: +# ~~~rb +# class Foo +# <<<<<<< left +# attr_accessor :a +# def m; end +# ======= +# attr_reader :a +# def m(x); end +# >>>>>>> right +# C = 10 +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:39 +class RBI::Rewriters::Merge + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:66 + sig { params(left_name: ::String, right_name: ::String, keep: ::RBI::Rewriters::Merge::Keep).void } + def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:75 + sig { params(tree: ::RBI::Tree).void } + def merge(tree); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:63 + sig { returns(::RBI::MergeTree) } + def tree; end + + class << self + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:50 + sig do + params( + left: ::RBI::Tree, + right: ::RBI::Tree, + left_name: ::String, + right_name: ::String, + keep: ::RBI::Rewriters::Merge::Keep + ).returns(::RBI::MergeTree) + end + def merge_trees(left, right, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end + end +end + +# Used for logging / error displaying purpose +# +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:82 +class RBI::Rewriters::Merge::Conflict + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:90 + sig { params(left: ::RBI::Node, right: ::RBI::Node, left_name: ::String, right_name: ::String).void } + def initialize(left:, right:, left_name:, right_name:); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:84 + sig { returns(::RBI::Node) } + def left; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:87 + sig { returns(::String) } + def left_name; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:84 + def right; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:87 + def right_name; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:98 + sig { returns(::String) } + def to_s; end +end + +# Merge adjacent conflict trees +# +# Transform this: +# ~~~rb +# class Foo +# <<<<<<< left +# def m1; end +# ======= +# def m1(a); end +# >>>>>>> right +# <<<<<<< left +# def m2(a); end +# ======= +# def m2; end +# >>>>>>> right +# end +# ~~~ +# +# Into this: +# ~~~rb +# class Foo +# <<<<<<< left +# def m1; end +# def m2(a); end +# ======= +# def m1(a); end +# def m2; end +# >>>>>>> right +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:258 +class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:261 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:267 + sig { override.params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:290 + sig { params(left: ::RBI::Tree, right: ::RBI::Tree).void } + def merge_conflict_trees(left, right); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:40 +class RBI::Rewriters::Merge::Keep + class << self + private + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:45 + def new(*_arg0); end + end +end + +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:42 +RBI::Rewriters::Merge::Keep::LEFT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) + +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:41 +RBI::Rewriters::Merge::Keep::NONE = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) + +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:43 +RBI::Rewriters::Merge::Keep::RIGHT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) + +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:103 +class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:108 + sig do + params( + output: ::RBI::Tree, + left_name: ::String, + right_name: ::String, + keep: ::RBI::Rewriters::Merge::Keep + ).void + end + def initialize(output, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:105 + sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } + def conflicts; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:121 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:181 + sig { returns(::RBI::Tree) } + def current_scope; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:198 + sig { params(left: ::RBI::Scope, right: ::RBI::Scope).void } + def make_conflict_scope(left, right); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:205 + sig { params(left: ::RBI::Node, right: ::RBI::Node).void } + def make_conflict_tree(left, right); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:186 + sig { params(node: ::RBI::Node).returns(T.nilable(::RBI::Node)) } + def previous_definition(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:217 + sig { params(left: ::RBI::Scope, right: ::RBI::Scope).returns(::RBI::Scope) } + def replace_scope_header(left, right); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:6 +class RBI::Rewriters::NestNonPublicMembers < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:9 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/nest_singleton_methods.rb:6 +class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/nest_singleton_methods.rb:9 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# This rewriter moves top-level members into a top-level Object class +# +# Example: +# ~~~rb +# def foo; end +# attr_reader :bar +# ~~~ +# +# will be rewritten to: +# +# ~~~rb +# class Object +# def foo; end +# attr_reader :bar +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:22 +class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:24 + sig { void } + def initialize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:32 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# Remove all definitions existing in the index from the current tree +# +# Let's create an `Index` from two different `Tree`s: +# ~~~rb +# tree1 = Parse.parse_string(<<~RBI) +# class Foo +# def foo; end +# end +# RBI +# +# tree2 = Parse.parse_string(<<~RBI) +# FOO = 10 +# RBI +# +# index = Index.index(tree1, tree2) +# ~~~ +# +# We can use `RemoveKnownDefinitions` to remove the definitions found in the `index` from the `Tree` to clean: +# ~~~rb +# tree_to_clean = Parser.parse_string(<<~RBI) +# class Foo +# def foo; end +# def bar; end +# end +# FOO = 10 +# BAR = 42 +# RBI +# +# cleaned_tree, operations = RemoveKnownDefinitions.remove(tree_to_clean, index) +# +# assert_equal(<<~RBI, cleaned_tree) +# class Foo +# def bar; end +# end +# BAR = 42 +# RBI +# +# assert_equal(<<~OPERATIONS, operations.join("\n")) +# Deleted ::Foo#foo at -:2:2-2-16 (duplicate from -:2:2-2:16) +# Deleted ::FOO at -:5:0-5:8 (duplicate from -:1:0-1:8) +# OPERATIONS +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:48 +class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:53 + sig { params(index: ::RBI::Index).void } + def initialize(index); end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:50 + sig { returns(T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]) } + def operations; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:75 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:69 + sig { params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:103 + sig { params(node: ::RBI::Node, previous: ::RBI::Node).returns(T::Boolean) } + def can_delete_node?(node, previous); end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:121 + sig { params(node: ::RBI::Node, previous: ::RBI::Node).void } + def delete_node(node, previous); end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:94 + sig { params(node: ::RBI::Indexable).returns(T.nilable(::RBI::Node)) } + def previous_definition_for(node); end + + class << self + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:61 + sig do + params( + tree: ::RBI::Tree, + index: ::RBI::Index + ).returns([::RBI::Tree, T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]]) + end + def remove(tree, index); end + end +end + +# pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:126 +class RBI::Rewriters::RemoveKnownDefinitions::Operation + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:131 + sig { params(deleted_node: ::RBI::Node, duplicate_of: ::RBI::Node).void } + def initialize(deleted_node:, duplicate_of:); end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:128 + sig { returns(::RBI::Node) } + def deleted_node; end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:128 + def duplicate_of; end + + # pkg:gem/rbi#lib/rbi/rewriters/remove_known_definitions.rb:137 + sig { returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:6 +class RBI::Rewriters::SortNodes < ::RBI::Visitor + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:9 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:71 + sig { params(kind: ::RBI::Group::Kind).returns(::Integer) } + def group_rank(kind); end + + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:92 + sig { params(node: ::RBI::Node).returns(T.nilable(::String)) } + def node_name(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:43 + sig { params(node: ::RBI::Node).returns(::Integer) } + def node_rank(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:104 + sig { params(node: ::RBI::Node).void } + def sort_node_names!(node); end +end + +# Translate all RBS signature comments to Sorbet RBI signatures +# +# pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:7 +class RBI::Rewriters::TranslateRBSSigs < ::RBI::Visitor + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:11 + sig { void } + def initialize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:18 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:40 + sig { params(node: T.any(::RBI::Attr, ::RBI::Method)).returns(T::Array[::RBI::RBSComment]) } + def extract_rbs_comments(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:67 + sig { params(node: ::RBI::Attr, comment: ::RBI::RBSComment).returns(::RBI::Sig) } + def translate_rbs_attr_type(node, comment); end + + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:59 + sig { params(node: ::RBI::Method, comment: ::RBI::RBSComment).returns(::RBI::Sig) } + def translate_rbs_method_type(node, comment); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:8 +class RBI::Rewriters::TranslateRBSSigs::Error < ::RBI::Error; end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:185 +class RBI::Scope < ::RBI::Tree + include ::RBI::Indexable + + abstract! + + # Duplicate `self` scope without its body + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:363 + sig { returns(T.self_type) } + def dup_empty; end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/model.rb:188 + sig { abstract.returns(::String) } + def fully_qualified_name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:84 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:192 + sig { override.returns(::String) } + def to_s; end +end + +# A conflict between two scope headers +# +# Is rendered as a merge conflict between `left` and` right` for scope definitions: +# ~~~rb +# <<<<<<< left +# class Foo +# ======= +# module Foo +# >>>>>>> right +# def m1; end +# end +# ~~~ +# +# pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:665 +class RBI::ScopeConflict < ::RBI::Tree + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:673 + sig { params(left: ::RBI::Scope, right: ::RBI::Scope, left_name: ::String, right_name: ::String).void } + def initialize(left:, right:, left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:667 + sig { returns(::RBI::Scope) } + def left; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:670 + sig { returns(::String) } + def left_name; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:667 + def right; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:670 + def right_name; end +end + +# Sends +# +# pkg:gem/rbi#lib/rbi/model.rb:980 +class RBI::Send < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:988 + sig do + params( + method: ::String, + args: T::Array[::RBI::Arg], + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Send).void) + ).void + end + def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:996 + sig { params(arg: ::RBI::Arg).void } + def <<(arg); end + + # pkg:gem/rbi#lib/rbi/model.rb:1001 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:985 + sig { returns(T::Array[::RBI::Arg]) } + def args; end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:591 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:184 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:982 + sig { returns(::String) } + def method; end + + # pkg:gem/rbi#lib/rbi/model.rb:1006 + sig { returns(::String) } + def to_s; end +end + +# Sorbet's sigs +# +# pkg:gem/rbi#lib/rbi/model.rb:1055 +class RBI::Sig < ::RBI::NodeWithComments + # pkg:gem/rbi#lib/rbi/model.rb:1117 + sig do + params( + params: T.nilable(T::Array[::RBI::SigParam]), + return_type: T.any(::RBI::Type, ::String), + bind_type: T.nilable(T.any(::RBI::Type, ::String)), + is_abstract: T::Boolean, + is_override: T::Boolean, + is_overridable: T::Boolean, + is_final: T::Boolean, + allow_incompatible_override: T::Boolean, + allow_incompatible_override_visibility: T::Boolean, + without_runtime: T::Boolean, + type_params: T.nilable(T::Array[::String]), + checked: T.nilable(::Symbol), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Sig).void) + ).void + end + def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), bind_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), allow_incompatible_override_visibility: T.unsafe(nil), without_runtime: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:1151 + sig { params(param: ::RBI::SigParam).void } + def <<(param); end + + # pkg:gem/rbi#lib/rbi/model.rb:1161 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1156 + sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void } + def add_param(name, type); end + + # pkg:gem/rbi#lib/rbi/model.rb:1080 + sig { returns(T::Boolean) } + def allow_incompatible_override; end + + # pkg:gem/rbi#lib/rbi/model.rb:1080 + def allow_incompatible_override=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1083 + sig { returns(T::Boolean) } + def allow_incompatible_override_visibility; end + + # pkg:gem/rbi#lib/rbi/model.rb:1083 + def allow_incompatible_override_visibility=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1065 + sig { returns(T.nilable(T.any(::RBI::Type, ::String))) } + def bind_type; end + + # pkg:gem/rbi#lib/rbi/model.rb:1065 + def bind_type=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1099 + sig { returns(T.nilable(::Symbol)) } + def checked; end + + # pkg:gem/rbi#lib/rbi/model.rb:1099 + def checked=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1068 + sig { returns(T::Boolean) } + def is_abstract; end + + # pkg:gem/rbi#lib/rbi/model.rb:1068 + def is_abstract=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1077 + sig { returns(T::Boolean) } + def is_final; end + + # pkg:gem/rbi#lib/rbi/model.rb:1077 + def is_final=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1074 + sig { returns(T::Boolean) } + def is_overridable; end + + # pkg:gem/rbi#lib/rbi/model.rb:1074 + def is_overridable=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1071 + sig { returns(T::Boolean) } + def is_override; end + + # pkg:gem/rbi#lib/rbi/model.rb:1071 + def is_override=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1057 + sig { returns(T::Array[::RBI::SigParam]) } + def params; end + + # pkg:gem/rbi#lib/rbi/model.rb:1062 + sig { returns(T.any(::RBI::Type, ::String)) } + def return_type; end + + # pkg:gem/rbi#lib/rbi/model.rb:1062 + def return_type=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1089 + sig { returns(T::Array[::String]) } + def type_params; end + + # pkg:gem/rbi#lib/rbi/model.rb:1094 + sig { returns(T::Boolean) } + def type_params?; end + + # pkg:gem/rbi#lib/rbi/model.rb:1086 + sig { returns(T::Boolean) } + def without_runtime; end + + # pkg:gem/rbi#lib/rbi/model.rb:1086 + def without_runtime=(_arg0); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1171 +class RBI::SigParam < ::RBI::NodeWithComments + # pkg:gem/rbi#lib/rbi/model.rb:1179 + sig do + params( + name: ::String, + type: T.any(::RBI::Type, ::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::SigParam).void) + ).void + end + def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:1199 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1194 + sig { returns(T::Boolean) } + def anonymous?; end + + # pkg:gem/rbi#lib/rbi/model.rb:1173 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1189 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:1176 + sig { returns(T.any(::RBI::Type, ::String)) } + def type; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:246 +class RBI::SingletonClass < ::RBI::Scope + # pkg:gem/rbi#lib/rbi/model.rb:248 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::SingletonClass).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:255 + sig { override.returns(::String) } + def fully_qualified_name; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:260 +class RBI::Struct < ::RBI::Scope + # pkg:gem/rbi#lib/rbi/model.rb:277 + sig do + params( + name: ::String, + members: T::Array[::Symbol], + keyword_init: T::Boolean, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(struct: ::RBI::Struct).void) + ).void + end + def initialize(name, members: T.unsafe(nil), keyword_init: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:404 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:287 + sig { override.returns(::String) } + def fully_qualified_name; end + + # pkg:gem/rbi#lib/rbi/model.rb:268 + sig { returns(T::Boolean) } + def keyword_init; end + + # pkg:gem/rbi#lib/rbi/model.rb:268 + def keyword_init=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:265 + sig { returns(T::Array[::Symbol]) } + def members; end + + # pkg:gem/rbi#lib/rbi/model.rb:265 + def members=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:262 + sig { returns(::String) } + def name; end +end + +# Sorbet's T::Enum +# +# pkg:gem/rbi#lib/rbi/model.rb:1296 +class RBI::TEnum < ::RBI::Class + # pkg:gem/rbi#lib/rbi/model.rb:1298 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(klass: ::RBI::TEnum).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1304 +class RBI::TEnumBlock < ::RBI::Scope + # pkg:gem/rbi#lib/rbi/model.rb:1306 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::TEnumBlock).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1313 + sig { override.returns(::String) } + def fully_qualified_name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:214 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1319 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1324 +class RBI::TEnumValue < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1329 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::TEnumValue).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:1336 + sig { returns(::String) } + def fully_qualified_name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:224 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:1326 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1342 + sig { override.returns(::String) } + def to_s; end +end + +# Sorbet's T::Struct +# +# pkg:gem/rbi#lib/rbi/model.rb:1208 +class RBI::TStruct < ::RBI::Class + # pkg:gem/rbi#lib/rbi/model.rb:1210 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(klass: ::RBI::TStruct).void) + ).void + end + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1240 +class RBI::TStructConst < ::RBI::TStructField + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1248 + sig do + params( + name: ::String, + type: T.any(::RBI::Type, ::String), + default: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::TStructConst).void) + ).void + end + def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:607 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1255 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:194 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1262 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:1217 +class RBI::TStructField < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:1228 + sig do + params( + name: ::String, + type: T.any(::RBI::Type, ::String), + default: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]) + ).void + end + def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:599 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1225 + sig { returns(T.nilable(::String)) } + def default; end + + # pkg:gem/rbi#lib/rbi/model.rb:1225 + def default=(_arg0); end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/model.rb:1237 + sig { abstract.returns(T::Array[::String]) } + def fully_qualified_names; end + + # pkg:gem/rbi#lib/rbi/model.rb:1219 + sig { returns(::String) } + def name; end + + # pkg:gem/rbi#lib/rbi/model.rb:1222 + sig { returns(T.any(::RBI::Type, ::String)) } + def type; end + + # pkg:gem/rbi#lib/rbi/model.rb:1222 + def type=(_arg0); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1267 +class RBI::TStructProp < ::RBI::TStructField + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1275 + sig do + params( + name: ::String, + type: T.any(::RBI::Type, ::String), + default: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::TStructProp).void) + ).void + end + def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:615 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1282 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:204 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1289 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:120 +class RBI::Tree < ::RBI::NodeWithComments + # pkg:gem/rbi#lib/rbi/model.rb:125 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::Tree).void) + ).void + end + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:132 + sig { params(node: ::RBI::Node).void } + def <<(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/add_sig_templates.rb:79 + sig { params(with_todo_comment: T::Boolean).void } + def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/annotate.rb:46 + sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } + def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/deannotate.rb:38 + sig { params(annotation: ::String).void } + def deannotate!(annotation); end + + # pkg:gem/rbi#lib/rbi/model.rb:138 + sig { returns(T::Boolean) } + def empty?; end + + # pkg:gem/rbi#lib/rbi/rewriters/filter_versions.rb:113 + sig { params(version: ::Gem::Version).void } + def filter_versions!(version); end + + # pkg:gem/rbi#lib/rbi/rewriters/flatten_singleton_methods.rb:58 + sig { void } + def flatten_singleton_methods!; end + + # pkg:gem/rbi#lib/rbi/rewriters/flatten_visibilities.rb:57 + sig { void } + def flatten_visibilities!; end + + # pkg:gem/rbi#lib/rbi/rewriters/group_nodes.rb:80 + sig { void } + def group_nodes!; end + + # pkg:gem/rbi#lib/rbi/index.rb:62 + sig { returns(::RBI::Index) } + def index; end + + # pkg:gem/rbi#lib/rbi/rewriters/merge_trees.rb:336 + sig do + params( + other: ::RBI::Tree, + left_name: ::String, + right_name: ::String, + keep: ::RBI::Rewriters::Merge::Keep + ).returns(::RBI::MergeTree) + end + def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:52 + sig { void } + def nest_non_public_members!; end + + # pkg:gem/rbi#lib/rbi/rewriters/nest_singleton_methods.rb:41 + sig { void } + def nest_singleton_methods!; end + + # pkg:gem/rbi#lib/rbi/rewriters/nest_top_level_members.rb:60 + sig { void } + def nest_top_level_members!; end + + # pkg:gem/rbi#lib/rbi/model.rb:122 + sig { returns(T::Array[::RBI::Node]) } + def nodes; end + + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:50 + sig { void } + def replace_attributes_with_methods!; end + + # pkg:gem/rbi#lib/rbi/rewriters/sort_nodes.rb:115 + sig { void } + def sort_nodes!; end + + # pkg:gem/rbi#lib/rbi/rewriters/translate_rbs_sigs.rb:88 + sig { void } + def translate_rbs_sigs!; end +end + +# The base class for all RBI types. +# @abstract +# +# pkg:gem/rbi#lib/rbi/type.rb:7 +class RBI::Type + abstract! + + # pkg:gem/rbi#lib/rbi/type.rb:1000 + sig { void } + def initialize; end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/type.rb:1071 + sig { abstract.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:1074 + sig { params(other: ::BasicObject).returns(T::Boolean) } + def eql?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:1080 + sig { override.returns(::Integer) } + def hash; end + + # Returns a new type that is `nilable` if it is not already. + # + # If the type is already nilable, it returns itself. + # ```ruby + # type = RBI::Type.simple("String") + # type.to_rbi # => "String" + # type.nilable.to_rbi # => "::T.nilable(String)" + # type.nilable.nilable.to_rbi # => "::T.nilable(String)" + # ``` + # + # pkg:gem/rbi#lib/rbi/type.rb:1014 + sig { returns(::RBI::Type) } + def nilable; end + + # Returns whether the type is nilable. + # + # pkg:gem/rbi#lib/rbi/type.rb:1041 + sig { returns(T::Boolean) } + def nilable?; end + + # Returns the non-nilable version of the type. + # If the type is already non-nilable, it returns itself. + # If the type is nilable, it returns the inner type. + # + # ```ruby + # type = RBI::Type.nilable(RBI::Type.simple("String")) + # type.to_rbi # => "::T.nilable(String)" + # type.non_nilable.to_rbi # => "String" + # type.non_nilable.non_nilable.to_rbi # => "String" + # ``` + # + # pkg:gem/rbi#lib/rbi/type.rb:1029 + sig { returns(::RBI::Type) } + def non_nilable; end + + # Returns a normalized version of the type. + # + # Normalized types are meant to be easier to process, not to read. + # For example, `T.any(TrueClass, FalseClass)` instead of `T::Boolean` or + # `T.any(String, NilClass)` instead of `T.nilable(String)`. + # + # This is the inverse of `#simplify`. + # + # @abstract + # + # pkg:gem/rbi#lib/rbi/type.rb:1055 + sig { abstract.returns(::RBI::Type) } + def normalize; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1248 + sig { returns(::String) } + def rbs_string; end + + # Returns a simplified version of the type. + # + # Simplified types are meant to be easier to read, not to process. + # For example, `T::Boolean` instead of `T.any(TrueClass, FalseClass)` or + # `T.nilable(String)` instead of `T.any(String, NilClass)`. + # + # This is the inverse of `#normalize`. + # + # @abstract + # + # pkg:gem/rbi#lib/rbi/type.rb:1067 + sig { abstract.returns(::RBI::Type) } + def simplify; end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/type.rb:1086 + sig { abstract.returns(::String) } + def to_rbi; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:1090 + sig { override.returns(::String) } + def to_s; end + + class << self + # Builds a type that represents an intersection of multiple types like `T.all(String, Integer)`. + # + # Note that this method transforms types such as `T.all(String, String)` into `String`, so + # it may return something other than a `All`. + # + # pkg:gem/rbi#lib/rbi/type.rb:936 + sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } + def all(type1, type2, *types); end + + # Builds a type that represents a union of multiple types like `T.any(String, Integer)`. + # + # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so + # it may return something other than a `Any`. + # + # pkg:gem/rbi#lib/rbi/type.rb:945 + sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } + def any(type1, type2, *types); end + + # Builds a type that represents `T.anything`. + # + # pkg:gem/rbi#lib/rbi/type.rb:861 + sig { returns(::RBI::Type::Anything) } + def anything; end + + # Builds a type that represents `T.attached_class`. + # + # pkg:gem/rbi#lib/rbi/type.rb:867 + sig { returns(::RBI::Type::AttachedClass) } + def attached_class; end + + # Builds a type that represents `T::Boolean`. + # + # pkg:gem/rbi#lib/rbi/type.rb:873 + sig { returns(::RBI::Type::Boolean) } + def boolean; end + + # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`. + # + # pkg:gem/rbi#lib/rbi/type.rb:917 + sig do + params( + type: ::RBI::Type::Simple, + type_parameters: T.any(::RBI::Type, T::Array[::RBI::Type]) + ).returns(::RBI::Type::ClassOf) + end + def class_of(type, *type_parameters); end + + # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. + # + # pkg:gem/rbi#lib/rbi/type.rb:953 + sig { params(name: ::String, params: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Generic) } + def generic(name, *params); end + + # Builds a type that represents a nilable of another type like `T.nilable(String)`. + # + # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so + # it may return something other than a `RBI::Type::Nilable`. + # + # pkg:gem/rbi#lib/rbi/type.rb:926 + sig { params(type: ::RBI::Type).returns(::RBI::Type) } + def nilable(type); end + + # Builds a type that represents `T.noreturn`. + # + # pkg:gem/rbi#lib/rbi/type.rb:879 + sig { returns(::RBI::Type::NoReturn) } + def noreturn; end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:26 + sig { params(node: ::Prism::Node).returns(::RBI::Type) } + def parse_node(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:10 + sig { params(string: ::String).returns(::RBI::Type) } + def parse_string(string); end + + # Builds a type that represents a proc type like `T.proc.void`. + # + # pkg:gem/rbi#lib/rbi/type.rb:987 + sig { returns(::RBI::Type::Proc) } + def proc; end + + # Builds a type that represents `T.self_type`. + # + # pkg:gem/rbi#lib/rbi/type.rb:885 + sig { returns(::RBI::Type::SelfType) } + def self_type; end + + # Builds a type that represents a shape type like `{name: String, age: Integer}`. + # + # pkg:gem/rbi#lib/rbi/type.rb:979 + sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).returns(::RBI::Type::Shape) } + def shape(types = T.unsafe(nil)); end + + # Builds a simple type like `String` or `::Foo::Bar`. + # + # It raises a `NameError` if the name is not a valid Ruby class identifier. + # + # pkg:gem/rbi#lib/rbi/type.rb:850 + sig { params(name: ::String).returns(::RBI::Type::Simple) } + def simple(name); end + + # Builds a type that represents the class of another type like `T::Class[Foo]`. + # + # pkg:gem/rbi#lib/rbi/type.rb:905 + sig { params(type: ::RBI::Type).returns(::RBI::Type::Class) } + def t_class(type); end + + # Builds a type that represents the module of another type like `T::Module[Foo]`. + # + # pkg:gem/rbi#lib/rbi/type.rb:911 + sig { params(type: ::RBI::Type).returns(::RBI::Type::Module) } + def t_module(type); end + + # Builds a type that represents a tuple type like `[String, Integer]`. + # + # pkg:gem/rbi#lib/rbi/type.rb:973 + sig { params(types: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Tuple) } + def tuple(*types); end + + # Builds a type that represents a type alias like `MyTypeAlias`. + # + # pkg:gem/rbi#lib/rbi/type.rb:965 + sig { params(name: ::String, aliased_type: ::RBI::Type).returns(::RBI::Type::TypeAlias) } + def type_alias(name, aliased_type); end + + # Builds a type that represents a type parameter like `T.type_parameter(:U)`. + # + # pkg:gem/rbi#lib/rbi/type.rb:959 + sig { params(name: ::Symbol).returns(::RBI::Type::TypeParameter) } + def type_parameter(name); end + + # Builds a type that represents `T.untyped`. + # + # pkg:gem/rbi#lib/rbi/type.rb:891 + sig { returns(::RBI::Type::Untyped) } + def untyped; end + + # Builds a type that represents `void`. + # + # pkg:gem/rbi#lib/rbi/type.rb:897 + sig { returns(::RBI::Type::Void) } + def void; end + + private + + # pkg:gem/rbi#lib/rbi/type_parser.rb:320 + sig { params(node: ::Prism::CallNode).returns(T::Array[::Prism::Node]) } + def call_chain(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:307 + sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } + def check_arguments_at_least!(node, count); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:292 + sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } + def check_arguments_exactly!(node, count); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:96 + sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } + def parse_call(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:56 + sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(::RBI::Type) } + def parse_constant(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:73 + sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).returns(::RBI::Type) } + def parse_constant_assignment(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:242 + sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } + def parse_proc(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:221 + sig { params(node: T.any(::Prism::HashNode, ::Prism::KeywordHashNode)).returns(::RBI::Type) } + def parse_shape(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:216 + sig { params(node: ::Prism::ArrayNode).returns(::RBI::Type) } + def parse_tuple(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:333 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:352 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_boolean?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:359 + sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } + def t_class?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:369 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_class_of?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:364 + sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } + def t_module?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:376 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def t_proc?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:345 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_type_alias?(node); end + + # pkg:gem/rbi#lib/rbi/type.rb:994 + sig { params(name: ::String).returns(T::Boolean) } + def valid_identifier?(name); end + end +end + +# A type that is intersection of multiple types like `T.all(String, Integer)`. +# +# pkg:gem/rbi#lib/rbi/type.rb:420 +class RBI::Type::All < ::RBI::Type::Composite + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:429 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:449 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:423 + sig { override.returns(::String) } + def to_rbi; end +end + +# A type that is union of multiple types like `T.any(String, Integer)`. +# +# pkg:gem/rbi#lib/rbi/type.rb:462 +class RBI::Type::Any < ::RBI::Type::Composite + # pkg:gem/rbi#lib/rbi/type.rb:470 + sig { returns(T::Boolean) } + def nilable?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:476 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:496 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:465 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T.anything`. +# +# pkg:gem/rbi#lib/rbi/type.rb:51 +class RBI::Type::Anything < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:54 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:66 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:72 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:60 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T.attached_class`. +# +# pkg:gem/rbi#lib/rbi/type.rb:78 +class RBI::Type::AttachedClass < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:81 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:93 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:99 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:87 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T::Boolean`. +# +# pkg:gem/rbi#lib/rbi/type.rb:105 +class RBI::Type::Boolean < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:108 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:120 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:126 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:114 + sig { override.returns(::String) } + def to_rbi; end +end + +# The class of another type like `T::Class[Foo]`. +# +# pkg:gem/rbi#lib/rbi/type.rb:242 +class RBI::Type::Class < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:247 + sig { params(type: ::RBI::Type).void } + def initialize(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:254 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:266 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:272 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:260 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:244 + sig { returns(::RBI::Type) } + def type; end +end + +# The singleton class of another type like `T.class_of(Foo)`. +# +# pkg:gem/rbi#lib/rbi/type.rb:314 +class RBI::Type::ClassOf < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:322 + sig { params(type: ::RBI::Type::Simple, type_parameters: ::RBI::Type).void } + def initialize(type, *type_parameters); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:330 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:346 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:352 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:336 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:316 + sig { returns(::RBI::Type::Simple) } + def type; end + + # pkg:gem/rbi#lib/rbi/type.rb:319 + sig { returns(T::Array[::RBI::Type]) } + def type_parameters; end +end + +# A type that is composed of multiple types like `T.all(String, Integer)`. +# @abstract +# +# pkg:gem/rbi#lib/rbi/type.rb:402 +class RBI::Type::Composite < ::RBI::Type + abstract! + + # pkg:gem/rbi#lib/rbi/type.rb:407 + sig { params(types: T::Array[::RBI::Type]).void } + def initialize(types); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:414 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:404 + sig { returns(T::Array[::RBI::Type]) } + def types; end +end + +# pkg:gem/rbi#lib/rbi/type_parser.rb:6 +class RBI::Type::Error < ::RBI::Error; end + +# A generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. +# +# pkg:gem/rbi#lib/rbi/type.rb:547 +class RBI::Type::Generic < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:555 + sig { params(name: ::String, params: ::RBI::Type).void } + def initialize(name, *params); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:563 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:549 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:575 + sig { override.returns(::RBI::Type) } + def normalize; end + + # pkg:gem/rbi#lib/rbi/type.rb:552 + sig { returns(T::Array[::RBI::Type]) } + def params; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:581 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:569 + sig { override.returns(::String) } + def to_rbi; end +end + +# The module of another type like `T::Module[Foo]`. +# +# pkg:gem/rbi#lib/rbi/type.rb:278 +class RBI::Type::Module < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:283 + sig { params(type: ::RBI::Type).void } + def initialize(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:290 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:302 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:308 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:296 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:280 + sig { returns(::RBI::Type) } + def type; end +end + +# A type that can be `nil` like `T.nilable(String)`. +# +# pkg:gem/rbi#lib/rbi/type.rb:358 +class RBI::Type::Nilable < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:363 + sig { params(type: ::RBI::Type).void } + def initialize(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:370 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:382 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:388 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:376 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:360 + sig { returns(::RBI::Type) } + def type; end +end + +# `T.noreturn`. +# +# pkg:gem/rbi#lib/rbi/type.rb:132 +class RBI::Type::NoReturn < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:135 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:147 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:153 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:141 + sig { override.returns(::String) } + def to_rbi; end +end + +# A proc type like `T.proc.void`. +# +# pkg:gem/rbi#lib/rbi/type.rb:750 +class RBI::Type::Proc < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:761 + sig { void } + def initialize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:770 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:798 + sig { params(type: T.untyped).returns(T.self_type) } + def bind(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:830 + sig { override.returns(::RBI::Type) } + def normalize; end + + # pkg:gem/rbi#lib/rbi/type.rb:780 + sig { params(params: ::RBI::Type).returns(T.self_type) } + def params(**params); end + + # pkg:gem/rbi#lib/rbi/type.rb:758 + sig { returns(T.nilable(::RBI::Type)) } + def proc_bind; end + + # pkg:gem/rbi#lib/rbi/type.rb:752 + sig { returns(T::Hash[::Symbol, ::RBI::Type]) } + def proc_params; end + + # pkg:gem/rbi#lib/rbi/type.rb:755 + sig { returns(::RBI::Type) } + def proc_returns; end + + # pkg:gem/rbi#lib/rbi/type.rb:786 + sig { params(type: T.untyped).returns(T.self_type) } + def returns(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:836 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:805 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:792 + sig { returns(T.self_type) } + def void; end +end + +# `T.self_type`. +# +# pkg:gem/rbi#lib/rbi/type.rb:159 +class RBI::Type::SelfType < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:162 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:174 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:180 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:168 + sig { override.returns(::String) } + def to_rbi; end +end + +# A shape type like `{name: String, age: Integer}`. +# +# pkg:gem/rbi#lib/rbi/type.rb:701 +class RBI::Type::Shape < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:706 + sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).void } + def initialize(types); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:713 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:736 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:742 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:719 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:703 + sig { returns(T::Hash[T.any(::String, ::Symbol), ::RBI::Type]) } + def types; end +end + +# A type that represents a simple class name like `String` or `Foo`. +# +# It can also be a qualified name like `::Foo` or `Foo::Bar`. +# +# pkg:gem/rbi#lib/rbi/type.rb:13 +class RBI::Type::Simple < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:18 + sig { params(name: ::String).void } + def initialize(name); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:25 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:15 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:37 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:43 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:31 + sig { override.returns(::String) } + def to_rbi; end +end + +# A tuple type like `[String, Integer]`. +# +# pkg:gem/rbi#lib/rbi/type.rb:665 +class RBI::Type::Tuple < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:670 + sig { params(types: T::Array[::RBI::Type]).void } + def initialize(types); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:677 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:689 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:695 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:683 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:667 + sig { returns(T::Array[::RBI::Type]) } + def types; end +end + +# A type alias that references another type by name like `MyTypeAlias`. +# +# pkg:gem/rbi#lib/rbi/type.rb:623 +class RBI::Type::TypeAlias < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:631 + sig { params(name: ::String, aliased_type: ::RBI::Type).void } + def initialize(name, aliased_type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:639 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:628 + sig { returns(::RBI::Type) } + def aliased_type; end + + # pkg:gem/rbi#lib/rbi/type.rb:625 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:651 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:657 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:645 + sig { override.returns(::String) } + def to_rbi; end +end + +# A type parameter like `T.type_parameter(:U)`. +# +# pkg:gem/rbi#lib/rbi/type.rb:587 +class RBI::Type::TypeParameter < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:592 + sig { params(name: ::Symbol).void } + def initialize(name); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:599 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:589 + sig { returns(::Symbol) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:611 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:617 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:605 + sig { override.returns(::String) } + def to_rbi; end +end + +# `T.untyped`. +# +# pkg:gem/rbi#lib/rbi/type.rb:186 +class RBI::Type::Untyped < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:189 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:201 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:207 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:195 + sig { override.returns(::String) } + def to_rbi; end +end + +# pkg:gem/rbi#lib/rbi/type_visitor.rb:6 +class RBI::Type::Visitor + # pkg:gem/rbi#lib/rbi/type_visitor.rb:10 + sig { params(node: ::RBI::Type).void } + def visit(node); end + + private + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:58 + sig { params(type: ::RBI::Type::All).void } + def visit_all(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:61 + sig { params(type: ::RBI::Type::Any).void } + def visit_any(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:64 + sig { params(type: ::RBI::Type::Anything).void } + def visit_anything(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:67 + sig { params(type: ::RBI::Type::AttachedClass).void } + def visit_attached_class(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:70 + sig { params(type: ::RBI::Type::Boolean).void } + def visit_boolean(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:73 + sig { params(type: ::RBI::Type::Class).void } + def visit_class(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:76 + sig { params(type: ::RBI::Type::ClassOf).void } + def visit_class_of(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:79 + sig { params(type: ::RBI::Type::Generic).void } + def visit_generic(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:82 + sig { params(type: ::RBI::Type::Nilable).void } + def visit_nilable(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:88 + sig { params(type: ::RBI::Type::NoReturn).void } + def visit_no_return(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:91 + sig { params(type: ::RBI::Type::Proc).void } + def visit_proc(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:94 + sig { params(type: ::RBI::Type::SelfType).void } + def visit_self_type(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:100 + sig { params(type: ::RBI::Type::Shape).void } + def visit_shape(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:85 + sig { params(type: ::RBI::Type::Simple).void } + def visit_simple(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:103 + sig { params(type: ::RBI::Type::Tuple).void } + def visit_tuple(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:112 + sig { params(type: ::RBI::Type::TypeAlias).void } + def visit_type_alias(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:106 + sig { params(type: ::RBI::Type::TypeParameter).void } + def visit_type_parameter(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:109 + sig { params(type: ::RBI::Type::Untyped).void } + def visit_untyped(type); end + + # pkg:gem/rbi#lib/rbi/type_visitor.rb:97 + sig { params(type: ::RBI::Type::Void).void } + def visit_void(type); end +end + +# pkg:gem/rbi#lib/rbi/type_visitor.rb:7 +class RBI::Type::Visitor::Error < ::RBI::Error; end + +# `void`. +# +# pkg:gem/rbi#lib/rbi/type.rb:213 +class RBI::Type::Void < ::RBI::Type + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:216 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:228 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:234 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:222 + sig { override.returns(::String) } + def to_rbi; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1367 +class RBI::TypeMember < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1372 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: T.nilable(T::Array[::RBI::Comment]), + block: T.nilable(T.proc.params(node: ::RBI::TypeMember).void) + ).void + end + def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # pkg:gem/rbi#lib/rbi/model.rb:1380 + sig { returns(::String) } + def fully_qualified_name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/index.rb:174 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # pkg:gem/rbi#lib/rbi/model.rb:1369 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1388 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:1369 + def value; end +end + +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:963 +class RBI::TypePrinter + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:968 + sig { params(max_line_length: T.nilable(::Integer)).void } + def initialize(max_line_length: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:965 + sig { returns(::String) } + def string; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:974 + sig { params(node: ::RBI::Type).void } + def visit(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1099 + sig { params(type: ::RBI::Type::All).void } + def visit_all(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1109 + sig { params(type: ::RBI::Type::Any).void } + def visit_any(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1041 + sig { params(type: ::RBI::Type::Anything).void } + def visit_anything(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1066 + sig { params(type: ::RBI::Type::AttachedClass).void } + def visit_attached_class(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1025 + sig { params(type: ::RBI::Type::Boolean).void } + def visit_boolean(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1176 + sig { params(type: ::RBI::Type::Class).void } + def visit_class(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1084 + sig { params(type: ::RBI::Type::ClassOf).void } + def visit_class_of(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1030 + sig { params(type: ::RBI::Type::Generic).void } + def visit_generic(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1183 + sig { params(type: ::RBI::Type::Module).void } + def visit_module(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1071 + sig { params(type: ::RBI::Type::Nilable).void } + def visit_nilable(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1051 + sig { params(type: ::RBI::Type::NoReturn).void } + def visit_no_return(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1149 + sig { params(type: ::RBI::Type::Proc).void } + def visit_proc(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1061 + sig { params(type: ::RBI::Type::SelfType).void } + def visit_self_type(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1129 + sig { params(type: ::RBI::Type::Shape).void } + def visit_shape(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1020 + sig { params(type: ::RBI::Type::Simple).void } + def visit_simple(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1119 + sig { params(type: ::RBI::Type::Tuple).void } + def visit_tuple(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1171 + sig { params(type: ::RBI::Type::TypeParameter).void } + def visit_type_parameter(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1056 + sig { params(type: ::RBI::Type::Untyped).void } + def visit_untyped(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1046 + sig { params(type: ::RBI::Type::Void).void } + def visit_void(type); end + + private + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1192 + sig { params(type_name: ::String).returns(::String) } + def translate_t_type(type_name); end +end + +# pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:5 +class RBI::UnexpectedMultipleSigsError < ::RBI::Error + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:10 + sig { params(node: ::RBI::Node).void } + def initialize(node); end + + # pkg:gem/rbi#lib/rbi/rewriters/attr_to_methods.rb:7 + sig { returns(::RBI::Node) } + def node; end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:18 +class RBI::UnexpectedParserError < ::RBI::Error + # pkg:gem/rbi#lib/rbi/parser.rb:23 + sig { params(parent_exception: ::Exception, last_location: ::RBI::Loc).void } + def initialize(parent_exception, last_location); end + + # pkg:gem/rbi#lib/rbi/parser.rb:20 + sig { returns(::RBI::Loc) } + def last_location; end + + # pkg:gem/rbi#lib/rbi/parser.rb:30 + sig { params(io: T.any(::IO, ::StringIO)).void } + def print_debug(io: T.unsafe(nil)); end +end + +# pkg:gem/rbi#lib/rbi/version.rb:5 +RBI::VERSION = T.let(T.unsafe(nil), String) + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:918 +class RBI::Visibility < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:923 + sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T.nilable(T::Array[::RBI::Comment])).void } + def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # pkg:gem/rbi#lib/rbi/model.rb:929 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:946 + sig { returns(T::Boolean) } + def private?; end + + # pkg:gem/rbi#lib/rbi/model.rb:941 + sig { returns(T::Boolean) } + def protected?; end + + # pkg:gem/rbi#lib/rbi/model.rb:936 + sig { returns(T::Boolean) } + def public?; end + + # pkg:gem/rbi#lib/rbi/model.rb:920 + sig { returns(::Symbol) } + def visibility; end +end + +# pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:58 +class RBI::VisibilityGroup < ::RBI::Tree + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:63 + sig { params(visibility: ::RBI::Visibility).void } + def initialize(visibility); end + + # pkg:gem/rbi#lib/rbi/rewriters/nest_non_public_members.rb:60 + sig { returns(::RBI::Visibility) } + def visibility; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/visitor.rb:8 +class RBI::Visitor + abstract! + + # pkg:gem/rbi#lib/rbi/visitor.rb:10 + sig { params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:110 + sig { params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:115 + sig { params(file: ::RBI::File).void } + def visit_file(file); end + + private + + # pkg:gem/rbi#lib/rbi/visitor.rb:203 + sig { params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:149 + sig { params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:152 + sig { params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:155 + sig { params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:128 + sig { params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:182 + sig { params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:134 + sig { params(node: ::RBI::Class).void } + def visit_class(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:122 + sig { params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:251 + sig { params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:146 + sig { params(node: ::RBI::Const).void } + def visit_const(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:188 + sig { params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:245 + sig { params(node: ::RBI::Group).void } + def visit_group(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:233 + sig { params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:185 + sig { params(node: ::RBI::Include).void } + def visit_include(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:206 + sig { params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:173 + sig { params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:170 + sig { params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:176 + sig { params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:158 + sig { params(node: ::RBI::Method).void } + def visit_method(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:239 + sig { params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:131 + sig { params(node: ::RBI::Module).void } + def visit_module(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:179 + sig { params(node: ::RBI::NoKwParam).void } + def visit_no_kw_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:164 + sig { params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:197 + sig { params(node: ::RBI::Private).void } + def visit_private(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:194 + sig { params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:191 + sig { params(node: ::RBI::Public).void } + def visit_public(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:125 + sig { params(node: ::RBI::RBSComment).void } + def visit_rbs_comment(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:161 + sig { params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:242 + sig { params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:167 + sig { params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:254 + sig { params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:200 + sig { params(node: ::RBI::Send).void } + def visit_send(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:209 + sig { params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:212 + sig { params(node: ::RBI::SigParam).void } + def visit_sig_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:137 + sig { params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:140 + sig { params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:224 + sig { params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:227 + sig { params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:230 + sig { params(node: ::RBI::TEnumValue).void } + def visit_tenum_value(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:143 + sig { params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:215 + sig { params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:218 + sig { params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:221 + sig { params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:236 + sig { params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:248 + sig { params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end +end + +# pkg:gem/rbi#lib/rbi/visitor.rb:5 +class RBI::VisitorError < ::RBI::Error; end diff --git a/sorbet/rbi/gems/rbs@4.2.0.rbi b/sorbet/rbi/gems/rbs@4.2.0.rbi new file mode 100644 index 0000000..d3b73ff --- /dev/null +++ b/sorbet/rbi/gems/rbs@4.2.0.rbi @@ -0,0 +1,7133 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rbs` gem. +# Please instead update this file by running `bin/tapioca gem rbs`. + + +# This file is generated by the templates/template.rb script and should not be +# modified manually. To change the template see +# templates/lib/rbs/wasm/serialization_schema.rb.erb +# +# pkg:gem/rbs#lib/rbs/version.rb:3 +module RBS + class << self + # pkg:gem/rbs#lib/rbs.rb:92 + def logger; end + + # pkg:gem/rbs#lib/rbs.rb:89 + def logger_level; end + + # pkg:gem/rbs#lib/rbs.rb:101 + def logger_level=(level); end + + # pkg:gem/rbs#lib/rbs.rb:90 + def logger_output; end + + # pkg:gem/rbs#lib/rbs.rb:96 + def logger_output=(val); end + + # pkg:gem/rbs#lib/rbs.rb:106 + def print_warning; end + end +end + +# pkg:gem/rbs#lib/rbs/ast/type_param.rb:4 +module RBS::AST; end + +# pkg:gem/rbs#lib/rbs/ast/annotation.rb:5 +class RBS::AST::Annotation + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:9 + def initialize(string:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:14 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:18 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:20 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:7 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:6 + def string; end + + # pkg:gem/rbs#lib/rbs/ast/annotation.rb:24 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/comment.rb:5 +class RBS::AST::Comment + # pkg:gem/rbs#lib/rbs/ast/comment.rb:9 + def initialize(string:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/comment.rb:14 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/comment.rb:18 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/comment.rb:20 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/comment.rb:7 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/comment.rb:6 + def string; end + + # pkg:gem/rbs#lib/rbs/ast/comment.rb:24 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:5 +module RBS::AST::Declarations; end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:423 +class RBS::AST::Declarations::AliasDecl < ::RBS::AST::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:426 + def initialize(new_name:, old_name:, location:, comment:, annotations: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:434 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:424 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:424 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:440 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:442 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:424 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:424 + def new_name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:424 + def old_name; end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:6 +class RBS::AST::Declarations::Base; end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:55 +class RBS::AST::Declarations::Class < ::RBS::AST::Declarations::Base + include ::RBS::AST::Declarations::NestedDeclarationHelper + include ::RBS::AST::Declarations::MixinHelper + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:97 + def initialize(name:, type_params:, super_class:, members:, annotations:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:119 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:93 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:95 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:127 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:129 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:94 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:91 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:89 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:92 + def super_class; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:133 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:90 + def type_params; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:107 + def update(name: T.unsafe(nil), type_params: T.unsafe(nil), super_class: T.unsafe(nil), members: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:56 +class RBS::AST::Declarations::Class::Super + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:61 + def initialize(name:, args:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:67 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:58 + def args; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:71 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:73 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:59 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:57 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:77 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:447 +class RBS::AST::Declarations::ClassAlias < ::RBS::AST::Declarations::AliasDecl + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:448 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:347 +class RBS::AST::Declarations::Constant < ::RBS::AST::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:354 + def initialize(name:, type:, location:, comment:, annotations: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:362 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:352 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:351 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:368 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:370 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:350 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:348 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:374 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:349 + def type; end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:385 +class RBS::AST::Declarations::Global < ::RBS::AST::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:392 + def initialize(name:, type:, location:, comment:, annotations: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:400 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:390 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:389 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:406 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:408 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:388 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:386 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:412 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:387 + def type; end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:248 +class RBS::AST::Declarations::Interface < ::RBS::AST::Declarations::Base + include ::RBS::AST::Declarations::MixinHelper + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:258 + def initialize(name:, type_params:, members:, annotations:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:278 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:252 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:254 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:285 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:287 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:253 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:251 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:249 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:291 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:250 + def type_params; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:267 + def update(name: T.unsafe(nil), type_params: T.unsafe(nil), members: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:35 +module RBS::AST::Declarations::MixinHelper + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:36 + def each_mixin(&block); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:147 +class RBS::AST::Declarations::Module < ::RBS::AST::Declarations::Base + include ::RBS::AST::Declarations::NestedDeclarationHelper + include ::RBS::AST::Declarations::MixinHelper + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:197 + def initialize(name:, type_params:, members:, self_types:, annotations:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:220 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:193 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:195 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:228 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:230 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:192 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:191 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:189 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:194 + def self_types; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:234 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:190 + def type_params; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:207 + def update(name: T.unsafe(nil), type_params: T.unsafe(nil), members: T.unsafe(nil), self_types: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:148 +class RBS::AST::Declarations::Module::Self + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:153 + def initialize(name:, args:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:159 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:150 + def args; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:163 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:165 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:151 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:149 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:169 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:177 + def to_s; end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:459 +class RBS::AST::Declarations::ModuleAlias < ::RBS::AST::Declarations::AliasDecl + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:460 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:9 +module RBS::AST::Declarations::NestedDeclarationHelper + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:22 + def each_decl; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:10 + def each_member; end +end + +# pkg:gem/rbs#lib/rbs/ast/declarations.rb:304 +class RBS::AST::Declarations::TypeAlias < ::RBS::AST::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:312 + def initialize(name:, type_params:, type:, annotations:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:321 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:308 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:310 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:328 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:330 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:309 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:305 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:334 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:307 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/declarations.rb:306 + def type_params; end +end + +# pkg:gem/rbs#lib/rbs/ast/directives.rb:5 +module RBS::AST::Directives; end + +# pkg:gem/rbs#lib/rbs/ast/directives.rb:6 +class RBS::AST::Directives::Base; end + +# pkg:gem/rbs#lib/rbs/ast/directives.rb:37 +class RBS::AST::Directives::ResolveTypeNames < ::RBS::AST::Directives::Base + # pkg:gem/rbs#lib/rbs/ast/directives.rb:42 + def initialize(value:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:38 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:40 + def value; end +end + +# pkg:gem/rbs#lib/rbs/ast/directives.rb:9 +class RBS::AST::Directives::Use < ::RBS::AST::Directives::Base + # pkg:gem/rbs#lib/rbs/ast/directives.rb:31 + def initialize(clauses:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:29 + def clauses; end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:29 + def location; end +end + +# pkg:gem/rbs#lib/rbs/ast/directives.rb:10 +class RBS::AST::Directives::Use::SingleClause + # pkg:gem/rbs#lib/rbs/ast/directives.rb:13 + def initialize(type_name:, new_name:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:11 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:11 + def new_name; end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:11 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/ast/directives.rb:20 +class RBS::AST::Directives::Use::WildcardClause + # pkg:gem/rbs#lib/rbs/ast/directives.rb:23 + def initialize(namespace:, location:); end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:21 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/directives.rb:21 + def namespace; end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:5 +module RBS::AST::Members; end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:399 +class RBS::AST::Members::Alias < ::RBS::AST::Members::Base + # pkg:gem/rbs#lib/rbs/ast/members.rb:407 + def initialize(new_name:, old_name:, kind:, annotations:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:416 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:403 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:405 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:423 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:425 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:441 + def instance?; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:402 + def kind; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:404 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:400 + def new_name; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:401 + def old_name; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:445 + def singleton?; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:429 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:329 +class RBS::AST::Members::AttrAccessor < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Attribute + + # pkg:gem/rbs#lib/rbs/ast/members.rb:332 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:311 +class RBS::AST::Members::AttrReader < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Attribute + + # pkg:gem/rbs#lib/rbs/ast/members.rb:314 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:347 +class RBS::AST::Members::AttrWriter < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Attribute + + # pkg:gem/rbs#lib/rbs/ast/members.rb:350 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:260 +module RBS::AST::Members::Attribute + # pkg:gem/rbs#lib/rbs/ast/members.rb:270 + def initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:281 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:265 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:267 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:290 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:292 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:264 + def ivar_name; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:263 + def kind; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:266 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:261 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:262 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:296 + def update(name: T.unsafe(nil), type: T.unsafe(nil), ivar_name: T.unsafe(nil), kind: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil), visibility: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:268 + def visibility; end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:6 +class RBS::AST::Members::Base; end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:159 +class RBS::AST::Members::ClassInstanceVariable < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Var + + # pkg:gem/rbs#lib/rbs/ast/members.rb:162 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:173 +class RBS::AST::Members::ClassVariable < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Var + + # pkg:gem/rbs#lib/rbs/ast/members.rb:176 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:230 +class RBS::AST::Members::Extend < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Mixin + + # pkg:gem/rbs#lib/rbs/ast/members.rb:233 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:215 +class RBS::AST::Members::Include < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Mixin + + # pkg:gem/rbs#lib/rbs/ast/members.rb:218 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:145 +class RBS::AST::Members::InstanceVariable < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Var + + # pkg:gem/rbs#lib/rbs/ast/members.rb:148 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:365 +module RBS::AST::Members::LocationOnly + # pkg:gem/rbs#lib/rbs/ast/members.rb:368 + def initialize(location:); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:372 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:376 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:378 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:366 + def location; end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:9 +class RBS::AST::Members::MethodDefinition < ::RBS::AST::Members::Base + # pkg:gem/rbs#lib/rbs/ast/members.rb:55 + def initialize(name:, kind:, overloads:, annotations:, location:, comment:, overloading:, visibility:); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:66 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:49 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:51 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:75 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:77 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:81 + def instance?; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:47 + def kind; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:50 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:46 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:52 + def overloading; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:89 + def overloading?; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:48 + def overloads; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:85 + def singleton?; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:106 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:93 + def update(name: T.unsafe(nil), kind: T.unsafe(nil), overloads: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil), overloading: T.unsafe(nil), visibility: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:53 + def visibility; end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:10 +class RBS::AST::Members::MethodDefinition::Overload + # pkg:gem/rbs#lib/rbs/ast/members.rb:13 + def initialize(method_type:, annotations:); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:18 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:11 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:26 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:22 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:11 + def method_type; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:32 + def sub(subst); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:38 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:28 + def update(annotations: T.unsafe(nil), method_type: T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:187 +module RBS::AST::Members::Mixin + # pkg:gem/rbs#lib/rbs/ast/members.rb:194 + def initialize(name:, args:, annotations:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:202 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:190 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:189 + def args; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:192 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:206 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:210 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:191 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:188 + def name; end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:245 +class RBS::AST::Members::Prepend < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Mixin + + # pkg:gem/rbs#lib/rbs/ast/members.rb:248 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:391 +class RBS::AST::Members::Private < ::RBS::AST::Members::Base + include ::RBS::AST::Members::LocationOnly + + # pkg:gem/rbs#lib/rbs/ast/members.rb:394 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:383 +class RBS::AST::Members::Public < ::RBS::AST::Members::Base + include ::RBS::AST::Members::LocationOnly + + # pkg:gem/rbs#lib/rbs/ast/members.rb:386 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/ast/members.rb:121 +module RBS::AST::Members::Var + # pkg:gem/rbs#lib/rbs/ast/members.rb:127 + def initialize(name:, type:, location:, comment:); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:134 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:125 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:138 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:140 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:124 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:122 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/members.rb:123 + def type; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:5 +module RBS::AST::Ruby; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:6 +module RBS::AST::Ruby::Annotations; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:43 +class RBS::AST::Ruby::Annotations::AliasAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:46 + def initialize(location:, prefix_location:, keyword_location:, type_name:, type_name_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:44 + def keyword_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:53 + def map_type_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:44 + def type_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:44 + def type_name_location; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:7 +class RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:10 + def initialize(location, prefix_location); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:15 + def buffer; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:8 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:8 + def prefix_location; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:398 +class RBS::AST::Ruby::Annotations::BlockParamTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:401 + def initialize(location:, prefix_location:, ampersand_location:, name_location:, colon_location:, question_location:, type_location:, type:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def ampersand_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:412 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:426 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:430 + def optional?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def question_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:434 + def required?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:438 + def type_fingerprint; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:399 + def type_location; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:64 +class RBS::AST::Ruby::Annotations::ClassAliasAnnotation < ::RBS::AST::Ruby::Annotations::AliasAnnotation + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:65 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:82 +class RBS::AST::Ruby::Annotations::ColonMethodTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:85 + def initialize(location:, prefix_location:, annotations:, method_type:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:83 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:91 + def map_type_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:83 + def method_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:100 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:322 +class RBS::AST::Ruby::Annotations::DoubleSplatParamTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:325 + def initialize(location:, prefix_location:, star2_location:, name_location:, colon_location:, param_type:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:323 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:323 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:334 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:323 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:323 + def param_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:323 + def star2_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:346 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:222 +class RBS::AST::Ruby::Annotations::InstanceVariableAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:225 + def initialize(location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:223 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:223 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:223 + def ivar_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:223 + def ivar_name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:234 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:223 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:246 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:109 +class RBS::AST::Ruby::Annotations::MethodTypesAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:114 + def initialize(location:, prefix_location:, overloads:, vertical_bar_locations:, dot3_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:112 + def dot3_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:121 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:112 + def overloads; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:132 + def type_fingerprint; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:112 + def vertical_bar_locations; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:110 +RBS::AST::Ruby::Annotations::MethodTypesAnnotation::Overload = RBS::AST::Members::MethodDefinition::Overload + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:73 +class RBS::AST::Ruby::Annotations::ModuleAliasAnnotation < ::RBS::AST::Ruby::Annotations::AliasAnnotation + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:74 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:356 +class RBS::AST::Ruby::Annotations::ModuleSelfAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:359 + def initialize(location:, prefix_location:, keyword_location:, colon_location:, name:, args:, open_bracket_location:, close_bracket_location:, args_comma_locations:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def args_comma_locations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def close_bracket_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def keyword_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:371 + def map_type_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def open_bracket_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:388 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:20 +class RBS::AST::Ruby::Annotations::NodeTypeAssertion < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:23 + def initialize(location:, prefix_location:, type:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:28 + def map_type_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:21 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:35 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:256 +class RBS::AST::Ruby::Annotations::ParamTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:259 + def initialize(location:, prefix_location:, name_location:, colon_location:, param_type:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:257 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:257 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:267 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:257 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:257 + def param_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:278 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:155 +class RBS::AST::Ruby::Annotations::ReturnTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:164 + def initialize(location:, prefix_location:, return_location:, colon_location:, return_type:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:158 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:162 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:172 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:156 + def return_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:160 + def return_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:183 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:141 +class RBS::AST::Ruby::Annotations::SkipAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:144 + def initialize(location:, prefix_location:, skip_location:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:142 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:142 + def skip_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:150 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:288 +class RBS::AST::Ruby::Annotations::SplatParamTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:291 + def initialize(location:, prefix_location:, star_location:, name_location:, colon_location:, param_type:, comment_location:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:289 + def colon_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:289 + def comment_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:300 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:289 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:289 + def param_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:289 + def star_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:312 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:192 +class RBS::AST::Ruby::Annotations::TypeApplicationAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:195 + def initialize(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:193 + def close_bracket_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:193 + def comma_locations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:202 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:193 + def type_args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:214 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:6 +class RBS::AST::Ruby::CommentBlock + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:9 + def initialize(source_buffer, comments); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:228 + def as_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:7 + def comment_buffer; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:213 + def comments; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:100 + def each_paragraph(variables, &block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:52 + def end_line; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:38 + def leading?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:217 + def leading_annotation?(index); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:176 + def line_location(start_line, end_line); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:56 + def line_starts; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:182 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:7 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:7 + def offsets; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:189 + def parse_annotation_lines(start_line, end_line, variables); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:48 + def start_line; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:171 + def text(comment_index); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:43 + def trailing?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:199 + def trailing_annotation(variables); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:132 + def yield_annotation(start_line, end_line, current_line, variables, &block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:112 + def yield_paragraph(start_line, current_line, variables, &block); end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:62 + def build(buffer, comments); end + end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 +class RBS::AST::Ruby::CommentBlock::AnnotationSyntaxError < ::Struct + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def error; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def error=(_); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def location=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def inspect; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:6 +module RBS::AST::Ruby::Declarations; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:7 +class RBS::AST::Ruby::Declarations::Base + include ::RBS::AST::Ruby::Helpers::ConstantHelper + include ::RBS::AST::Ruby::Helpers::LocationHelper + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:13 + def initialize(buffer); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:8 + def buffer; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:18 +class RBS::AST::Ruby::Declarations::ClassDecl < ::RBS::AST::Ruby::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:74 + def initialize(buffer, name, node, super_class); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:66 + def class_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:82 + def each_decl(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:94 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:68 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:98 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:70 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:72 + def super_class; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:102 + def type_fingerprint; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:92 + def type_params; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:19 +class RBS::AST::Ruby::Declarations::ClassDecl::SuperClass + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:28 + def initialize(type_name_location, operator_location, type_name, type_annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:56 + def args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:43 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:55 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:22 + def operator_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:26 + def type_annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:35 + def type_args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:58 + def type_fingerprint; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:24 + def type_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:20 + def type_name_location; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:233 +class RBS::AST::Ruby::Declarations::ClassModuleAliasDecl < ::RBS::AST::Ruby::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:240 + def initialize(buffer, node, new_name, infered_old_name, leading_comment, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:238 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:274 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:237 + def infered_old_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:235 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:249 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:253 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:236 + def new_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:234 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:262 + def old_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:278 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:171 +class RBS::AST::Ruby::Declarations::ConstantDecl < ::RBS::AST::Ruby::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:177 + def initialize(buffer, constant_name, node, leading_comment, type_annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:219 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:173 + def constant_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:172 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:185 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:189 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:174 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:198 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:175 + def type_annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:223 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:114 +class RBS::AST::Ruby::Declarations::ModuleDecl < ::RBS::AST::Ruby::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:121 + def initialize(buffer, name, node); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:128 + def each_decl(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:152 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:117 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:115 + def module_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:156 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:119 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:140 + def self_types; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:160 + def type_fingerprint; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:138 + def type_params; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/helpers/constant_helper.rb:6 +module RBS::AST::Ruby::Helpers; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/helpers/constant_helper.rb:7 +module RBS::AST::Ruby::Helpers::ConstantHelper + private + + # pkg:gem/rbs#lib/rbs/ast/ruby/helpers/constant_helper.rb:10 + def constant_as_type_name(node); end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/helpers/constant_helper.rb:10 + def constant_as_type_name(node); end + end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/helpers/location_helper.rb:7 +module RBS::AST::Ruby::Helpers::LocationHelper + # pkg:gem/rbs#lib/rbs/ast/ruby/helpers/location_helper.rb:8 + def rbs_location(location); end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:6 +module RBS::AST::Ruby::Members; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:701 +class RBS::AST::Ruby::Members::AttrAccessorMember < ::RBS::AST::Ruby::Members::AttributeMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:695 +class RBS::AST::Ruby::Members::AttrReaderMember < ::RBS::AST::Ruby::Members::AttributeMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:698 +class RBS::AST::Ruby::Members::AttrWriterMember < ::RBS::AST::Ruby::Members::AttributeMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:650 +class RBS::AST::Ruby::Members::AttributeMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:656 + def initialize(buffer, node, name_nodes, leading_comment, type_annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:654 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:670 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:674 + def name_locations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:652 + def name_nodes; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:664 + def names; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:651 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:680 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:653 + def type_annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:684 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:7 +class RBS::AST::Ruby::Members::Base + include ::RBS::AST::Ruby::Helpers::LocationHelper + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:10 + def initialize(buffer); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:8 + def buffer; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:547 +class RBS::AST::Ruby::Members::DefMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:556 + def initialize(buffer, name, node, method_type, leading_comment, kind: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:585 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:569 + def instance?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:552 + def kind; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:554 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:573 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:553 + def method_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:550 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:589 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:551 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:581 + def overloading?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:577 + def overloads; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:565 + def singleton?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:593 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:548 +RBS::AST::Ruby::Members::DefMember::Overload = RBS::AST::Members::MethodDefinition::Overload + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:644 +class RBS::AST::Ruby::Members::ExtendMember < ::RBS::AST::Ruby::Members::MixinMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:641 +class RBS::AST::Ruby::Members::IncludeMember < ::RBS::AST::Ruby::Members::MixinMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:704 +class RBS::AST::Ruby::Members::InstanceVariableMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:707 + def initialize(buffer, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:705 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:720 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:712 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:716 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:724 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:17 +class RBS::AST::Ruby::Members::MethodTypeAnnotation + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:403 + def initialize(type_annotations:); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:484 + def empty?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:407 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:524 + def overloading?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:488 + def overloads; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:401 + def type_annotations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:535 + def type_fingerprint; end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:420 + def build(leading_block, trailing_block, variables, node); end + end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:18 +class RBS::AST::Ruby::Members::MethodTypeAnnotation::DocStyle + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:29 + def initialize; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:181 + def all_param_annotations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:27 + def block; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:27 + def block=(_arg0); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:196 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:287 + def method_type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:25 + def optional_keywords; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:21 + def optional_positionals; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:24 + def required_keywords; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:20 + def required_positionals; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:26 + def rest_keywords; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:26 + def rest_keywords=(_arg0); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:22 + def rest_positionals; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:22 + def rest_positionals=(_arg0); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:19 + def return_type_annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:19 + def return_type_annotation=(_arg0); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:23 + def trailing_positionals; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:273 + def type_fingerprint; end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:41 + def build(param_type_annotations, return_type_annotation, node); end + end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:604 +class RBS::AST::Ruby::Members::MixinMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:609 + def initialize(buffer, node, module_name, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:607 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:616 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:606 + def module_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:620 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:605 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:627 + def type_args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:631 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:732 +class RBS::AST::Ruby::Members::ModuleSelfMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:735 + def initialize(buffer, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:733 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:744 + def args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:748 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:740 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:752 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:647 +class RBS::AST::Ruby::Members::PrependMember < ::RBS::AST::Ruby::Members::MixinMember; end + +# pkg:gem/rbs#lib/rbs/ast/type_param.rb:5 +class RBS::AST::TypeParam + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:8 + def initialize(name:, variance:, upper_bound:, lower_bound:, location:, default_type: T.unsafe(nil), unchecked: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:41 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:6 + def default_type; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:51 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:53 + def hash; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:6 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:25 + def lower_bound; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:6 + def lower_bound_type; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:69 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:6 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:57 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:133 + def to_s; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:32 + def unchecked!(value = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:37 + def unchecked?; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:18 + def upper_bound; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:6 + def upper_bound_type; end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:6 + def variance; end + + class << self + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:166 + def application(params, args); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:198 + def normalize_args(params, args); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:114 + def rename(params, new_names:); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:92 + def resolve_variables(params); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:102 + def subst_var(vars, type); end + + # pkg:gem/rbs#lib/rbs/ast/type_param.rb:219 + def validate(type_params); end + end +end + +# The Visitor class implements the Visitor pattern for traversing the RBS Abstract Syntax Tree (AST). +# +# It provides methods to visit each type of node in the AST, allowing for custom processing of each node type. +# +# This class is designed to be subclassed, with specific visit methods overridden to implement custom behavior for +# different node types. +# +# Example usage: +# +# ~~~rb +# class MyVisitor < RBS::AST::Visitor +# def visit_declaration_class(node) +# puts "Visiting class: #{node.name}" +# +# super # call `super` to run the default visiting behavior +# end +# end +# +# visitor = MyVisitor.new +# visitor.visit(ast_node) +# ~~~ +# +# pkg:gem/rbs#lib/rbs/ast/visitor.rb:26 +class RBS::AST::Visitor + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:27 + def visit(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:70 + def visit_all(nodes); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:79 + def visit_declaration_class(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:87 + def visit_declaration_constant(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:76 + def visit_declaration_global(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:93 + def visit_declaration_interface(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:83 + def visit_declaration_module(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:90 + def visit_declaration_type_alias(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:97 + def visit_member_alias(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:124 + def visit_member_attr_accessor(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:118 + def visit_member_attr_reader(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:121 + def visit_member_attr_writer(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:100 + def visit_member_class_instance_variable(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:103 + def visit_member_class_variable(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:133 + def visit_member_extend(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:127 + def visit_member_include(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:106 + def visit_member_instance_variable(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:115 + def visit_member_method_definition(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:130 + def visit_member_prepend(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:109 + def visit_member_private(node); end + + # pkg:gem/rbs#lib/rbs/ast/visitor.rb:112 + def visit_member_public(node); end +end + +# pkg:gem/rbs#lib/rbs/ancestor_graph.rb:4 +class RBS::AncestorGraph + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:13 + def initialize(env:, ancestor_builder: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:9 + def ancestor_builder; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:19 + def build; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:32 + def build_ancestors(node, ancestors); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:11 + def children; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:64 + def each_ancestor(node, yielded: T.unsafe(nil), &block); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:56 + def each_child(node, &block); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:78 + def each_descendant(node, yielded: T.unsafe(nil), &block); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:48 + def each_parent(node, &block); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:8 + def env; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:10 + def parents; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:43 + def register(parent:, child:); end +end + +# pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 +class RBS::AncestorGraph::InstanceNode < ::Struct + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def type_name; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def type_name=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def inspect; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def members; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:5 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 +class RBS::AncestorGraph::SingletonNode < ::Struct + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def type_name; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def type_name=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def inspect; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def members; end + + # pkg:gem/rbs#lib/rbs/ancestor_graph.rb:6 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:19 +class RBS::BaseError < ::StandardError; end + +# pkg:gem/rbs#lib/rbs/buffer.rb:4 +class RBS::Buffer + # pkg:gem/rbs#lib/rbs/buffer.rb:9 + def initialize(content:, name: T.unsafe(nil), parent: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:168 + def absolute_position(position); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:90 + def character_offset(byte_offset); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:6 + def content; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:185 + def detach; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:86 + def inspect; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:78 + def last_position; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:26 + def line_count; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:22 + def lines; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:68 + def loc_to_pos(loc); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:5 + def name; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:7 + def parent; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:153 + def parent_buffer; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:159 + def parent_position(position); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:56 + def pos_to_loc(pos); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:30 + def ranges; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:114 + def rbs_location(location, loc2 = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:123 + def sub_buffer(lines:, byte_lines_hint: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:177 + def top_buffer; end +end + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:4 +module RBS::BuiltinNames; end + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:45 +RBS::BuiltinNames::Array = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:37 +RBS::BuiltinNames::BasicObject = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:43 +RBS::BuiltinNames::Class = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:41 +RBS::BuiltinNames::Comparable = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:42 +RBS::BuiltinNames::Enumerable = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:48 +RBS::BuiltinNames::Enumerator = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:55 +RBS::BuiltinNames::FalseClass = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:52 +RBS::BuiltinNames::Float = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:46 +RBS::BuiltinNames::Hash = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:51 +RBS::BuiltinNames::Integer = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:39 +RBS::BuiltinNames::Kernel = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:44 +RBS::BuiltinNames::Module = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:5 +class RBS::BuiltinNames::Name + # pkg:gem/rbs#lib/rbs/builtin_names.rb:8 + def initialize(name:); end + + # pkg:gem/rbs#lib/rbs/builtin_names.rb:16 + def instance_type(*args); end + + # pkg:gem/rbs#lib/rbs/builtin_names.rb:20 + def instance_type?(type); end + + # pkg:gem/rbs#lib/rbs/builtin_names.rb:6 + def name; end + + # pkg:gem/rbs#lib/rbs/builtin_names.rb:24 + def singleton_type; end + + # pkg:gem/rbs#lib/rbs/builtin_names.rb:28 + def singleton_type?(type); end + + # pkg:gem/rbs#lib/rbs/builtin_names.rb:12 + def to_s; end + + class << self + # pkg:gem/rbs#lib/rbs/builtin_names.rb:32 + def define(name, namespace: T.unsafe(nil)); end + end +end + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:56 +RBS::BuiltinNames::Numeric = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:38 +RBS::BuiltinNames::Object = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:47 +RBS::BuiltinNames::Range = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:53 +RBS::BuiltinNames::Regexp = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:49 +RBS::BuiltinNames::Set = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:40 +RBS::BuiltinNames::String = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:50 +RBS::BuiltinNames::Symbol = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/builtin_names.rb:54 +RBS::BuiltinNames::TrueClass = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# pkg:gem/rbs#lib/rbs/cli/colored_io.rb:4 +class RBS::CLI; end + +# pkg:gem/rbs#lib/rbs/cli/colored_io.rb:5 +class RBS::CLI::ColoredIO + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:8 + def initialize(stdout:); end + + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:28 + def puts(*, **, &); end + + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:20 + def puts_green(string); end + + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:12 + def puts_red(string); end + + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:6 + def stdout; end + + private + + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:43 + def are_colors_disabled?; end + + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:39 + def are_colors_supported?; end + + # https://github.com/rubygems/rubygems/blob/ed65279100234a17d65d71fe26de5083984ac5b8/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb#L99-L109 + # + # pkg:gem/rbs#lib/rbs/cli/colored_io.rb:35 + def can_display_colors?; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:345 +class RBS::ClassInstanceVariableDuplicationError < ::RBS::VariableDuplicationError + # pkg:gem/rbs#lib/rbs/errors.rb:346 + def kind; end +end + +# pkg:gem/rbs#lib/rbs/collection/sources/base.rb:4 +module RBS::Collection; end + +# pkg:gem/rbs#lib/rbs/collection/cleaner.rb:5 +class RBS::Collection::Cleaner + # pkg:gem/rbs#lib/rbs/collection/cleaner.rb:8 + def initialize(lockfile_path:); end + + # pkg:gem/rbs#lib/rbs/collection/cleaner.rb:12 + def clean; end + + # pkg:gem/rbs#lib/rbs/collection/cleaner.rb:6 + def lock; end + + # pkg:gem/rbs#lib/rbs/collection/cleaner.rb:30 + def needed?(gem_name, version); end +end + +# This class represent the configuration file. +# +# pkg:gem/rbs#lib/rbs/collection/config.rb:7 +class RBS::Collection::Config + # pkg:gem/rbs#lib/rbs/collection/config.rb:49 + def initialize(data, config_path:); end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:19 + def config_path; end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:19 + def data; end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:54 + def gem(gem_name); end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:74 + def gems; end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:58 + def repo_path; end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:62 + def repo_path_data; end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:66 + def sources; end + + class << self + # pkg:gem/rbs#lib/rbs/collection/config.rb:21 + def find_config_path; end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:41 + def from_path(path); end + + # Generate a rbs lockfile from Gemfile.lock to `config_path`. + # If `with_lockfile` is true, it respects existing rbs lockfile. + # + # pkg:gem/rbs#lib/rbs/collection/config.rb:34 + def generate_lockfile(config_path:, definition:, with_lockfile: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/collection/config.rb:45 + def to_lockfile_path(config_path); end + end +end + +# pkg:gem/rbs#lib/rbs/collection/config.rb:8 +class RBS::Collection::Config::CollectionNotAvailable < ::StandardError + # pkg:gem/rbs#lib/rbs/collection/config.rb:9 + def initialize; end +end + +# pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:6 +class RBS::Collection::Config::Lockfile + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:9 + def initialize(lockfile_path:, path:, gemfile_lock_path:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:73 + def check_rbs_availability!; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:18 + def fullpath; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:22 + def gemfile_lock_fullpath; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:7 + def gemfile_lock_path; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:7 + def gems; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:65 + def library_data(lib); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:7 + def lockfile_dir; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:7 + def lockfile_path; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:7 + def path; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:7 + def sources; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:28 + def to_lockfile; end + + class << self + # pkg:gem/rbs#lib/rbs/collection/config/lockfile.rb:42 + def from_lockfile(lockfile_path:, data:); end + end +end + +# pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:6 +class RBS::Collection::Config::LockfileGenerator + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:59 + def initialize(config:, definition:, with_lockfile:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:51 + def config; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:51 + def definition; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:51 + def existing_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:51 + def gem_entries; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:51 + def gem_hash; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:87 + def generate; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:51 + def lockfile; end + + private + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:120 + def assign_gem(name:, version:, skip: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:188 + def assign_stdlib(name:, from_gem: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:259 + def find_best_version(version:, versions:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:253 + def find_source(name:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:112 + def validate_gemfile_lock_path!(lock:, gemfile_lock_path:); end + + class << self + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:53 + def generate(config:, definition:, with_lockfile: T.unsafe(nil)); end + end +end + +# pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:7 +RBS::Collection::Config::LockfileGenerator::ALUMNI_STDLIBS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:35 +class RBS::Collection::Config::LockfileGenerator::GemfileLockMismatchError < ::StandardError + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:36 + def initialize(expected:, actual:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:41 + def message; end +end + +# pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:24 +RBS::Collection::Config::LockfileGenerator::NONGEM_STDLIBS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rbs#lib/rbs/collection/config.rb:17 +RBS::Collection::Config::PATH = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/rbs#lib/rbs/collection/installer.rb:5 +class RBS::Collection::Installer + # pkg:gem/rbs#lib/rbs/collection/installer.rb:9 + def initialize(lockfile_path:, stdout: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/collection/installer.rb:14 + def install_from_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/installer.rb:6 + def lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/installer.rb:7 + def stdout; end +end + +# pkg:gem/rbs#lib/rbs/collection/sources/base.rb:5 +module RBS::Collection::Sources + class << self + # pkg:gem/rbs#lib/rbs/collection/sources.rb:12 + def from_config_entry(source_entry, base_directory:); end + end +end + +# pkg:gem/rbs#lib/rbs/collection/sources/base.rb:6 +module RBS::Collection::Sources::Base + # pkg:gem/rbs#lib/rbs/collection/sources/base.rb:7 + def dependencies_of(name, version); end +end + +# pkg:gem/rbs#lib/rbs/collection/sources/git.rb:11 +class RBS::Collection::Sources::Git + include ::RBS::Collection::Sources::Base + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:19 + def initialize(name:, revision:, remote:, repo_dir:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:27 + def has?(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:44 + def install(dest:, name:, version:, stdout:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:230 + def load_metadata(dir:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:74 + def manifest_of(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:214 + def metadata_content(name:, version:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:17 + def name; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:17 + def remote; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:17 + def repo_dir; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:179 + def resolved_revision; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:17 + def revision; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:114 + def to_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:37 + def versions(name); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:222 + def write_metadata(dir:, name:, version:); end + + private + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:88 + def _install(dest:, name:, version:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:190 + def commit_hash?; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:100 + def cp_r(src, dest); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:124 + def format_config_entry(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:175 + def gem_repo_dir; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:236 + def gems_versions; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:194 + def git(*cmd, **opt); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:198 + def git?(*cmd, **opt); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:165 + def git_dir; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:159 + def need_to_fetch?(revision); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:131 + def setup!; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:204 + def sh!(*cmd, **opt); end +end + +# pkg:gem/rbs#lib/rbs/collection/sources/git.rb:15 +class RBS::Collection::Sources::Git::CommandError < ::StandardError; end + +# pkg:gem/rbs#lib/rbs/collection/sources/git.rb:13 +RBS::Collection::Sources::Git::METADATA_FILENAME = T.let(T.unsafe(nil), String) + +# pkg:gem/rbs#lib/rbs/collection/sources/local.rb:6 +class RBS::Collection::Sources::Local + include ::RBS::Collection::Sources::Base + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:11 + def initialize(path:, base_directory:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:9 + def full_path; end + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:17 + def has?(name, version); end + + # Create a symlink instead of copying file to refer files in @path. + # By avoiding copying RBS files, the users do not need re-run `rbs collection install` + # when the RBS files are updated. + # + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:32 + def install(dest:, name:, version:, stdout:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:64 + def manifest_of(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:9 + def path; end + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:72 + def to_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:25 + def versions(name); end + + private + + # pkg:gem/rbs#lib/rbs/collection/sources/local.rb:59 + def _install(src, dst); end +end + +# Signatures that are included in gem package as sig/ directory. +# +# pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:9 +class RBS::Collection::Sources::Rubygems + include ::RBS::Collection::Sources::Base + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:13 + def has?(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:23 + def install(dest:, name:, version:, stdout:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:29 + def manifest_of(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:36 + def to_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:17 + def versions(name); end + + private + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:42 + def gem_sig_path(name, version); end + + class << self + private + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:11 + def allocate; end + + # pkg:gem/rbs#lib/rbs/collection/sources/rubygems.rb:11 + def new(*_arg0); end + end +end + +# signatures that are bundled in rbs gem under the stdlib/ directory +# +# pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:9 +class RBS::Collection::Sources::Stdlib + include ::RBS::Collection::Sources::Base + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:15 + def has?(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:23 + def install(dest:, name:, version:, stdout:); end + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:29 + def manifest_of(name, version); end + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:38 + def to_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:19 + def versions(name); end + + private + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:44 + def lookup(name, version); end + + class << self + private + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:11 + def allocate; end + + # pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:11 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/collection/sources/stdlib.rb:13 +RBS::Collection::Sources::Stdlib::REPO = T.let(T.unsafe(nil), RBS::Repository) + +# pkg:gem/rbs#lib/rbs/constant.rb:4 +class RBS::Constant + # pkg:gem/rbs#lib/rbs/constant.rb:9 + def initialize(name:, type:, entry:); end + + # pkg:gem/rbs#lib/rbs/constant.rb:15 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/constant.rb:7 + def entry; end + + # pkg:gem/rbs#lib/rbs/constant.rb:22 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/constant.rb:24 + def hash; end + + # pkg:gem/rbs#lib/rbs/constant.rb:5 + def name; end + + # pkg:gem/rbs#lib/rbs/constant.rb:6 + def type; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:598 +class RBS::CyclicClassAliasDefinitionError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:603 + def initialize(entry); end + + # pkg:gem/rbs#lib/rbs/errors.rb:601 + def alias_entry; end + + # pkg:gem/rbs#lib/rbs/errors.rb:609 + def location; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:559 +class RBS::CyclicTypeParameterBound < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:564 + def initialize(type_name:, method_name:, params:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:562 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:562 + def method_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:562 + def params; end + + # pkg:gem/rbs#lib/rbs/errors.rb:562 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:4 +class RBS::Definition + # pkg:gem/rbs#lib/rbs/definition.rb:302 + def initialize(type_name:, entry:, self_type:, ancestors:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:296 + def ancestors; end + + # pkg:gem/rbs#lib/rbs/definition.rb:325 + def class?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:342 + def class_type?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:300 + def class_variables; end + + # pkg:gem/rbs#lib/rbs/definition.rb:389 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/definition.rb:295 + def entry; end + + # pkg:gem/rbs#lib/rbs/definition.rb:346 + def instance_type?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:299 + def instance_variables; end + + # pkg:gem/rbs#lib/rbs/definition.rb:333 + def interface?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:350 + def interface_type?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:379 + def map_method_type(&block); end + + # pkg:gem/rbs#lib/rbs/definition.rb:298 + def methods; end + + # pkg:gem/rbs#lib/rbs/definition.rb:329 + def module?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:297 + def self_type; end + + # pkg:gem/rbs#lib/rbs/definition.rb:367 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/definition.rb:294 + def type_name; end + + # pkg:gem/rbs#lib/rbs/definition.rb:354 + def type_params; end + + # pkg:gem/rbs#lib/rbs/definition.rb:358 + def type_params_decl; end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:209 +module RBS::Definition::Ancestor; end + +# pkg:gem/rbs#lib/rbs/definition.rb:210 +class RBS::Definition::Ancestor::Instance + # pkg:gem/rbs#lib/rbs/definition.rb:213 + def initialize(name:, args:, source:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:219 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:211 + def args; end + + # pkg:gem/rbs#lib/rbs/definition.rb:223 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:225 + def hash; end + + # pkg:gem/rbs#lib/rbs/definition.rb:211 + def name; end + + # pkg:gem/rbs#lib/rbs/definition.rb:211 + def source; end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:230 +class RBS::Definition::Ancestor::Singleton + # pkg:gem/rbs#lib/rbs/definition.rb:233 + def initialize(name:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:237 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:241 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:243 + def hash; end + + # pkg:gem/rbs#lib/rbs/definition.rb:231 + def name; end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:249 +class RBS::Definition::InstanceAncestors + # pkg:gem/rbs#lib/rbs/definition.rb:254 + def initialize(type_name:, params:, ancestors:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:252 + def ancestors; end + + # pkg:gem/rbs#lib/rbs/definition.rb:260 + def apply(args, env:, location:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:251 + def params; end + + # pkg:gem/rbs#lib/rbs/definition.rb:250 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:30 +class RBS::Definition::Method + # pkg:gem/rbs#lib/rbs/definition.rb:107 + def initialize(super_method:, defs:, accessibility:, alias_of:, annotations: T.unsafe(nil), alias_member: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition.rb:117 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:101 + def accessibility; end + + # pkg:gem/rbs#lib/rbs/definition.rb:105 + def alias_member; end + + # pkg:gem/rbs#lib/rbs/definition.rb:104 + def alias_of; end + + # pkg:gem/rbs#lib/rbs/definition.rb:103 + def annotations; end + + # pkg:gem/rbs#lib/rbs/definition.rb:151 + def comments; end + + # pkg:gem/rbs#lib/rbs/definition.rb:133 + def defined_in; end + + # pkg:gem/rbs#lib/rbs/definition.rb:100 + def defs; end + + # pkg:gem/rbs#lib/rbs/definition.rb:127 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:102 + def extra_annotations; end + + # pkg:gem/rbs#lib/rbs/definition.rb:129 + def hash; end + + # pkg:gem/rbs#lib/rbs/definition.rb:140 + def implemented_in; end + + # pkg:gem/rbs#lib/rbs/definition.rb:190 + def map_method_type(&block); end + + # pkg:gem/rbs#lib/rbs/definition.rb:176 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/definition.rb:183 + def map_type_bound(&block); end + + # pkg:gem/rbs#lib/rbs/definition.rb:155 + def members; end + + # pkg:gem/rbs#lib/rbs/definition.rb:147 + def method_types; end + + # pkg:gem/rbs#lib/rbs/definition.rb:163 + def private?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:159 + def public?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:167 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/definition.rb:99 + def super_method; end + + # pkg:gem/rbs#lib/rbs/definition.rb:196 + def update(super_method: T.unsafe(nil), defs: T.unsafe(nil), accessibility: T.unsafe(nil), alias_of: T.unsafe(nil), annotations: T.unsafe(nil), alias_member: T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:31 +class RBS::Definition::Method::TypeDef + # pkg:gem/rbs#lib/rbs/definition.rb:40 + def initialize(type:, member:, defined_in:, implemented_in:, overload_annotations: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition.rb:50 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:38 + def annotations; end + + # pkg:gem/rbs#lib/rbs/definition.rb:64 + def comment; end + + # pkg:gem/rbs#lib/rbs/definition.rb:34 + def defined_in; end + + # pkg:gem/rbs#lib/rbs/definition.rb:89 + def each_annotation(&block); end + + # pkg:gem/rbs#lib/rbs/definition.rb:58 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/definition.rb:60 + def hash; end + + # pkg:gem/rbs#lib/rbs/definition.rb:35 + def implemented_in; end + + # pkg:gem/rbs#lib/rbs/definition.rb:33 + def member; end + + # pkg:gem/rbs#lib/rbs/definition.rb:36 + def member_annotations; end + + # pkg:gem/rbs#lib/rbs/definition.rb:80 + def overload?; end + + # pkg:gem/rbs#lib/rbs/definition.rb:37 + def overload_annotations; end + + # pkg:gem/rbs#lib/rbs/definition.rb:32 + def type; end + + # pkg:gem/rbs#lib/rbs/definition.rb:73 + def update(type: T.unsafe(nil), member: T.unsafe(nil), defined_in: T.unsafe(nil), implemented_in: T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:284 +class RBS::Definition::SingletonAncestors + # pkg:gem/rbs#lib/rbs/definition.rb:288 + def initialize(type_name:, ancestors:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:286 + def ancestors; end + + # pkg:gem/rbs#lib/rbs/definition.rb:285 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/definition.rb:5 +class RBS::Definition::Variable + # pkg:gem/rbs#lib/rbs/definition.rb:11 + def initialize(parent_variable:, type:, declared_in:, source:); end + + # pkg:gem/rbs#lib/rbs/definition.rb:8 + def declared_in; end + + # pkg:gem/rbs#lib/rbs/definition.rb:6 + def parent_variable; end + + # pkg:gem/rbs#lib/rbs/definition.rb:9 + def source; end + + # pkg:gem/rbs#lib/rbs/definition.rb:18 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/definition.rb:7 + def type; end +end + +# pkg:gem/rbs#lib/rbs/definition_builder.rb:4 +class RBS::DefinitionBuilder + # pkg:gem/rbs#lib/rbs/definition_builder.rb:14 + def initialize(env:, ancestor_builder: T.unsafe(nil), method_builder: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:6 + def ancestor_builder; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:198 + def build_instance(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:43 + def build_interface(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:330 + def build_singleton(type_name); end + + # Builds a definition for singleton without .new method. + # + # pkg:gem/rbs#lib/rbs/definition_builder.rb:260 + def build_singleton0(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:85 + def define_instance(definition, type_name, subst, define_class_vars:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:33 + def define_interface(definition, type_name, subst); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:698 + def define_method(methods, definition, method, subst, self_type_methods, defined_in:, implemented_in: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:25 + def ensure_namespace!(namespace, location:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:5 + def env; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:986 + def expand_alias(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:990 + def expand_alias1(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:997 + def expand_alias2(type_name, args); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:637 + def import_methods(definition, module_name, module_methods, interfaces_methods, subst, self_type_methods); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:586 + def insert_variable(type_name, variables, name:, type:, source:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:9 + def instance_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:12 + def interface_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:456 + def interface_methods(interface_ancestors); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:7 + def method_builder; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:11 + def singleton0_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:10 + def singleton_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:486 + def source_location(source, decl); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:976 + def special_accessibility(is_instance, method_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:66 + def tapp_subst(name, args); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:982 + def try_cache(type_name, cache:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:1021 + def update(env:, except:, ancestor_builder:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:476 + def validate_params_with(type_params, result:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:1050 + def validate_type_name(name, location); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:504 + def validate_type_params(definition, ancestors:, methods:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:1039 + def validate_type_presence(type); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:597 + def validate_variable(var); end +end + +# pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:5 +class RBS::DefinitionBuilder::AncestorBuilder + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:162 + def initialize(env:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:151 + def env; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:667 + def fill_ancestor_source(ancestor, name:, source:, &block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:495 + def instance_ancestors(type_name, building_ancestors: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:154 + def instance_ancestors_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:631 + def interface_ancestors(type_name, building_ancestors: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:160 + def interface_ancestors_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:480 + def mixin_ancestors(entry, type_name, included_modules:, included_interfaces:, extended_modules:, prepended_modules:, extended_interfaces:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:356 + def mixin_ancestors0(decl, type_name, align_params:, included_modules:, included_interfaces:, extended_modules:, prepended_modules:, extended_interfaces:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:198 + def one_instance_ancestors(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:153 + def one_instance_ancestors_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:337 + def one_interface_ancestors(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:159 + def one_interface_ancestors_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:283 + def one_singleton_ancestors(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:156 + def one_singleton_ancestors_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:576 + def singleton_ancestors(type_name, building_ancestors: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:157 + def singleton_ancestors_cache; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:175 + def validate_super_class!(type_name, entry); end +end + +# pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:6 +class RBS::DefinitionBuilder::AncestorBuilder::OneAncestors + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:17 + def initialize(type_name:, params:, super_class:, self_types:, included_modules:, included_interfaces:, prepended_modules:, extended_modules:, extended_interfaces:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:29 + def each_ancestor(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:86 + def each_extended_interface(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:78 + def each_extended_module(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:62 + def each_included_interface(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:54 + def each_included_module(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:70 + def each_prepended_module(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:46 + def each_self_type(&block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:15 + def extended_interfaces; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:14 + def extended_modules; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:12 + def included_interfaces; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:11 + def included_modules; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:8 + def params; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:13 + def prepended_modules; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:10 + def self_types; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:9 + def super_class; end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:7 + def type_name; end + + class << self + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:94 + def class_instance(type_name:, params:, super_class:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:136 + def interface(type_name:, params:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:122 + def module_instance(type_name:, params:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:108 + def singleton(type_name:, super_class:); end + end +end + +# pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:5 +class RBS::DefinitionBuilder::MethodBuilder + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:91 + def initialize(env:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:217 + def build_alias(methods, type, member:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:222 + def build_attribute(methods, type, member:, accessibility:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:99 + def build_instance(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:197 + def build_interface(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:256 + def build_method(methods, type, member:, accessibility:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:238 + def build_ruby_attribute(methods, type, member:, accessibility:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:164 + def build_singleton(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:267 + def each_rbs_member_with_accessibility(members, accessibility: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:86 + def env; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:87 + def instance_methods; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:89 + def interface_methods; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:88 + def singleton_methods; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:280 + def update(env:, except:); end +end + +# pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:6 +class RBS::DefinitionBuilder::MethodBuilder::Methods + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:30 + def initialize(type:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:49 + def each; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:28 + def methods; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:27 + def type; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:35 + def validate!; end +end + +# pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:7 +class RBS::DefinitionBuilder::MethodBuilder::Methods::Definition < ::Struct + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:14 + def accessibility; end + + # @implements Definition + # + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:10 + def original; end + + class << self + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:22 + def empty(name:, type:); end + end +end + +# pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:63 +class RBS::DefinitionBuilder::MethodBuilder::Methods::Sorter + include ::TSort + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:68 + def initialize(methods); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:66 + def methods; end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:76 + def tsort_each_child(defn); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:72 + def tsort_each_node(&block); end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:21 +class RBS::DefinitionError < ::RBS::BaseError; end + +# pkg:gem/rbs#lib/rbs/errors.rb:23 +module RBS::DetailedMessageable + # pkg:gem/rbs#lib/rbs/errors.rb:24 + def detailed_message(highlight: T.unsafe(nil), **); end +end + +# pkg:gem/rbs#lib/rbs/diff.rb:4 +class RBS::Diff + # pkg:gem/rbs#lib/rbs/diff.rb:5 + def initialize(type_name:, library_options:, after_path: T.unsafe(nil), before_path: T.unsafe(nil), detail: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/diff.rb:13 + def each_diff(&block); end + + private + + # pkg:gem/rbs#lib/rbs/diff.rb:96 + def build_builder(env); end + + # pkg:gem/rbs#lib/rbs/diff.rb:77 + def build_env(path); end + + # pkg:gem/rbs#lib/rbs/diff.rb:49 + def build_methods(path); end + + # pkg:gem/rbs#lib/rbs/diff.rb:122 + def constant_to_s(constant); end + + # pkg:gem/rbs#lib/rbs/diff.rb:100 + def definition_method_to_s(key, kind, definition_method); end + + # pkg:gem/rbs#lib/rbs/diff.rb:38 + def each_diff_constants(before_constant_children, after_constant_children); end + + # pkg:gem/rbs#lib/rbs/diff.rb:27 + def each_diff_methods(kind, before_methods, after_methods); end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:419 +class RBS::DuplicatedDeclarationError < ::RBS::LoadingError + # pkg:gem/rbs#lib/rbs/errors.rb:423 + def initialize(name, *decls); end + + # pkg:gem/rbs#lib/rbs/errors.rb:421 + def decls; end + + # pkg:gem/rbs#lib/rbs/errors.rb:420 + def name; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:292 +class RBS::DuplicatedInterfaceMethodDefinitionError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:299 + def initialize(type:, method_name:, member:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:307 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:297 + def member; end + + # pkg:gem/rbs#lib/rbs/errors.rb:296 + def method_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:311 + def qualified_method_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:295 + def type; end + + # pkg:gem/rbs#lib/rbs/errors.rb:320 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:251 +class RBS::DuplicatedMethodDefinitionError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:258 + def initialize(type:, method_name:, members:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:283 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:256 + def members; end + + # pkg:gem/rbs#lib/rbs/errors.rb:255 + def method_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:287 + def other_locations; end + + # pkg:gem/rbs#lib/rbs/errors.rb:270 + def qualified_method_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:254 + def type; end + + # pkg:gem/rbs#lib/rbs/errors.rb:279 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/environment.rb:4 +class RBS::Environment + # pkg:gem/rbs#lib/rbs/environment.rb:48 + def initialize; end + + # pkg:gem/rbs#lib/rbs/environment.rb:988 + def absolute_type(resolver, map, type, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:983 + def absolute_type_name(resolver, map, type_name, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:455 + def add_source(source); end + + # pkg:gem/rbs#lib/rbs/environment.rb:568 + def append_context(context, decl); end + + # pkg:gem/rbs#lib/rbs/environment.rb:999 + def buffers; end + + # pkg:gem/rbs#lib/rbs/environment.rb:117 + def class_alias?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:10 + def class_alias_decls; end + + # pkg:gem/rbs#lib/rbs/environment.rb:101 + def class_decl?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:5 + def class_decls; end + + # pkg:gem/rbs#lib/rbs/environment.rb:125 + def class_entry(type_name, normalized: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment.rb:97 + def constant_decl?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:8 + def constant_decls; end + + # pkg:gem/rbs#lib/rbs/environment.rb:167 + def constant_entry(type_name, normalized: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment.rb:93 + def constant_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:14 + def declarations; end + + # pkg:gem/rbs#lib/rbs/environment.rb:470 + def each_rbs_source(&block); end + + # pkg:gem/rbs#lib/rbs/environment.rb:482 + def each_ruby_source(&block); end + + # pkg:gem/rbs#lib/rbs/environment.rb:9 + def global_decls; end + + # pkg:gem/rbs#lib/rbs/environment.rb:277 + def insert_rbs_decl(decl, context:, namespace:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:374 + def insert_ruby_decl(decl, context:, namespace:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:994 + def inspect; end + + # pkg:gem/rbs#lib/rbs/environment.rb:6 + def interface_decls; end + + # pkg:gem/rbs#lib/rbs/environment.rb:75 + def interface_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:109 + def module_alias?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:154 + def module_class_entry(type_name, normalized: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment.rb:105 + def module_decl?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:132 + def module_entry(type_name, normalized: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment.rb:83 + def module_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:269 + def normalize_module_name(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:273 + def normalize_module_name!(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:241 + def normalize_module_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:219 + def normalize_type_name(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:206 + def normalize_type_name!(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:187 + def normalize_type_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:139 + def normalized_class_entry(type_name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:163 + def normalized_module_class_entry(type_name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:150 + def normalized_module_entry(type_name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:236 + def normalized_type_name!(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:223 + def normalized_type_name?(type_name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:577 + def resolve_declaration(resolver, map, decl, context:, prefix:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:869 + def resolve_member(resolver, map, member, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:969 + def resolve_method_type(resolver, map, type, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:713 + def resolve_ruby_decl(resolver, decl, context:, prefix:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:790 + def resolve_ruby_member(resolver, member, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:500 + def resolve_signature(resolver, table, dirs, decls, only: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment.rb:522 + def resolve_type_names(only: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment.rb:977 + def resolve_type_params(resolver, map, params, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:562 + def resolver_context(*nesting); end + + # pkg:gem/rbs#lib/rbs/environment.rb:12 + def sources; end + + # pkg:gem/rbs#lib/rbs/environment.rb:7 + def type_alias_decls; end + + # pkg:gem/rbs#lib/rbs/environment.rb:79 + def type_alias_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:87 + def type_name?(name); end + + # pkg:gem/rbs#lib/rbs/environment.rb:1003 + def unload(paths); end + + # pkg:gem/rbs#lib/rbs/environment.rb:494 + def validate_type_params; end + + private + + # pkg:gem/rbs#lib/rbs/environment.rb:59 + def initialize_copy(other); end + + class << self + # pkg:gem/rbs#lib/rbs/environment.rb:69 + def from_loader(loader); end + end +end + +# pkg:gem/rbs#lib/rbs/environment.rb:33 +class RBS::Environment::ClassAliasEntry < ::RBS::Environment::SingleEntry; end + +# pkg:gem/rbs#lib/rbs/environment/class_entry.rb:5 +class RBS::Environment::ClassEntry + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:10 + def initialize(name); end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:15 + def <<(context_decl); end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:68 + def align_params(decl); end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:8 + def context_decls; end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:21 + def each_decl(&block); end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:31 + def empty?; end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:6 + def name; end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:35 + def primary_decl; end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:47 + def type_params; end + + # pkg:gem/rbs#lib/rbs/environment/class_entry.rb:52 + def validate_type_params; end +end + +# pkg:gem/rbs#lib/rbs/environment.rb:42 +class RBS::Environment::ConstantEntry < ::RBS::Environment::SingleEntry; end + +# pkg:gem/rbs#lib/rbs/environment.rb:45 +class RBS::Environment::GlobalEntry < ::RBS::Environment::SingleEntry; end + +# pkg:gem/rbs#lib/rbs/environment.rb:36 +class RBS::Environment::InterfaceEntry < ::RBS::Environment::SingleEntry; end + +# pkg:gem/rbs#lib/rbs/environment.rb:30 +class RBS::Environment::ModuleAliasEntry < ::RBS::Environment::SingleEntry; end + +# pkg:gem/rbs#lib/rbs/environment/module_entry.rb:5 +class RBS::Environment::ModuleEntry + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:10 + def initialize(name); end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:15 + def <<(context_decl); end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:62 + def align_params(decl); end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:8 + def context_decls; end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:20 + def each_decl(&block); end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:30 + def empty?; end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:6 + def name; end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:34 + def primary_decl; end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:43 + def self_types; end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:38 + def type_params; end + + # pkg:gem/rbs#lib/rbs/environment/module_entry.rb:74 + def validate_type_params; end +end + +# pkg:gem/rbs#lib/rbs/environment.rb:18 +class RBS::Environment::SingleEntry + # pkg:gem/rbs#lib/rbs/environment.rb:23 + def initialize(name:, decl:, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:20 + def context; end + + # pkg:gem/rbs#lib/rbs/environment.rb:21 + def decl; end + + # pkg:gem/rbs#lib/rbs/environment.rb:19 + def name; end +end + +# pkg:gem/rbs#lib/rbs/environment.rb:39 +class RBS::Environment::TypeAliasEntry < ::RBS::Environment::SingleEntry; end + +# pkg:gem/rbs#lib/rbs/environment/use_map.rb:5 +class RBS::Environment::UseMap + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:30 + def initialize(table:); end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:36 + def build_map(clause); end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:72 + def resolve(type_name); end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:53 + def resolve?(type_name); end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:28 + def use_dirs; end +end + +# pkg:gem/rbs#lib/rbs/environment/use_map.rb:6 +class RBS::Environment::UseMap::Table + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:9 + def initialize; end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:7 + def children; end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:14 + def compute_children; end + + # pkg:gem/rbs#lib/rbs/environment/use_map.rb:7 + def known_types; end +end + +# pkg:gem/rbs#lib/rbs/environment_loader.rb:4 +class RBS::EnvironmentLoader + include ::RBS::FileFinder + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:40 + def initialize(core_root: T.unsafe(nil), repository: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:48 + def add(path: T.unsafe(nil), library: T.unsafe(nil), version: T.unsafe(nil), resolve_dependencies: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:74 + def add_collection(lockfile); end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:20 + def core_root; end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:24 + def dirs; end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:125 + def each_dir; end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:148 + def each_signature; end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:98 + def has_library?(library:, version:); end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:23 + def libs; end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:106 + def load(env:); end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:21 + def repository; end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:59 + def resolve_dependencies(library:, version:); end + + class << self + # pkg:gem/rbs#lib/rbs/environment_loader.rb:28 + def gem_sig_path(name, version); end + end +end + +# pkg:gem/rbs#lib/rbs/environment_loader.rb:26 +RBS::EnvironmentLoader::DEFAULT_CORE_ROOT = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/rbs#lib/rbs/environment_loader.rb:17 +class RBS::EnvironmentLoader::Library < ::Struct; end + +# pkg:gem/rbs#lib/rbs/environment_loader.rb:5 +class RBS::EnvironmentLoader::UnknownLibraryError < ::StandardError + # pkg:gem/rbs#lib/rbs/environment_loader.rb:8 + def initialize(lib:); end + + # pkg:gem/rbs#lib/rbs/environment_loader.rb:6 + def library; end +end + +# pkg:gem/rbs#lib/rbs/environment_walker.rb:4 +class RBS::EnvironmentWalker + include ::TSort + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:11 + def initialize(env:); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:16 + def builder; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:99 + def each_type_name(type, &block); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:105 + def each_type_node(type, &block); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:9 + def env; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:20 + def only_ancestors!(only = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:25 + def only_ancestors?; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:44 + def tsort_each_child(node, &block); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:31 + def tsort_each_node(&block); end +end + +# pkg:gem/rbs#lib/rbs/environment_walker.rb:5 +class RBS::EnvironmentWalker::InstanceNode < ::Struct + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def type_name; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def type_name=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def inspect; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def members; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:5 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/environment_walker.rb:6 +class RBS::EnvironmentWalker::SingletonNode < ::Struct + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def type_name; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def type_name=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def inspect; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def members; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:6 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/environment_walker.rb:7 +class RBS::EnvironmentWalker::TypeNameNode < ::Struct + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def type_name; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def type_name=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def inspect; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def members; end + + # pkg:gem/rbs#lib/rbs/environment_walker.rb:7 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/factory.rb:4 +class RBS::Factory + # pkg:gem/rbs#lib/rbs/factory.rb:5 + def type_name(string); end +end + +# pkg:gem/rbs#lib/rbs/file_finder.rb:4 +module RBS::FileFinder + class << self + # pkg:gem/rbs#lib/rbs/file_finder.rb:7 + def each_file(path, skip_hidden:, immediate: T.unsafe(nil), &block); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:407 +class RBS::GenericParameterMismatchError < ::RBS::LoadingError + # pkg:gem/rbs#lib/rbs/errors.rb:411 + def initialize(name:, decl:, location: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/errors.rb:409 + def decl; end + + # pkg:gem/rbs#lib/rbs/errors.rb:408 + def name; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:574 +class RBS::InconsistentClassModuleAliasError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:579 + def initialize(entry); end + + # pkg:gem/rbs#lib/rbs/errors.rb:577 + def alias_entry; end + + # pkg:gem/rbs#lib/rbs/errors.rb:593 + def location; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:187 +class RBS::InheritModuleError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:192 + def initialize(super_decl); end + + # pkg:gem/rbs#lib/rbs/errors.rb:198 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:190 + def super_decl; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:202 + def check!(super_decl, env:); end + end +end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:4 +class RBS::InlineParser + class << self + # pkg:gem/rbs#lib/rbs/inline_parser.rb:45 + def parse(buffer, prism); end + end +end + +# pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:5 +class RBS::InlineParser::CommentAssociation + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:8 + def initialize(blocks); end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:6 + def associated_blocks; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:6 + def blocks; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:84 + def each_enclosed_block(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:104 + def each_unassociated_block; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:6 + def end_line_map; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:47 + def leading_block(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:55 + def leading_block!(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:6 + def start_line_map; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:63 + def trailing_block(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:76 + def trailing_block!(node); end + + class << self + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:24 + def build(buffer, result); end + end +end + +# pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:29 +class RBS::InlineParser::CommentAssociation::Reference + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:32 + def initialize(block, association); end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:37 + def associate!; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:42 + def associated?; end + + # pkg:gem/rbs#lib/rbs/inline_parser/comment_association.rb:30 + def block; end +end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:20 +module RBS::InlineParser::Diagnostic; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:38 +class RBS::InlineParser::Diagnostic::AnnotationSyntaxError < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:41 +class RBS::InlineParser::Diagnostic::AttributeNonSymbolName < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:21 +class RBS::InlineParser::Diagnostic::Base + # pkg:gem/rbs#lib/rbs/inline_parser.rb:24 + def initialize(location, message); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:22 + def location; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:22 + def message; end +end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:42 +class RBS::InlineParser::Diagnostic::ClassModuleAliasDeclarationMissingTypeName < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:39 +class RBS::InlineParser::Diagnostic::MixinMultipleArguments < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:40 +class RBS::InlineParser::Diagnostic::MixinNonConstantModule < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:31 +class RBS::InlineParser::Diagnostic::NonConstantClassName < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:36 +class RBS::InlineParser::Diagnostic::NonConstantConstantDeclaration < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:32 +class RBS::InlineParser::Diagnostic::NonConstantModuleName < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:33 +class RBS::InlineParser::Diagnostic::NonConstantSuperClassName < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:30 +class RBS::InlineParser::Diagnostic::NotImplementedYet < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:35 +class RBS::InlineParser::Diagnostic::TopLevelAttributeDefinition < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:34 +class RBS::InlineParser::Diagnostic::TopLevelMethodDefinition < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:37 +class RBS::InlineParser::Diagnostic::UnusedInlineAnnotation < ::RBS::InlineParser::Diagnostic::Base; end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:57 +class RBS::InlineParser::Parser < ::Prism::Visitor + include ::RBS::AST::Ruby::Helpers::ConstantHelper + include ::RBS::AST::Ruby::Helpers::LocationHelper + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:63 + def initialize(result); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:69 + def buffer; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:58 + def comments; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:73 + def current_module; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:77 + def current_module!; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:81 + def diagnostics; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:498 + def insert_declaration(decl); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:58 + def module_nesting; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:341 + def parse_attribute_call(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:401 + def parse_constant_declaration(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:285 + def parse_mixin_call(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:534 + def parse_super_class(super_class_expr, inheritance_operator_loc); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:85 + def push_module_nesting(mod); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:506 + def report_unused_annotation(*annotations); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:521 + def report_unused_block(block); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:58 + def result; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:92 + def skip_node?(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:243 + def visit_call_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:103 + def visit_class_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:167 + def visit_class_or_module_body(decl, node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:279 + def visit_constant_path_write_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:272 + def visit_constant_write_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:202 + def visit_def_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:125 + def visit_module_node(node); end +end + +# pkg:gem/rbs#lib/rbs/inline_parser.rb:5 +class RBS::InlineParser::Result + # pkg:gem/rbs#lib/rbs/inline_parser.rb:8 + def initialize(buffer, prism); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:6 + def buffer; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:6 + def declarations; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:6 + def diagnostics; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:6 + def prism_result; end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:15 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:341 +class RBS::InstanceVariableDuplicationError < ::RBS::VariableDuplicationError + # pkg:gem/rbs#lib/rbs/errors.rb:342 + def kind; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:378 +class RBS::InvalidOverloadMethodError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:386 + def initialize(type_name:, method_name:, kind:, members:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:383 + def kind; end + + # pkg:gem/rbs#lib/rbs/errors.rb:402 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:384 + def members; end + + # pkg:gem/rbs#lib/rbs/errors.rb:382 + def method_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:381 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:67 +class RBS::InvalidTypeApplicationError < ::RBS::DefinitionError + # pkg:gem/rbs#lib/rbs/errors.rb:74 + def initialize(type_name:, args:, params:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:69 + def args; end + + # pkg:gem/rbs#lib/rbs/errors.rb:72 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:70 + def params; end + + # pkg:gem/rbs#lib/rbs/errors.rb:68 + def type_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:71 + def type_params; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:83 + def check!(type_name:, args:, params:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:92 + def check2!(env:, type_name:, args:, location:); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:432 +class RBS::InvalidVarianceAnnotationError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:439 + def initialize(type_name:, param:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:437 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:436 + def param; end + + # pkg:gem/rbs#lib/rbs/errors.rb:435 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:20 +class RBS::LoadingError < ::RBS::BaseError; end + +# Pure-Ruby implementation of the primitives that back RBS::Location. +# +# On CRuby these come from the C extension (ext/rbs_extension/legacy_location.c). +# JRuby loads this instead, before rbs/location_aux.rb layers the public API on +# top, so RBS::Location behaves identically without the native extension. +# +# pkg:gem/rbs#lib/rbs.rb:82 +class RBS::Location + # pkg:gem/rbs#lib/rbs.rb:82 + def initialize(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:79 + def ==(other); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def [](_arg0); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _add_optional_child(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _add_optional_no_child(_arg0); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _add_required_child(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _end_pos; end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _optional_keys; end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _required_keys; end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _start_pos; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:110 + def add_optional_child(name, range); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:106 + def add_required_child(name, range); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:27 + def aref(_arg0); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def buffer; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:118 + def each_optional_key(&block); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:126 + def each_required_key(&block); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:55 + def end_column; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:51 + def end_line; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:63 + def end_loc; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:35 + def end_pos; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:5 + def inspect; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:134 + def key?(name); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:146 + def local_location; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:166 + def local_source; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:39 + def name; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:138 + def optional_key?(name); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:67 + def range; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:142 + def required_key?(name); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:71 + def source; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:47 + def start_column; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:43 + def start_line; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:59 + def start_loc; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:31 + def start_pos; end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:86 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:75 + def to_s; end + + private + + # pkg:gem/rbs#lib/rbs.rb:82 + def initialize_copy(_arg0); end + + class << self + # pkg:gem/rbs#lib/rbs/location_aux.rb:16 + def new(buffer_ = T.unsafe(nil), start_pos_ = T.unsafe(nil), end_pos_ = T.unsafe(nil), buffer: T.unsafe(nil), start_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:102 + def to_string(location, default: T.unsafe(nil)); end + end +end + +# pkg:gem/rbs#lib/rbs/location_aux.rb:29 +RBS::Location::WithChildren = RBS::Location + +# pkg:gem/rbs#lib/rbs/locator.rb:4 +class RBS::Locator + # pkg:gem/rbs#lib/rbs/locator.rb:7 + def initialize(buffer:, dirs:, decls:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:5 + def buffer; end + + # pkg:gem/rbs#lib/rbs/locator.rb:5 + def decls; end + + # pkg:gem/rbs#lib/rbs/locator.rb:5 + def dirs; end + + # pkg:gem/rbs#lib/rbs/locator.rb:13 + def find(line:, column:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:29 + def find2(line:, column:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:60 + def find_in_decl(pos, decl:, array:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:42 + def find_in_directive(pos, dir, array); end + + # pkg:gem/rbs#lib/rbs/locator.rb:212 + def find_in_loc(pos, location:, array:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:131 + def find_in_member(pos, member:, array:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:154 + def find_in_method_type(pos, method_type:, array:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:196 + def find_in_type(pos, type:, array:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:172 + def find_in_type_param(pos, type_param:, array:); end + + # pkg:gem/rbs#lib/rbs/locator.rb:239 + def test_loc(pos, location:); end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:4 +module RBS::MethodNameHelper + # pkg:gem/rbs#lib/rbs/errors.rb:5 + def method_name_string; end +end + +# pkg:gem/rbs#lib/rbs/method_type.rb:4 +class RBS::MethodType + # pkg:gem/rbs#lib/rbs/method_type.rb:10 + def initialize(type_params:, type:, block:, location:); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:17 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:7 + def block; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:86 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:59 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:127 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:123 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:8 + def location; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:65 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:74 + def map_type_bound(&block); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:33 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:24 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:100 + def to_s; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:6 + def type; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:119 + def type_param_names; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:5 + def type_params; end + + # pkg:gem/rbs#lib/rbs/method_type.rb:50 + def update(type_params: T.unsafe(nil), type: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/method_type.rb:131 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:468 +class RBS::MixinClassError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:474 + def initialize(type_name:, member:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:481 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:472 + def member; end + + # pkg:gem/rbs#lib/rbs/errors.rb:471 + def type_name; end + + private + + # pkg:gem/rbs#lib/rbs/errors.rb:502 + def member_name(member); end + + # pkg:gem/rbs#lib/rbs/errors.rb:513 + def mixin_name; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:485 + def check!(type_name:, env:, member:); end + end +end + +# pkg:gem/rbs#lib/rbs/namespace.rb:4 +class RBS::Namespace + # pkg:gem/rbs#lib/rbs/namespace.rb:7 + def initialize(path:, absolute:); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:55 + def +(other); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:94 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:82 + def absolute!; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:74 + def absolute?; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:63 + def append(component); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:137 + def ascend; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:90 + def empty?; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:99 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:101 + def hash; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:67 + def parent; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:5 + def path; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:86 + def relative!; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:78 + def relative?; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:105 + def split; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:111 + def to_s; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:120 + def to_type_name; end + + class << self + # Returns a canonical `Namespace` instance for the given `path` / + # `absolute` pair. Repeated calls with structurally equal arguments + # return the same object, so callers can rely on `equal?` for fast + # equality. The path Array is duplicated and frozen on insert. + # + # pkg:gem/rbs#lib/rbs/namespace.rb:24 + def [](path, absolute); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:47 + def empty; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:129 + def parse(string); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:51 + def root; end + end +end + +# pkg:gem/rbs#lib/rbs/namespace.rb:18 +module RBS::Namespace::INTERN_LEAF; end + +# pkg:gem/rbs#lib/rbs/errors.rb:229 +class RBS::NoMixinFoundError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:235 + def initialize(type_name:, member:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:242 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:233 + def member; end + + # pkg:gem/rbs#lib/rbs/errors.rb:232 + def type_name; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:246 + def check!(type_name, env:, member:); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:210 +class RBS::NoSelfTypeFoundError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:216 + def initialize(type_name:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:214 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:213 + def type_name; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:223 + def check!(self_type, env:); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:167 +class RBS::NoSuperclassFoundError < ::RBS::DefinitionError + # pkg:gem/rbs#lib/rbs/errors.rb:171 + def initialize(type_name:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:169 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:168 + def type_name; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:178 + def check!(type_name, env:, location:); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:148 +class RBS::NoTypeFoundError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:154 + def initialize(type_name:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:152 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:151 + def type_name; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:161 + def check!(type_name, env:, location:); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:545 +class RBS::NonregularTypeAliasError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:551 + def initialize(diagnostic:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:548 + def diagnostic; end + + # pkg:gem/rbs#lib/rbs/errors.rb:549 + def location; end +end + +# WebAssembly-backed implementation of the parser primitives. +# +# On CRuby these come from the C extension (ext/rbs_extension/main.c). JRuby +# loads this instead: it runs the parser inside WebAssembly, then rebuilds the +# AST with RBS::WASM::Deserializer. rbs/parser_aux.rb layers the public +# RBS::Parser API on top, exactly as it does for the C extension. +# +# pkg:gem/rbs#lib/rbs.rb:82 +class RBS::Parser + class << self + # pkg:gem/rbs#lib/rbs.rb:82 + def _lex(_arg0, _arg1); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_inline_leading_annotation(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_inline_trailing_annotation(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_method_type(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_method_type_to_bytes(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_signature(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_signature_to_bytes(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_type(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_type_params(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:82 + def _parse_type_to_bytes(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:79 + def buffer(source); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:134 + def byte_range(char_range, content); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:70 + def lex(source); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:46 + def magic_comment(buf); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:122 + def parse_inline_leading_annotation(source, range, variables: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:128 + def parse_inline_trailing_annotation(source, range, variables: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:14 + def parse_method_type(source, range: T.unsafe(nil), byte_range: T.unsafe(nil), variables: T.unsafe(nil), require_eof: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:20 + def parse_signature(source); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:8 + def parse_type(source, range: T.unsafe(nil), byte_range: T.unsafe(nil), variables: T.unsafe(nil), require_eof: T.unsafe(nil), void_allowed: T.unsafe(nil), self_allowed: T.unsafe(nil), classish_allowed: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:41 + def parse_type_params(source, module_type_params: T.unsafe(nil)); end + end +end + +# pkg:gem/rbs#lib/rbs/parser_aux.rb:88 +RBS::Parser::KEYWORDS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rbs#lib/rbs/parser/lex_result.rb:5 +class RBS::Parser::LexResult + # pkg:gem/rbs#lib/rbs/parser/lex_result.rb:9 + def initialize(buffer:, value:); end + + # pkg:gem/rbs#lib/rbs/parser/lex_result.rb:6 + def buffer; end + + # pkg:gem/rbs#lib/rbs/parser/lex_result.rb:7 + def value; end +end + +# pkg:gem/rbs#lib/rbs/parser/token.rb:5 +class RBS::Parser::Token + # pkg:gem/rbs#lib/rbs/parser/token.rb:9 + def initialize(type:, location:); end + + # pkg:gem/rbs#lib/rbs/parser/token.rb:18 + def comment?; end + + # pkg:gem/rbs#lib/rbs/parser/token.rb:7 + def location; end + + # pkg:gem/rbs#lib/rbs/parser/token.rb:6 + def type; end + + # pkg:gem/rbs#lib/rbs/parser/token.rb:14 + def value; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:51 +class RBS::ParsingError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:58 + def initialize(location, error_message, token_type); end + + # pkg:gem/rbs#lib/rbs/errors.rb:55 + def error_message; end + + # pkg:gem/rbs#lib/rbs/errors.rb:54 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:56 + def token_type; end +end + +# pkg:gem/rbs#lib/rbs/prototype/helpers.rb:4 +module RBS::Prototype; end + +# pkg:gem/rbs#lib/rbs/prototype/helpers.rb:5 +module RBS::Prototype::Helpers + private + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:120 + def any_node?(node, nodes: T.unsafe(nil), &block); end + + # NOTE: args_node may be a nil by a bug + # https://bugs.ruby-lang.org/issues/17495 + # + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:144 + def args_from_node(args_node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:32 + def block_from_body(node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:108 + def each_child(node, &block); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:112 + def each_node(nodes); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:132 + def keyword_hash?(node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:8 + def parse_comments(string, include_trailing:); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:148 + def symbol_literal_node?(node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:159 + def untyped; end +end + +# pkg:gem/rbs#lib/rbs/prototype/node_usage.rb:5 +class RBS::Prototype::NodeUsage + include ::RBS::Prototype::Helpers + + # pkg:gem/rbs#lib/rbs/prototype/node_usage.rb:10 + def initialize(node); end + + # pkg:gem/rbs#lib/rbs/prototype/node_usage.rb:25 + def calculate(node, conditional:); end + + # pkg:gem/rbs#lib/rbs/prototype/node_usage.rb:8 + def conditional_nodes; end + + # pkg:gem/rbs#lib/rbs/prototype/node_usage.rb:17 + def each_conditional_node(&block); end +end + +# pkg:gem/rbs#lib/rbs/prototype/rb.rb:5 +class RBS::Prototype::RB + include ::RBS::Prototype::Helpers + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:45 + def initialize; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:536 + def block_type(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:516 + def body_type(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:431 + def const_to_name(node, context:); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:408 + def const_to_name!(node, context: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:747 + def current_accessibility(decls, index = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:49 + def decls; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:787 + def find_def_index_by_name(decls, name); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:511 + def function_return_type_from_body(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:453 + def function_type_from_body(node, def_name); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:529 + def if_unless_type(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:783 + def is_accessibility?(decl); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:442 + def literal_to_symbol(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:550 + def literal_to_type(node); end + + # backward compatible + # + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:737 + def node_type(node, default: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:694 + def param_type(node, default: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:75 + def parse(string); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:739 + def private; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:82 + def process(node, decls:, comments:, context:); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:402 + def process_children(node, decls:, comments:, context:); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:743 + def public; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:674 + def range_element_type(types); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:757 + def remove_unnecessary_accessibility_methods!(decls); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:805 + def sort_members!(decls); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:42 + def source_decls; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:43 + def toplevel_members; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:663 + def types_to_union_type(types); end +end + +# pkg:gem/rbs#lib/rbs/prototype/rb.rb:8 +class RBS::Prototype::RB::Context < ::Struct + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:25 + def attribute_kind; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:33 + def enter_namespace(namespace); end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:15 + def method_kind; end + + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:37 + def update(module_function: T.unsafe(nil), singleton: T.unsafe(nil), in_def: T.unsafe(nil)); end + + class << self + # @implements Context + # + # pkg:gem/rbs#lib/rbs/prototype/rb.rb:11 + def initial(namespace: T.unsafe(nil)); end + end +end + +# pkg:gem/rbs#lib/rbs/prototype/rbi.rb:5 +class RBS::Prototype::RBI + include ::RBS::Prototype::Helpers + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:22 + def initialize; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:35 + def append_decl(decl); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:394 + def attribute_type(kind, sigs); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:713 + def call_node?(node, name:, receiver: T.unsafe(nil), args: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:717 + def const_to_name(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:95 + def current_context; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:99 + def current_context!; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:87 + def current_module; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:91 + def current_module!; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:8 + def decls; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:753 + def each_arg(array, &block); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:767 + def each_child(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:150 + def join_comments(nodes, comments); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:10 + def last_sig; end + + # Visibility of a member, given as `private def ...` in RBS + # + # Returns `nil` for members in a visibility _section_, which `sync_visibility` emits instead. + # + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:106 + def member_visibility(context); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:423 + def method_type(args_node, type_node, variables:, overloads:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:9 + def modules; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:775 + def node_to_hash(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:30 + def parse(string); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:496 + def parse_params(args_node, args, method_type, variables:, overloads:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:144 + def pop_sig; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:705 + def proc_type?(type_node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:155 + def process(node, comments:, outer: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:359 + def process_attribute(node, comments:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:336 + def process_visibility(node, outer:, comments:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:43 + def push_class(name, super_class, comment:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:65 + def push_module(name, comment:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:136 + def push_sig(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:113 + def sync_visibility(visibility); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:621 + def type_of(type_node, variables:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:636 + def type_of0(type_node, variables:); end +end + +# pkg:gem/rbs#lib/rbs/prototype/rbi.rb:12 +class RBS::Prototype::RBI::Context + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:16 + def initialize(singleton:, visibility:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:13 + def singleton; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:13 + def singleton=(_arg0); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:14 + def visibility; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:14 + def visibility=(_arg0); end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:5 +class RBS::Prototype::Runtime + include ::RBS::Prototype::Helpers + include ::RBS::Prototype::Runtime::Helpers + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:79 + def initialize(patterns:, env:, merge:, todo: T.unsafe(nil), owners_included: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:664 + def block_from_ast_of(method); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:111 + def builder; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:119 + def decls; end + + # Generate/find outer module declarations + # This is broken down into another method to comply with `DRY` + # This generates/finds declarations in nested form & returns the last array of declarations + # + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:593 + def ensure_outer_module_declarations(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:73 + def env; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:498 + def generate_class(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:435 + def generate_constants(mod, decls); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:311 + def generate_methods(mod, module_name, members); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:575 + def generate_mixin(mod, decl, type_name, type_name_absolute); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:537 + def generate_module(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:483 + def generate_super_class(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:74 + def merge; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:250 + def merge_rbs(module_name, members, instance: T.unsafe(nil), singleton: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:181 + def method_type(method); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:77 + def outline; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:77 + def outline=(_arg0); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:76 + def owners_included; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:115 + def parse(file); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:72 + def patterns; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:94 + def target?(const); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:298 + def target_method?(mod, instance: T.unsafe(nil), singleton: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:75 + def todo; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:107 + def todo_object; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:647 + def type_args(type_name); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:655 + def type_params(mod); end + + private + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:425 + def can_alias?(mod, method); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:139 + def each_mixined_module(type_name, mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:148 + def each_mixined_module_one(type_name, mod); end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:213 +class RBS::Prototype::Runtime::DataGenerator < ::RBS::Prototype::Runtime::ValueObjectBase + private + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:228 + def add_decl_members(decl); end + + # def self.new: (untyped foo, untyped bar) -> instance + # | (foo: untyped, bar: untyped) -> instance + # + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:236 + def build_s_new; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:224 + def build_super_class; end + + class << self + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:214 + def generatable?(target); end + end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:6 +module RBS::Prototype::Runtime::Helpers + private + + # pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:19 + def const_name(const); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:15 + def const_name!(const); end + + # Returns the exact name & not compactly declared name + # + # pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:10 + def only_name(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:37 + def to_type_name(name, full_name: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/helpers.rb:53 + def untyped; end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/reflection.rb:6 +module RBS::Prototype::Runtime::Reflection + class << self + # pkg:gem/rbs#lib/rbs/prototype/runtime/reflection.rb:12 + def constants_of(mod, inherit = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/reflection.rb:7 + def object_class(value); end + end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:91 +class RBS::Prototype::Runtime::StructGenerator < ::RBS::Prototype::Runtime::ValueObjectBase + private + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:108 + def add_decl_members(decl); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:165 + def build_overload_for_keyword_arguments; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:151 + def build_overload_for_positional_arguments; end + + # def self.keyword_init?: () -> bool? + # + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:180 + def build_s_keyword_init_p; end + + # def self.new: (?untyped foo, ?untyped bar) -> instance + # | (?foo: untyped, ?bar: untyped) -> instance + # + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:117 + def build_s_new; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:104 + def build_super_class; end + + class << self + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:92 + def generatable?(target); end + end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:102 +RBS::Prototype::Runtime::StructGenerator::CAN_CALL_KEYWORD_INIT_P = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/rbs#lib/rbs/prototype/runtime.rb:10 +class RBS::Prototype::Runtime::Todo + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:11 + def initialize(builder:); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:50 + def skip_constant?(module_name:, name:); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:37 + def skip_instance_method?(module_name:, method:, accessibility:); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:15 + def skip_mixin?(type_name:, module_name:, mixin_class:); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:24 + def skip_singleton_method?(module_name:, method:, accessibility:); end + + private + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:57 + def mixin_decls(type_name); end +end + +# pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:8 +class RBS::Prototype::Runtime::ValueObjectBase + include ::RBS::Prototype::Runtime::Helpers + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:11 + def initialize(target_class); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:15 + def build_decl; end + + private + + # attr_accessor foo: untyped + # + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:74 + def build_member_accessors(ast_members_class); end + + # def self.members: () -> [ :foo, :bar ] + # def members: () -> [ :foo, :bar ] + # + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:35 + def build_s_members; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:448 +class RBS::RecursiveAliasDefinitionError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:454 + def initialize(type:, defs:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:452 + def defs; end + + # pkg:gem/rbs#lib/rbs/errors.rb:461 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:451 + def type; end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:110 +class RBS::RecursiveAncestorError < ::RBS::DefinitionError + # pkg:gem/rbs#lib/rbs/errors.rb:114 + def initialize(ancestors:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:111 + def ancestors; end + + # pkg:gem/rbs#lib/rbs/errors.rb:112 + def location; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:134 + def check!(self_ancestor, ancestors:, location:); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:527 +class RBS::RecursiveTypeAliasError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:533 + def initialize(alias_names:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:530 + def alias_names; end + + # pkg:gem/rbs#lib/rbs/errors.rb:531 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:540 + def name; end +end + +# pkg:gem/rbs#lib/rbs/repository.rb:4 +class RBS::Repository + # pkg:gem/rbs#lib/rbs/repository.rb:74 + def initialize(no_stdlib: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/repository.rb:98 + def add(dir); end + + # pkg:gem/rbs#lib/rbs/repository.rb:71 + def dirs; end + + # pkg:gem/rbs#lib/rbs/repository.rb:72 + def gems; end + + # pkg:gem/rbs#lib/rbs/repository.rb:108 + def lookup(gem, version); end + + # pkg:gem/rbs#lib/rbs/repository.rb:113 + def lookup_path(gem, version); end + + class << self + # pkg:gem/rbs#lib/rbs/repository.rb:83 + def default; end + + # pkg:gem/rbs#lib/rbs/repository.rb:87 + def find_best_version(version, candidates); end + end +end + +# pkg:gem/rbs#lib/rbs/repository.rb:5 +RBS::Repository::DEFAULT_STDLIB_ROOT = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/rbs#lib/rbs/repository.rb:7 +class RBS::Repository::GemRBS + # pkg:gem/rbs#lib/rbs/repository.rb:11 + def initialize(name:); end + + # pkg:gem/rbs#lib/rbs/repository.rb:64 + def empty?; end + + # pkg:gem/rbs#lib/rbs/repository.rb:59 + def find_best_version(version); end + + # pkg:gem/rbs#lib/rbs/repository.rb:54 + def latest_version; end + + # pkg:gem/rbs#lib/rbs/repository.rb:22 + def load!; end + + # pkg:gem/rbs#lib/rbs/repository.rb:8 + def name; end + + # pkg:gem/rbs#lib/rbs/repository.rb:49 + def oldest_version; end + + # pkg:gem/rbs#lib/rbs/repository.rb:9 + def paths; end + + # pkg:gem/rbs#lib/rbs/repository.rb:45 + def version_names; end + + # pkg:gem/rbs#lib/rbs/repository.rb:17 + def versions; end +end + +# pkg:gem/rbs#lib/rbs/repository.rb:69 +class RBS::Repository::VersionPath < ::Struct + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def gem; end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def gem=(_); end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def path; end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def path=(_); end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def version; end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def version=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def inspect; end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def members; end + + # pkg:gem/rbs#lib/rbs/repository.rb:69 + def new(*_arg0); end + end +end + +# pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:4 +module RBS::Resolver; end + +# pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:5 +class RBS::Resolver::ConstantResolver + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:88 + def initialize(builder:); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:85 + def builder; end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:86 + def child_constants_cache; end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:112 + def children(module_name); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:100 + def constants(context); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:178 + def constants_from_ancestors(module_name, constants:); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:163 + def constants_from_context(context, constants:); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:201 + def constants_itself(context, constants:); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:86 + def context_constants_cache; end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:138 + def load_child_constants(name); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:122 + def load_context_constants(context); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:95 + def resolve(name, context:); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:108 + def resolve_child(module_name, name); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:85 + def table; end +end + +# pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:6 +class RBS::Resolver::ConstantResolver::Table + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:10 + def initialize(environment); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:63 + def children(name); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:7 + def children_table; end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:67 + def constant(name); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:80 + def constant_of_constant(name, entry); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:71 + def constant_of_module(name, entry); end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:8 + def constants_table; end + + # pkg:gem/rbs#lib/rbs/resolver/constant_resolver.rb:7 + def toplevel; end +end + +# pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:5 +class RBS::Resolver::TypeNameResolver + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:10 + def initialize(all_names, aliases); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:80 + def aliased_name?(type_name); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:8 + def aliases; end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:6 + def all_names; end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:7 + def cache; end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:74 + def has_type_name?(full_name); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:119 + def normalize_namespace(type_name, rhs, context, visited); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:37 + def resolve(type_name, context:); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:102 + def resolve_head_namespace(head, context); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:60 + def resolve_namespace(type_name, context:); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:134 + def resolve_namespace0(type_name, context, visited); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:86 + def resolve_type_name(type_name, context); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:32 + def try_cache(type_name, context); end + + class << self + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:16 + def build(env); end + end +end + +# pkg:gem/rbs#lib/rbs/rewriter.rb:4 +class RBS::Rewriter + # pkg:gem/rbs#lib/rbs/rewriter.rb:7 + def initialize(buffer); end + + # pkg:gem/rbs#lib/rbs/rewriter.rb:25 + def add_comment(*locations, content:); end + + # pkg:gem/rbs#lib/rbs/rewriter.rb:5 + def buffer; end + + # pkg:gem/rbs#lib/rbs/rewriter.rb:43 + def delete_comment(comment); end + + # pkg:gem/rbs#lib/rbs/rewriter.rb:36 + def replace_comment(comment, content:); end + + # pkg:gem/rbs#lib/rbs/rewriter.rb:14 + def rewrite(location, string); end + + # pkg:gem/rbs#lib/rbs/rewriter.rb:51 + def string; end + + private + + # pkg:gem/rbs#lib/rbs/rewriter.rb:63 + def format_comment(content, indent); end +end + +# pkg:gem/rbs#lib/rbs/source.rb:4 +module RBS::Source; end + +# pkg:gem/rbs#lib/rbs/source.rb:5 +class RBS::Source::RBS + # pkg:gem/rbs#lib/rbs/source.rb:8 + def initialize(buffer, directives, decls); end + + # pkg:gem/rbs#lib/rbs/source.rb:6 + def buffer; end + + # pkg:gem/rbs#lib/rbs/source.rb:6 + def declarations; end + + # pkg:gem/rbs#lib/rbs/source.rb:6 + def directives; end + + # pkg:gem/rbs#lib/rbs/source.rb:25 + def each_declaration_type_name(names, decl, &block); end + + # pkg:gem/rbs#lib/rbs/source.rb:14 + def each_type_name(&block); end +end + +# pkg:gem/rbs#lib/rbs/source.rb:52 +class RBS::Source::Ruby + # pkg:gem/rbs#lib/rbs/source.rb:58 + def initialize(buffer, prism, declarations, diagnostics); end + + # pkg:gem/rbs#lib/rbs/source.rb:53 + def buffer; end + + # pkg:gem/rbs#lib/rbs/source.rb:55 + def declarations; end + + # pkg:gem/rbs#lib/rbs/source.rb:56 + def diagnostics; end + + # pkg:gem/rbs#lib/rbs/source.rb:76 + def each_declaration_type_name(names, decl, &block); end + + # pkg:gem/rbs#lib/rbs/source.rb:65 + def each_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/source.rb:54 + def prism_result; end +end + +# pkg:gem/rbs#lib/rbs/substitution.rb:4 +class RBS::Substitution + # pkg:gem/rbs#lib/rbs/substitution.rb:12 + def initialize; end + + # pkg:gem/rbs#lib/rbs/substitution.rb:66 + def +(other); end + + # pkg:gem/rbs#lib/rbs/substitution.rb:53 + def [](ty); end + + # pkg:gem/rbs#lib/rbs/substitution.rb:16 + def add(from:, to:); end + + # pkg:gem/rbs#lib/rbs/substitution.rb:37 + def apply(ty); end + + # pkg:gem/rbs#lib/rbs/substitution.rb:8 + def empty?; end + + # pkg:gem/rbs#lib/rbs/substitution.rb:6 + def instance_type; end + + # pkg:gem/rbs#lib/rbs/substitution.rb:6 + def instance_type=(_arg0); end + + # pkg:gem/rbs#lib/rbs/substitution.rb:5 + def mapping; end + + # pkg:gem/rbs#lib/rbs/substitution.rb:55 + def without(*vars); end + + class << self + # pkg:gem/rbs#lib/rbs/substitution.rb:20 + def build(variables, types, instance_type: T.unsafe(nil), &block); end + end +end + +# pkg:gem/rbs#lib/rbs/subtractor.rb:4 +class RBS::Subtractor + # pkg:gem/rbs#lib/rbs/subtractor.rb:5 + def initialize(minuend, subtrahend); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:10 + def call(minuend = T.unsafe(nil), context: T.unsafe(nil)); end + + private + + # pkg:gem/rbs#lib/rbs/subtractor.rb:180 + def absolute_typename(name, context:); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:163 + def access_modifier?(decl); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:120 + def cvar_exist?(owner, name); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:129 + def each_member(owner, &block); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:48 + def filter_members(decl, context:); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:151 + def filter_redundant_access_modifiers(decls); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:106 + def ivar_exist?(owner, name, kind); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:60 + def member_exist?(owner, member, context:); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:89 + def method_exist?(owner, method_name, kind); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:140 + def mixin_exist?(owner, mixin, context:); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:189 + def typename_candidates(name, context:); end + + # pkg:gem/rbs#lib/rbs/subtractor.rb:167 + def update_decl(decl, members:); end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:367 +class RBS::SuperclassMismatchError < ::RBS::DefinitionError + # pkg:gem/rbs#lib/rbs/errors.rb:371 + def initialize(name:, entry:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:369 + def entry; end + + # pkg:gem/rbs#lib/rbs/errors.rb:368 + def name; end +end + +# pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:4 +class RBS::TypeAliasDependency + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:14 + def initialize(env:); end + + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:27 + def build_dependencies; end + + # Check if an alias type definition is circular & prohibited + # + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:19 + def circular_definition?(alias_name); end + + # A hash which stores the transitive closure + # of the directed graph + # + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:12 + def dependencies; end + + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:57 + def dependencies_of(name); end + + # Direct dependencies corresponds to a directed graph + # with vertices as types and directions based on assignment of types + # + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:9 + def direct_dependencies; end + + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:52 + def direct_dependencies_of(name); end + + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:5 + def env; end + + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:43 + def transitive_closure; end + + private + + # Recursive function to construct transitive closure + # + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:81 + def dependency(start, vertex, nested = T.unsafe(nil)); end + + # Constructs directed graph recursively + # + # pkg:gem/rbs#lib/rbs/type_alias_dependency.rb:65 + def direct_dependency(type, result = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:4 +class RBS::TypeAliasRegularity + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:16 + def initialize(env:); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:61 + def build_alias_type(name); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:14 + def builder; end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:69 + def compatible_args?(args1, args2); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:14 + def diagnostics; end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:110 + def each_alias_type(type, &block); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:83 + def each_mutual_alias_defs(&block); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:14 + def env; end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:79 + def nonregular?(type_name); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:22 + def validate; end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:39 + def validate_alias_type(alias_type, names, types); end + + class << self + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:120 + def validate(env:); end + end +end + +# pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:5 +class RBS::TypeAliasRegularity::Diagnostic + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:8 + def initialize(type_name:, nonregular_type:); end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:6 + def nonregular_type; end + + # pkg:gem/rbs#lib/rbs/type_alias_regularity.rb:6 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/type_name.rb:4 +class RBS::TypeName + # pkg:gem/rbs#lib/rbs/type_name.rb:9 + def initialize(namespace:, name:); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:105 + def +(other); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:50 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:81 + def absolute!; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:85 + def absolute?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:77 + def alias?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:73 + def class?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:55 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:57 + def hash; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:93 + def interface?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:7 + def kind; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:6 + def name; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:5 + def namespace; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:89 + def relative!; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:101 + def split; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:65 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:69 + def to_namespace; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:61 + def to_s; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:97 + def with_prefix(namespace); end + + class << self + # Returns a canonical `TypeName` instance for the given `namespace` / + # `name` pair. The namespace is canonicalized through `Namespace.[]` + # so identity-based lookup works regardless of the caller passing a + # fresh `Namespace.new` or an already-interned instance. + # + # pkg:gem/rbs#lib/rbs/type_name.rb:36 + def [](namespace, name); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:113 + def parse(string); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:614 +class RBS::TypeParamDefaultReferenceError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:620 + def initialize(type_param, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:618 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:617 + def type_param; end + + class << self + # pkg:gem/rbs#lib/rbs/errors.rb:626 + def check!(type_params); end + end +end + +# pkg:gem/rbs#lib/rbs/types.rb:4 +module RBS::Types; end + +# pkg:gem/rbs#lib/rbs/types.rb:410 +class RBS::Types::Alias + include ::RBS::Types::Application + + # pkg:gem/rbs#lib/rbs/types.rb:415 + def initialize(name:, args:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:411 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:439 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:431 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:425 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:421 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:202 +module RBS::Types::Application + # pkg:gem/rbs#lib/rbs/types.rb:206 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:204 + def args; end + + # pkg:gem/rbs#lib/rbs/types.rb:232 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:210 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:216 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:244 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:240 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:212 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:203 + def name; end + + # pkg:gem/rbs#lib/rbs/types.rb:224 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:248 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:41 +module RBS::Types::Bases; end + +# pkg:gem/rbs#lib/rbs/types.rb:109 +class RBS::Types::Bases::Any < ::RBS::Types::Bases::Base + # pkg:gem/rbs#lib/rbs/types.rb:110 + def initialize(location:, todo: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:117 + def to_s(level = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:42 +class RBS::Types::Bases::Base + include ::RBS::Types::NoFreeVariables + include ::RBS::Types::NoSubst + include ::RBS::Types::EmptyEachType + include ::RBS::Types::NoTypeName + + # pkg:gem/rbs#lib/rbs/types.rb:45 + def initialize(location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:49 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:57 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:98 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:94 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:53 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:43 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:64 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:69 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:102 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:107 +class RBS::Types::Bases::Bool < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:123 +class RBS::Types::Bases::Bottom < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:130 +class RBS::Types::Bases::Class < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:125 +class RBS::Types::Bases::Instance < ::RBS::Types::Bases::Base + # pkg:gem/rbs#lib/rbs/types.rb:126 + def sub(s); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:121 +class RBS::Types::Bases::Nil < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:124 +class RBS::Types::Bases::Self < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:122 +class RBS::Types::Bases::Top < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:108 +class RBS::Types::Bases::Void < ::RBS::Types::Bases::Base; end + +# pkg:gem/rbs#lib/rbs/types.rb:1390 +class RBS::Types::Block + # pkg:gem/rbs#lib/rbs/types.rb:1396 + def initialize(type:, required:, location: T.unsafe(nil), self_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1403 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1394 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:1428 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1392 + def required; end + + # pkg:gem/rbs#lib/rbs/types.rb:1393 + def self_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1418 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:1410 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1391 + def type; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:366 +class RBS::Types::ClassInstance + include ::RBS::Types::Application + + # pkg:gem/rbs#lib/rbs/types.rb:371 + def initialize(name:, args:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:367 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:397 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:389 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:381 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:377 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:260 +class RBS::Types::ClassSingleton + include ::RBS::Types::Application + + # pkg:gem/rbs#lib/rbs/types.rb:265 + def initialize(name:, location:, args: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:271 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:275 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:277 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:261 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:309 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:301 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:281 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:289 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:293 + def to_s(level = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:23 +module RBS::Types::EmptyEachType + # pkg:gem/rbs#lib/rbs/types.rb:24 + def each_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:32 + def map_type(&block); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:915 +class RBS::Types::Function + # pkg:gem/rbs#lib/rbs/types.rb:999 + def initialize(required_positionals:, optional_positionals:, rest_positionals:, trailing_positionals:, required_keywords:, optional_keywords:, rest_keywords:, return_type:, forwarding: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1011 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1085 + def amap(array, &block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1234 + def drop_head; end + + # pkg:gem/rbs#lib/rbs/types.rb:1251 + def drop_tail; end + + # pkg:gem/rbs#lib/rbs/types.rb:1122 + def each_param(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1107 + def each_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1199 + def empty?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1024 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:996 + def forwarding; end + + # pkg:gem/rbs#lib/rbs/types.rb:1226 + def forwarding?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1039 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1276 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1264 + def has_keyword?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1272 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1026 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1093 + def hmapv(hash, &block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1067 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1101 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:994 + def optional_keywords; end + + # pkg:gem/rbs#lib/rbs/types.rb:990 + def optional_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:1210 + def param_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:993 + def required_keywords; end + + # pkg:gem/rbs#lib/rbs/types.rb:989 + def required_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:995 + def rest_keywords; end + + # pkg:gem/rbs#lib/rbs/types.rb:991 + def rest_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:1230 + def return_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:997 + def return_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1150 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:1136 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:992 + def trailing_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:1184 + def update(required_positionals: T.unsafe(nil), optional_positionals: T.unsafe(nil), rest_positionals: T.unsafe(nil), trailing_positionals: T.unsafe(nil), required_keywords: T.unsafe(nil), optional_keywords: T.unsafe(nil), rest_keywords: T.unsafe(nil), forwarding: T.unsafe(nil), return_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1280 + def with_nonreturn_void?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1170 + def with_return_type(type); end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:1156 + def empty(return_type); end + end +end + +# pkg:gem/rbs#lib/rbs/types.rb:962 +class RBS::Types::Function::ForwardingParam + # pkg:gem/rbs#lib/rbs/types.rb:965 + def initialize(location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:969 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:973 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:975 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:963 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:979 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:984 + def to_s; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:916 +class RBS::Types::Function::Param + # pkg:gem/rbs#lib/rbs/types.rb:921 + def initialize(type:, name:, location: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:927 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:931 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:933 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:919 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:937 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:918 + def name; end + + # pkg:gem/rbs#lib/rbs/types.rb:945 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:949 + def to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:917 + def type; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:322 +class RBS::Types::Interface + include ::RBS::Types::Application + + # pkg:gem/rbs#lib/rbs/types.rb:327 + def initialize(name:, args:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:323 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:353 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:345 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:337 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:333 + def to_json(state = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:832 +class RBS::Types::Intersection + # pkg:gem/rbs#lib/rbs/types.rb:836 + def initialize(types:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:841 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:879 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:845 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:851 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:906 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:902 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:847 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:834 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:887 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:895 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:863 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:859 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:870 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:833 + def types; end + + # pkg:gem/rbs#lib/rbs/types.rb:910 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:1572 +class RBS::Types::Literal + include ::RBS::Types::NoFreeVariables + include ::RBS::Types::NoSubst + include ::RBS::Types::EmptyEachType + include ::RBS::Types::NoTypeName + + # pkg:gem/rbs#lib/rbs/types.rb:1576 + def initialize(literal:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:1581 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1585 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1608 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1604 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1587 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1573 + def literal; end + + # pkg:gem/rbs#lib/rbs/types.rb:1574 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:1596 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1600 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1612 + def with_nonreturn_void?; end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:1632 + def unescape_string(string, is_double_quote); end + end +end + +# pkg:gem/rbs#lib/rbs/types.rb:1616 +RBS::Types::Literal::TABLE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rbs#lib/rbs/types.rb:5 +module RBS::Types::NoFreeVariables + # pkg:gem/rbs#lib/rbs/types.rb:6 + def free_variables(set = T.unsafe(nil)); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:11 +module RBS::Types::NoSubst + # pkg:gem/rbs#lib/rbs/types.rb:12 + def sub(s); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:17 +module RBS::Types::NoTypeName + # pkg:gem/rbs#lib/rbs/types.rb:18 + def map_type_name(&); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:655 +class RBS::Types::Optional + # pkg:gem/rbs#lib/rbs/types.rb:659 + def initialize(type:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:664 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:702 + def each_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:668 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:674 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:732 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:728 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:670 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:657 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:717 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:710 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:682 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:678 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:688 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:656 + def type; end + + # pkg:gem/rbs#lib/rbs/types.rb:736 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:1449 +class RBS::Types::Proc + # pkg:gem/rbs#lib/rbs/types.rb:1455 + def initialize(location:, type:, block:, self_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1462 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1451 + def block; end + + # pkg:gem/rbs#lib/rbs/types.rb:1516 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1466 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1472 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1555 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1551 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1468 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1453 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:1538 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1529 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1452 + def self_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1489 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:1479 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1500 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1450 + def type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1559 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:537 +class RBS::Types::Record + # pkg:gem/rbs#lib/rbs/types.rb:541 + def initialize(location:, all_fields: T.unsafe(nil), fields: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:565 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:538 + def all_fields; end + + # pkg:gem/rbs#lib/rbs/types.rb:615 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:569 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:538 + def fields; end + + # pkg:gem/rbs#lib/rbs/types.rb:575 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:646 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:642 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:571 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:539 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:631 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:624 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:538 + def optional_fields; end + + # pkg:gem/rbs#lib/rbs/types.rb:590 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:586 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:599 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:650 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:1437 +module RBS::Types::SelfTypeBindingHelper + private + + # pkg:gem/rbs#lib/rbs/types.rb:1440 + def self_type_binding_to_s(t); end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:1440 + def self_type_binding_to_s(t); end + end +end + +# pkg:gem/rbs#lib/rbs/types.rb:452 +class RBS::Types::Tuple + # pkg:gem/rbs#lib/rbs/types.rb:456 + def initialize(types:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:461 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:498 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:465 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:471 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:528 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:524 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:467 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:454 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:513 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:506 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:483 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:479 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:490 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:453 + def types; end + + # pkg:gem/rbs#lib/rbs/types.rb:532 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:741 +class RBS::Types::Union + # pkg:gem/rbs#lib/rbs/types.rb:745 + def initialize(types:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:750 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:796 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:754 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:760 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:823 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:819 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:756 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:743 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:804 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:812 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:772 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:768 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:779 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:742 + def types; end + + # pkg:gem/rbs#lib/rbs/types.rb:827 + def with_nonreturn_void?; end +end + +# pkg:gem/rbs#lib/rbs/types.rb:1293 +class RBS::Types::UntypedFunction + # pkg:gem/rbs#lib/rbs/types.rb:1296 + def initialize(return_type:); end + + # pkg:gem/rbs#lib/rbs/types.rb:1378 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1326 + def each_param(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1318 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1354 + def empty?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1382 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1300 + def free_variables(acc = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1362 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1358 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1384 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1304 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1312 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1370 + def param_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:1374 + def return_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:1294 + def return_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1340 + def sub(subst); end + + # pkg:gem/rbs#lib/rbs/types.rb:1334 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1350 + def update(return_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1366 + def with_nonreturn_void?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1346 + def with_return_type(ty); end +end + +# pkg:gem/rbs#lib/rbs/types.rb:133 +class RBS::Types::Variable + include ::RBS::Types::NoTypeName + include ::RBS::Types::EmptyEachType + + # pkg:gem/rbs#lib/rbs/types.rb:139 + def initialize(name:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:144 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:148 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:154 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:193 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:189 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:150 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:135 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:134 + def name; end + + # pkg:gem/rbs#lib/rbs/types.rb:164 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:160 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:183 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:197 + def with_nonreturn_void?; end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:168 + def build(v); end + + # pkg:gem/rbs#lib/rbs/types.rb:178 + def fresh(v = T.unsafe(nil)); end + end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:349 +class RBS::UnknownMethodAliasError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:357 + def initialize(type_name:, original_name:, aliased_name:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:354 + def aliased_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:355 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:353 + def original_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:352 + def type_name; end +end + +# pkg:gem/rbs#lib/rbs/version.rb:4 +RBS::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rbs#lib/rbs/validator.rb:4 +class RBS::Validator + # pkg:gem/rbs#lib/rbs/validator.rb:9 + def initialize(env:, resolver: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/validator.rb:15 + def absolute_type(type, context:, &block); end + + # pkg:gem/rbs#lib/rbs/validator.rb:7 + def definition_builder; end + + # pkg:gem/rbs#lib/rbs/validator.rb:5 + def env; end + + # pkg:gem/rbs#lib/rbs/validator.rb:6 + def resolver; end + + # pkg:gem/rbs#lib/rbs/validator.rb:178 + def type_alias_dependency; end + + # pkg:gem/rbs#lib/rbs/validator.rb:182 + def type_alias_regularity; end + + # pkg:gem/rbs#lib/rbs/validator.rb:158 + def validate_class_alias(entry:); end + + # pkg:gem/rbs#lib/rbs/validator.rb:104 + def validate_method_definition(method_def, type_name:); end + + # Validates presence of the relative type, and application arity match. + # + # pkg:gem/rbs#lib/rbs/validator.rb:24 + def validate_type(type, context:); end + + # pkg:gem/rbs#lib/rbs/validator.rb:63 + def validate_type_alias(entry:); end + + # pkg:gem/rbs#lib/rbs/validator.rb:120 + def validate_type_params(params, type_name:, location:, method_name: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/validator.rb:154 + def validate_variable(var); end +end + +# pkg:gem/rbs#lib/rbs/errors.rb:325 +class RBS::VariableDuplicationError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # pkg:gem/rbs#lib/rbs/errors.rb:332 + def initialize(type_name:, variable_name:, location:); end + + # pkg:gem/rbs#lib/rbs/errors.rb:330 + def location; end + + # pkg:gem/rbs#lib/rbs/errors.rb:328 + def type_name; end + + # pkg:gem/rbs#lib/rbs/errors.rb:329 + def variable_name; end +end + +# pkg:gem/rbs#lib/rbs/variance_calculator.rb:4 +class RBS::VarianceCalculator + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:78 + def initialize(builder:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:76 + def builder; end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:82 + def env; end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:169 + def function(type, result:, context:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:98 + def in_inherit(name:, args:, variables:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:86 + def in_method_type(method_type:, variables:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:110 + def in_type_alias(name:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:176 + def negate(variance); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:121 + def type(type, result:, context:); end +end + +# pkg:gem/rbs#lib/rbs/variance_calculator.rb:5 +class RBS::VarianceCalculator::Result + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:8 + def initialize(variables:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:45 + def compatible?(var, with_annotation:); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:24 + def contravariant(x); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:15 + def covariant(x); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:37 + def each(&block); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:41 + def include?(name); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:60 + def incompatible?(params); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:33 + def invariant(x); end + + # pkg:gem/rbs#lib/rbs/variance_calculator.rb:6 + def result; end +end + +# pkg:gem/rbs#lib/rbs/vendorer.rb:4 +class RBS::Vendorer + # pkg:gem/rbs#lib/rbs/vendorer.rb:8 + def initialize(vendor_dir:, loader:); end + + # pkg:gem/rbs#lib/rbs/vendorer.rb:21 + def clean!; end + + # pkg:gem/rbs#lib/rbs/vendorer.rb:28 + def copy!; end + + # pkg:gem/rbs#lib/rbs/vendorer.rb:13 + def ensure_dir; end + + # pkg:gem/rbs#lib/rbs/vendorer.rb:6 + def loader; end + + # pkg:gem/rbs#lib/rbs/vendorer.rb:5 + def vendor_dir; end +end + +# pkg:gem/rbs#lib/rbs/writer.rb:4 +class RBS::Writer + # pkg:gem/rbs#lib/rbs/writer.rb:8 + def initialize(out:); end + + # pkg:gem/rbs#lib/rbs/writer.rb:366 + def attribute(kind, attr); end + + # pkg:gem/rbs#lib/rbs/writer.rb:42 + def format_annotation(annotation); end + + # pkg:gem/rbs#lib/rbs/writer.rb:23 + def indent(size = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/writer.rb:6 + def indentation; end + + # pkg:gem/rbs#lib/rbs/writer.rb:293 + def method_name(name); end + + # pkg:gem/rbs#lib/rbs/writer.rb:219 + def name_and_args(name, args); end + + # pkg:gem/rbs#lib/rbs/writer.rb:207 + def name_and_params(name, params); end + + # pkg:gem/rbs#lib/rbs/writer.rb:5 + def out; end + + # pkg:gem/rbs#lib/rbs/writer.rb:30 + def prefix; end + + # pkg:gem/rbs#lib/rbs/writer.rb:18 + def preserve!(preserve: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/writer.rb:14 + def preserve?; end + + # pkg:gem/rbs#lib/rbs/writer.rb:396 + def preserve_empty_line(prev, decl); end + + # pkg:gem/rbs#lib/rbs/writer.rb:229 + def put_lines(lines, leading_spaces:); end + + # pkg:gem/rbs#lib/rbs/writer.rb:34 + def puts(string = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/writer.rb:79 + def write(contents); end + + # pkg:gem/rbs#lib/rbs/writer.rb:60 + def write_annotation(annotations); end + + # pkg:gem/rbs#lib/rbs/writer.rb:66 + def write_comment(comment); end + + # pkg:gem/rbs#lib/rbs/writer.rb:119 + def write_decl(decl); end + + # pkg:gem/rbs#lib/rbs/writer.rb:314 + def write_def(member); end + + # pkg:gem/rbs#lib/rbs/writer.rb:306 + def write_loc_source(located); end + + # pkg:gem/rbs#lib/rbs/writer.rb:239 + def write_member(member); end + + # pkg:gem/rbs#lib/rbs/writer.rb:102 + def write_use_directive(dir); end +end diff --git a/sorbet/rbi/gems/redis-client@0.30.1.rbi b/sorbet/rbi/gems/redis-client@0.30.1.rbi new file mode 100644 index 0000000..ba481a5 --- /dev/null +++ b/sorbet/rbi/gems/redis-client@0.30.1.rbi @@ -0,0 +1,1306 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `redis-client` gem. +# Please instead update this file by running `bin/tapioca gem redis-client`. + + +module Process + extend ::ConnectionPool::ForkTracker + extend ::RedisClient::PIDCache::CoreExt + extend ::ActiveSupport::ForkTracker::CoreExt +end + +# pkg:gem/redis-client#lib/redis_client/version.rb:3 +class RedisClient + include ::RedisClient::Common + + # pkg:gem/redis-client#lib/redis_client.rb:269 + def initialize(config, **); end + + # pkg:gem/redis-client#lib/redis_client.rb:421 + def blocking_call(timeout, *command, **kwargs); end + + # pkg:gem/redis-client#lib/redis_client.rb:441 + def blocking_call_v(timeout, command); end + + # pkg:gem/redis-client#lib/redis_client.rb:361 + def call(*command, **kwargs); end + + # pkg:gem/redis-client#lib/redis_client.rb:391 + def call_once(*command, **kwargs); end + + # pkg:gem/redis-client#lib/redis_client.rb:406 + def call_once_v(command); end + + # pkg:gem/redis-client#lib/redis_client.rb:376 + def call_v(command); end + + # pkg:gem/redis-client#lib/redis_client.rb:501 + def close; end + + # pkg:gem/redis-client#lib/redis_client.rb:497 + def connected?; end + + # pkg:gem/redis-client#lib/redis_client.rb:298 + def db; end + + # pkg:gem/redis-client#lib/redis_client.rb:506 + def disable_reconnection(&block); end + + # pkg:gem/redis-client#lib/redis_client.rb:302 + def host; end + + # pkg:gem/redis-client#lib/redis_client.rb:479 + def hscan(key, *args, **kwargs, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:286 + def id; end + + # pkg:gem/redis-client#lib/redis_client.rb:294 + def idle_timeout; end + + # pkg:gem/redis-client#lib/redis_client.rb:277 + def inspect; end + + # pkg:gem/redis-client#lib/redis_client.rb:353 + def measure_round_trip_delay; end + + # pkg:gem/redis-client#lib/redis_client.rb:528 + def multi(watch: T.unsafe(nil), &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:318 + def password; end + + # pkg:gem/redis-client#lib/redis_client.rb:310 + def path; end + + # pkg:gem/redis-client#lib/redis_client.rb:510 + def pipelined(exception: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client.rb:306 + def port; end + + # pkg:gem/redis-client#lib/redis_client.rb:347 + def pubsub; end + + # pkg:gem/redis-client#lib/redis_client.rb:337 + def read_timeout=(timeout); end + + # pkg:gem/redis-client#lib/redis_client.rb:461 + def scan(*args, **kwargs, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:282 + def server_url; end + + # pkg:gem/redis-client#lib/redis_client.rb:322 + def size; end + + # pkg:gem/redis-client#lib/redis_client.rb:470 + def sscan(key, *args, **kwargs, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:329 + def then(_options = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client.rb:290 + def timeout; end + + # pkg:gem/redis-client#lib/redis_client.rb:331 + def timeout=(timeout); end + + # pkg:gem/redis-client#lib/redis_client.rb:314 + def username; end + + # pkg:gem/redis-client#lib/redis_client.rb:326 + def with(_options = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client.rb:342 + def write_timeout=(timeout); end + + # pkg:gem/redis-client#lib/redis_client.rb:488 + def zscan(key, *args, **kwargs, &block); end + + private + + # pkg:gem/redis-client#lib/redis_client.rb:735 + def build_transaction; end + + # pkg:gem/redis-client#lib/redis_client.rb:846 + def connect; end + + # pkg:gem/redis-client#lib/redis_client.rb:769 + def ensure_connected(retryable: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client.rb:828 + def raw_connection; end + + # pkg:gem/redis-client#lib/redis_client.rb:743 + def scan_list(cursor_index, command, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:753 + def scan_pairs(cursor_index, command); end + + class << self + # pkg:gem/redis-client#lib/redis_client.rb:240 + def config(**kwargs); end + + # pkg:gem/redis-client#lib/redis_client.rb:33 + def default_driver; end + + # pkg:gem/redis-client#lib/redis_client.rb:45 + def default_driver=(name); end + + # pkg:gem/redis-client#lib/redis_client.rb:22 + def driver(name); end + + # pkg:gem/redis-client#lib/redis_client.rb:254 + def new(arg = T.unsafe(nil), **kwargs); end + + # pkg:gem/redis-client#lib/redis_client.rb:49 + def now; end + + # pkg:gem/redis-client#lib/redis_client.rb:53 + def now_ms; end + + # pkg:gem/redis-client#lib/redis_client.rb:262 + def register(middleware); end + + # pkg:gem/redis-client#lib/redis_client.rb:18 + def register_driver(name, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:248 + def ring(*clients, **options); end + + # pkg:gem/redis-client#lib/redis_client.rb:244 + def sentinel(**kwargs); end + end +end + +# pkg:gem/redis-client#lib/redis_client.rb:215 +class RedisClient::AuthenticationError < ::RedisClient::CommandError; end + +# pkg:gem/redis-client#lib/redis_client/middlewares.rb:4 +class RedisClient::BasicMiddleware + # pkg:gem/redis-client#lib/redis_client/middlewares.rb:7 + def initialize(client); end + + # pkg:gem/redis-client#lib/redis_client/middlewares.rb:15 + def call(command, _config); end + + # pkg:gem/redis-client#lib/redis_client/middlewares.rb:18 + def call_pipelined(command, _config); end + + # pkg:gem/redis-client#lib/redis_client/middlewares.rb:5 + def client; end + + # pkg:gem/redis-client#lib/redis_client/middlewares.rb:11 + def connect(_config); end +end + +# pkg:gem/redis-client#lib/redis_client.rb:168 +class RedisClient::CannotConnectError < ::RedisClient::ConnectionError; end + +# pkg:gem/redis-client#lib/redis_client.rb:175 +class RedisClient::CheckoutTimeoutError < ::RedisClient::TimeoutError; end + +# pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:4 +class RedisClient::CircuitBreaker + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:23 + def initialize(error_threshold:, error_timeout:, error_threshold_timeout: T.unsafe(nil), success_threshold: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:21 + def error_threshold; end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:21 + def error_threshold_timeout; end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:21 + def error_timeout; end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:34 + def protect; end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:21 + def success_threshold; end + + private + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:80 + def record_error; end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:95 + def record_success; end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:65 + def refresh_state; end +end + +# pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:5 +module RedisClient::CircuitBreaker::Middleware + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:10 + def call(_command, config); end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:14 + def call_pipelined(_commands, config); end + + # pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:6 + def connect(config); end +end + +# pkg:gem/redis-client#lib/redis_client/circuit_breaker.rb:19 +class RedisClient::CircuitBreaker::OpenCircuitError < ::RedisClient::CannotConnectError; end + +# pkg:gem/redis-client#lib/redis_client/command_builder.rb:4 +module RedisClient::CommandBuilder + extend ::RedisClient::CommandBuilder + + # pkg:gem/redis-client#lib/redis_client/command_builder.rb:8 + def generate(args, kwargs = T.unsafe(nil)); end +end + +# pkg:gem/redis-client#lib/redis_client.rb:194 +class RedisClient::CommandError < ::RedisClient::Error + include ::RedisClient::HasCommand + include ::RedisClient::HasCode + include ::RedisClient::Final + + class << self + # pkg:gem/redis-client#lib/redis_client.rb:200 + def parse(error_message); end + end +end + +# pkg:gem/redis-client#lib/redis_client.rb:229 +RedisClient::CommandError::ERRORS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/redis-client#lib/redis_client.rb:63 +module RedisClient::Common + # pkg:gem/redis-client#lib/redis_client.rb:67 + def initialize(config, id: T.unsafe(nil), connect_timeout: T.unsafe(nil), read_timeout: T.unsafe(nil), write_timeout: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client.rb:64 + def config; end + + # pkg:gem/redis-client#lib/redis_client.rb:65 + def connect_timeout; end + + # pkg:gem/redis-client#lib/redis_client.rb:65 + def connect_timeout=(_arg0); end + + # pkg:gem/redis-client#lib/redis_client.rb:64 + def id; end + + # pkg:gem/redis-client#lib/redis_client.rb:88 + def node_for(_key); end + + # pkg:gem/redis-client#lib/redis_client.rb:64 + def nodes; end + + # pkg:gem/redis-client#lib/redis_client.rb:92 + def nodes_for(*keys); end + + # pkg:gem/redis-client#lib/redis_client.rb:65 + def read_timeout; end + + # pkg:gem/redis-client#lib/redis_client.rb:65 + def read_timeout=(_arg0); end + + # pkg:gem/redis-client#lib/redis_client.rb:84 + def timeout=(timeout); end + + # pkg:gem/redis-client#lib/redis_client.rb:65 + def write_timeout; end + + # pkg:gem/redis-client#lib/redis_client.rb:65 + def write_timeout=(_arg0); end +end + +# pkg:gem/redis-client#lib/redis_client/config.rb:7 +class RedisClient::Config + include ::RedisClient::Config::Common + + # pkg:gem/redis-client#lib/redis_client/config.rb:223 + def initialize(url: T.unsafe(nil), host: T.unsafe(nil), port: T.unsafe(nil), path: T.unsafe(nil), username: T.unsafe(nil), password: T.unsafe(nil), db: T.unsafe(nil), **kwargs); end + + # pkg:gem/redis-client#lib/redis_client/config.rb:221 + def host; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:221 + def path; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:221 + def port; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:221 + def server_key; end +end + +# pkg:gem/redis-client#lib/redis_client/config.rb:15 +module RedisClient::Config::Common + # pkg:gem/redis-client#lib/redis_client/config.rb:22 + def initialize(username: T.unsafe(nil), password: T.unsafe(nil), db: T.unsafe(nil), id: T.unsafe(nil), timeout: T.unsafe(nil), read_timeout: T.unsafe(nil), write_timeout: T.unsafe(nil), connect_timeout: T.unsafe(nil), idle_timeout: T.unsafe(nil), ssl: T.unsafe(nil), custom: T.unsafe(nil), ssl_params: T.unsafe(nil), driver: T.unsafe(nil), protocol: T.unsafe(nil), client_implementation: T.unsafe(nil), command_builder: T.unsafe(nil), inherit_socket: T.unsafe(nil), reconnect_attempts: T.unsafe(nil), middlewares: T.unsafe(nil), circuit_breaker: T.unsafe(nil), driver_info: T.unsafe(nil)); end + + # Build the library name for CLIENT SETINFO LIB-NAME. + # + # @param driver_info [String, Array, nil] Upstream driver info + # @return [String] Library name with optional upstream driver info + # @raise [ArgumentError] if driver_info is not a String or Array + # + # pkg:gem/redis-client#lib/redis_client/config.rb:144 + def build_lib_name; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def circuit_breaker; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def command_builder; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def connect_timeout; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:95 + def connection_prelude; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def custom; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def db; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def driver; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def driver_info; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def id; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def idle_timeout; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def inherit_socket; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def middlewares_stack; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:171 + def new_client(**kwargs); end + + # pkg:gem/redis-client#lib/redis_client/config.rb:166 + def new_pool(**kwargs); end + + # pkg:gem/redis-client#lib/redis_client/config.rb:131 + def password; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def protocol; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def read_timeout; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:158 + def resolved?; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:175 + def retriable?(attempt); end + + # pkg:gem/redis-client#lib/redis_client/config.rb:179 + def retry_connecting?(attempt, _error); end + + # pkg:gem/redis-client#lib/redis_client/config.rb:162 + def sentinel?; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:197 + def server_url; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def ssl; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:20 + def ssl?; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:191 + def ssl_context; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def ssl_params; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:135 + def username; end + + # pkg:gem/redis-client#lib/redis_client/config.rb:16 + def write_timeout; end +end + +# pkg:gem/redis-client#lib/redis_client/config.rb:12 +RedisClient::Config::DEFAULT_DB = T.let(T.unsafe(nil), Integer) + +# pkg:gem/redis-client#lib/redis_client/config.rb:9 +RedisClient::Config::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# pkg:gem/redis-client#lib/redis_client/config.rb:13 +RedisClient::Config::DEFAULT_IDLE_TIMEOUT = T.let(T.unsafe(nil), Float) + +# pkg:gem/redis-client#lib/redis_client/config.rb:10 +RedisClient::Config::DEFAULT_PORT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/redis-client#lib/redis_client/config.rb:8 +RedisClient::Config::DEFAULT_TIMEOUT = T.let(T.unsafe(nil), Float) + +# pkg:gem/redis-client#lib/redis_client/config.rb:11 +RedisClient::Config::DEFAULT_USERNAME = T.let(T.unsafe(nil), String) + +# pkg:gem/redis-client#lib/redis_client.rb:167 +class RedisClient::ConnectionError < ::RedisClient::Error; end + +# pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:4 +module RedisClient::ConnectionMixin + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:8 + def initialize(config); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:34 + def call(command, timeout); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:49 + def call_pipelined(commands, timeouts, exception: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:20 + def close; end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:6 + def config; end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:102 + def connection_error(message); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:87 + def connection_timeout(timeout); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:96 + def protocol_error(message); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:15 + def reconnect; end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:5 + def retry_attempt; end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:5 + def retry_attempt=(_arg0); end + + # pkg:gem/redis-client#lib/redis_client/connection_mixin.rb:25 + def revalidate; end +end + +# pkg:gem/redis-client#lib/redis_client/decorator.rb:4 +module RedisClient::Decorator + class << self + # pkg:gem/redis-client#lib/redis_client/decorator.rb:6 + def create(commands_mixin); end + end +end + +# pkg:gem/redis-client#lib/redis_client/decorator.rb:37 +class RedisClient::Decorator::Client + include ::RedisClient::Decorator::CommandsMixin + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:40 + def initialize(_client); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:59 + def close(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def config; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def connect_timeout; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:76 + def connect_timeout=(value); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:59 + def hscan(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def id; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:54 + def multi(**kwargs); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:50 + def pipelined(exception: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def pubsub; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def read_timeout; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:76 + def read_timeout=(value); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:59 + def scan(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def size; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:59 + def sscan(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:76 + def timeout=(value); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:45 + def with(*args, **); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:68 + def write_timeout; end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:76 + def write_timeout=(value); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:59 + def zscan(*args, **, &block); end +end + +# pkg:gem/redis-client#lib/redis_client/decorator.rb:18 +module RedisClient::Decorator::CommandsMixin + # pkg:gem/redis-client#lib/redis_client/decorator.rb:19 + def initialize(client); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:24 + def blocking_call(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:24 + def blocking_call_v(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:24 + def call(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:24 + def call_once(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:24 + def call_once_v(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/decorator.rb:24 + def call_v(*args, **, &block); end +end + +# pkg:gem/redis-client#lib/redis_client/decorator.rb:33 +class RedisClient::Decorator::Pipeline + include ::RedisClient::Decorator::CommandsMixin +end + +# pkg:gem/redis-client#lib/redis_client.rb:147 +class RedisClient::Error < ::StandardError + include ::RedisClient::HasConfig + include ::RedisClient::Retriable + + # pkg:gem/redis-client#lib/redis_client.rb:159 + def _set_next_error(error); end + + # pkg:gem/redis-client#lib/redis_client.rb:151 + def next_error; end + + class << self + # pkg:gem/redis-client#lib/redis_client.rb:153 + def with_config(message, config = T.unsafe(nil)); end + end +end + +# pkg:gem/redis-client#lib/redis_client.rb:170 +class RedisClient::FailoverError < ::RedisClient::ConnectionError; end + +# pkg:gem/redis-client#lib/redis_client.rb:130 +module RedisClient::Final + # pkg:gem/redis-client#lib/redis_client.rb:131 + def _set_retry_attempt(_retry_attempt); end + + # pkg:gem/redis-client#lib/redis_client.rb:142 + def final?; end + + # pkg:gem/redis-client#lib/redis_client.rb:138 + def retriable?; end + + # pkg:gem/redis-client#lib/redis_client.rb:134 + def retry_attempt; end +end + +# pkg:gem/redis-client#lib/redis_client.rb:185 +module RedisClient::HasCode + # pkg:gem/redis-client#lib/redis_client.rb:188 + def initialize(message = T.unsafe(nil), code = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client.rb:186 + def code; end +end + +# pkg:gem/redis-client#lib/redis_client.rb:177 +module RedisClient::HasCommand + # pkg:gem/redis-client#lib/redis_client.rb:180 + def _set_command(command); end + + # pkg:gem/redis-client#lib/redis_client.rb:178 + def command; end +end + +# pkg:gem/redis-client#lib/redis_client.rb:98 +module RedisClient::HasConfig + # pkg:gem/redis-client#lib/redis_client.rb:101 + def _set_config(config); end + + # pkg:gem/redis-client#lib/redis_client.rb:99 + def config; end + + # pkg:gem/redis-client#lib/redis_client.rb:105 + def message; end +end + +# pkg:gem/redis-client#lib/redis_client.rb:225 +class RedisClient::MasterDownError < ::RedisClient::ConnectionError + include ::RedisClient::HasCommand + include ::RedisClient::HasCode +end + +# pkg:gem/redis-client#lib/redis_client/middlewares.rb:21 +class RedisClient::Middlewares < ::RedisClient::BasicMiddleware; end + +# pkg:gem/redis-client#lib/redis_client.rb:609 +class RedisClient::Multi + # pkg:gem/redis-client#lib/redis_client.rb:610 + def initialize(command_builder); end + + # pkg:gem/redis-client#lib/redis_client.rb:652 + def _blocks; end + + # pkg:gem/redis-client#lib/redis_client.rb:672 + def _coerce!(results); end + + # pkg:gem/redis-client#lib/redis_client.rb:648 + def _commands; end + + # pkg:gem/redis-client#lib/redis_client.rb:660 + def _empty?; end + + # pkg:gem/redis-client#lib/redis_client.rb:668 + def _retryable?; end + + # pkg:gem/redis-client#lib/redis_client.rb:656 + def _size; end + + # pkg:gem/redis-client#lib/redis_client.rb:664 + def _timeouts; end + + # pkg:gem/redis-client#lib/redis_client.rb:618 + def call(*command, **kwargs, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:632 + def call_once(*command, **kwargs, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:640 + def call_once_v(command, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:625 + def call_v(command, &block); end +end + +# pkg:gem/redis-client#lib/redis_client.rb:219 +class RedisClient::NoScriptError < ::RedisClient::CommandError; end + +# pkg:gem/redis-client#lib/redis_client.rb:218 +class RedisClient::OutOfMemoryError < ::RedisClient::CommandError; end + +# pkg:gem/redis-client#lib/redis_client/pid_cache.rb:4 +module RedisClient::PIDCache + class << self + # pkg:gem/redis-client#lib/redis_client/pid_cache.rb:10 + def pid; end + + # pkg:gem/redis-client#lib/redis_client/pid_cache.rb:12 + def update!; end + end +end + +# pkg:gem/redis-client#lib/redis_client/pid_cache.rb:18 +module RedisClient::PIDCache::CoreExt + # pkg:gem/redis-client#lib/redis_client/pid_cache.rb:19 + def _fork; end +end + +# pkg:gem/redis-client#lib/redis_client.rb:216 +class RedisClient::PermissionError < ::RedisClient::CommandError; end + +# pkg:gem/redis-client#lib/redis_client.rb:688 +class RedisClient::Pipeline < ::RedisClient::Multi + # pkg:gem/redis-client#lib/redis_client.rb:689 + def initialize(_command_builder); end + + # pkg:gem/redis-client#lib/redis_client.rb:720 + def _coerce!(results); end + + # pkg:gem/redis-client#lib/redis_client.rb:716 + def _empty?; end + + # pkg:gem/redis-client#lib/redis_client.rb:712 + def _timeouts; end + + # pkg:gem/redis-client#lib/redis_client.rb:694 + def blocking_call(timeout, *command, **kwargs, &block); end + + # pkg:gem/redis-client#lib/redis_client.rb:703 + def blocking_call_v(timeout, command, &block); end +end + +# pkg:gem/redis-client#lib/redis_client/pooled.rb:6 +class RedisClient::Pooled + include ::RedisClient::Common + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:11 + def initialize(config, id: T.unsafe(nil), connect_timeout: T.unsafe(nil), read_timeout: T.unsafe(nil), write_timeout: T.unsafe(nil), **kwargs); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def blocking_call(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def blocking_call_v(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def call(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def call_once(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def call_once_v(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def call_v(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:37 + def close; end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:64 + def hscan(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def multi(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def pipelined(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:55 + def pubsub(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:64 + def scan(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:48 + def size; end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:64 + def sscan(*args, **, &block); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:35 + def then(options = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:25 + def with(options = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:64 + def zscan(*args, **, &block); end + + private + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:82 + def new_pool; end + + # pkg:gem/redis-client#lib/redis_client/pooled.rb:78 + def pool; end +end + +# pkg:gem/redis-client#lib/redis_client/pooled.rb:7 +RedisClient::Pooled::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/redis-client#lib/redis_client.rb:164 +class RedisClient::ProtocolError < ::RedisClient::Error; end + +# pkg:gem/redis-client#lib/redis_client.rb:572 +class RedisClient::PubSub + # pkg:gem/redis-client#lib/redis_client.rb:573 + def initialize(raw_connection, command_builder); end + + # pkg:gem/redis-client#lib/redis_client.rb:578 + def call(*command, **kwargs); end + + # pkg:gem/redis-client#lib/redis_client.rb:583 + def call_v(command); end + + # pkg:gem/redis-client#lib/redis_client.rb:588 + def close; end + + # pkg:gem/redis-client#lib/redis_client.rb:594 + def next_event(timeout = T.unsafe(nil)); end + + private + + # pkg:gem/redis-client#lib/redis_client.rb:606 + def raw_connection; end +end + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:4 +module RedisClient::RESP3 + private + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:36 + def dump(command, buffer = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:57 + def dump_any(object, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:68 + def dump_array(array, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:84 + def dump_hash(hash, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:93 + def dump_numeric(numeric, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:76 + def dump_set(set, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:97 + def dump_string(string, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:103 + def dump_symbol(symbol, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:49 + def load(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:53 + def new_buffer; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:112 + def parse(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:166 + def parse_array(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:218 + def parse_blob(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:155 + def parse_boolean(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:200 + def parse_double(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:151 + def parse_error(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:196 + def parse_integer(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:174 + def parse_map(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:213 + def parse_null(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:182 + def parse_push(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:186 + def parse_sequence(io, size); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:170 + def parse_set(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:145 + def parse_string(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:227 + def parse_verbatim_string(io); end + + class << self + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:36 + def dump(command, buffer = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:57 + def dump_any(object, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:68 + def dump_array(array, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:84 + def dump_hash(hash, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:93 + def dump_numeric(numeric, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:76 + def dump_set(set, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:97 + def dump_string(string, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:103 + def dump_symbol(symbol, buffer); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:49 + def load(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:53 + def new_buffer; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:112 + def parse(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:166 + def parse_array(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:218 + def parse_blob(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:155 + def parse_boolean(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:200 + def parse_double(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:151 + def parse_error(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:196 + def parse_integer(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:174 + def parse_map(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:213 + def parse_null(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:182 + def parse_push(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:186 + def parse_sequence(io, size); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:170 + def parse_set(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:145 + def parse_string(io); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:227 + def parse_verbatim_string(io); end + end +end + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:13 +RedisClient::RESP3::DUMP_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:11 +RedisClient::RESP3::EOL = T.let(T.unsafe(nil), String) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:12 +RedisClient::RESP3::EOL_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:7 +class RedisClient::RESP3::Error < ::RedisClient::Error; end + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:34 +RedisClient::RESP3::INTEGER_RANGE = T.let(T.unsafe(nil), Range) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:19 +RedisClient::RESP3::PARSER_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:9 +class RedisClient::RESP3::SyntaxError < ::RedisClient::RESP3::Error; end + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/resp3.rb:8 +class RedisClient::RESP3::UnknownType < ::RedisClient::RESP3::Error; end + +# pkg:gem/redis-client#lib/redis_client.rb:221 +class RedisClient::ReadOnlyError < ::RedisClient::ConnectionError + include ::RedisClient::HasCommand + include ::RedisClient::HasCode +end + +# pkg:gem/redis-client#lib/redis_client.rb:173 +class RedisClient::ReadTimeoutError < ::RedisClient::TimeoutError; end + +# pkg:gem/redis-client#lib/redis_client.rb:112 +module RedisClient::Retriable + # pkg:gem/redis-client#lib/redis_client.rb:113 + def _set_retry_attempt(retry_attempt); end + + # pkg:gem/redis-client#lib/redis_client.rb:125 + def final?; end + + # pkg:gem/redis-client#lib/redis_client.rb:121 + def retriable?; end + + # pkg:gem/redis-client#lib/redis_client.rb:117 + def retry_attempt; end +end + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:6 +class RedisClient::RubyConnection + include ::RedisClient::ConnectionMixin + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:43 + def initialize(config, connect_timeout:, read_timeout:, write_timeout:); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:55 + def close; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:51 + def connected?; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:107 + def measure_round_trip_delay; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:95 + def read(timeout = T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:60 + def read_timeout=(timeout); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:70 + def write(command); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:83 + def write_multi(commands); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:65 + def write_timeout=(timeout); end + + private + + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:115 + def connect; end + + # Linux + # macOS + # unknown POSIX + # unknown + # + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:179 + def enable_socket_keep_alive(socket); end + + class << self + # pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:14 + def ssl_context(ssl_params); end + end +end + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:7 +class RedisClient::RubyConnection::BufferedIO + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:16 + def initialize(io, read_timeout:, write_timeout:, chunk_size: T.unsafe(nil)); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:89 + def close; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:93 + def closed?; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:97 + def eof?; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:150 + def getbyte; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:26 + def gets_chomp; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:159 + def gets_integer; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:37 + def read_chomp(bytes); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:11 + def read_timeout; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:11 + def read_timeout=(_arg0); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:121 + def skip(offset); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:101 + def with_timeout(new_timeout); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:127 + def write(string); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:11 + def write_timeout; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:11 + def write_timeout=(_arg0); end + + private + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:44 + def ensure_line; end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:184 + def ensure_remaining(bytes); end + + # pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:191 + def fill_buffer(strict, size = T.unsafe(nil)); end +end + +# Ruby 3.2+ +# +# pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:14 +RedisClient::RubyConnection::BufferedIO::ENCODING = T.let(T.unsafe(nil), Encoding) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:8 +RedisClient::RubyConnection::BufferedIO::EOL = T.let(T.unsafe(nil), String) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection/buffered_io.rb:9 +RedisClient::RubyConnection::BufferedIO::EOL_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:164 +RedisClient::RubyConnection::KEEP_ALIVE_INTERVAL = T.let(T.unsafe(nil), Integer) + +# Longer than hiredis defaults +# +# pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:166 +RedisClient::RubyConnection::KEEP_ALIVE_PROBES = T.let(T.unsafe(nil), Integer) + +# Same as hiredis defaults +# +# pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:165 +RedisClient::RubyConnection::KEEP_ALIVE_TTL = T.let(T.unsafe(nil), Integer) + +# pkg:gem/redis-client#lib/redis_client/ruby_connection.rb:41 +RedisClient::RubyConnection::SUPPORTS_RESOLV_TIMEOUT = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:4 +class RedisClient::SentinelConfig + include ::RedisClient::Config::Common + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:12 + def initialize(sentinels:, sentinel_password: T.unsafe(nil), sentinel_username: T.unsafe(nil), role: T.unsafe(nil), name: T.unsafe(nil), url: T.unsafe(nil), **client_config); end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:118 + def check_role!(role); end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:97 + def host; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:10 + def name; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:105 + def path; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:101 + def port; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:87 + def reset; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:136 + def resolved?; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:109 + def retry_connecting?(attempt, error); end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:114 + def sentinel?; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:81 + def sentinels; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:93 + def server_key; end + + private + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:155 + def config; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:202 + def each_sentinel; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:228 + def refresh_sentinels(sentinel_client); end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:165 + def resolve_master; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:184 + def resolve_replica; end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:180 + def sentinel_client(sentinel_config); end + + # pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:144 + def sentinels_to_configs(sentinels); end +end + +# pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:8 +RedisClient::SentinelConfig::DEFAULT_RECONNECT_ATTEMPTS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/redis-client#lib/redis_client/sentinel_config.rb:7 +RedisClient::SentinelConfig::SENTINEL_DELAY = T.let(T.unsafe(nil), Float) + +# pkg:gem/redis-client#lib/redis_client.rb:172 +class RedisClient::TimeoutError < ::RedisClient::ConnectionError; end + +# pkg:gem/redis-client#lib/redis_client/url_config.rb:6 +class RedisClient::URLConfig + # pkg:gem/redis-client#lib/redis_client/url_config.rb:9 + def initialize(url); end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:30 + def db; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:56 + def host; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:48 + def password; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:62 + def path; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:68 + def port; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:26 + def ssl?; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:7 + def uri; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:7 + def url; end + + # pkg:gem/redis-client#lib/redis_client/url_config.rb:44 + def username; end +end + +# pkg:gem/redis-client#lib/redis_client.rb:165 +class RedisClient::UnsupportedServer < ::RedisClient::Error; end + +# pkg:gem/redis-client#lib/redis_client/version.rb:4 +RedisClient::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/redis-client#lib/redis_client.rb:174 +class RedisClient::WriteTimeoutError < ::RedisClient::TimeoutError; end + +# pkg:gem/redis-client#lib/redis_client.rb:217 +class RedisClient::WrongTypeError < ::RedisClient::CommandError; end diff --git a/sorbet/rbi/gems/regexp_parser@2.12.0.rbi b/sorbet/rbi/gems/regexp_parser@2.12.0.rbi new file mode 100644 index 0000000..db8a8ca --- /dev/null +++ b/sorbet/rbi/gems/regexp_parser@2.12.0.rbi @@ -0,0 +1,3398 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `regexp_parser` gem. +# Please instead update this file by running `bin/tapioca gem regexp_parser`. + + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:3 +module Regexp::Expression; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/alternation.rb:7 +class Regexp::Expression::Alternation < ::Regexp::Expression::SequenceOperation + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/alternation.rb:10 + def alternatives; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:11 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:132 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/alternation.rb:8 +Regexp::Expression::Alternation::OPERAND = Regexp::Expression::Alternative + +# A sequence of expressions, used by Alternation as one of its alternatives. +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/alternation.rb:5 +class Regexp::Expression::Alternative < ::Regexp::Expression::Sequence + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:12 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:4 +module Regexp::Expression::Anchor; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:20 +Regexp::Expression::Anchor::BOL = Regexp::Expression::Anchor::BeginningOfLine + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:22 +Regexp::Expression::Anchor::BOS = Regexp::Expression::Anchor::BeginningOfString + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:5 +class Regexp::Expression::Anchor::Base < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:149 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:7 +class Regexp::Expression::Anchor::BeginningOfLine < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:13 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:10 +class Regexp::Expression::Anchor::BeginningOfString < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:14 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:21 +Regexp::Expression::Anchor::EOL = Regexp::Expression::Anchor::EndOfLine + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:23 +Regexp::Expression::Anchor::EOS = Regexp::Expression::Anchor::EndOfString + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:24 +Regexp::Expression::Anchor::EOSobEOL = Regexp::Expression::Anchor::EndOfStringOrBeforeEndOfLine + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:8 +class Regexp::Expression::Anchor::EndOfLine < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:15 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:11 +class Regexp::Expression::Anchor::EndOfString < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:16 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:13 +class Regexp::Expression::Anchor::EndOfStringOrBeforeEndOfLine < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:17 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:18 +class Regexp::Expression::Anchor::MatchStart < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:18 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:16 +class Regexp::Expression::Anchor::NonWordBoundary < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:19 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:15 + def negative?; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/anchor.rb:15 +class Regexp::Expression::Anchor::WordBoundary < ::Regexp::Expression::Anchor::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:20 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:66 +module Regexp::Expression::Assertion; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:67 +class Regexp::Expression::Assertion::Base < ::Regexp::Expression::Group::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:149 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:69 +class Regexp::Expression::Assertion::Lookahead < ::Regexp::Expression::Assertion::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:21 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:72 +class Regexp::Expression::Assertion::Lookbehind < ::Regexp::Expression::Assertion::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:22 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:70 +class Regexp::Expression::Assertion::NegativeLookahead < ::Regexp::Expression::Assertion::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:23 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:16 + def negative?; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:73 +class Regexp::Expression::Assertion::NegativeLookbehind < ::Regexp::Expression::Assertion::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:24 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:17 + def negative?; end +end + +# alias for symmetry between token symbol and Expression class name +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:57 +Regexp::Expression::Backref = Regexp::Expression::Backreference + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:4 +module Regexp::Expression::Backreference; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:5 +class Regexp::Expression::Backreference::Base < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:157 + def match_length; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:142 + def referential?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:17 +class Regexp::Expression::Backreference::Name < ::Regexp::Expression::Backreference::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:21 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:25 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:18 + def name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:19 + def reference; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:33 +class Regexp::Expression::Backreference::NameCall < ::Regexp::Expression::Backreference::Name + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:26 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:45 +class Regexp::Expression::Backreference::NameRecursionLevel < ::Regexp::Expression::Backreference::Name + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:48 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:46 + def recursion_level; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:7 +class Regexp::Expression::Backreference::Number < ::Regexp::Expression::Backreference::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:11 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:27 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:8 + def number; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:9 + def reference; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:32 +class Regexp::Expression::Backreference::NumberCall < ::Regexp::Expression::Backreference::Number + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:29 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:34 +class Regexp::Expression::Backreference::NumberCallRelative < ::Regexp::Expression::Backreference::NumberRelative + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:30 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:36 +class Regexp::Expression::Backreference::NumberRecursionLevel < ::Regexp::Expression::Backreference::NumberRelative + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:39 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:37 + def recursion_level; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:27 +class Regexp::Expression::Backreference::NumberRelative < ::Regexp::Expression::Backreference::Number + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:28 + def effective_number; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:28 + def effective_number=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:28 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/backreference.rb:29 + def reference; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:4 +class Regexp::Expression::Base + include ::Regexp::Expression::Shared + include ::Regexp::Expression::ReferencedExpressions + extend ::Regexp::Expression::Shared::ClassMethods + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:7 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match.rb:13 + def =~(string, offset = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:30 + def a?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:27 + def ascii_classes?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:76 + def attributes; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:10 + def case_insensitive?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def conditional_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def conditional_level=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def custom_to_s_handling; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def custom_to_s_handling=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:25 + def d?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:22 + def default_classes?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:20 + def extended?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:16 + def free_spacing?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:49 + def greedy?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:13 + def i?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:14 + def ignore_case?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:56 + def lazy?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def level=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:8 + def m?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match.rb:10 + def match(string, offset = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match.rb:5 + def match?(string); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match.rb:8 + def matches?(string); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:5 + def multiline?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def nesting_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def options; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def options=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def parent; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def parent=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:58 + def possessive?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def pre_quantifier_decorations; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def pre_quantifier_decorations=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def quantifier; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:19 + def quantify(*args); end + + # Deprecated. Prefer `#repetitions` which has a more uniform interface. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:28 + def quantity; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:53 + def reluctant?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:33 + def repetitions; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def set_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def set_level=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/strfregexp.rb:100 + def strfre(format = T.unsafe(nil), indent_offset = T.unsafe(nil), index = T.unsafe(nil)); end + + # %l Level (depth) of the expression. Returns 'root' for the root + # expression, returns zero or higher for all others. + # + # %> Indentation at expression's level. + # + # %x Index of the expression at its depth. Available when using + # the sprintf_tree method only. + # + # %s Start offset within the whole expression. + # %e End offset within the whole expression. + # %S Length of expression. + # + # %o Coded offset and length, same as '@%s+%S' + # + # %y Type of expression. + # %k Token of expression. + # %i ID, same as '%y:%k' + # %c Class name + # + # %q Quantifier info, as {m[,M]} + # %Q Quantifier text + # + # %z Quantifier min + # %Z Quantifier max + # + # %t Base text of the expression (excludes quantifier, if any) + # %~t Full text if the expression is terminal, otherwise %i + # %T Full text of the expression (includes quantifier, if any) + # + # %b Basic info, same as '%o %i' + # %m Most info, same as '%b %q' + # %a All info, same as '%m %t' + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/strfregexp.rb:39 + def strfregexp(format = T.unsafe(nil), indent_offset = T.unsafe(nil), index = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def te; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def te=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def text; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def text=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:62 + def to_h; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:11 + def to_re(format = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def token; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def token=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def ts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def ts=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def type; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:5 + def type=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:35 + def u?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:32 + def unicode_classes?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/base.rb:23 + def unquantified_clone; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/options.rb:19 + def x?; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:4 +class Regexp::Expression::CharacterSet < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:8 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:18 + def close; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:5 + def closed; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:5 + def closed=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:6 + def closed?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:14 + def negate; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:5 + def negative; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:5 + def negative=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:18 + def negative?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:17 + def parts; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/intersection.rb:5 +class Regexp::Expression::CharacterSet::IntersectedSequence < ::Regexp::Expression::Sequence + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:31 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/intersection.rb:7 +class Regexp::Expression::CharacterSet::Intersection < ::Regexp::Expression::SequenceOperation + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:32 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/intersection.rb:8 +Regexp::Expression::CharacterSet::Intersection::OPERAND = Regexp::Expression::CharacterSet::IntersectedSequence + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/range.rb:5 +class Regexp::Expression::CharacterSet::Range < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/range.rb:10 + def <<(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/range.rb:16 + def complete?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:33 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:18 + def parts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set/range.rb:6 + def ts; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:4 +module Regexp::Expression::CharacterType; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:7 +class Regexp::Expression::CharacterType::Any < ::Regexp::Expression::CharacterType::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:34 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:5 +class Regexp::Expression::CharacterType::Base < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:19 + def negative?; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:8 +class Regexp::Expression::CharacterType::Digit < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:17 +class Regexp::Expression::CharacterType::ExtendedGrapheme < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:10 +class Regexp::Expression::CharacterType::Hex < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:16 +class Regexp::Expression::CharacterType::Linebreak < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:9 +class Regexp::Expression::CharacterType::NonDigit < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:11 +class Regexp::Expression::CharacterType::NonHex < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:15 +class Regexp::Expression::CharacterType::NonSpace < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:13 +class Regexp::Expression::CharacterType::NonWord < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:14 +class Regexp::Expression::CharacterType::Space < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_type.rb:12 +class Regexp::Expression::CharacterType::Word < ::Regexp::Expression::CharacterType::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/free_space.rb:10 +class Regexp::Expression::Comment < ::Regexp::Expression::FreeSpace + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:35 + def human_name; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:132 + def comment?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:4 +module Regexp::Expression::Conditional; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:20 +class Regexp::Expression::Conditional::Branch < ::Regexp::Expression::Sequence + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:36 + def human_name; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:11 +class Regexp::Expression::Conditional::Condition < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:37 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:149 + def match_length; end + + # Name or number of the referenced capturing group that determines state. + # Returns a String if reference is by name, Integer if by number. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:14 + def reference; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:143 + def referential?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:22 +class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:23 + def <<(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:27 + def add_sequence(active_opts = T.unsafe(nil), params = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:32 + def branch(active_opts = T.unsafe(nil), params = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:43 + def branches; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:39 + def condition; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:34 + def condition=(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:38 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:132 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:19 + def parts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:47 + def reference; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:144 + def referential?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:5 +class Regexp::Expression::Conditional::TooManyBranches < ::Regexp::Parser::Error + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/conditional.rb:6 + def initialize; end +end + +# alias for symmetry between Token::* and Expression::* +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:32 +Regexp::Expression::Escape = Regexp::Expression::EscapeSequence + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:4 +module Regexp::Expression::EscapeSequence; end + +# e.g. \xE2\x82\xAC +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:25 +class Regexp::Expression::EscapeSequence::AbstractMetaControlSequence < ::Regexp::Expression::EscapeSequence::Base + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:48 + def control_sequence_to_s(control_sequence); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:53 + def meta_char_to_codepoint(meta_char); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:7 +class Regexp::Expression::EscapeSequence::AsciiEscape < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:4 + def codepoint; end +end + +# \e +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:8 +class Regexp::Expression::EscapeSequence::Backspace < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:5 + def codepoint; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:5 +class Regexp::Expression::EscapeSequence::Base < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_char.rb:4 + def char; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end +end + +# \b +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:9 +class Regexp::Expression::EscapeSequence::Bell < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:6 + def codepoint; end +end + +# e.g. \x0A +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:20 +class Regexp::Expression::EscapeSequence::Codepoint < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:18 + def codepoint; end +end + +# e.g. \u000A +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:22 +class Regexp::Expression::EscapeSequence::CodepointList < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:28 + def char; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:36 + def chars; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:32 + def codepoint; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:40 + def codepoints; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:166 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:26 +class Regexp::Expression::EscapeSequence::Control < ::Regexp::Expression::EscapeSequence::AbstractMetaControlSequence + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:60 + def codepoint; end +end + +# \a +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:10 +class Regexp::Expression::EscapeSequence::FormFeed < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:7 + def codepoint; end +end + +# e.g. \012 +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:19 +class Regexp::Expression::EscapeSequence::Hex < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:17 + def codepoint; end +end + +# \v +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:16 +class Regexp::Expression::EscapeSequence::Literal < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:13 + def codepoint; end +end + +# e.g. \cB +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:27 +class Regexp::Expression::EscapeSequence::Meta < ::Regexp::Expression::EscapeSequence::AbstractMetaControlSequence + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:66 + def codepoint; end +end + +# e.g. \M-Z +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:28 +class Regexp::Expression::EscapeSequence::MetaControl < ::Regexp::Expression::EscapeSequence::AbstractMetaControlSequence + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:72 + def codepoint; end +end + +# \f +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:11 +class Regexp::Expression::EscapeSequence::Newline < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:8 + def codepoint; end +end + +# e.g. \j, \@, \😀 (ineffectual escapes) +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:18 +class Regexp::Expression::EscapeSequence::Octal < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:15 + def codepoint; end +end + +# \n +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:12 +class Regexp::Expression::EscapeSequence::Return < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:9 + def codepoint; end +end + +# \r +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:13 +class Regexp::Expression::EscapeSequence::Tab < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:10 + def codepoint; end +end + +# e.g. \u{A B} +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:23 +class Regexp::Expression::EscapeSequence::UTF8Hex < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:21 + def codepoint; end +end + +# \t +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/escape_sequence.rb:14 +class Regexp::Expression::EscapeSequence::VerticalTab < ::Regexp::Expression::EscapeSequence::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb:11 + def codepoint; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/free_space.rb:4 +class Regexp::Expression::FreeSpace < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:149 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/free_space.rb:5 + def quantify(*_args); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:137 + def decorative?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:4 +module Regexp::Expression::Group; end + +# Special case. Absence group can match 0.. chars, irrespective of content. +# TODO: in theory, they *can* exclude match lengths with `.`: `(?~.{3})` +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:21 +class Regexp::Expression::Group::Absence < ::Regexp::Expression::Group::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:174 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:22 +class Regexp::Expression::Group::Atomic < ::Regexp::Expression::Group::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:5 +class Regexp::Expression::Group::Base < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:20 + def parts; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:42 +class Regexp::Expression::Group::Capture < ::Regexp::Expression::Group::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:39 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:44 + def identifier; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:43 + def number; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:43 + def number=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:43 + def number_at_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:43 + def number_at_level=(_arg0); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:128 + def capturing?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:62 +class Regexp::Expression::Group::Comment < ::Regexp::Expression::Group::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:22 + def parts; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:133 + def comment?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:138 + def decorative?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:47 +class Regexp::Expression::Group::Named < ::Regexp::Expression::Group::Capture + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:51 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:40 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:49 + def identifier; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:48 + def name; end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:56 + def initialize_copy(orig); end +end + +# TODO: should split off OptionsSwitch in v3.0.0. Maybe even make it no +# longer inherit from Group because it is effectively a terminal expression. +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:25 +class Regexp::Expression::Group::Options < ::Regexp::Expression::Group::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:26 + def option_changes; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:26 + def option_changes=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:33 + def quantify(*args); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:28 + def initialize_copy(orig); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:8 +class Regexp::Expression::Group::Passive < ::Regexp::Expression::Group::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:11 + def initialize(*); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:9 + def implicit=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/group.rb:16 + def implicit?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:21 + def parts; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/keep.rb:4 +module Regexp::Expression::Keep; end + +# TODO: in regexp_parser v3.0.0 this should possibly be a Subexpression +# that contains all expressions to its left. +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/keep.rb:7 +class Regexp::Expression::Keep::Mark < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:41 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:149 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/literal.rb:4 +class Regexp::Expression::Literal < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:42 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:107 + def match_length; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:87 +Regexp::Expression::MatchLength = Regexp::MatchLength + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/posix_class.rb:12 +Regexp::Expression::Nonposixclass = Regexp::Expression::PosixClass + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:120 +Regexp::Expression::Nonproperty = Regexp::Expression::UnicodeProperty + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/posix_class.rb:4 +class Regexp::Expression::PosixClass < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/posix_class.rb:5 + def name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:20 + def negative?; end +end + +# alias for symmetry between token symbol and Expression class name +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/posix_class.rb:11 +Regexp::Expression::Posixclass = Regexp::Expression::PosixClass + +# alias for symmetry between token symbol and Expression class name +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:119 +Regexp::Expression::Property = Regexp::Expression::UnicodeProperty + +# TODO: in v3.0.0, maybe put Shared back into Base, and inherit from Base and +# call super in #initialize, but raise in #quantifier= and #quantify, +# or introduce an Expression::Quantifiable intermediate class. +# Or actually allow chaining as a more concise but tricky solution than PR#69. +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:8 +class Regexp::Expression::Quantifier + include ::Regexp::Expression::Shared + extend ::Regexp::Expression::Shared::ClassMethods + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:13 + def initialize(*args); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def conditional_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def conditional_level=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def custom_to_s_handling; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def custom_to_s_handling=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:32 + def greedy?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:38 + def lazy?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def level=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:44 + def max; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:40 + def min; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:48 + def mode; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def nesting_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def options; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def options=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def parent; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def parent=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:32 + def possessive?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def pre_quantifier_decorations; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def pre_quantifier_decorations=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def quantifier; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:32 + def reluctant?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def set_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def set_level=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def te; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def te=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def text; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def text=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:21 + def to_h; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def token; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def token=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def ts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def ts=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def type; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:9 + def type=(_arg0); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:54 + def deprecated_old_init(token, text, _min, _max, _mode = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:66 + def derived_data; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/quantifier.rb:11 +Regexp::Expression::Quantifier::MODES = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/referenced_expressions.rb:4 +module Regexp::Expression::ReferencedExpressions + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/referenced_expressions.rb:7 + def referenced_expression; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/referenced_expressions.rb:5 + def referenced_expressions; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/referenced_expressions.rb:5 + def referenced_expressions=(_arg0); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/referenced_expressions.rb:11 + def initialize_copy(orig); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/root.rb:4 +class Regexp::Expression::Root < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:43 + def human_name; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/root.rb:5 + def build(options = T.unsafe(nil)); end + end +end + +# A sequence of expressions. Differs from a Subexpressions by how it handles +# quantifiers, as it applies them to its last element instead of itself as +# a whole subexpression. +# +# Used as the base class for the Alternation alternatives, Conditional +# branches, and CharacterSet::Intersection intersected sequences. +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence.rb:10 +class Regexp::Expression::Sequence < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence.rb:29 + def quantify(token, *args); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence.rb:25 + def ts; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence.rb:12 + def add_to(exp, params = T.unsafe(nil), active_opts = T.unsafe(nil)); end + end +end + +# abstract class +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:5 +class Regexp::Expression::SequenceOperation < ::Regexp::Expression::Subexpression + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:14 + def <<(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:18 + def add_sequence(active_opts = T.unsafe(nil), params = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:7 + def operands; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:8 + def operator; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:24 + def parts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:6 + def sequences; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/sequence_operation.rb:10 + def ts; end +end + +# alias for symmetry between token symbol and Expression class name +# +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/character_set.rb:24 +Regexp::Expression::Set = Regexp::Expression::CharacterSet + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:4 +module Regexp::Expression::Shared + mixes_in_class_methods ::Regexp::Expression::Shared::ClassMethods + + # Deep-compare two expressions for equality. + # + # When changing the conditions, please make sure to update + # #pretty_print_instance_variables so that it includes all relevant values. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:103 + def ==(other); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:110 + def ===(other); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:53 + def base_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:126 + def capturing?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:99 + def coded_offset; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:130 + def comment?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:135 + def decorative?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:49 + def ends_at(include_quantifier = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:111 + def eql?(other); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:57 + def full_length; end + + # default implementation, e.g. "atomic group", "hex escape", "word type", .. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:6 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/printing.rb:5 + def inspect; end + + # Test if this expression has the given test_token, and optionally a given + # test_type. + # + # # Any expressions + # exp.is? :* # always returns true + # + # # is it a :capture + # exp.is? :capture + # + # # is it a :character and a :set + # exp.is? :character, :set + # + # # is it a :meta :dot + # exp.is? :dot, :meta + # + # # is it a :meta or :escape :dot + # exp.is? :dot, [:meta, :escape] + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:38 + def is?(test_token, test_type = T.unsafe(nil)); end + + # not an alias so as to respect overrides of #negative? + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:10 + def negated?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:5 + def negative?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:103 + def nesting_level=(lvl); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:95 + def offset; end + + # Test if this expression matches an entry in the given scope spec. + # + # A scope spec can be one of: + # + # . An array: Interpreted as a set of tokens, tested for inclusion + # of the expression's token. + # + # . A hash: Where the key is interpreted as the expression type + # and the value is either a symbol or an array. In this + # case, when the scope is a hash, one_of? calls itself to + # evaluate the key's value. + # + # . A symbol: matches the expression's token or type, depending on + # the level of the call. If one_of? is called directly with + # a symbol then it will always be checked against the + # type of the expression. If it's being called for a value + # from a hash, it will be checked against the token of the + # expression. + # + # # any expression + # exp.one_of?(:*) # always true + # + # # like exp.type?(:group) + # exp.one_of?(:group) + # + # # any expression of type meta + # exp.one_of?(:meta => :*) + # + # # meta dots and alternations + # exp.one_of?(:meta => [:dot, :alternation]) + # + # # meta dots and any set tokens + # exp.one_of?({meta: [:dot], set: :*}) + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:77 + def one_of?(scope, top = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:113 + def optional?; end + + # default implementation + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:6 + def parts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:87 + def pre_quantifier_decoration(expression_format = T.unsafe(nil)); end + + # Make pretty-print work despite #inspect implementation. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/printing.rb:14 + def pretty_print(q); end + + # Called by pretty_print (ruby/pp) and #inspect. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/printing.rb:19 + def pretty_print_instance_variables; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:117 + def quantified?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:109 + def quantifier=(qtf); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:91 + def quantifier_affix(expression_format = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:140 + def referential?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:45 + def starts_at; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:122 + def terminal?; end + + # #to_s reproduces the original source, as an unparser would. + # + # It takes an optional format argument. + # + # Example: + # + # lit = Regexp::Parser.parse(/a +/x)[0] + # + # lit.to_s # => 'a+' # default; with quantifier + # lit.to_s(:full) # => 'a+' # default; with quantifier + # lit.to_s(:base) # => 'a' # without quantifier + # lit.to_s(:original) # => 'a +' # with quantifier AND intermittent decorations + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:74 + def to_s(format = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:85 + def to_str(format = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/construct.rb:39 + def token_class; end + + # Test if this expression has the given test_type, which can be either + # a symbol or an array of symbols to check against the expression's type. + # + # # is it a :group expression + # exp.type? :group + # + # # is it a :set, or :meta + # exp.type? [:set, :meta] + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:15 + def type?(test_type); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:20 + def init_from_token_and_options(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:34 + def initialize_copy(orig); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:12 + def intersperse(expressions, separator); end + + class << self + # filled in ./methods/*.rb + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:7 + def included(mod); end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/shared.rb:5 +module Regexp::Expression::Shared::ClassMethods + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:127 + def capturing?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:131 + def comment?; end + + # Convenience method to init a valid Expression without a Regexp::Token + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/construct.rb:7 + def construct(params = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/construct.rb:17 + def construct_defaults; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:136 + def decorative?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:141 + def referential?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:123 + def terminal?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/construct.rb:27 + def token_class; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:4 +class Regexp::Expression::Subexpression < ::Regexp::Expression::Base + include ::Enumerable + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:9 + def initialize(token, options = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:22 + def <<(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def [](*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def at(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:35 + def dig(*indices); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def each(*args, &block); end + + # Traverses the expression, passing each recursive child to the + # given block. + # If the block takes two arguments, the indices of the children within + # their parents are also passed to it. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/traverse.rb:10 + def each_expression(include_self = T.unsafe(nil), &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def empty?(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:7 + def expressions; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:7 + def expressions=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:52 + def extract_quantifier_target(quantifier_description); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def fetch(*args, &block); end + + # Returns a new array with the results of calling the given block once + # for every expression. If a block is not given, returns an array with + # each expression and its level index as an array. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/traverse.rb:58 + def flat_map(include_self = T.unsafe(nil), &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def index(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:120 + def inner_match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def join(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def last(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def length(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:113 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/parts.rb:23 + def parts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/strfregexp.rb:114 + def strfre_tree(format = T.unsafe(nil), include_self = T.unsafe(nil), separator = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/strfregexp.rb:104 + def strfregexp_tree(format = T.unsafe(nil), include_self = T.unsafe(nil), separator = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:41 + def te; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:45 + def to_h; end + + # Traverses the subexpression (depth-first, pre-order) and calls the given + # block for each expression with three arguments; the traversal event, + # the expression, and the index of the expression within its parent. + # + # The event argument is passed as follows: + # + # - For subexpressions, :enter upon entering the subexpression, and + # :exit upon exiting it. + # + # - For terminal expressions, :visit is called once. + # + # Returns self. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/traverse.rb:34 + def traverse(include_self = T.unsafe(nil), &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:28 + def values_at(*args, &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/traverse.rb:53 + def walk(include_self = T.unsafe(nil), &block); end + + protected + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/traverse.rb:68 + def each_expression_with_index(&block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/traverse.rb:75 + def each_expression_without_index(&block); end + + private + + # Override base method to clone the expressions as well. + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/subexpression.rb:15 + def initialize_copy(orig); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/tests.rb:124 + def terminal?; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:4 +module Regexp::Expression::UnicodeProperty; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:110 +class Regexp::Expression::UnicodeProperty::Age < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:15 +class Regexp::Expression::UnicodeProperty::Alnum < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:16 +class Regexp::Expression::UnicodeProperty::Alpha < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:33 +class Regexp::Expression::UnicodeProperty::Any < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:17 +class Regexp::Expression::UnicodeProperty::Ascii < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:34 +class Regexp::Expression::UnicodeProperty::Assigned < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:5 +class Regexp::Expression::UnicodeProperty::Base < ::Regexp::Expression::Base + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:99 + def match_length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:6 + def name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/negative.rb:21 + def negative?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:10 + def shortcut; end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:18 +class Regexp::Expression::UnicodeProperty::Blank < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:111 +class Regexp::Expression::UnicodeProperty::Block < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:19 +class Regexp::Expression::UnicodeProperty::Cntrl < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:99 +module Regexp::Expression::UnicodeProperty::Codepoint; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:102 +class Regexp::Expression::UnicodeProperty::Codepoint::Any < ::Regexp::Expression::UnicodeProperty::Codepoint::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:100 +class Regexp::Expression::UnicodeProperty::Codepoint::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:103 +class Regexp::Expression::UnicodeProperty::Codepoint::Control < ::Regexp::Expression::UnicodeProperty::Codepoint::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:104 +class Regexp::Expression::UnicodeProperty::Codepoint::Format < ::Regexp::Expression::UnicodeProperty::Codepoint::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:106 +class Regexp::Expression::UnicodeProperty::Codepoint::PrivateUse < ::Regexp::Expression::UnicodeProperty::Codepoint::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:105 +class Regexp::Expression::UnicodeProperty::Codepoint::Surrogate < ::Regexp::Expression::UnicodeProperty::Codepoint::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:107 +class Regexp::Expression::UnicodeProperty::Codepoint::Unassigned < ::Regexp::Expression::UnicodeProperty::Codepoint::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:112 +class Regexp::Expression::UnicodeProperty::Derived < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:20 +class Regexp::Expression::UnicodeProperty::Digit < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:113 +class Regexp::Expression::UnicodeProperty::Emoji < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:114 +class Regexp::Expression::UnicodeProperty::Enumerated < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:21 +class Regexp::Expression::UnicodeProperty::Graph < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:36 +module Regexp::Expression::UnicodeProperty::Letter; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:39 +class Regexp::Expression::UnicodeProperty::Letter::Any < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:37 +class Regexp::Expression::UnicodeProperty::Letter::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:40 +class Regexp::Expression::UnicodeProperty::Letter::Cased < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:42 +class Regexp::Expression::UnicodeProperty::Letter::Lowercase < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:44 +class Regexp::Expression::UnicodeProperty::Letter::Modifier < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:45 +class Regexp::Expression::UnicodeProperty::Letter::Other < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:43 +class Regexp::Expression::UnicodeProperty::Letter::Titlecase < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:41 +class Regexp::Expression::UnicodeProperty::Letter::Uppercase < ::Regexp::Expression::UnicodeProperty::Letter::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:22 +class Regexp::Expression::UnicodeProperty::Lower < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:48 +module Regexp::Expression::UnicodeProperty::Mark; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:51 +class Regexp::Expression::UnicodeProperty::Mark::Any < ::Regexp::Expression::UnicodeProperty::Mark::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:49 +class Regexp::Expression::UnicodeProperty::Mark::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:52 +class Regexp::Expression::UnicodeProperty::Mark::Combining < ::Regexp::Expression::UnicodeProperty::Mark::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:55 +class Regexp::Expression::UnicodeProperty::Mark::Enclosing < ::Regexp::Expression::UnicodeProperty::Mark::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:53 +class Regexp::Expression::UnicodeProperty::Mark::Nonspacing < ::Regexp::Expression::UnicodeProperty::Mark::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:54 +class Regexp::Expression::UnicodeProperty::Mark::Spacing < ::Regexp::Expression::UnicodeProperty::Mark::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:31 +class Regexp::Expression::UnicodeProperty::Newline < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:58 +module Regexp::Expression::UnicodeProperty::Number; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:61 +class Regexp::Expression::UnicodeProperty::Number::Any < ::Regexp::Expression::UnicodeProperty::Number::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:59 +class Regexp::Expression::UnicodeProperty::Number::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:62 +class Regexp::Expression::UnicodeProperty::Number::Decimal < ::Regexp::Expression::UnicodeProperty::Number::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:63 +class Regexp::Expression::UnicodeProperty::Number::Letter < ::Regexp::Expression::UnicodeProperty::Number::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:64 +class Regexp::Expression::UnicodeProperty::Number::Other < ::Regexp::Expression::UnicodeProperty::Number::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:23 +class Regexp::Expression::UnicodeProperty::Print < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:24 +class Regexp::Expression::UnicodeProperty::Punct < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:67 +module Regexp::Expression::UnicodeProperty::Punctuation; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:70 +class Regexp::Expression::UnicodeProperty::Punctuation::Any < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:68 +class Regexp::Expression::UnicodeProperty::Punctuation::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:74 +class Regexp::Expression::UnicodeProperty::Punctuation::Close < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:71 +class Regexp::Expression::UnicodeProperty::Punctuation::Connector < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:72 +class Regexp::Expression::UnicodeProperty::Punctuation::Dash < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:76 +class Regexp::Expression::UnicodeProperty::Punctuation::Final < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:75 +class Regexp::Expression::UnicodeProperty::Punctuation::Initial < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:73 +class Regexp::Expression::UnicodeProperty::Punctuation::Open < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:77 +class Regexp::Expression::UnicodeProperty::Punctuation::Other < ::Regexp::Expression::UnicodeProperty::Punctuation::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:115 +class Regexp::Expression::UnicodeProperty::Script < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:80 +module Regexp::Expression::UnicodeProperty::Separator; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:83 +class Regexp::Expression::UnicodeProperty::Separator::Any < ::Regexp::Expression::UnicodeProperty::Separator::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:81 +class Regexp::Expression::UnicodeProperty::Separator::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:85 +class Regexp::Expression::UnicodeProperty::Separator::Line < ::Regexp::Expression::UnicodeProperty::Separator::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:86 +class Regexp::Expression::UnicodeProperty::Separator::Paragraph < ::Regexp::Expression::UnicodeProperty::Separator::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:84 +class Regexp::Expression::UnicodeProperty::Separator::Space < ::Regexp::Expression::UnicodeProperty::Separator::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:25 +class Regexp::Expression::UnicodeProperty::Space < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:89 +module Regexp::Expression::UnicodeProperty::Symbol; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:92 +class Regexp::Expression::UnicodeProperty::Symbol::Any < ::Regexp::Expression::UnicodeProperty::Symbol::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:90 +class Regexp::Expression::UnicodeProperty::Symbol::Base < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:94 +class Regexp::Expression::UnicodeProperty::Symbol::Currency < ::Regexp::Expression::UnicodeProperty::Symbol::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:93 +class Regexp::Expression::UnicodeProperty::Symbol::Math < ::Regexp::Expression::UnicodeProperty::Symbol::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:95 +class Regexp::Expression::UnicodeProperty::Symbol::Modifier < ::Regexp::Expression::UnicodeProperty::Symbol::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:96 +class Regexp::Expression::UnicodeProperty::Symbol::Other < ::Regexp::Expression::UnicodeProperty::Symbol::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:26 +class Regexp::Expression::UnicodeProperty::Upper < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:27 +class Regexp::Expression::UnicodeProperty::Word < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:29 +class Regexp::Expression::UnicodeProperty::XPosixPunct < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/unicode_property.rb:28 +class Regexp::Expression::UnicodeProperty::Xdigit < ::Regexp::Expression::UnicodeProperty::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/free_space.rb:13 +class Regexp::Expression::WhiteSpace < ::Regexp::Expression::FreeSpace + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/human_name.rb:44 + def human_name; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/classes/free_space.rb:14 + def merge(exp); end +end + +# A very thin wrapper around the scanner that breaks quantified literal runs, +# collects emitted tokens into an array, calculates their nesting depth, and +# normalizes tokens for the parser, and checks if they are implemented by the +# given syntax flavor. +# +# pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:7 +class Regexp::Lexer + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:73 + def emit(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:22 + def lex(input, syntax = T.unsafe(nil), options: T.unsafe(nil), collect_tokens: T.unsafe(nil), &block); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:93 + def ascend(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def block; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def block=(_arg0); end + + # if a codepoint list is followed by a quantifier, that quantifier applies + # to the last codepoint, e.g. /\u{61 62 63}{3}/ =~ 'abccc' + # c.f. #break_literal. + # + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:145 + def break_codepoint_list(token); end + + # called by scan to break a literal run that is longer than one character + # into two separate tokens when it is followed by a quantifier + # + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:125 + def break_literal(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def collect_tokens; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def collect_tokens=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def conditional_nesting; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def conditional_nesting=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:108 + def descend(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:164 + def merge_condition(current, last); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def nesting; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def nesting=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def preprev_token; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def preprev_token=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def prev_token; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def prev_token=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def set_nesting; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def set_nesting=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def shift; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def shift=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def tokens; end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:89 + def tokens=(_arg0); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:18 + def lex(input, syntax = T.unsafe(nil), options: T.unsafe(nil), collect_tokens: T.unsafe(nil), &block); end + + # pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:84 + def scan(input, syntax = T.unsafe(nil), options: T.unsafe(nil), collect_tokens: T.unsafe(nil), &block); end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:14 +Regexp::Lexer::CLOSING_TOKENS = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:16 +Regexp::Lexer::CONDITION_TOKENS = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/lexer.rb:9 +Regexp::Lexer::OPENING_TOKENS = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:3 +class Regexp::MatchLength + include ::Enumerable + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:11 + def initialize(exp, opts = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:26 + def each(opts = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:37 + def endless_each; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:46 + def fixed?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:42 + def include?(length); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:62 + def inspect; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:54 + def max; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:50 + def min; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:58 + def minmax; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:67 + def to_re; end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def base_max; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def base_max=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def base_min; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def base_min=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def exp_class; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def exp_class=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def max_rep; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def max_rep=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def min_rep; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def min_rep=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def reify; end + + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:73 + def reify=(_arg0); end + + # ruby >= 2.4 + # + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:76 + def test_regexp; end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/expression/methods/match_length.rb:6 + def of(obj); end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/version.rb:4 +class Regexp::Parser + include ::Regexp::Expression + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:27 + def parse(input, syntax = T.unsafe(nil), options: T.unsafe(nil), &block); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:577 + def active_opts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:101 + def anchor(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:264 + def assign_effective_number(exp); end + + # Assigns referenced expressions to referring expressions, e.g. if there is + # an instance of Backreference::Number, its #referenced_expression is set to + # the instance of Group::Capture that it refers to via its number. + # + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:584 + def assign_referenced_expressions; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:229 + def backref(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:204 + def captured_group_count_at_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def captured_group_counts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def captured_group_counts=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:573 + def close_completed_character_set_range; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:212 + def close_group; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:541 + def close_set; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:271 + def conditional(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def conditional_nesting; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def conditional_nesting=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:208 + def count_captured_group; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:218 + def decrease_nesting; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:307 + def escape(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:62 + def extract_options(input, options); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:352 + def free_space(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:116 + def group(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:512 + def increase_group_level(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:552 + def intersection(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:363 + def keep(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:367 + def literal(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:371 + def meta(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:537 + def negate_set; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:301 + def nest(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:296 + def nest_conditional(exp); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def nesting; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def nesting=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def node; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def node=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:167 + def open_group(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:530 + def open_set(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:132 + def options_group(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def options_stack; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def options_stack=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:78 + def parse_token(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:393 + def posixclass(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:400 + def property(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:482 + def quantifier(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:545 + def range(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def root; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def root=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:382 + def sequence_operation(klass, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:518 + def set(token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def switching_options; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:58 + def switching_options=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:200 + def total_captured_group_count; end + + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:556 + def type(token); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:23 + def parse(input, syntax = T.unsafe(nil), options: T.unsafe(nil), &block); end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:130 +Regexp::Parser::ENC_FLAGS = T.let(T.unsafe(nil), Array) + +# base class for all gem-specific errors +# +# pkg:gem/regexp_parser#lib/regexp_parser/error.rb:5 +class Regexp::Parser::Error < ::StandardError; end + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:129 +Regexp::Parser::MOD_FLAGS = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:9 +class Regexp::Parser::ParserError < ::Regexp::Parser::Error; end + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:397 +Regexp::Parser::UP = Regexp::Expression::UnicodeProperty + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:398 +Regexp::Parser::UPTokens = Regexp::Syntax::Token::UnicodeProperty + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:17 +class Regexp::Parser::UnknownTokenError < ::Regexp::Parser::ParserError + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:18 + def initialize(type, token); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:11 +class Regexp::Parser::UnknownTokenTypeError < ::Regexp::Parser::ParserError + # pkg:gem/regexp_parser#lib/regexp_parser/parser.rb:12 + def initialize(type, token); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/version.rb:5 +Regexp::Parser::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/scanner_error.rb:5 +class Regexp::Scanner + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2509 + def capturing_group_count; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2509 + def capturing_group_count=(_arg0); end + + # Emits an array with the details of the scanned pattern + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2484 + def emit(type, token, text); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2509 + def literal_run; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2509 + def literal_run=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:24 + def scan(input_object, options: T.unsafe(nil), collect_tokens: T.unsafe(nil), &block); end + + private + + # Appends one or more characters to the literal buffer, to be emitted later + # by a call to emit_literal. + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2555 + def append_literal(data, ts, te); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def block; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def block=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def char_pos; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def char_pos=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def collect_tokens; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def collect_tokens=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def conditional_stack; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def conditional_stack=(_arg0); end + + # Copy from ts to te from data as text + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2549 + def copy(data, ts, te); end + + # Emits the literal run collected by calls to the append_literal method. + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2560 + def emit_literal; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2595 + def emit_meta_control_sequence(data, ts, te, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2566 + def emit_options(text); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2520 + def extract_encoding(input_object, options); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def free_spacing; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def free_spacing=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2528 + def free_spacing?(input_object, options); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def group_depth; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def group_depth=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2540 + def in_group?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2544 + def in_set?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def prev_token; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def prev_token=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def regexp_encoding; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def regexp_encoding=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def set_depth; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def set_depth=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def spacing_stack; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def spacing_stack=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def tokens; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2513 + def tokens=(_arg0); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2469 + def long_prop_map; end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2473 + def parse_prop_map(name); end + + # Scans the given regular expression text, or Regexp object and collects the + # emitted token into an array that gets returned at the end. If a block is + # given, it gets called for each emitted token. + # + # This method may raise errors if a syntax error is encountered. + # -------------------------------------------------------------------------- + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:20 + def scan(input_object, options: T.unsafe(nil), collect_tokens: T.unsafe(nil), &block); end + + # lazy-load property maps when first needed + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2465 + def short_prop_map; end + end +end + +# Invalid back reference. Used for name a number refs/calls. +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:46 +class Regexp::Scanner::InvalidBackrefError < ::Regexp::Scanner::ValidationError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:47 + def initialize(what, reason); end +end + +# Invalid group. Used for named groups. +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:31 +class Regexp::Scanner::InvalidGroupError < ::Regexp::Scanner::ValidationError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:32 + def initialize(what, reason); end +end + +# Invalid groupOption. Used for inline options. +# TODO: should become InvalidGroupOptionError in v3.0.0 for consistency +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:39 +class Regexp::Scanner::InvalidGroupOption < ::Regexp::Scanner::ValidationError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:40 + def initialize(option, text); end +end + +# Invalid sequence format. Used for escape sequences, mainly. +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:24 +class Regexp::Scanner::InvalidSequenceError < ::Regexp::Scanner::ValidationError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:25 + def initialize(what = T.unsafe(nil), where = T.unsafe(nil)); end +end + +# Use each_with_object for required_ruby_version >= 2.2,or #to_h for >= 2.6 +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner.rb:2478 +Regexp::Scanner::POSIX_CLASSES = T.let(T.unsafe(nil), Hash) + +# Unexpected end of pattern +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/premature_end_error.rb:5 +class Regexp::Scanner::PrematureEndError < ::Regexp::Scanner::ScannerError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/premature_end_error.rb:6 + def initialize(where = T.unsafe(nil)); end +end + +# General scanner error (catch all) +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/scanner_error.rb:7 +class Regexp::Scanner::ScannerError < ::Regexp::Parser::Error; end + +# The POSIX class name was not recognized by the scanner. +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:60 +class Regexp::Scanner::UnknownPosixClassError < ::Regexp::Scanner::ValidationError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:61 + def initialize(text, _); end +end + +# The property name was not recognized by the scanner. +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:53 +class Regexp::Scanner::UnknownUnicodePropertyError < ::Regexp::Scanner::ValidationError + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:54 + def initialize(name, _); end +end + +# Base for all scanner validation errors +# +# pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:5 +class Regexp::Scanner::ValidationError < ::Regexp::Scanner::ScannerError + class << self + # Centralizes and unifies the handling of validation related errors. + # + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:7 + def for(type, problem, reason = T.unsafe(nil)); end + + # pkg:gem/regexp_parser#lib/regexp_parser/scanner/errors/validation_error.rb:11 + def types; end + end +end + +# Define the base module and the simplest of tokens. +# After loading all the tokens the map is full. Extract all tokens and types +# into the All and Types constants. +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax.rb:5 +module Regexp::Syntax + private + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:63 + def comparable(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:46 + def const_missing(const_name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:53 + def fallback_version_class(version); end + + # Returns the syntax specification class for the given syntax + # version name. The special names 'any' and '*' return Syntax::Any. + # + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:24 + def for(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:28 + def new(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:59 + def specified_versions; end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:34 + def supported?(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:38 + def version_class(version); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:63 + def comparable(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:46 + def const_missing(const_name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:53 + def fallback_version_class(version); end + + # Returns the syntax specification class for the given syntax + # version name. The special names 'any' and '*' return Syntax::Any. + # + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:24 + def for(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:28 + def new(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:59 + def specified_versions; end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:34 + def supported?(name); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:38 + def version_class(version); end + end +end + +# A syntax that always returns true, passing all tokens as implemented. This +# is useful during development, testing, and should be useful for some types +# of transformations as well. +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/any.rb:7 +class Regexp::Syntax::Any < ::Regexp::Syntax::Base + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/any.rb:10 + def implements?(_type, _token); end + end +end + +# A lookup map of supported types and tokens in a given syntax +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:11 +class Regexp::Syntax::Base + include ::Regexp::Syntax::Token + + # TODO: drop this backwards compatibility code in v3.0.0, do `private :new` + # + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:101 + def initialize; end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:106 + def method_missing(name, *args); end + + private + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:117 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:48 + def added_features; end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:46 + def check!(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:36 + def check?(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:28 + def excludes(type, tokens); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:15 + def features; end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:15 + def features=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:38 + def implementations(type); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:23 + def implements(type, tokens); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:42 + def implements!(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:33 + def implements?(type, token); end + + # automatically inherit features through the syntax class hierarchy + # + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:18 + def inherited(subclass); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:56 + def normalize(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:76 + def normalize_backref(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:67 + def normalize_group(type, token); end + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:52 + def removed_features; end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions.rb:10 +Regexp::Syntax::CURRENT = Regexp::Syntax::V4_0_0 + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:8 +class Regexp::Syntax::InvalidVersionNameError < ::Regexp::Syntax::SyntaxError + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:9 + def initialize(name); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:4 +class Regexp::Syntax::NotImplementedError < ::Regexp::Syntax::SyntaxError + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/base.rb:5 + def initialize(syntax, type, token); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax.rb:6 +class Regexp::Syntax::SyntaxError < ::Regexp::Parser::Error; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:5 +module Regexp::Syntax::Token; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:44 +Regexp::Syntax::Token::All = T.let(T.unsafe(nil), Array) + +# alias for symmetry between Token::* and Expression::* +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:17 +module Regexp::Syntax::Token::Alternation; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:18 +Regexp::Syntax::Token::Alternation::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:19 +Regexp::Syntax::Token::Alternation::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:5 +module Regexp::Syntax::Token::Anchor; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:11 +Regexp::Syntax::Token::Anchor::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:6 +Regexp::Syntax::Token::Anchor::Basic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:7 +Regexp::Syntax::Token::Anchor::Extended = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:9 +Regexp::Syntax::Token::Anchor::MatchStart = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:8 +Regexp::Syntax::Token::Anchor::String = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/anchor.rb:12 +Regexp::Syntax::Token::Anchor::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/assertion.rb:5 +module Regexp::Syntax::Token::Assertion; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/assertion.rb:9 +Regexp::Syntax::Token::Assertion::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/assertion.rb:6 +Regexp::Syntax::Token::Assertion::Lookahead = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/assertion.rb:7 +Regexp::Syntax::Token::Assertion::Lookbehind = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/assertion.rb:10 +Regexp::Syntax::Token::Assertion::Type = T.let(T.unsafe(nil), Symbol) + +# alias for symmetry between token symbol and Expression class name +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:33 +Regexp::Syntax::Token::Backref = Regexp::Syntax::Token::Backreference + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:5 +module Regexp::Syntax::Token::Backreference; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:17 +Regexp::Syntax::Token::Backreference::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:9 +Regexp::Syntax::Token::Backreference::Name = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:8 +Regexp::Syntax::Token::Backreference::Number = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:7 +Regexp::Syntax::Token::Backreference::NumberRef = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:6 +Regexp::Syntax::Token::Backreference::Plain = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:11 +Regexp::Syntax::Token::Backreference::RecursionLevel = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:18 +Regexp::Syntax::Token::Backreference::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:13 +Regexp::Syntax::Token::Backreference::V1_8_6 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:15 +Regexp::Syntax::Token::Backreference::V1_9_1 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_set.rb:5 +module Regexp::Syntax::Token::CharacterSet; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_set.rb:9 +Regexp::Syntax::Token::CharacterSet::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_set.rb:6 +Regexp::Syntax::Token::CharacterSet::Basic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_set.rb:7 +Regexp::Syntax::Token::CharacterSet::Extended = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_set.rb:10 +Regexp::Syntax::Token::CharacterSet::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:5 +module Regexp::Syntax::Token::CharacterType; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:12 +Regexp::Syntax::Token::CharacterType::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:6 +Regexp::Syntax::Token::CharacterType::Basic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:10 +Regexp::Syntax::Token::CharacterType::Clustered = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:7 +Regexp::Syntax::Token::CharacterType::Extended = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:8 +Regexp::Syntax::Token::CharacterType::Hex = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_type.rb:13 +Regexp::Syntax::Token::CharacterType::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/conditional.rb:5 +module Regexp::Syntax::Token::Conditional; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/conditional.rb:11 +Regexp::Syntax::Token::Conditional::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/conditional.rb:8 +Regexp::Syntax::Token::Conditional::Condition = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/conditional.rb:6 +Regexp::Syntax::Token::Conditional::Delimiters = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/conditional.rb:9 +Regexp::Syntax::Token::Conditional::Separator = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/conditional.rb:13 +Regexp::Syntax::Token::Conditional::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:5 +module Regexp::Syntax::Token::Escape; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:10 +Regexp::Syntax::Token::Escape::ASCII = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:26 +Regexp::Syntax::Token::Escape::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:6 +Regexp::Syntax::Token::Escape::Basic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:8 +Regexp::Syntax::Token::Escape::Control = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:22 +Regexp::Syntax::Token::Escape::Hex = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:15 +Regexp::Syntax::Token::Escape::Meta = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:24 +Regexp::Syntax::Token::Escape::Octal = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:27 +Regexp::Syntax::Token::Escape::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:13 +Regexp::Syntax::Token::Escape::Unicode = T.let(T.unsafe(nil), Array) + +# alias for symmetry between Token::* and Expression::* +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/escape.rb:33 +Regexp::Syntax::Token::EscapeSequence = Regexp::Syntax::Token::Escape + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:13 +module Regexp::Syntax::Token::FreeSpace; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:14 +Regexp::Syntax::Token::FreeSpace::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:15 +Regexp::Syntax::Token::FreeSpace::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:5 +module Regexp::Syntax::Token::Group; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:19 +Regexp::Syntax::Token::Group::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:10 +Regexp::Syntax::Token::Group::Atomic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:6 +Regexp::Syntax::Token::Group::Basic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:12 +Regexp::Syntax::Token::Group::Comment = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:7 +Regexp::Syntax::Token::Group::Extended = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:9 +Regexp::Syntax::Token::Group::Named = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:11 +Regexp::Syntax::Token::Group::Passive = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:20 +Regexp::Syntax::Token::Group::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:14 +Regexp::Syntax::Token::Group::V1_8_6 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/group.rb:17 +Regexp::Syntax::Token::Group::V2_4_1 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/keep.rb:5 +module Regexp::Syntax::Token::Keep; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/keep.rb:8 +Regexp::Syntax::Token::Keep::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/keep.rb:6 +Regexp::Syntax::Token::Keep::Mark = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/keep.rb:9 +Regexp::Syntax::Token::Keep::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:8 +module Regexp::Syntax::Token::Literal; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:9 +Regexp::Syntax::Token::Literal::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:10 +Regexp::Syntax::Token::Literal::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:6 +Regexp::Syntax::Token::Map = T.let(T.unsafe(nil), Hash) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:5 +module Regexp::Syntax::Token::Meta; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:10 +Regexp::Syntax::Token::Meta::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:7 +Regexp::Syntax::Token::Meta::Alternation = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:6 +Regexp::Syntax::Token::Meta::Basic = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:8 +Regexp::Syntax::Token::Meta::Extended = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/meta.rb:11 +Regexp::Syntax::Token::Meta::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/posix_class.rb:5 +module Regexp::Syntax::Token::PosixClass; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/posix_class.rb:11 +Regexp::Syntax::Token::PosixClass::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/posix_class.rb:9 +Regexp::Syntax::Token::PosixClass::Extensions = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/posix_class.rb:13 +Regexp::Syntax::Token::PosixClass::NonType = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/posix_class.rb:6 +Regexp::Syntax::Token::PosixClass::Standard = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/posix_class.rb:12 +Regexp::Syntax::Token::PosixClass::Type = T.let(T.unsafe(nil), Symbol) + +# alias for symmetry between token symbol and Token module name +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:809 +Regexp::Syntax::Token::Property = Regexp::Syntax::Token::UnicodeProperty + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:5 +module Regexp::Syntax::Token::Quantifier; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:31 +Regexp::Syntax::Token::Quantifier::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:6 +Regexp::Syntax::Token::Quantifier::Greedy = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:24 +Regexp::Syntax::Token::Quantifier::Interval = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:28 +Regexp::Syntax::Token::Quantifier::IntervalAll = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:26 +Regexp::Syntax::Token::Quantifier::IntervalPossessive = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:25 +Regexp::Syntax::Token::Quantifier::IntervalReluctant = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:18 +Regexp::Syntax::Token::Quantifier::Possessive = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:12 +Regexp::Syntax::Token::Quantifier::Reluctant = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:32 +Regexp::Syntax::Token::Quantifier::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/quantifier.rb:30 +Regexp::Syntax::Token::Quantifier::V1_8_6 = T.let(T.unsafe(nil), Array) + +# alias for symmetry between token symbol and Token module name +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/character_set.rb:16 +Regexp::Syntax::Token::Set = Regexp::Syntax::Token::CharacterSet + +# Type is the same as Backreference so keeping it here, for now. +# +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:22 +module Regexp::Syntax::Token::SubexpressionCall; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:26 +Regexp::Syntax::Token::SubexpressionCall::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:23 +Regexp::Syntax::Token::SubexpressionCall::Name = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/backreference.rb:24 +Regexp::Syntax::Token::SubexpressionCall::Number = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token.rb:45 +Regexp::Syntax::Token::Types = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:5 +module Regexp::Syntax::Token::UnicodeProperty + class << self + private + + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:6 + def all(name); end + end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:73 +Regexp::Syntax::Token::UnicodeProperty::Age = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:45 +Regexp::Syntax::Token::UnicodeProperty::Age_V1_9_3 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:49 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:51 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:53 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_3_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:55 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_4_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:57 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:59 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_6_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:61 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_6_2 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:63 +Regexp::Syntax::Token::UnicodeProperty::Age_V2_6_3 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:65 +Regexp::Syntax::Token::UnicodeProperty::Age_V3_1_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:67 +Regexp::Syntax::Token::UnicodeProperty::Age_V3_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:69 +Regexp::Syntax::Token::UnicodeProperty::Age_V3_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:71 +Regexp::Syntax::Token::UnicodeProperty::Age_V4_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:799 +Regexp::Syntax::Token::UnicodeProperty::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:18 +module Regexp::Syntax::Token::UnicodeProperty::Category; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:41 +Regexp::Syntax::Token::UnicodeProperty::Category::All = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:38 +Regexp::Syntax::Token::UnicodeProperty::Category::Codepoint = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:19 +Regexp::Syntax::Token::UnicodeProperty::Category::Letter = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:22 +Regexp::Syntax::Token::UnicodeProperty::Category::Mark = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:25 +Regexp::Syntax::Token::UnicodeProperty::Category::Number = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:28 +Regexp::Syntax::Token::UnicodeProperty::Category::Punctuation = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:35 +Regexp::Syntax::Token::UnicodeProperty::Category::Separator = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:32 +Regexp::Syntax::Token::UnicodeProperty::Category::Symbol = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:11 +Regexp::Syntax::Token::UnicodeProperty::CharType_V1_9_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:14 +Regexp::Syntax::Token::UnicodeProperty::CharType_V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:152 +Regexp::Syntax::Token::UnicodeProperty::Derived = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:75 +Regexp::Syntax::Token::UnicodeProperty::Derived_V1_9_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:129 +Regexp::Syntax::Token::UnicodeProperty::Derived_V2_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:134 +Regexp::Syntax::Token::UnicodeProperty::Derived_V2_4_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:138 +Regexp::Syntax::Token::UnicodeProperty::Derived_V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:142 +Regexp::Syntax::Token::UnicodeProperty::Derived_V3_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:148 +Regexp::Syntax::Token::UnicodeProperty::Derived_V4_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:782 +Regexp::Syntax::Token::UnicodeProperty::Emoji = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:752 +Regexp::Syntax::Token::UnicodeProperty::Emoji_V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:760 +Regexp::Syntax::Token::UnicodeProperty::Emoji_V2_6_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:780 +Regexp::Syntax::Token::UnicodeProperty::Enumerated = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:764 +Regexp::Syntax::Token::UnicodeProperty::Enumerated_V2_4_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:802 +Regexp::Syntax::Token::UnicodeProperty::NonType = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:16 +Regexp::Syntax::Token::UnicodeProperty::POSIX = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:365 +Regexp::Syntax::Token::UnicodeProperty::Script = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:154 +Regexp::Syntax::Token::UnicodeProperty::Script_V1_9_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:250 +Regexp::Syntax::Token::UnicodeProperty::Script_V1_9_3 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:256 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:266 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:292 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_3_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:301 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_4_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:310 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:317 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_6_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:327 +Regexp::Syntax::Token::UnicodeProperty::Script_V2_6_2 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:334 +Regexp::Syntax::Token::UnicodeProperty::Script_V3_1_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:341 +Regexp::Syntax::Token::UnicodeProperty::Script_V3_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:351 +Regexp::Syntax::Token::UnicodeProperty::Script_V4_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:801 +Regexp::Syntax::Token::UnicodeProperty::Type = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:750 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:367 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V1_9_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:466 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:594 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:629 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_3_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:642 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_4_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:656 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:666 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_6_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:680 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V2_6_2 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:692 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V3_1_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:703 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V3_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:725 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V3_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:729 +Regexp::Syntax::Token::UnicodeProperty::UnicodeBlock_V4_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:784 +Regexp::Syntax::Token::UnicodeProperty::V1_9_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:785 +Regexp::Syntax::Token::UnicodeProperty::V1_9_3 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:786 +Regexp::Syntax::Token::UnicodeProperty::V2_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:787 +Regexp::Syntax::Token::UnicodeProperty::V2_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:788 +Regexp::Syntax::Token::UnicodeProperty::V2_3_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:789 +Regexp::Syntax::Token::UnicodeProperty::V2_4_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:790 +Regexp::Syntax::Token::UnicodeProperty::V2_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:791 +Regexp::Syntax::Token::UnicodeProperty::V2_6_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:792 +Regexp::Syntax::Token::UnicodeProperty::V2_6_2 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:793 +Regexp::Syntax::Token::UnicodeProperty::V2_6_3 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:794 +Regexp::Syntax::Token::UnicodeProperty::V3_1_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:795 +Regexp::Syntax::Token::UnicodeProperty::V3_2_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:796 +Regexp::Syntax::Token::UnicodeProperty::V3_5_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/token/unicode_property.rb:797 +Regexp::Syntax::Token::UnicodeProperty::V4_0_0 = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:14 +class Regexp::Syntax::UnknownSyntaxNameError < ::Regexp::Syntax::SyntaxError + # pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:15 + def initialize(name); end +end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/1.8.6.rb:3 +class Regexp::Syntax::V1_8_6 < ::Regexp::Syntax::Base; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/1.9.1.rb:3 +class Regexp::Syntax::V1_9_1 < ::Regexp::Syntax::V1_8_6; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/1.9.3.rb:3 +class Regexp::Syntax::V1_9_3 < ::Regexp::Syntax::V1_9_1; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.0.0.rb:3 +class Regexp::Syntax::V2_0_0 < ::Regexp::Syntax::V1_9_3; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.2.0.rb:3 +class Regexp::Syntax::V2_2_0 < ::Regexp::Syntax::V2_0_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.3.0.rb:3 +class Regexp::Syntax::V2_3_0 < ::Regexp::Syntax::V2_2_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.4.0.rb:3 +class Regexp::Syntax::V2_4_0 < ::Regexp::Syntax::V2_3_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.4.1.rb:3 +class Regexp::Syntax::V2_4_1 < ::Regexp::Syntax::V2_4_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.5.0.rb:3 +class Regexp::Syntax::V2_5_0 < ::Regexp::Syntax::V2_4_1; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.6.0.rb:3 +class Regexp::Syntax::V2_6_0 < ::Regexp::Syntax::V2_5_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.6.2.rb:3 +class Regexp::Syntax::V2_6_2 < ::Regexp::Syntax::V2_6_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/2.6.3.rb:3 +class Regexp::Syntax::V2_6_3 < ::Regexp::Syntax::V2_6_2; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/3.1.0.rb:3 +class Regexp::Syntax::V3_1_0 < ::Regexp::Syntax::V2_6_3; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/3.2.0.rb:3 +class Regexp::Syntax::V3_2_0 < ::Regexp::Syntax::V3_1_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/3.5.0.rb:1 +class Regexp::Syntax::V3_5_0 < ::Regexp::Syntax::V3_2_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/versions/4.0.0.rb:1 +class Regexp::Syntax::V4_0_0 < ::Regexp::Syntax::V3_5_0; end + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:6 +Regexp::Syntax::VERSION_CONST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:4 +Regexp::Syntax::VERSION_FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/regexp_parser#lib/regexp_parser/syntax/version_lookup.rb:5 +Regexp::Syntax::VERSION_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/regexp_parser#lib/regexp_parser/token.rb:4 +Regexp::TOKEN_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 +class Regexp::Token < ::Struct + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def conditional_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def conditional_level=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:22 + def length; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def level=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:16 + def next; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:16 + def next=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:18 + def offset; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:16 + def previous; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:16 + def previous=(_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def set_level; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def set_level=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def te; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def te=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def text; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def text=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def token; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def token=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def ts; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def ts=(_); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def type; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def type=(_); end + + class << self + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def [](*_arg0); end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def inspect; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def keyword_init?; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def members; end + + # pkg:gem/regexp_parser#lib/regexp_parser/token.rb:15 + def new(*_arg0); end + end +end diff --git a/sorbet/rbi/gems/require-hooks@0.5.1.rbi b/sorbet/rbi/gems/require-hooks@0.5.1.rbi new file mode 100644 index 0000000..1e536b2 --- /dev/null +++ b/sorbet/rbi/gems/require-hooks@0.5.1.rbi @@ -0,0 +1,152 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `require-hooks` gem. +# Please instead update this file by running `bin/tapioca gem require-hooks`. + + +# pkg:gem/require-hooks#lib/require-hooks/api.rb:3 +module RequireHooks + class << self + # Define a block to wrap the code loading. + # The return value MUST be a result of calling the passed block. + # For example, you can use such hooks for instrumentation, debugging purposes. + # + # RequireHooks.around_load do |path, &block| + # puts "Loading #{path}" + # block.call.tap { puts "Loaded #{path}" } + # end + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:103 + def around_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:139 + def context_for(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:168 + def contexts; end + + # This hook should be used to manually compile byte code to be loaded by the VM. + # The arguments are (path, source = nil), where source is only defined if transformations took place. + # Otherwise, you MUST read the source code from the file yourself. + # + # The return value MUST be either nil (continue to the next hook or default behavior) or a platform-specific bytecode object (e.g., RubyVM::InstructionSequence). + # + # RequireHooks.hijack_load do |path, source| + # source ||= File.read(path) + # if defined?(RubyVM::InstructionSequence) + # RubyVM::InstructionSequence.compile(source) + # elsif defined?(JRUBY_VERSION) + # JRuby.compile(source) + # end + # end + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:135 + def hijack_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:93 + def print_warnings; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:93 + def print_warnings=(_arg0); end + + # Hack to enable coverage for hooked files. + # Requires eval coverage to be on. + # See https://bugs.ruby-lang.org/issues/22018 (https://github.com/ruby/ruby/pull/16805) + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:160 + def setup_path_coverage(path, contents = T.unsafe(nil)); end + + # Define hooks to perform source-to-source transformations. + # The return value MUST be either String (new source code) or nil (indicating that no transformations were performed). + # + # NOTE: The second argument (`source`) MAY be nil, indicating that no transformer tried to transform the source code. + # + # + # RequireHooks.source_transform do |path, source| + # end + # + # pkg:gem/require-hooks#lib/require-hooks/api.rb:117 + def source_transform(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + private + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:184 + def eval_coverage_enabled?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:174 + def register_hook(type, block, patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + end +end + +# pkg:gem/require-hooks#lib/require-hooks/api.rb:4 +class RequireHooks::Context + # pkg:gem/require-hooks#lib/require-hooks/api.rb:8 + def initialize(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def around_load; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:30 + def empty?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def exclude_patterns; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:45 + def hijack?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def hijack_load; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:24 + def match?(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:81 + def merge!(another_ctx); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def patterns; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:59 + def perform_source_transform(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:35 + def readonly?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:49 + def run_around_load_callbacks(path); end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:5 + def source_transform; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:41 + def source_transform?; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:20 + def to_key; end + + # pkg:gem/require-hooks#lib/require-hooks/api.rb:71 + def try_hijack_load(path, source); end +end + +# pkg:gem/require-hooks#lib/require-hooks/mode/load_iseq.rb:6 +RequireHooks::EMPTY_ISEQ = T.let(T.unsafe(nil), RubyVM::InstructionSequence) + +# pkg:gem/require-hooks#lib/require-hooks/iseq.rb:4 +module RequireHooks::Iseq + class << self + # pkg:gem/require-hooks#lib/require-hooks/iseq.rb:6 + def compile_with_coverage(ctx, path); end + end +end + +# pkg:gem/require-hooks#lib/require-hooks/mode/load_iseq.rb:8 +module RequireHooks::LoadIseq + # pkg:gem/require-hooks#lib/require-hooks/mode/load_iseq.rb:9 + def load_iseq(path); end +end + +class RubyVM::InstructionSequence + extend ::RequireHooks::LoadIseq +end diff --git a/sorbet/rbi/gems/rspec-core@3.13.6.rbi b/sorbet/rbi/gems/rspec-core@3.13.6.rbi new file mode 100644 index 0000000..3a41a78 --- /dev/null +++ b/sorbet/rbi/gems/rspec-core@3.13.6.rbi @@ -0,0 +1,9599 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rspec-core` gem. +# Please instead update this file by running `bin/tapioca gem rspec-core`. + + +# Namespace for all core RSpec code. +# This is borrowed (slightly modified) from Scott Taylor's +# project_path project: +# http://github.com/smtlaissezfaire/project_path +# +# pkg:gem/rspec-core#lib/rspec/core/version.rb:1 +module RSpec + extend ::RSpec::Core::Warnings + + class << self + # Used to ensure examples get reloaded between multiple runs in the same + # process and ensures user configuration is persisted. + # + # Users must invoke this if they want to clear all examples but preserve + # current configuration when they use the runner multiple times within the + # same process. + # + # pkg:gem/rspec-core#lib/rspec/core.rb:70 + def clear_examples; end + + # Returns the global [Configuration](RSpec/Core/Configuration) object. While + # you _can_ use this method to access the configuration, the more common + # convention is to use [RSpec.configure](RSpec#configure-class_method). + # + # @example + # RSpec.configuration.drb_port = 1234 + # @see RSpec.configure + # @see Core::Configuration + # Setters for shared global objects + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:85 + def configuration; end + + # Returns the global [Configuration](RSpec/Core/Configuration) object. While + # you _can_ use this method to access the configuration, the more common + # convention is to use [RSpec.configure](RSpec#configure-class_method). + # + # @example + # RSpec.configuration.drb_port = 1234 + # @see RSpec.configure + # @see Core::Configuration + # Setters for shared global objects + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:49 + def configuration=(_arg0); end + + # Yields the global configuration to a block. + # @yield [Configuration] global configuration + # + # @example + # RSpec.configure do |config| + # config.add_formatter 'documentation' + # end + # @see Core::Configuration + # + # pkg:gem/rspec-core#lib/rspec/core.rb:97 + def configure; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:194 + def const_missing(name); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def context(*args, &example_group_block); end + + # The example being executed. + # + # The primary audience for this method is library authors who need access + # to the example currently being executed and also want to support all + # versions of RSpec 2 and 3. + # + # @example + # + # RSpec.configure do |c| + # # context.example is deprecated, but RSpec.current_example is not + # # available until RSpec 3.0. + # fetch_current_example = RSpec.respond_to?(:current_example) ? + # proc { RSpec.current_example } : proc { |context| context.example } + # + # c.before(:example) do + # example = fetch_current_example.call(self) + # + # # ... + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core.rb:122 + def current_example; end + + # Set the current example being executed. + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:128 + def current_example=(example); end + + # Get the current RSpec execution scope + # + # Returns (in order of lifecycle): + # * `:suite` as an initial value, this is outside of the test lifecycle. + # * `:before_suite_hook` during `before(:suite)` hooks. + # * `:before_context_hook` during `before(:context)` hooks. + # * `:before_example_hook` during `before(:example)` hooks and `around(:example)` before `example.run`. + # * `:example` within the example run. + # * `:after_example_hook` during `after(:example)` hooks and `around(:example)` after `example.run`. + # * `:after_context_hook` during `after(:context)` hooks. + # * `:after_suite_hook` during `after(:suite)` hooks. + # * `:suite` as a final value, again this is outside of the test lifecycle. + # + # Reminder, `:context` hooks have `:all` alias and `:example` hooks have `:each` alias. + # @return [Symbol] + # + # pkg:gem/rspec-core#lib/rspec/core.rb:154 + def current_scope; end + + # Set the current scope rspec is executing in + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:134 + def current_scope=(scope); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def describe(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def example_group(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def fcontext(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def fdescribe(*args, &example_group_block); end + + # Used to ensure examples get reloaded and user configuration gets reset to + # defaults between multiple runs in the same process. + # + # Users must invoke this if they want to have the configuration reset when + # they use the runner multiple times within the same process. Users must deal + # themselves with re-configuration of RSpec before run. + # + # pkg:gem/rspec-core#lib/rspec/core.rb:58 + def reset; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:113 + def shared_context(name, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:110 + def shared_examples(name, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:114 + def shared_examples_for(name, *args, &block); end + + # @private + # Internal container for global non-configuration data. + # Setters for shared global objects + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:160 + def world; end + + # @private + # Internal container for global non-configuration data. + # Setters for shared global objects + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core.rb:49 + def world=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def xcontext(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:279 + def xdescribe(*args, &example_group_block); end + end +end + +# Namespace for the rspec-core code. +# +# pkg:gem/rspec-core#lib/rspec/core/version.rb:2 +module RSpec::Core + class << self + # @private path to executable file. + # + # pkg:gem/rspec-core#lib/rspec/core.rb:181 + def path_to_executable; end + end +end + +# @private +# Unnamed example group used by `SuiteHookContext`. +# +# pkg:gem/rspec-core#lib/rspec/core/example_group.rb:782 +class RSpec::Core::AnonymousExampleGroup < ::RSpec::Core::ExampleGroup + class << self + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:783 + def metadata; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:4 +class RSpec::Core::BacktraceFormatter + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:8 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:49 + def backtrace_line(line); end + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:53 + def exclude?(line); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:6 + def exclusion_patterns; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:6 + def exclusion_patterns=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:28 + def filter_gem(gem_name); end + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:33 + def format_backtrace(backtrace, options = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:22 + def full_backtrace=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:24 + def full_backtrace?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:6 + def inclusion_patterns; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:6 + def inclusion_patterns=(_arg0); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/backtrace_formatter.rb:60 + def matches?(patterns, line); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:3 +module RSpec::Core::Bisect; end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:8 +class RSpec::Core::Bisect::BisectFailedError < ::StandardError + class << self + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:9 + def for_failed_spec_run(spec_output); end + end +end + +# Wraps a pipe to support sending objects between a child and +# parent process. Where supported, encoding is explicitly +# set to ensure binary data is able to pass from child to +# parent. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:36 +class RSpec::Core::Bisect::Channel + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:41 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:62 + def close; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:56 + def receive; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:50 + def send(message); end +end + +# pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:38 +RSpec::Core::Bisect::Channel::MARSHAL_DUMP_ENCODING = T.let(T.unsafe(nil), Encoding) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 +class RSpec::Core::Bisect::ExampleSetDescriptor < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def all_example_ids; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def all_example_ids=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def failed_example_ids; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def failed_example_ids=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:5 + def new(*_arg0); end + end +end + +# Wraps a `formatter` providing a simple means to notify it in place +# of an `RSpec::Core::Reporter`, without involving configuration in +# any way. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:19 +class RSpec::Core::Bisect::Notifier + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:20 + def initialize(formatter); end + + # pkg:gem/rspec-core#lib/rspec/core/bisect/utilities.rb:24 + def publish(event, *args); end +end + +# Stores runtime configuration information. +# +# Configuration options are loaded from multiple files and joined together +# with command-line switches and the `SPEC_OPTS` environment variable. +# +# Precedence order (where later entries overwrite earlier entries on +# conflicts): +# +# * Global (`$XDG_CONFIG_HOME/rspec/options`, or `~/.rspec` if it does +# not exist) +# * Project-specific (`./.rspec`) +# * Local (`./.rspec-local`) +# * Command-line options +# * `SPEC_OPTS` +# +# For example, an option set in the local file will override an option set +# in your global file. +# +# The global, project-specific and local files can all be overridden with a +# separate custom file using the --options command-line parameter. +# +# @example Standard settings +# RSpec.configure do |c| +# c.drb = true +# c.drb_port = 1234 +# c.default_path = 'behavior' +# end +# +# @example Hooks +# RSpec.configure do |c| +# c.before(:suite) { establish_connection } +# c.before(:example) { log_in_as :authorized } +# c.around(:example) { |ex| Database.transaction(&ex) } +# end +# +# @see RSpec.configure +# @see Hooks +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:47 +class RSpec::Core::Configuration + include ::RSpec::Core::Hooks + include ::RSpec::Core::Configuration::Readers + + # Build an object to store runtime configuration options and set defaults + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:528 + def initialize; end + + # @overload add_formatter(formatter) + # @overload add_formatter(formatter, output) + # + # @param formatter [Class, String, Object] formatter to use. Can be any of the + # string values supported from the CLI (`p`/`progress`, + # `d`/`doc`/`documentation`, `h`/`html`, or `j`/`json`), any + # class that implements the formatter protocol and has registered + # itself with RSpec as a formatter, or a formatter instance. + # @param output [String, IO] where the formatter will write its output. + # Can be an IO object or a string path to a file. If not provided, + # the configured `output_stream` (`$stdout`, by default) will be used. + # + # Adds a formatter to the set RSpec will use for this run. + # + # @see RSpec::Core::Formatters::Protocol + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:996 + def add_formatter(formatter, output = T.unsafe(nil)); end + + # @overload add_setting(name) + # @overload add_setting(name, opts) + # @option opts [Symbol] :default + # + # Set a default value for the generated getter and predicate methods: + # + # add_setting(:foo, :default => "default value") + # + # @option opts [Symbol] :alias_with + # + # Use `:alias_with` to alias the setter, getter, and predicate to + # another name, or names: + # + # add_setting(:foo, :alias_with => :bar) + # add_setting(:foo, :alias_with => [:bar, :baz]) + # + # Adds a custom setting to the RSpec.configuration object. + # + # RSpec.configuration.add_setting :foo + # + # Used internally and by extension frameworks like rspec-rails, so they + # can add config settings that are domain specific. For example: + # + # RSpec.configure do |c| + # c.add_setting :use_transactional_fixtures, + # :default => true, + # :alias_with => :use_transactional_examples + # end + # + # `add_setting` creates three methods on the configuration object, a + # setter, a getter, and a predicate: + # + # RSpec.configuration.foo=(value) + # RSpec.configuration.foo + # RSpec.configuration.foo? # Returns true if foo returns anything but nil or false. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:659 + def add_setting(name, opts = T.unsafe(nil)); end + + # Defines a `after` hook. See {Hooks#after} for full docs. + # + # This method differs from {Hooks#after} in only one way: it supports + # the `:suite` scope. Hooks with the `:suite` scope will be run once after + # the last example of the entire suite is executed. Conditions passed along + # with `:suite` are effectively ignored. + # + # @see #append_after + # @see #before + # @see #prepend_before + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2031 + def after(scope = T.unsafe(nil), *meta, &block); end + + # Creates a method that defines an example group with the provided + # metadata. Can be used to define example group/metadata shortcuts. + # + # @example + # RSpec.configure do |config| + # config.alias_example_group_to :describe_model, :type => :model + # end + # + # shared_context_for "model tests", :type => :model do + # # define common model test helper methods, `let` declarations, etc + # end + # + # # This lets you do this: + # + # RSpec.describe_model User do + # end + # + # # ... which is the equivalent of + # + # RSpec.describe User, :type => :model do + # end + # + # @note The defined aliased will also be added to the top level + # (e.g. `main` and from within modules) if + # `expose_dsl_globally` is set to true. + # @see #alias_example_to + # @see #expose_dsl_globally= + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1209 + def alias_example_group_to(new_name, *args); end + + # Creates a method that delegates to `example` including the submitted + # `args`. Used internally to add variants of `example` like `pending`: + # @param name [String] example name alias + # @param args [Array, Hash] metadata for the generated example + # + # @note The specific example alias below (`pending`) is already + # defined for you. + # @note Use with caution. This extends the language used in your + # specs, but does not add any additional documentation. We use this + # in RSpec to define methods like `focus` and `xit`, but we also add + # docs for those methods. + # + # @example + # RSpec.configure do |config| + # config.alias_example_to :pending, :pending => true + # end + # + # # This lets you do this: + # + # RSpec.describe Thing do + # pending "does something" do + # thing = Thing.new + # end + # end + # + # # ... which is the equivalent of + # + # RSpec.describe Thing do + # it "does something", :pending => true do + # thing = Thing.new + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1177 + def alias_example_to(name, *args); end + + # Define an alias for it_should_behave_like that allows different + # language (like "it_has_behavior" or "it_behaves_like") to be + # employed when including shared examples. + # + # @example + # RSpec.configure do |config| + # config.alias_it_behaves_like_to(:it_has_behavior, 'has behavior:') + # end + # + # # allows the user to include a shared example group like: + # + # RSpec.describe Entity do + # it_has_behavior 'sortability' do + # let(:sortable) { Entity.new } + # end + # end + # + # # which is reported in the output as: + # # Entity + # # has behavior: sortability + # # ...sortability examples here + # + # @note Use with caution. This extends the language used in your + # specs, but does not add any additional documentation. We use this + # in RSpec to define `it_should_behave_like` (for backward + # compatibility), but we also add docs for that method. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1240 + def alias_it_behaves_like_to(new_name, report_label = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1243 + def alias_it_should_behave_like_to(new_name, report_label = T.unsafe(nil)); end + + # Adds `block` to the end of the list of `after` blocks in the same + # scope (`:example`, `:context`, or `:suite`), in contrast to {#after}, + # which adds the hook to the start of the list. + # + # See {Hooks#after} for full `after` hook docs. + # + # This method differs from {Hooks#append_after} in only one way: it supports + # the `:suite` scope. Hooks with the `:suite` scope will be run once after + # the last example of the entire suite is executed. Conditions passed along + # with `:suite` are effectively ignored. + # + # @see #append_after + # @see #before + # @see #prepend_before + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2061 + def append_after(scope = T.unsafe(nil), *meta, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1990 + def append_before(scope = T.unsafe(nil), *meta, &block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1941 + def apply_derived_metadata_to(metadata); end + + # Registers `block` as an `around` hook. + # + # See {Hooks#around} for full `around` hook docs. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2079 + def around(scope = T.unsafe(nil), *meta, &block); end + + # Regexps used to exclude lines from backtraces. + # + # Excludes lines from ruby (and jruby) source, installed gems, anything + # in any "bin" directory, and any of the RSpec libs (outside gem + # installs) by default. + # + # You can modify the list via the getter, or replace it with the setter. + # + # To override this behaviour and display a full backtrace, use + # `--backtrace` on the command line, in a `.rspec` file, or in the + # `rspec_options` attribute of RSpec's rake task. + # @return [Array] + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:697 + def backtrace_exclusion_patterns; end + + # Set regular expressions used to exclude lines in backtrace. + # @param patterns [Array] set backtrace_formatter exclusion_patterns + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:703 + def backtrace_exclusion_patterns=(patterns); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:522 + def backtrace_formatter; end + + # Regexps used to include lines in backtraces. + # + # Defaults to [Regexp.new Dir.getwd]. + # + # Lines that match an exclusion _and_ an inclusion pattern + # will be included. + # + # You can modify the list via the getter, or replace it with the setter. + # @return [Array] + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:716 + def backtrace_inclusion_patterns; end + + # Set regular expressions used to include lines in backtrace. + # @attr patterns [Array] set backtrace_formatter inclusion_patterns + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:722 + def backtrace_inclusion_patterns=(patterns); end + + # Defines a `before` hook. See {Hooks#before} for full docs. + # + # This method differs from {Hooks#before} in only one way: it supports + # the `:suite` scope. Hooks with the `:suite` scope will be run once before + # the first example of the entire suite is executed. Conditions passed along + # with `:suite` are effectively ignored. + # + # @see #prepend_before + # @see #after + # @see #append_after + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1976 + def before(scope = T.unsafe(nil), *meta, &block); end + + # Determines which bisect runner implementation gets used to run subsets + # of the suite during a bisection. Your choices are: + # + # - `:shell`: Performs a spec run by shelling out, booting RSpec and your + # application environment each time. This runner is the most widely + # compatible runner, but is not as fast. On platforms that do not + # support forking, this is the default. + # - `:fork`: Pre-boots RSpec and your application environment in a parent + # process, and then forks a child process for each spec run. This runner + # tends to be significantly faster than the `:shell` runner but cannot + # be used in some situations. On platforms that support forking, this + # is the default. If you use this runner, you should ensure that all + # of your one-time setup logic goes in a `before(:suite)` hook instead + # of getting run at the top-level of a file loaded by `--require`. + # + # @note This option will only be used by `--bisect` if you set it in a file + # loaded via `--require`. + # + # @return [Symbol] + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:499 + def bisect_runner; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:500 + def bisect_runner=(value); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2125 + def bisect_runner_class; end + + # Enables color output if the output is a TTY. As of RSpec 3.6, this is + # the default behavior and this option is retained only for backwards + # compatibility. + # + # @deprecated No longer recommended because of complex behavior. Instead, + # rely on the fact that TTYs will display color by default, or set + # {#color_mode} to :on to display color on a non-TTY output. + # @see color_mode + # @see color_enabled? + # @return [Boolean] + # Toggle output color. + # + # @deprecated No longer recommended because of complex behavior. Instead, + # rely on the fact that TTYs will display color by default, or set + # {:color_mode} to :on to display color on a non-TTY output. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:922 + def color; end + + # Enables color output if the output is a TTY. As of RSpec 3.6, this is + # the default behavior and this option is retained only for backwards + # compatibility. + # + # @deprecated No longer recommended because of complex behavior. Instead, + # rely on the fact that TTYs will display color by default, or set + # {#color_mode} to :on to display color on a non-TTY output. + # @see color_mode + # @see color_enabled? + # @return [Boolean] + # Toggle output color. + # + # @deprecated No longer recommended because of complex behavior. Instead, + # rely on the fact that TTYs will display color by default, or set + # {:color_mode} to :on to display color on a non-TTY output. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:960 + def color=(_arg0); end + + # Check if color is enabled for a particular output. + # @param output [IO] an output stream to use, defaults to the current + # `output_stream` + # @return [Boolean] + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:943 + def color_enabled?(output = T.unsafe(nil)); end + + # The mode for determining whether to display output in color. One of: + # + # - :automatic - the output will be in color if the output is a TTY (the + # default) + # - :on - the output will be in color, whether or not the output is a TTY + # - :off - the output will not be in color + # + # @see color_enabled? + # @return [Boolean] + # Set the color mode. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:935 + def color_mode; end + + # The mode for determining whether to display output in color. One of: + # + # - :automatic - the output will be in color if the output is a TTY (the + # default) + # - :on - the output will be in color, whether or not the output is a TTY + # - :off - the output will not be in color + # + # @see color_enabled? + # @return [Boolean] + # Set the color mode. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:953 + def color_mode=(_arg0); end + + # @private + # + # Used internally to extend the singleton class of a single example's + # example group instance with modules using `include` and/or `extend`. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1580 + def configure_example(example, example_hooks); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1622 + def configure_expectation_framework; end + + # @private + # + # Used internally to extend a group with modules using `include`, `prepend` and/or + # `extend`. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1568 + def configure_group(group); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1616 + def configure_mock_framework; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def default_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def default_color=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def default_color?; end + + # The formatter that will be used if no formatter has been set. + # Defaults to 'progress'. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1003 + def default_formatter; end + + # Sets a fallback formatter to use if none other has been set. + # + # @example + # + # RSpec.configure do |rspec| + # rspec.default_formatter = 'doc' + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1014 + def default_formatter=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def default_path; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:121 + def default_path=(path); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def default_path?; end + + # Defines a callback that can assign derived metadata values. + # + # @param filters [Array, Hash] metadata filters that determine + # which example or group metadata hashes the callback will be triggered + # for. If none are given, the callback will be run against the metadata + # hashes of all groups and examples. + # @yieldparam metadata [Hash] original metadata hash from an example or + # group. Mutate this in your block as needed. + # + # @example + # RSpec.configure do |config| + # # Tag all groups and examples in the spec/unit directory with + # # :type => :unit + # config.define_derived_metadata(:file_path => %r{/spec/unit/}) do |metadata| + # metadata[:type] = :unit + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1900 + def define_derived_metadata(*filters, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def deprecation_stream; end + + # Determines where deprecation warnings are printed. + # @param value [IO, String] IO to write to or filename to write to + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:168 + def deprecation_stream=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def detail_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def detail_color=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def detail_color?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1881 + def disable_monkey_patching; end + + # Enables zero monkey patching mode for RSpec. It removes monkey + # patching of the top-level DSL methods (`describe`, + # `shared_examples_for`, etc) onto `main` and `Module`, instead + # requiring you to prefix these methods with `RSpec.`. It enables + # expect-only syntax for rspec-mocks and rspec-expectations. It + # simply disables monkey patching on whatever pieces of RSpec + # the user is using. + # + # @note It configures rspec-mocks and rspec-expectations only + # if the user is using those (either explicitly or implicitly + # by not setting `mock_with` or `expect_with` to anything else). + # + # @note If the user uses this options with `mock_with :mocha` + # (or similar) they will still have monkey patching active + # in their test environment from mocha. + # + # @example + # + # # It disables all monkey patching. + # RSpec.configure do |config| + # config.disable_monkey_patching! + # end + # + # # Is an equivalent to + # RSpec.configure do |config| + # config.expose_dsl_globally = false + # + # config.mock_with :rspec do |mocks| + # mocks.syntax = :expect + # mocks.patch_marshal_to_support_partial_doubles = false + # end + # + # config.expect_with :rspec do |expectations| + # expectations.syntax = :expect + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1873 + def disable_monkey_patching!; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1881 + def disable_monkey_patching=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def drb; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def drb=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def drb?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def drb_port; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def drb_port=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def drb_port?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def dry_run; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def dry_run=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def dry_run?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def error_exit_code; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def error_exit_code=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def error_exit_code?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def error_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def error_stream=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def error_stream?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def example_status_persistence_file_path; end + + # Sets the file path to use for persisting example statuses. Necessary for the + # `--only-failures` and `--next-failure` CLI options. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:192 + def example_status_persistence_file_path=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def exclude_pattern; end + + # Set pattern to match files to exclude. + # @attr value [String] the filename pattern to exclude spec files by + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:304 + def exclude_pattern=(value); end + + # Returns the `exclusion_filter`. If none has been set, returns an empty + # hash. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1369 + def exclusion_filter; end + + # Clears and reassigns the `exclusion_filter`. Set to `nil` if you don't + # want any exclusion filter at all. + # + # ### Warning + # + # This overrides any exclusion filters/tags set on the command line or in + # configuration files. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1362 + def exclusion_filter=(filter); end + + # Sets the expectation framework module(s) to be included in each example + # group. + # + # `frameworks` can be `:rspec`, `:test_unit`, `:minitest`, a custom + # module, or any combination thereof: + # + # config.expect_with :rspec + # config.expect_with :test_unit + # config.expect_with :minitest + # config.expect_with :rspec, :minitest + # config.expect_with OtherExpectationFramework + # + # RSpec will translate `:rspec`, `:minitest`, and `:test_unit` into the + # appropriate modules. + # + # ## Configuration + # + # If the module responds to `configuration`, `expect_with` will + # yield the `configuration` object if given a block: + # + # config.expect_with OtherExpectationFramework do |custom_config| + # custom_config.custom_setting = true + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:858 + def expect_with(*frameworks); end + + # Delegates to expect_with(framework). + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:831 + def expectation_framework=(framework); end + + # Returns the configured expectation framework adapter module(s) + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:819 + def expectation_frameworks; end + + # Exposes the current running example via the named + # helper method. RSpec 2.x exposed this via `example`, + # but in RSpec 3.0, the example is instead exposed via + # an arg yielded to `it`, `before`, `let`, etc. However, + # some extension gems (such as Capybara) depend on the + # RSpec 2.x's `example` method, so this config option + # can be used to maintain compatibility. + # + # @param method_name [Symbol] the name of the helper method + # + # @example + # + # RSpec.configure do |rspec| + # rspec.expose_current_running_example_as :example + # end + # + # RSpec.describe MyClass do + # before do + # # `example` can be used here because of the above config. + # do_something if example.metadata[:type] == "foo" + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1811 + def expose_current_running_example_as(method_name); end + + # Use this to expose the core RSpec DSL via `Module` and the `main` + # object. It will be set automatically but you can override it to + # remove the DSL. + # Default: true + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:151 + def expose_dsl_globally=(value); end + + # Indicates if the DSL has been exposed off of modules and `main`. + # Default: true + # @return [Boolean] + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:143 + def expose_dsl_globally?; end + + # Tells RSpec to extend example groups with `mod`. Methods defined in + # `mod` are exposed to example groups (not examples). Use `filters` to + # constrain the groups to extend. + # + # Similar to `include`, but behavior is added to example groups, which + # are classes, rather than the examples, which are instances of those + # classes. + # + # @example + # + # module UiHelpers + # def run_in_browser + # # ... + # end + # end + # + # module PermissionHelpers + # def define_permissions + # # ... + # end + # end + # + # RSpec.configure do |config| + # config.extend(UiHelpers, :type => :request) + # config.extend(PermissionHelpers, :with_permissions, :type => :request) + # end + # + # describe "edit profile", :with_permissions, :type => :request do + # run_in_browser + # define_permissions + # + # it "does stuff in the client" do + # # ... + # end + # end + # + # @see #include + # @see #prepend + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1518 + def extend(mod, *filters); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def fail_fast; end + + # @see fail_fast + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:214 + def fail_fast=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def fail_if_no_examples; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def fail_if_no_examples=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def fail_if_no_examples?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def failure_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def failure_color=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def failure_color?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def failure_exit_code; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def failure_exit_code=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def failure_exit_code?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1083 + def files_or_directories_to_run=(*files); end + + # @private + # The spec files RSpec will run. + # @return [Array] specified files about to run + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1096 + def files_to_run; end + + # @private + # The spec files RSpec will run. + # @return [Array] specified files about to run + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:516 + def files_to_run=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1317 + def filter; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1309 + def filter=(filter); end + + # Adds {#backtrace_exclusion_patterns} that will filter lines from + # the named gems from backtraces. + # + # @param gem_names [Array] Names of the gems to filter + # + # @example + # RSpec.configure do |config| + # config.filter_gems_from_backtrace "rack", "rake" + # end + # + # @note The patterns this adds will match the named gems in their common + # locations (e.g. system gems, vendored with bundler, installed as a + # :git dependency with bundler, etc) but is not guaranteed to work for + # all possible gem locations. For example, if you have the gem source + # in a directory with a completely unrelated name, and use bundler's + # :path option, this will not filter it. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:742 + def filter_gems_from_backtrace(*gem_names); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:518 + def filter_manager; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:518 + def filter_manager=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1280 + def filter_run(*args); end + + # Adds key/value pairs to the `exclusion_filter`. If `args` + # includes any symbols that are not part of the hash, each symbol + # is treated as a key in the hash with the value `true`. + # + # ### Note + # + # Filters set using this method can be overridden from the command line + # or config files (e.g. `.rspec`). + # + # @example + # # Given this declaration. + # describe "something", :foo => 'bar' do + # # ... + # end + # + # # Any of the following will exclude that group. + # config.filter_run_excluding :foo => 'bar' + # config.filter_run_excluding :foo => /^ba/ + # config.filter_run_excluding :foo => lambda {|v| v == 'bar'} + # config.filter_run_excluding :foo => lambda {|v,m| m[:foo] == 'bar'} + # + # # Given a proc with an arity of 1, the lambda is passed the value + # # related to the key, e.g. + # config.filter_run_excluding :foo => lambda {|v| v == 'bar'} + # + # # Given a proc with an arity of 2, the lambda is passed the value + # # related to the key, and the metadata itself e.g. + # config.filter_run_excluding :foo => lambda {|v,m| m[:foo] == 'bar'} + # + # filter_run_excluding :foo # same as filter_run_excluding :foo => true + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1349 + def filter_run_excluding(*args); end + + # Adds key/value pairs to the `inclusion_filter`. If `args` + # includes any symbols that are not part of the hash, each symbol + # is treated as a key in the hash with the value `true`. + # + # ### Note + # + # Filters set using this method can be overridden from the command line + # or config files (e.g. `.rspec`). + # + # @example + # # Given this declaration. + # describe "something", :foo => 'bar' do + # # ... + # end + # + # # Any of the following will include that group. + # config.filter_run_including :foo => 'bar' + # config.filter_run_including :foo => /^ba/ + # config.filter_run_including :foo => lambda {|v| v == 'bar'} + # config.filter_run_including :foo => lambda {|v,m| m[:foo] == 'bar'} + # + # # Given a proc with an arity of 1, the lambda is passed the value + # # related to the key, e.g. + # config.filter_run_including :foo => lambda {|v| v == 'bar'} + # + # # Given a proc with an arity of 2, the lambda is passed the value + # # related to the key, and the metadata itself e.g. + # config.filter_run_including :foo => lambda {|v,m| m[:foo] == 'bar'} + # + # filter_run_including :foo # same as filter_run_including :foo => true + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1275 + def filter_run_including(*args); end + + # Applies the provided filter only if any of examples match, in constrast + # to {#filter_run}, which always applies even if no examples match, in + # which case no examples will be run. This allows you to leave configured + # filters in place that are intended only for temporary use. The most common + # example is focus filtering: `config.filter_run_when_matching :focus`. + # With that configured, you can temporarily focus an example or group + # by tagging it with `:focus` metadata, or prefixing it with an `f` + # (as in `fdescribe`, `fcontext` and `fit`) since those are aliases for + # `describe`/`context`/`it` with `:focus` metadata. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1291 + def filter_run_when_matching(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def fixed_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def fixed_color=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def fixed_color?; end + + # @private + # + # Used to set higher priority option values from the command line. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:592 + def force(hash); end + + # Formats the docstring output using the block provided. + # + # @example + # # This will strip the descriptions of both examples and example + # # groups. + # RSpec.configure do |config| + # config.format_docstrings { |s| s.strip } + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1661 + def format_docstrings(&block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1666 + def format_docstrings_block; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:999 + def formatter=(formatter, output = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1029 + def formatter_loader; end + + # Returns a duplicate of the formatters currently loaded in + # the `FormatterLoader` for introspection. + # + # Note as this is a duplicate, any mutations will be disregarded. + # + # @return [Array] the formatters currently loaded + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1024 + def formatters; end + + # Toggle full backtrace. + # @attr true_or_false [Boolean] toggle full backtrace display + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:908 + def full_backtrace=(true_or_false); end + + # Check if full backtrace is enabled. + # @return [Boolean] is full backtrace enabled + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:902 + def full_backtrace?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def full_cause_backtrace; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def full_cause_backtrace=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def full_cause_backtrace?; end + + # @return [Array] full description filter + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:977 + def full_description; end + + # Run examples matching on `description` in all files to run. + # @param description [String, Regexp] the pattern to filter on + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:972 + def full_description=(description); end + + # @private + # Holds the various registered hooks. Here we use a FilterableItemRepository + # implementation that is specifically optimized for the read/write patterns + # of the config object. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2109 + def hooks; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1607 + def in_project_source_dir_regex; end + + # Tells RSpec to include `mod` in example groups. Methods defined in + # `mod` are exposed to examples (not example groups). Use `filters` to + # constrain the groups or examples in which to include the module. + # + # @example + # + # module AuthenticationHelpers + # def login_as(user) + # # ... + # end + # end + # + # module PreferencesHelpers + # def preferences(user, preferences = {}) + # # ... + # end + # end + # + # module UserHelpers + # def users(username) + # # ... + # end + # end + # + # RSpec.configure do |config| + # config.include(UserHelpers) # included in all groups + # + # # included in examples with `:preferences` metadata + # config.include(PreferenceHelpers, :preferences) + # + # # included in examples with `:type => :request` metadata + # config.include(AuthenticationHelpers, :type => :request) + # + # # included in examples where the `:type` metadata matches a proc condition + # config.include(AuthenticationHelpers, :type => proc { |type, _metadata| [:request, :controller].include?(type) }) + # end + # + # describe "edit profile", :preferences, :type => :request do + # it "can be viewed by owning user" do + # login_as preferences(users(:jdoe), :lang => 'es') + # get "/profiles/jdoe" + # assert_select ".username", :text => 'jdoe' + # end + # end + # + # @note Filtered module inclusions can also be applied to + # individual examples that have matching metadata. Just like + # Ruby's object model is that every object has a singleton class + # which has only a single instance, RSpec's model is that every + # example has a singleton example group containing just the one + # example. + # + # @see #include_context + # @see #extend + # @see #prepend + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1428 + def include(mod, *filters); end + + # Tells RSpec to include the named shared example group in example groups. + # Use `filters` to constrain the groups or examples in which to include + # the example group. + # + # @example + # + # RSpec.shared_context "example admin user" do + # let(:admin_user) { create_user(:admin) } + # end + # + # RSpec.shared_context "example guest user" do + # let(:guest_user) { create_user(:guest) } + # end + # + # RSpec.configure do |config| + # config.include_context "example guest user", :type => :request + # config.include_context "example admin user", :admin, :type => :request + # end + # + # RSpec.describe "The admin page", :type => :request do + # it "can be viewed by admins", :admin do + # login_with admin_user + # get "/admin" + # expect(response).to be_ok + # end + # + # it "cannot be viewed by guests" do + # login_with guest_user + # get "/admin" + # expect(response).to be_forbidden + # end + # end + # + # @note Filtered context inclusions can also be applied to + # individual examples that have matching metadata. Just like + # Ruby's object model is that every object has a singleton class + # which has only a single instance, RSpec's model is that every + # example has a singleton example group containing just the one + # example. + # + # @see #include + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1475 + def include_context(shared_group_name, *filters); end + + # Returns the `inclusion_filter`. If none has been set, returns an empty + # hash. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1313 + def inclusion_filter; end + + # Clears and reassigns the `inclusion_filter`. Set to `nil` if you don't + # want any inclusion filter at all. + # + # ### Warning + # + # This overrides any inclusion filters/tags set on the command line or in + # configuration files. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1304 + def inclusion_filter=(filter); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1101 + def last_run_statuses; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def libs; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:963 + def libs=(libs); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1630 + def load_spec_files; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:522 + def loaded_spec_files; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def max_displayed_failure_line_count; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def max_displayed_failure_line_count=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def max_displayed_failure_line_count?; end + + # Returns the configured mock framework adapter module. + # @return [Symbol] + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:669 + def mock_framework; end + + # Delegates to mock_framework=(framework). + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:681 + def mock_framework=(framework); end + + # Sets the mock framework adapter module. + # + # `framework` can be a Symbol or a Module. + # + # Given any of `:rspec`, `:mocha`, `:flexmock`, or `:rr`, configures the + # named framework. + # + # Given `:nothing`, configures no framework. Use this if you don't use + # any mocking framework to save a little bit of overhead. + # + # Given a Module, includes that module in every example group. The module + # should adhere to RSpec's mock framework adapter API: + # + # setup_mocks_for_rspec + # - called before each example + # + # verify_mocks_for_rspec + # - called after each example if the example hasn't yet failed. + # Framework should raise an exception when expectations fail + # + # teardown_mocks_for_rspec + # - called after verify_mocks_for_rspec (even if there are errors) + # + # If the module responds to `configuration` and `mock_with` receives a + # block, it will yield the configuration object to the block e.g. + # + # config.mock_with OtherMockFrameworkAdapter do |mod_config| + # mod_config.custom_setting = true + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:786 + def mock_with(framework); end + + # Invokes block before defining an example group + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2114 + def on_example_group_definition(&block); end + + # @api private + # Returns an array of blocks to call before defining an example group + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2120 + def on_example_group_definition_callbacks; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def only_failures; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:200 + def only_failures?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:203 + def only_failures_but_not_configured?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1673 + def order=(*args, &block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:522 + def ordering_manager; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1673 + def ordering_registry(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def output_stream; end + + # Set the output stream for reporter. + # @attr value [IO, String] IO to write to or filename to write to, defaults to $stdout + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:274 + def output_stream=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def pattern; end + + # Set pattern to match files to load. + # @attr value [String] the filename pattern to filter spec files by + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:293 + def pattern=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def pending_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def pending_color=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def pending_color?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def pending_failure_output; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:473 + def pending_failure_output=(mode); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def pending_failure_output?; end + + # Tells RSpec to prepend example groups with `mod`. Methods defined in + # `mod` are exposed to examples (not example groups). Use `filters` to + # constrain the groups in which to prepend the module. + # + # Similar to `include`, but module is included before the example group's class + # in the ancestor chain. + # + # @example + # + # module OverrideMod + # def override_me + # "overridden" + # end + # end + # + # RSpec.configure do |config| + # config.prepend(OverrideMod, :method => :prepend) + # end + # + # describe "overriding example's class", :method => :prepend do + # it "finds the user" do + # self.class.class_eval do + # def override_me + # end + # end + # override_me # => "overridden" + # # ... + # end + # end + # + # @see #include + # @see #extend + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1557 + def prepend(mod, *filters); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2045 + def prepend_after(scope = T.unsafe(nil), *meta, &block); end + + # Adds `block` to the start of the list of `before` blocks in the same + # scope (`:example`, `:context`, or `:suite`), in contrast to {#before}, + # which adds the hook to the end of the list. + # + # See {Hooks#before} for full `before` hook docs. + # + # This method differs from {Hooks#prepend_before} in only one way: it supports + # the `:suite` scope. Hooks with the `:suite` scope will be run once before + # the first example of the entire suite is executed. Conditions passed along + # with `:suite` are effectively ignored. + # + # @see #before + # @see #after + # @see #append_after + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2006 + def prepend_before(scope = T.unsafe(nil), *meta, &block); end + + # @macro add_setting + # Report the times for the slowest examples (default: `false`). + # Use this to specify the number of examples to include in the profile. + # @return [Boolean] + # @api private + # + # Defaults `profile_examples` to 10 examples when `@profile_examples` is + # `true`. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1073 + def profile_examples; end + + # @macro add_setting + # Report the times for the slowest examples (default: `false`). + # Use this to specify the number of examples to include in the profile. + # @return [Boolean] + # @api private + # + # Defaults `profile_examples` to 10 examples when `@profile_examples` is + # `true`. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:322 + def profile_examples=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def profile_examples?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def project_source_dirs; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def project_source_dirs=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def project_source_dirs?; end + + # Turns deprecation warnings into errors, in order to surface + # the full backtrace of the call site. This can be useful when + # you need more context to address a deprecation than the + # single-line call site normally provided. + # + # @example + # + # RSpec.configure do |rspec| + # rspec.raise_errors_for_deprecations! + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1833 + def raise_errors_for_deprecations!; end + + # Turns RSpec warnings into errors. This can be useful when + # you want RSpec to run in a 'strict' no warning situation. + # (Note this does not capture or raise on Ruby warnings). + # + # @example + # + # RSpec.configure do |rspec| + # rspec.raise_on_warning = true + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1781 + def raise_on_warning=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1673 + def register_ordering(*args, &block); end + + # @return [RSpec::Core::Reporter] the currently configured reporter + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1056 + def reporter; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def requires; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1597 + def requires=(paths); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:601 + def reset; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:614 + def reset_filters; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:607 + def reset_reporter; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def run_all_when_everything_filtered; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def run_all_when_everything_filtered=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def run_all_when_everything_filtered?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1673 + def seed(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1673 + def seed=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1673 + def seed_used?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def shared_context_metadata_behavior; end + + # @see shared_context_metadata_behavior + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:434 + def shared_context_metadata_behavior=(value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def silence_filter_announcements; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def silence_filter_announcements=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def silence_filter_announcements?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1138 + def spec_files_with_failures; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def start_time; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def start_time=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def start_time?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:520 + def static_config_filter_manager; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:520 + def static_config_filter_manager=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def success_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def success_color=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def success_color?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def threadsafe; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def threadsafe=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def threadsafe?; end + + # @deprecated This config option was added in RSpec 2 to pave the way + # for this being the default behavior in RSpec 3. Now this option is + # a no-op. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:383 + def treat_symbols_as_metadata_keys_with_true_values=(_value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:66 + def tty; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:89 + def tty=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:78 + def tty?; end + + # Set Ruby warnings on or off. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1760 + def warnings=(value); end + + # @return [Boolean] Whether or not ruby warnings are enabled. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1765 + def warnings?; end + + # Defines a callback that runs after the first example with matching + # metadata is defined. If no examples are defined with matching metadata, + # it will not get called at all. + # + # This can be used to ensure some setup is performed (such as bootstrapping + # a DB or loading a specific file that adds significantly to the boot time) + # if needed (as indicated by the presence of an example with matching metadata) + # but avoided otherwise. + # + # @example + # RSpec.configure do |config| + # config.when_first_matching_example_defined(:db) do + # # Load a support file that does some heavyweight setup, + # # including bootstrapping the DB, but only if we have loaded + # # any examples tagged with `:db`. + # require 'support/db' + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1923 + def when_first_matching_example_defined(*filters); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2091 + def with_suite_hooks; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:518 + def world; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:518 + def world=(_arg0); end + + private + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2254 + def absolute_pattern?(pattern); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2355 + def add_hook_to_existing_matching_groups(meta, scope, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2294 + def assert_no_example_groups_defined(config_option); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2344 + def clear_values_derived_from_example_status_persistence_file_path; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2276 + def command; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2320 + def conditionally_disable_expectations_monkey_patching; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2311 + def conditionally_disable_mocks_monkey_patching; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2349 + def configure_group_with(group, module_list, application_method); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2284 + def define_built_in_hooks; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2407 + def define_mixed_in_module(mod, filters, mod_list, config_method, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2259 + def extract_location(path); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2236 + def file_glob_from(path, pattern); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2225 + def gather_directories(path); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2204 + def get_files_to_run(paths); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2231 + def get_matching_files(path, pattern); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2171 + def handle_suite_hook(scope, meta); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2143 + def load_file_handling_errors(method, file); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2377 + def metadata_applies_to_group?(meta, group); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2369 + def on_existing_matching_groups(meta); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2307 + def output_to_tty?(output = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2303 + def output_wrapper; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2216 + def paths_to_check(paths); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2221 + def pattern_might_load_specs_from_vendored_dirs?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2330 + def rspec_expectations_loaded?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2326 + def rspec_mocks_loaded?; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2186 + def run_suite_hooks(hook_description, hooks); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2392 + def safe_extend(mod, host); end + + # for 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2388 + def safe_include(mod, host); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2382 + def safe_prepend(mod, host); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2334 + def update_pattern_attr(name, value); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:2280 + def value_for(key); end + + class << self + # @private + # + # As `add_setting` but only add the reader. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:100 + def add_read_only_setting(name, opts = T.unsafe(nil)); end + + # @private + # + # Invoked by the `add_setting` instance method. Use that method on a + # `Configuration` instance rather than this class method. + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:87 + def add_setting(name, opts = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:70 + def define_alias(name, alias_name); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:77 + def define_predicate(name); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:60 + def define_reader(name); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1671 + def delegate_to_ordering_manager(*methods); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1651 +RSpec::Core::Configuration::DEFAULT_FORMATTER = T.let(T.unsafe(nil), Proc) + +# @private +# +# This buffer is used to capture all messages sent to the reporter during +# reporter initialization. It can then replay those messages after the +# formatter is correctly initialized. Otherwise, deprecation warnings +# during formatter initialization can cause an infinite loop. +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1039 +class RSpec::Core::Configuration::DeprecationReporterBuffer + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1040 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1044 + def deprecation(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1048 + def play_onto(reporter); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1821 +module RSpec::Core::Configuration::ExposeCurrentExample; end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1126 +RSpec::Core::Configuration::FAILED_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:749 +RSpec::Core::Configuration::MOCKING_ADAPTERS = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:57 +class RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError < ::StandardError; end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1129 +RSpec::Core::Configuration::PASSED_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1132 +RSpec::Core::Configuration::PENDING_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1770 +RSpec::Core::Configuration::RAISE_ERROR_WARNING_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# Module that holds `attr_reader` declarations. It's in a separate +# module to allow us to override those methods and use `super`. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:53 +module RSpec::Core::Configuration::Readers + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def default_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def default_path; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def deprecation_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def detail_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def drb; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def drb_port; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def dry_run; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def error_exit_code; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def error_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def example_status_persistence_file_path; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def exclude_pattern; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def fail_fast; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def fail_if_no_examples; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def failure_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def failure_exit_code; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def fixed_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def full_cause_backtrace; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def libs; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def max_displayed_failure_line_count; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def only_failures; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def output_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def pattern; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def pending_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def pending_failure_output; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def project_source_dirs; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def requires; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def run_all_when_everything_filtered; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def shared_context_metadata_behavior; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def silence_filter_announcements; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def start_time; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def success_color; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def threadsafe; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration.rb:63 + def tty; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1123 +RSpec::Core::Configuration::UNKNOWN_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/configuration.rb:1135 +RSpec::Core::Configuration::VALID_STATUSES = T.let(T.unsafe(nil), Array) + +# Responsible for utilizing externally provided configuration options, +# whether via the command line, `.rspec`, `~/.rspec`, +# `$XDG_CONFIG_HOME/rspec/options`, `.rspec-local` or a custom options +# file. +# +# pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:10 +class RSpec::Core::ConfigurationOptions + # @param args [Array] command line arguments + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:12 + def initialize(args); end + + # @return [Array] the original command-line arguments + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:40 + def args; end + + # Updates the provided {Configuration} instance based on the provided + # external configuration options. + # + # @param config [Configuration] the configuration instance to update + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:21 + def configure(config); end + + # @api private + # Updates the provided {FilterManager} based on the filter options. + # @param filter_manager [FilterManager] instance to update + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:30 + def configure_filter_manager(filter_manager); end + + # @return [Hash] the final merged options, drawn from all external sources + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:37 + def options; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:173 + def args_from_options_file(path); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:142 + def command_line_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:146 + def custom_options; end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:190 + def custom_options_file; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:133 + def env_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:125 + def file_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:66 + def force?(key); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:158 + def global_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:202 + def global_options_file; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:213 + def home_options_file_path; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:121 + def load_formatters_into(config); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:150 + def local_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:198 + def local_options_file; end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:181 + def options_file_as_erb_string(path); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:162 + def options_from(path); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:70 + def order(keys); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:44 + def organize_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:167 + def parse_args_ignoring_files_or_dirs_to_run(args, source); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:113 + def process_options_into(config); end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:154 + def project_options; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:194 + def project_options_file; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:229 + def resolve_xdg_config_home; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:206 + def xdg_options_file_if_exists; end + + # pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:222 + def xdg_options_file_path; end +end + +# pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:77 +RSpec::Core::ConfigurationOptions::OPTIONS_ORDER = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:59 +RSpec::Core::ConfigurationOptions::UNFORCED_OPTIONS = T.let(T.unsafe(nil), RSpec::Core::Set) + +# pkg:gem/rspec-core#lib/rspec/core/configuration_options.rb:64 +RSpec::Core::ConfigurationOptions::UNPROCESSABLE_OPTIONS = T.let(T.unsafe(nil), RSpec::Core::Set) + +# DSL defines methods to group examples, most notably `describe`, +# and exposes them as class methods of {RSpec}. They can also be +# exposed globally (on `main` and instances of `Module`) through +# the {Configuration} option `expose_dsl_globally`. +# +# By default the methods `describe`, `context` and `example_group` +# are exposed. These methods define a named context for one or +# more examples. The given block is evaluated in the context of +# a generated subclass of {RSpec::Core::ExampleGroup}. +# +# ## Examples: +# +# RSpec.describe "something" do +# context "when something is a certain way" do +# it "does something" do +# # example code goes here +# end +# end +# end +# +# @see ExampleGroup +# @see ExampleGroup.example_group +# +# pkg:gem/rspec-core#lib/rspec/core/dsl.rb:25 +module RSpec::Core::DSL + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:89 + def change_global_dsl(&changes); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:27 + def example_group_aliases; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:37 + def expose_example_group_alias(name); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:81 + def expose_example_group_alias_globally(method_name); end + + # Adds the describe method to Module and the top level binding. + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:58 + def expose_globally!; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:32 + def exposed_globally?; end + + # Removes the describe method from Module and the top level binding. + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:70 + def remove_globally!; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:53 + def top_level; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/dsl.rb:53 + def top_level=(_arg0); end + end +end + +# Deprecation Error. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:221 +class RSpec::Core::DeprecationError < ::StandardError; end + +# @private +# Wrapper around Ruby's `DidYouMean::SpellChecker` when available to provide file name suggestions. +# +# pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:5 +class RSpec::Core::DidYouMean + # pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:8 + def initialize(relative_file_name); end + + # provide probable suggestions + # :nocov: - not installed on CI + # return a hint if API for ::DidYouMean::SpellChecker not supported + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:15 + def call; end + + # pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:6 + def relative_file_name; end + + private + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:35 + def formats(probables); end + + # pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:45 + def red_font(mytext); end + + # pkg:gem/rspec-core#lib/rspec/core/did_you_mean.rb:40 + def top_and_tail(rspec_format); end +end + +# Wrapper for an instance of a subclass of {ExampleGroup}. An instance of +# `RSpec::Core::Example` is returned by example definition methods +# such as {ExampleGroup.it it} and is yielded to the {ExampleGroup.it it}, +# {Hooks#before before}, {Hooks#after after}, {Hooks#around around}, +# {MemoizedHelpers::ClassMethods#let let} and +# {MemoizedHelpers::ClassMethods#subject subject} blocks. +# +# This allows us to provide rich metadata about each individual +# example without adding tons of methods directly to the ExampleGroup +# that users may inadvertently redefine. +# +# Useful for configuring logging and/or taking some action based +# on the state of an example's metadata. +# +# @example +# +# RSpec.configure do |config| +# config.before do |example| +# log example.description +# end +# +# config.after do |example| +# log example.description +# end +# +# config.around do |example| +# log example.description +# example.run +# end +# end +# +# shared_examples "auditable" do +# it "does something" do +# log "#{example.full_description}: #{auditable.inspect}" +# auditable.should do_something +# end +# end +# +# @see ExampleGroup +# @note Example blocks are evaluated in the context of an instance +# of an `ExampleGroup`, not in the context of an instance of `Example`. +# +# pkg:gem/rspec-core#lib/rspec/core/example.rb:44 +class RSpec::Core::Example + # Creates a new instance of Example. + # @param example_group_class [Class] the subclass of ExampleGroup in which + # this Example is declared + # @param description [String] the String passed to the `it` method (or + # alias) + # @param user_metadata [Hash] additional args passed to `it` to be used as + # metadata + # @param example_block [Proc] the block of code that represents the + # example + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:186 + def initialize(example_group_class, description, user_metadata, example_block = T.unsafe(nil)); end + + # @attr + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:174 + def clock; end + + # @attr + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:174 + def clock=(_arg0); end + + # Returns the string submitted to `example` or its aliases (e.g. + # `specify`, `it`, etc). If no string is submitted (e.g. + # `it { is_expected.to do_something }`) it returns the message generated + # by the matcher if there is one, otherwise returns a message including + # the location of the example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:76 + def description; end + + # @private + # + # The exception that will be displayed to the user -- either the failure of + # the example or the `pending_exception` if the example is pending. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:388 + def display_exception; end + + # @private + # + # Assigns the exception that will be displayed to the user -- either the failure of + # the example or the `pending_exception` if the example is pending. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:396 + def display_exception=(ex); end + + # Duplicates the example and overrides metadata with the provided + # hash. + # + # @param metadata_overrides [Hash] the hash to override the example metadata + # @return [Example] a duplicate of the example with modified metadata + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:132 + def duplicate_with(metadata_overrides = T.unsafe(nil)); end + + # Returns the example group class that provides the context for running + # this example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:230 + def example_group; end + + # @attr_reader + # @private + # + # Returns the example_group_instance that provides the context for + # running this example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:170 + def example_group_instance; end + + # @attr_reader + # + # Returns the first exception raised in the context of running this + # example (nil if no exception is raised). + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:158 + def exception; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:49 + def execution_result; end + + # @private + # + # Used internally to set an exception and fail without actually executing + # the example when an exception is raised in before(:context). + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:439 + def fail_with_exception(reporter, exception); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:49 + def file_path; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:49 + def full_description; end + + # @return [String] the unique id of this example. Pass + # this at the command line to re-run this exact example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:117 + def id; end + + # Provide a human-readable representation of this class + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:220 + def inspect; end + + # Returns a description of the example that always includes the location. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:87 + def inspect_output; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:456 + def instance_exec(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:49 + def location; end + + # Returns the location-based argument that can be passed to the `rspec` command to rerun this example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:96 + def location_rerun_argument; end + + # @attr_reader + # + # Returns the metadata object associated with this example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:163 + def metadata; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:49 + def pending; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:234 + def pending?; end + + # @return [RSpec::Core::Reporter] the current reporter for the example + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:226 + def reporter; end + + # Returns the location-based argument that can be passed to the `rspec` command to rerun this example. + # + # @deprecated Use {#location_rerun_argument} instead. + # @note If there are multiple examples identified by this location, they will use {#id} + # to rerun instead, but this method will still return the location (that's why it is deprecated!). + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:111 + def rerun_argument; end + + # @api private + # instance_execs the block passed to the constructor in the context of + # the instance of {ExampleGroup}. + # @param example_group_instance the instance of an ExampleGroup subclass + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:246 + def run(example_group_instance, reporter); end + + # @private + # + # Used to set the exception when `aggregate_failures` fails. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:425 + def set_aggregate_failures_exception(exception); end + + # @private + # + # Used internally to set an exception in an after hook, which + # captures the exception but doesn't raise it. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:412 + def set_exception(exception); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:49 + def skip; end + + # @private + # + # Used internally to skip without actually executing the example when + # skip is used in before(:context). + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:449 + def skip_with_exception(reporter, exception); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:238 + def skipped?; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:223 + def to_s; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:148 + def update_inherited_metadata(updates); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:534 + def assign_generated_description; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:478 + def finish(reporter); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:543 + def generate_description; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:462 + def hooks; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:550 + def location_description; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:530 + def mocks_need_verification?; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:498 + def record_finished(status, reporter); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:516 + def run_after_example; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:503 + def run_before_example; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:473 + def start(reporter); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:524 + def verify_mocks; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:508 + def with_around_and_singleton_context_hooks; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:466 + def with_around_example_hooks; end + + class << self + # @private + # + # Used to define methods that delegate to this example's metadata. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:48 + def delegate_to_metadata(key); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:122 + def parse_id(id); end + end +end + +# :nocov: +# For some reason, rescuing `Support::AllExceptionsExceptOnesWeMustNotRescue` +# in place of `Exception` above can cause the exit status to be the wrong +# thing. I have no idea why. See: +# https://github.com/rspec/rspec-core/pull/2063#discussion_r38284978 +# @private +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/example.rb:310 +RSpec::Core::Example::AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt = RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue + +# Represents the result of executing an example. +# Behaves like a hash for backwards compatibility. +# +# pkg:gem/rspec-core#lib/rspec/core/example.rb:556 +class RSpec::Core::Example::ExecutionResult + include ::RSpec::Core::HashImitatable + extend ::RSpec::Core::HashImitatable::ClassMethods + + # @api private + # Populates finished_at and run_time if it has not yet been set + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:610 + def ensure_timing_set(clock); end + + # @return [Boolean] Indicates if the example was completely skipped + # (typically done via `:skip` metadata or the `skip` method). Skipped examples + # will have a `:pending` result. A `:pending` result can also come from examples + # that were marked as `:pending`, which causes them to be run, and produces a + # `:failed` result if the example passes. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:597 + def example_skipped?; end + + # @return [Exception, nil] The failure, if there was one. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:563 + def exception; end + + # @return [Exception, nil] The failure, if there was one. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:563 + def exception=(_arg0); end + + # @return [Time] When the example finished. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:569 + def finished_at; end + + # @return [Time] When the example finished. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:569 + def finished_at=(_arg0); end + + # @return [Exception, nil] The exception triggered while + # executing the pending example. If no exception was triggered + # it would no longer get a status of `:pending` unless it was + # tagged with `:skip`. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:582 + def pending_exception; end + + # @return [Exception, nil] The exception triggered while + # executing the pending example. If no exception was triggered + # it would no longer get a status of `:pending` unless it was + # tagged with `:skip`. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:582 + def pending_exception=(_arg0); end + + # @return [Boolean] For examples tagged with `:pending`, + # this indicates whether or not it now passes. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:586 + def pending_fixed; end + + # @return [Boolean] For examples tagged with `:pending`, + # this indicates whether or not it now passes. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:586 + def pending_fixed=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:588 + def pending_fixed?; end + + # @return [String, nil] The reason the example was pending, + # or nil if the example was not pending. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:576 + def pending_message; end + + # @return [String, nil] The reason the example was pending, + # or nil if the example was not pending. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:576 + def pending_message=(_arg0); end + + # @api private + # Records the finished status of the example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:603 + def record_finished(status, finished_at); end + + # @return [Float] How long the example took in seconds. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:572 + def run_time; end + + # @return [Float] How long the example took in seconds. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:572 + def run_time=(_arg0); end + + # @return [Time] When the example started. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:566 + def started_at; end + + # @return [Time] When the example started. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:566 + def started_at=(_arg0); end + + # @return [Symbol] `:passed`, `:failed` or `:pending`. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:560 + def status; end + + # @return [Symbol] `:passed`, `:failed` or `:pending`. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:560 + def status=(_arg0); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:616 + def calculate_run_time(finished_at); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:634 + def get_value(name); end + + # For backwards compatibility we present `status` as a string + # when presenting the legacy hash interface. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:623 + def hash_for_delegation; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:642 + def issue_deprecation(_method_name, *_args); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:629 + def set_value(name, value); end +end + +# Wraps both a `Proc` and an {Example} for use in {Hooks#around +# around} hooks. In around hooks we need to yield this special +# kind of object (rather than the raw {Example}) because when +# there are multiple `around` hooks we have to wrap them recursively. +# +# @example +# +# RSpec.configure do |c| +# c.around do |ex| # Procsy which wraps the example +# if ex.metadata[:key] == :some_value && some_global_condition +# raise "some message" +# end +# ex.run # run delegates to ex.call. +# end +# end +# +# @note This class also exposes the instance methods of {Example}, +# proxying them through to the wrapped {Example} instance. +# +# pkg:gem/rspec-core#lib/rspec/core/example.rb:331 +class RSpec::Core::Example::Procsy + # pkg:gem/rspec-core#lib/rspec/core/example.rb:362 + def initialize(example, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def <<(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def ==(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def ===(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def >>(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def [](*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def arity(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def binding(*a, &b); end + + # Calls the proc and notes that the example has been executed. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:350 + def call(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def clock(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def clock=(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def clone(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def curry(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def description(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def dup(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def duplicate_with(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def eql?(*a, &b); end + + # The {Example} instance. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:333 + def example; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def example_group(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def example_group_instance(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def exception(*a, &b); end + + # Indicates whether or not the around hook has executed the example. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:374 + def executed?; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def execution_result(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def file_path(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def full_description(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def hash(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def id(*a, &b); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:379 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def inspect_output(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def lambda?(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def location(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def location_rerun_argument(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def metadata(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def parameters(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def pending(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def pending?(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def reporter(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def rerun_argument(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def ruby2_keywords(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:354 + def run(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def skip(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def skipped?(*a, &b); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def source_location(*a, &b); end + + # Provides a wrapped proc that will update our `executed?` state when + # executed. + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:358 + def to_proc; end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:339 + def update_inherited_metadata(*a, &b); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example.rb:369 + def wrap(&block); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:346 + def yield(*a, &b); end +end + +# ExampleGroup and {Example} are the main structural elements of +# rspec-core. Consider this example: +# +# RSpec.describe Thing do +# it "does something" do +# end +# end +# +# The object returned by `describe Thing` is a subclass of ExampleGroup. +# The object returned by `it "does something"` is an instance of Example, +# which serves as a wrapper for an instance of the ExampleGroup in which it +# is declared. +# +# Example group bodies (e.g. `describe` or `context` blocks) are evaluated +# in the context of a new subclass of ExampleGroup. Individual examples are +# evaluated in the context of an instance of the specific ExampleGroup +# subclass to which they belong. +# +# Besides the class methods defined here, there are other interesting macros +# defined in {Hooks}, {MemoizedHelpers::ClassMethods} and +# {SharedExampleGroup}. There are additional instance methods available to +# your examples defined in {MemoizedHelpers} and {Pending}. +# +# pkg:gem/rspec-core#lib/rspec/core/example_group.rb:29 +class RSpec::Core::ExampleGroup + include ::RSpec::Core::MemoizedHelpers + include ::RSpec::Core::Pending + extend ::RSpec::Core::Hooks + extend ::RSpec::Core::MemoizedHelpers::ClassMethods + extend ::RSpec::Core::SharedExampleGroup + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:714 + def initialize(inspect_output = T.unsafe(nil)); end + + # Returns the class or module passed to the `describe` method (or alias). + # Returns nil if the subject is not a class or module. + # @example + # RSpec.describe Thing do + # it "does something" do + # described_class == Thing + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:99 + def described_class; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:720 + def inspect; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:765 + def method_missing(name, *args, **); end + + class << self + # Adds an example to the example group + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:374 + def add_example(example); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:536 + def before_context_ivars; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:473 + def children; end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def context(*args, &example_group_block); end + + # Returns true if a `before(:context)` or `after(:context)` + # hook is currently executing. + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:549 + def currently_executing_a_context_hook?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:674 + def declaration_locations; end + + # @private + # @macro [attach] define_example_group_method + # @!scope class + # @method $1 + # @overload $1 + # @overload $1(&example_group_definition) + # @param example_group_definition [Block] The definition of the example group. + # @overload $1(doc_string, *metadata, &example_implementation) + # @param doc_string [String] The group's doc string. + # @param metadata [Array, Hash] Metadata for the group. + # Symbols will be transformed into hash entries with `true` values. + # @param example_group_definition [Block] The definition of the example group. + # @return [RSpec::Core::ExampleGroup] + # + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # $1 "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # $1 "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # + # @see DSL#describe + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:248 + def define_example_group_method(name, metadata = T.unsafe(nil)); end + + # @private + # @macro [attach] define_example_method + # @!scope class + # @method $1 + # @overload $1 + # @overload $1(&example_implementation) + # @param example_implementation [Block] The implementation of the example. + # @overload $1(doc_string, *metadata) + # @param doc_string [String] The example's doc string. + # @param metadata [Array, Hash] Metadata for the example. + # Symbols will be transformed into hash entries with `true` values. + # @overload $1(doc_string, *metadata, &example_implementation) + # @param doc_string [String] The example's doc string. + # @param metadata [Array, Hash] Metadata for the example. + # Symbols will be transformed into hash entries with `true` values. + # @param example_implementation [Block] The implementation of the example. + # @yield [Example] the example object + # @example + # $1 do + # end + # + # $1 "does something" do + # end + # + # $1 "does something", :slow, :uses_js do + # end + # + # $1 "does something", :with => 'additional metadata' do + # end + # + # $1 "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # + # @example + # $1 "does something", :slow, :load_factor => 100 do + # end + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:145 + def define_example_method(name, extra_options = T.unsafe(nil)); end + + # @private + # @macro [attach] define_nested_shared_group_method + # @!scope class + # @method $1(name, *args, &block) + # @param name [String, Symbol] The name of the shared group to include. + # @param args [Array] Pass parameters to a shared example group + # @param block [Block] Additional context to pass to the shared group. + # @return [RSpec::Core::ExampleGroup] + # + # @see SharedExampleGroup + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:324 + def define_nested_shared_group_method(new_name, report_label = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:76 + def delegate_to_metadata(*names); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:467 + def descendant_filtered_examples; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:510 + def descendants; end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def describe(*args, &example_group_block); end + + # Returns the class or module passed to the `describe` method (or alias). + # Returns nil if the subject is not a class or module. + # @example + # RSpec.describe Thing do + # it "does something" do + # described_class == Thing + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def described_class; end + + # @return [String] the current example group description + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:85 + def description; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:707 + def each_instance_variable_for_example(group); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:525 + def ensure_example_groups_are_configured; end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def example(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def example_group(*args, &example_group_block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:457 + def examples; end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def fcontext(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def fdescribe(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def fexample(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def file_path; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:462 + def filtered_examples; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:386 + def find_and_eval_shared(label, name, inclusion_location, *args, &customization_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def fit(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def focus(*all_args, &block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:662 + def for_filtered_examples(reporter, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def fspecify(*all_args, &block); end + + # @return [String] the unique id of this example group. Pass + # this at the command line to re-run this exact example group. + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:682 + def id; end + + # Define a singleton method for the singleton class (remove the method if + # it's already been defined). + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:40 + def idempotently_define_singleton_method(name, &definition); end + + # Includes shared content mapped to `name` directly in the group in which + # it is declared, as opposed to `it_behaves_like`, which creates a nested + # group. If given a block, that block is also eval'd in the current + # context. + # + # @see SharedExampleGroup + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:350 + def include_context(name, *args, &block); end + + # Includes shared content mapped to `name` directly in the group in which + # it is declared, as opposed to `it_behaves_like`, which creates a nested + # group. If given a block, that block is also eval'd in the current + # context. + # + # @see SharedExampleGroup + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:360 + def include_examples(name, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def it(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def it_behaves_like(name, *args, &customization_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def it_should_behave_like(name, *args, &customization_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def location; end + + # The [Metadata](Metadata) object associated with this group. + # @see Metadata + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:51 + def metadata; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:492 + def next_runnable_index_for(file); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:632 + def ordering_strategy; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:515 + def parent_groups; end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def pending(*all_args, &block); end + + # Removes an example from the example group + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:380 + def remove_example(example); end + + # Clear memoized values when adding/removing examples + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:366 + def reset_memoized; end + + # Runs all the examples in this group. + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:606 + def run(reporter = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:592 + def run_after_context_hooks(example_group_instance); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:554 + def run_before_context_hooks(example_group_instance); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:648 + def run_examples(reporter); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:417 + def set_it_up(description, args, registration_collection, &example_group_block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:692 + def set_ivars(instance, ivars); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def skip(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def specify(*all_args, &block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:541 + def store_before_context_ivars(example_group_instance); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:402 + def subclass(parent, description, args, registration_collection, &example_group_block); end + + # 1.8.7 + # :nocov: + # @private + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:569 + def superclass_before_context_ivars; end + + # @private + # @return [Metadata] belonging to the parent of a nested {ExampleGroup} + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:71 + def superclass_metadata; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:520 + def top_level?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:687 + def top_level_description; end + + # @private + # Traverses the tree of groups, starting with `self`, then the children, recursively. + # Halts the traversal of a branch of the tree as soon as the passed block returns true. + # Note that siblings groups and their sub-trees will continue to be explored. + # This is intended to make it easy to find the top-most group that satisfies some + # condition. + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:483 + def traverse_tree_until(&block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:734 + def update_inherited_metadata(updates); end + + # Temporarily replace the provided metadata. + # Intended primarily to allow an example group's singleton class + # to return the metadata of the example that it exists for. This + # is necessary for shared example group inclusion to work properly + # with singleton example groups. + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:61 + def with_replaced_metadata(meta); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def xcontext(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def xdescribe(*args, &example_group_block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def xexample(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def xit(*all_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:43 + def xspecify(*all_args, &block); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:749 + def method_missing(name, *args); end + end +end + +# :nocov: +# @private +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/example_group.rb:703 +RSpec::Core::ExampleGroup::INSTANCE_VARIABLE_TO_IGNORE = T.let(T.unsafe(nil), Symbol) + +# Raised when an RSpec API is called in the wrong scope, such as `before` +# being called from within an example rather than from within an example +# group block. +# +# pkg:gem/rspec-core#lib/rspec/core/example_group.rb:747 +class RSpec::Core::ExampleGroup::WrongScopeError < ::NoMethodError; end + +# Dumps a list of hashes in a pretty, human readable format +# for later parsing. The hashes are expected to have symbol +# keys and string values, and each hash should have the same +# set of keys. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:143 +class RSpec::Core::ExampleStatusDumper + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:148 + def initialize(examples); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:152 + def dump; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:188 + def column_widths; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:159 + def formatted_header_rows; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:176 + def formatted_row_from(row_values); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:166 + def formatted_value_rows; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:184 + def headers; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:172 + def rows; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:144 + def dump(examples); end + end +end + +# Merges together a list of example statuses from this run +# and a list from previous runs (presumably loaded from disk). +# Each example status object is expected to be a hash with +# at least an `:example_id` and a `:status` key. Examples that +# were loaded but not executed (due to filtering, `--fail-fast` +# or whatever) should have a `:status` of `UNKNOWN_STATUS`. +# +# This will produce a new list that: +# - Will be missing examples from previous runs that we know for sure +# no longer exist. +# - Will have the latest known status for any examples that either +# definitively do exist or may still exist. +# - Is sorted by file name and example definition order, so that +# the saved file is easily scannable if users want to inspect it. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:74 +class RSpec::Core::ExampleStatusMerger + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:79 + def initialize(this_run, from_previous_runs); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:85 + def merge; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:102 + def delete_previous_examples_that_no_longer_exist; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:108 + def example_must_no_longer_exist?(ex_id); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:95 + def hash_from(example_list); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:124 + def loaded_spec_files; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:132 + def sort_value_from(example); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:128 + def spec_file_from(ex_id); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:75 + def merge(this_run, from_previous_runs); end + end +end + +# Parses a string that has been previously dumped by ExampleStatusDumper. +# Note that this parser is a bit naive in that it does a simple split on +# "\n" and " | ", with no concern for handling escaping. For now, that's +# OK because the values we plan to persist (example id, status, and perhaps +# example duration) are highly unlikely to contain "\n" or " | " -- after +# all, who puts those in file names? +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:207 +class RSpec::Core::ExampleStatusParser + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:212 + def initialize(string); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:216 + def parse; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:226 + def headers; end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:222 + def parse_row(line); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:230 + def split_line(line); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:208 + def parse(string); end + end +end + +# Persists example ids and their statuses so that we can filter +# to just the ones that failed the last time they ran. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:8 +class RSpec::Core::ExampleStatusPersister + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:18 + def initialize(examples, file_name); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:23 + def persist; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:40 + def dump_statuses(unparsed_previous_runs); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:46 + def statuses_from_this_run; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:9 + def load_from(file_name); end + + # pkg:gem/rspec-core#lib/rspec/core/example_status_persister.rb:14 + def persist(examples, file_name); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:183 +RSpec::Core::ExclusionRules = RSpec::Core::FilterRules + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:4 +class RSpec::Core::FilterManager + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:7 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:22 + def add_ids(rerun_path, scoped_ids); end + + # @api private + # + # @param file_path [String] + # @param line_numbers [Array] + # + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:15 + def add_location(file_path, line_numbers); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:30 + def empty?; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:57 + def exclude(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:61 + def exclude_only(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:65 + def exclude_with_low_priority(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:5 + def exclusions; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:69 + def include(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:73 + def include_only(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:77 + def include_with_low_priority(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:5 + def inclusions; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:34 + def prune(examples); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:83 + def add_path_to_arrays_filter(filter_key, path, values); end + + # When a user specifies a particular spec location, that takes priority + # over any exclusion filters (such as if the spec is tagged with `:slow` + # and there is a `:slow => true` exclusion filter), but only for specs + # defined in the same file as the location filters. Excluded specs in + # other files should still be excluded. + # + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:101 + def file_scoped_include?(ex_metadata, ids, locations); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:89 + def prune_conditionally_filtered_examples(examples); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:115 +class RSpec::Core::FilterRules + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:130 + def initialize(rules = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:161 + def [](key); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:134 + def add(updated); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:138 + def add_with_low_priority(updated); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:149 + def clear; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:153 + def delete(key); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:173 + def description; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:169 + def each_pair(&block); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:165 + def empty?; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:157 + def fetch(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:177 + def include_example?(example); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:119 + def opposite; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:119 + def opposite=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:120 + def rules; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:144 + def use_only(updated); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:122 + def build; end + end +end + +# pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:116 +RSpec::Core::FilterRules::PROC_HEX_NUMBER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:117 +RSpec::Core::FilterRules::PROJECT_DIR = T.let(T.unsafe(nil), String) + +# Tracks a collection of filterable items (e.g. modules, hooks, etc) +# and provides an optimized API to get the applicable items for the +# metadata of an example or example group. +# +# There are two implementations, optimized for different uses. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:87 +module RSpec::Core::FilterableItemRepository; end + +# This implementation is much more complex, and is optimized for +# rare (or hopefully no) updates once the queries start. Updates +# incur a cost as it has to clear the memoization and keep track +# of applicable keys. Queries will be O(N) the first time an item +# is provided with a given set of applicable metadata; subsequent +# queries with items with the same set of applicable metadata will +# be O(1) due to internal memoization. +# +# This is ideal for use by config, where filterable items (e.g. hooks) +# are typically added at the start of the process (e.g. in `spec_helper`) +# and then repeatedly queried as example groups and examples are defined. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:151 +class RSpec::Core::FilterableItemRepository::QueryOptimized < ::RSpec::Core::FilterableItemRepository::UpdateOptimized + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:155 + def initialize(applies_predicate); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:164 + def append(item, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:174 + def delete(item, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:179 + def items_for(metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:169 + def prepend(item, metadata); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:217 + def applicable_metadata_from(metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:152 + def find_items_for(request_meta); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:211 + def handle_mutation(metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:235 + def proc_keys_from(metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:203 + def reconstruct_caches; end +end + +# This implementation is simple, and is optimized for frequent +# updates but rare queries. `append` and `prepend` do no extra +# processing, and no internal memoization is done, since this +# is not optimized for queries. +# +# This is ideal for use by a example or example group, which may +# be updated multiple times with globally configured hooks, etc, +# but will not be queried frequently by other examples or example +# groups. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:98 +class RSpec::Core::FilterableItemRepository::UpdateOptimized + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:101 + def initialize(applies_predicate); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:106 + def append(item, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:114 + def delete(item, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:99 + def items_and_filters; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:118 + def items_for(request_meta); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:110 + def prepend(item, metadata); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/flat_map.rb:4 +module RSpec::Core::FlatMap + private + + # for 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/flat_map.rb:6 + def flat_map(array, &block); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/flat_map.rb:17 + def flat_map(array, &block); end + end +end + +# ## Built-in Formatters +# +# * progress (default) - Prints dots for passing examples, `F` for failures, `*` +# for pending. +# * documentation - Prints the docstrings passed to `describe` and `it` methods +# (and their aliases). +# * html +# * json - Useful for archiving data for subsequent analysis. +# +# The progress formatter is the default, but you can choose any one or more of +# the other formatters by passing with the `--format` (or `-f` for short) +# command-line option, e.g. +# +# rspec --format documentation +# +# You can also send the output of multiple formatters to different streams, e.g. +# +# rspec --format documentation --format html --out results.html +# +# This example sends the output of the documentation formatter to `$stdout`, and +# the output of the html formatter to results.html. +# +# ## Custom Formatters +# +# You can tell RSpec to use a custom formatter by passing its path and name to +# the `rspec` command. For example, if you define MyCustomFormatter in +# path/to/my_custom_formatter.rb, you would type this command: +# +# rspec --require path/to/my_custom_formatter.rb --format MyCustomFormatter +# +# The reporter calls every formatter with this protocol: +# +# * To start +# * `start(StartNotification)` +# * Once per example group +# * `example_group_started(GroupNotification)` +# * Once per example +# * `example_started(ExampleNotification)` +# * One of these per example, depending on outcome +# * `example_passed(ExampleNotification)` +# * `example_failed(FailedExampleNotification)` +# * `example_pending(ExampleNotification)` +# * Optionally at any time +# * `message(MessageNotification)` +# * At the end of the suite +# * `stop(ExamplesNotification)` +# * `start_dump(NullNotification)` +# * `dump_pending(ExamplesNotification)` +# * `dump_failures(ExamplesNotification)` +# * `dump_summary(SummaryNotification)` +# * `seed(SeedNotification)` +# * `close(NullNotification)` +# +# Only the notifications to which you subscribe your formatter will be called +# on your formatter. To subscribe your formatter use: +# `RSpec::Core::Formatters#register` e.g. +# +# `RSpec::Core::Formatters.register FormatterClassName, :example_passed, :example_failed` +# +# We recommend you implement the methods yourself; for simplicity we provide the +# default formatter output via our notification objects but if you prefer you +# can subclass `RSpec::Core::Formatters::BaseTextFormatter` and override the +# methods you wish to enhance. +# +# @see RSpec::Core::Formatters::BaseTextFormatter +# @see RSpec::Core::Reporter +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:3 +module RSpec::Core::Formatters + class << self + # Register the formatter class + # @param formatter_class [Class] formatter class to register + # @param notifications [Array] one or more notifications to be + # registered to the specified formatter + # + # @see RSpec::Core::Formatters::BaseFormatter + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:86 + def register(formatter_class, *notifications); end + end +end + +# Contains common logic for formatters used by `--bisect` to communicate results +# back to the bisect runner. +# +# Subclasses must define a `notify_results(all_example_ids, failed_example_ids)` +# method. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/base_bisect_formatter.rb:12 +class RSpec::Core::Formatters::BaseBisectFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_bisect_formatter.rb:17 + def initialize(expected_failures); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_bisect_formatter.rb:23 + def example_failed(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_bisect_formatter.rb:27 + def example_finished(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_bisect_formatter.rb:37 + def start_dump(_notification); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_bisect_formatter.rb:13 + def inherited(formatter); end + end +end + +# RSpec's built-in formatters are all subclasses of +# RSpec::Core::Formatters::BaseFormatter. +# +# @see RSpec::Core::Formatters::BaseTextFormatter +# @see RSpec::Core::Reporter +# @see RSpec::Core::Formatters::Protocol +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:13 +class RSpec::Core::Formatters::BaseFormatter + # @api public + # @param output [IO] the formatter output + # @see RSpec::Core::Formatters::Protocol#initialize + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:23 + def initialize(output); end + + # @api public + # + # @param _notification [NullNotification] (Ignored) + # @see RSpec::Core::Formatters::Protocol#close + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:50 + def close(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:17 + def example_group; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:17 + def example_group=(_arg0); end + + # @api public + # + # @param notification [GroupNotification] containing example_group + # subclass of `RSpec::Core::ExampleGroup` + # @see RSpec::Core::Formatters::Protocol#example_group_started + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:42 + def example_group_started(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:18 + def output; end + + # @api public + # + # @param notification [StartNotification] + # @see RSpec::Core::Formatters::Protocol#start + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:32 + def start(notification); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:64 + def output_supports_sync; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:60 + def restore_sync_output; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_formatter.rb:56 + def start_sync_output; end +end + +# Base for all of RSpec's built-in formatters. See +# RSpec::Core::Formatters::BaseFormatter to learn more about all of the +# methods called by the reporter. +# +# @see RSpec::Core::Formatters::BaseFormatter +# @see RSpec::Core::Reporter +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:12 +class RSpec::Core::Formatters::BaseTextFormatter < ::RSpec::Core::Formatters::BaseFormatter + # @api public + # + # Invoked at the end of a suite run. Allows the formatter to do any + # tidying up, but be aware that formatter output streams may be used + # elsewhere so don't actually close them. + # + # @param _notification [NullNotification] (Ignored) + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:65 + def close(_notification); end + + # @api public + # + # Dumps detailed information about each example failure. + # + # @param notification [NullNotification] + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:30 + def dump_failures(notification); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:47 + def dump_pending(notification); end + + # @api public + # + # This method is invoked after the dumping of examples and failures. + # Each parameter is assigned to a corresponding attribute. + # + # @param summary [SummaryNotification] containing duration, + # example_count, failure_count and pending_count + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:42 + def dump_summary(summary); end + + # @api public + # + # Used by the reporter to send messages to the output stream. + # + # @param notification [MessageNotification] containing message + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:21 + def message(notification); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/base_text_formatter.rb:53 + def seed(notification); end +end + +# Used by `--bisect`. When it shells out and runs a portion of the suite, it uses +# this formatter as a means to have the status reported back to it, via DRb. +# +# Note that since DRb calls carry considerable overhead compared to normal +# method calls, we try to minimize the number of DRb calls for perf reasons, +# opting to communicate only at the start and the end of the run, rather than +# after each example. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/bisect_drb_formatter.rb:15 +class RSpec::Core::Formatters::BisectDRbFormatter < ::RSpec::Core::Formatters::BaseBisectFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/bisect_drb_formatter.rb:16 + def initialize(_output); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/bisect_drb_formatter.rb:23 + def notify_results(results); end +end + +# ConsoleCodes provides helpers for formatting console output +# with ANSI codes, e.g. color's and bold. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:6 +module RSpec::Core::Formatters::ConsoleCodes + private + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:34 + def config_colors_to_methods; end + + # Fetches the correct code for the supplied symbol, or checks + # that a code is valid. Defaults to white (37). + # + # @param code_or_symbol [Symbol, Fixnum] Symbol or code to check + # @return [Fixnum] a console code + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:47 + def console_code_for(code_or_symbol); end + + # Wraps a piece of text in ANSI codes with the supplied code. Will + # only apply the control code if `RSpec.configuration.color_enabled?` + # returns true. + # + # @param text [String] the text to wrap + # @param code_or_symbol [Symbol, Fixnum] the desired control code + # @return [String] the wrapped text + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:66 + def wrap(text, code_or_symbol); end + + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:34 + def config_colors_to_methods; end + + # Fetches the correct code for the supplied symbol, or checks + # that a code is valid. Defaults to white (37). + # + # @param code_or_symbol [Symbol, Fixnum] Symbol or code to check + # @return [Fixnum] a console code + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:47 + def console_code_for(code_or_symbol); end + + # Wraps a piece of text in ANSI codes with the supplied code. Will + # only apply the control code if `RSpec.configuration.color_enabled?` + # returns true. + # + # @param text [String] the text to wrap + # @param code_or_symbol [Symbol, Fixnum] the desired control code + # @return [String] the wrapped text + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:66 + def wrap(text, code_or_symbol); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:8 +RSpec::Core::Formatters::ConsoleCodes::VT100_CODES = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/console_codes.rb:29 +RSpec::Core::Formatters::ConsoleCodes::VT100_CODE_VALUES = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:7 +class RSpec::Core::Formatters::DeprecationFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:12 + def initialize(deprecation_stream, summary_stream); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:10 + def count; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:32 + def deprecation(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:44 + def deprecation_message_for(data); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:10 + def deprecation_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:40 + def deprecation_summary(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:18 + def output; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:20 + def printer; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:10 + def summary_stream; end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:60 +RSpec::Core::Formatters::DeprecationFormatter::DEPRECATION_STREAM_NOTICE = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:135 +class RSpec::Core::Formatters::DeprecationFormatter::DelayedPrinter + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:140 + def initialize(deprecation_stream, summary_stream, deprecation_formatter); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:138 + def deprecation_formatter; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:138 + def deprecation_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:163 + def deprecation_summary; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:172 + def print_deferred_deprecation_warnings; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:148 + def print_deprecation_message(data); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:155 + def stash_deprecation_message(deprecation_message); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:138 + def summary_stream; end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:136 +RSpec::Core::Formatters::DeprecationFormatter::DelayedPrinter::TOO_MANY_USES_LIMIT = T.let(T.unsafe(nil), Integer) + +# @private +# Wraps a File object and provides file-specific operations. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:196 +class RSpec::Core::Formatters::DeprecationFormatter::FileStream + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:197 + def initialize(file); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:207 + def puts(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:211 + def summarize(summary_stream, deprecation_count); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 +class RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:95 + def initialize(data); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:100 + def to_s; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:107 + def too_many_warnings_message; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def type; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def type=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:94 + def new(*_arg0); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:113 +class RSpec::Core::Formatters::DeprecationFormatter::ImmediatePrinter + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:116 + def initialize(deprecation_stream, summary_stream, deprecation_formatter); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:114 + def deprecation_formatter; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:114 + def deprecation_stream; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:128 + def deprecation_summary; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:123 + def print_deprecation_message(data); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:114 + def summary_stream; end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:52 +RSpec::Core::Formatters::DeprecationFormatter::RAISE_ERROR_CONFIG_NOTICE = T.let(T.unsafe(nil), String) + +# @private +# Not really a stream, but is usable in place of one. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:184 +class RSpec::Core::Formatters::DeprecationFormatter::RaiseErrorStream + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:185 + def puts(message); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:189 + def summarize(summary_stream, deprecation_count); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 +class RSpec::Core::Formatters::DeprecationFormatter::SpecifiedDeprecationMessage < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:67 + def initialize(data); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:72 + def to_s; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:76 + def too_many_warnings_message; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def type; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def type=(_); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:88 + def deprecation_type_for(data); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:82 + def output_formatted(str); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:66 + def new(*_arg0); end + end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/deprecation_formatter.rb:62 +RSpec::Core::Formatters::DeprecationFormatter::TOO_MANY_WARNINGS_NOTICE = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:8 +class RSpec::Core::Formatters::DocumentationFormatter < ::RSpec::Core::Formatters::BaseTextFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:12 + def initialize(output); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:50 + def example_failed(failure); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:31 + def example_group_finished(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:24 + def example_group_started(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:35 + def example_passed(passed); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:42 + def example_pending(pending); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:20 + def example_started(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:57 + def message(notification); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:96 + def current_indentation(offset = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:85 + def failure_output(example); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:67 + def flush_messages; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:91 + def next_failure_index; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:75 + def passed_output(example); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/documentation_formatter.rb:79 + def pending_output(example, message); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:11 +class RSpec::Core::Formatters::ExceptionPresenter + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:16 + def initialize(exception, example, options = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:78 + def colorized_formatted_backtrace(colorizer = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:33 + def colorized_message_lines(colorizer = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def description; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def example; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def exception; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:39 + def formatted_backtrace(exception = T.unsafe(nil)); end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:45 + def formatted_cause(exception); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:84 + def fully_formatted(failure_number, colorizer = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:89 + def fully_formatted_lines(failure_number, colorizer); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:29 + def message_lines; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:226 + def add_shared_group_lines(lines, colorizer); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def backtrace_formatter; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def detail_formatter; end + + # for 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:287 + def encoded_description(description); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:120 + def encoded_string(string); end + + # for 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:116 + def encoding_of(string); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:299 + def exception_backtrace; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:150 + def exception_class_name(exception = T.unsafe(nil)); end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:204 + def exception_lines; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:185 + def exception_message_string(exception); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def extra_detail_formatter; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:215 + def extra_failure_lines; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:156 + def failure_lines; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:170 + def failure_slash_error_lines; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:104 + def final_exception(exception, previous = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:262 + def find_failed_line; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:278 + def formatted_message_and_backtrace(colorizer); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:134 + def indent_lines(lines, failure_number); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:12 + def message_color; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:236 + def read_failed_lines; end +end + +# @private +# Configuring the `ExceptionPresenter` with the right set of options to handle +# pending vs failed vs skipped and aggregated (or not) failures is not simple. +# This class takes care of building an appropriate `ExceptionPresenter` for the +# provided example. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:308 +class RSpec::Core::Formatters::ExceptionPresenter::Factory + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:315 + def initialize(example); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:309 + def build; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:370 + def multiple_exception_summarizer(exception, prior_detail_formatter, color); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:366 + def multiple_exceptions_error?(exception); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:325 + def options; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:329 + def pending_options; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:391 + def sub_failure_list_formatter(exception, message_color); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:350 + def with_multiple_error_options_as_needed(exception, options); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:424 +class RSpec::Core::Formatters::ExceptionPresenter::Factory::CommonBacktraceTruncater + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:425 + def initialize(parent); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:429 + def with_truncated_backtrace(child); end +end + +# @private +# Used to prevent a confusing backtrace from showing up from the `aggregate_failures` +# block declared for `:aggregate_failures` metadata. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:417 +module RSpec::Core::Formatters::ExceptionPresenter::Factory::EmptyBacktraceFormatter + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:418 + def format_backtrace(*); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:449 +RSpec::Core::Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER = T.let(T.unsafe(nil), Proc) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/failure_list_formatter.rb:7 +class RSpec::Core::Formatters::FailureListFormatter < ::RSpec::Core::Formatters::BaseFormatter + # Discard profile and messages + # + # These outputs are not really relevant in the context of this failure + # list formatter. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/failure_list_formatter.rb:18 + def dump_profile(_profile); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/failure_list_formatter.rb:10 + def example_failed(failure); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/failure_list_formatter.rb:19 + def message(_message); end +end + +# @api private +# Formatter for providing message output as a fallback when no other +# profiler implements #message +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/fallback_message_formatter.rb:7 +class RSpec::Core::Formatters::FallbackMessageFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/fallback_message_formatter.rb:10 + def initialize(output); end + + # @api public + # + # Used by the reporter to send messages to the output stream. + # + # @param notification [MessageNotification] containing message + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/fallback_message_formatter.rb:22 + def message(notification); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/fallback_message_formatter.rb:15 + def output; end +end + +# Formatters helpers. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:7 +module RSpec::Core::Formatters::Helpers + class << self + # @api private + # + # Formats seconds into a human-readable string. + # + # @param duration [Float, Fixnum] in seconds + # @return [String] human-readable time + # + # @example + # format_duration(1) #=> "1 minute 1 second" + # format_duration(135.14) #=> "2 minutes 15.14 seconds" + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:24 + def format_duration(duration); end + + # @api private + # + # Formats seconds to have 5 digits of precision with trailing zeros + # removed if the number is less than 1 or with 2 digits of precision if + # the number is greater than zero. + # + # @param float [Float] + # @return [String] formatted float + # + # @example + # format_seconds(0.000006) #=> "0.00001" + # format_seconds(0.020000) #=> "0.02" + # format_seconds(1.00000000001) #=> "1" + # + # The precision used is set in {Helpers::SUB_SECOND_PRECISION} and + # {Helpers::DEFAULT_PRECISION}. + # + # @see #strip_trailing_zeroes + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:60 + def format_seconds(float, precision = T.unsafe(nil)); end + + # @api private + # Given a list of example ids, organizes them into a compact, ordered list. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:102 + def organize_ids(ids); end + + # @api private + # + # Pluralize a word based on a count. + # + # @param count [Fixnum] number of objects + # @param string [String] word to be pluralized + # @return [String] pluralized word + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:88 + def pluralize(count, string); end + + private + + # @api private + # + # Remove trailing zeros from a string. + # + # Only remove trailing zeros after a decimal place. + # see: http://rubular.com/r/ojtTydOgpn + # + # @param string [String] string with trailing zeros + # @return [String] string with trailing zeros removed + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:76 + def strip_trailing_zeroes(string); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:12 +RSpec::Core::Formatters::Helpers::DEFAULT_PRECISION = T.let(T.unsafe(nil), Integer) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/helpers.rb:9 +RSpec::Core::Formatters::Helpers::SUB_SECOND_PRECISION = T.let(T.unsafe(nil), Integer) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:8 +class RSpec::Core::Formatters::HtmlFormatter < ::RSpec::Core::Formatters::BaseFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:13 + def initialize(output); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:103 + def dump_summary(summary); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:55 + def example_failed(failure); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:28 + def example_group_started(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:49 + def example_passed(passed); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:93 + def example_pending(pending); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:45 + def example_started(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:22 + def start(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:40 + def start_dump(_notification); end + + private + + # The number of the currently running example_group. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:120 + def example_group_number; end + + # The number of the currently running example (a global counter). + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:125 + def example_number; end + + # Override this method if you wish to output extra HTML for a failed + # spec. For example, you could output links to images or other files + # produced during the specs. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:141 + def extra_failure_content(failure); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_formatter.rb:130 + def percent_done; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:7 +class RSpec::Core::Formatters::HtmlPrinter + include ::ERB::Escape + include ::ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + + # For the #h method. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:9 + def initialize(output); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:79 + def flush; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:96 + def make_example_group_header_red(group_id); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:103 + def make_example_group_header_yellow(group_id); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:88 + def make_header_red; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:92 + def make_header_yellow; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:83 + def move_progress(percent_done); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:36 + def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:18 + def print_example_group_end; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:23 + def print_example_group_start(group_id, description, number_of_parents); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:29 + def print_example_passed(description, run_time); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:53 + def print_example_pending(description, pending_message); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:13 + def print_html_start; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:59 + def print_summary(duration, example_count, failure_count, pending_count); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:112 + def indentation_style(number_of_parents); end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:140 +RSpec::Core::Formatters::HtmlPrinter::GLOBAL_SCRIPTS = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:218 +RSpec::Core::Formatters::HtmlPrinter::GLOBAL_STYLES = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:382 +RSpec::Core::Formatters::HtmlPrinter::HTML_HEADER = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-core#lib/rspec/core/formatters/html_printer.rb:116 +RSpec::Core::Formatters::HtmlPrinter::REPORT_HEADER = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:8 +class RSpec::Core::Formatters::JsonFormatter < ::RSpec::Core::Formatters::BaseFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:13 + def initialize(output); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:56 + def close(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:60 + def dump_profile(profile); end + + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:79 + def dump_profile_slowest_example_groups(profile); end + + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:67 + def dump_profile_slowest_examples(profile); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:24 + def dump_summary(summary); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:20 + def message(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:11 + def output_hash; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:51 + def seed(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:35 + def stop(group_notification); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/json_formatter.rb:88 + def format_example(example); end +end + +# @api private +# +# `RSpec::Core::Formatters::Loader` is an internal class for +# managing formatters used by a particular configuration. It is +# not expected to be used directly, but only through the configuration +# interface. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters.rb:96 +class RSpec::Core::Formatters::Loader + # @api private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:105 + def initialize(reporter); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:144 + def add(formatter_to_use, *paths); end + + # @return [String] the default formatter to setup, defaults to `progress` + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:118 + def default_formatter; end + + # @return [String] the default formatter to setup, defaults to `progress` + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:118 + def default_formatter=(_arg0); end + + # @return [Array] the loaded formatters + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:112 + def formatters; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:121 + def prepare_default(output_stream, deprecation_stream); end + + # @return [Reporter] the reporter + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:115 + def reporter; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:126 + def setup_default(output_stream, deprecation_stream); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:211 + def built_in_formatter(key); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:234 + def custom_formatter(formatter_ref); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:195 + def duplicate_formatter_exists?(new_formatter); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:207 + def existing_formatter_implements?(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:181 + def find_formatter(formatter_to_use); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:202 + def has_matching_output?(formatter, new_formatter); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:228 + def notifications_for(formatter_class); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:269 + def open_stream(path_or_wrapper); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:250 + def path_for(const_ref); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:188 + def register(formatter, notifications); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:246 + def string_const?(str); end + + # activesupport/lib/active_support/inflector/methods.rb, line 48 + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:259 + def underscore(camel_cased_word); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:254 + def underscore_with_fix_for_non_standard_rspec_naming(string); end + + class << self + # @api private + # + # Internal formatters are stored here when loaded. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters.rb:100 + def formatters; end + end +end + +# @api private +# Formatter for providing profile output. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:8 +class RSpec::Core::Formatters::ProfileFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:11 + def initialize(output); end + + # @api public + # + # This method is invoked after the dumping the summary if profiling is + # enabled. + # + # @param profile [ProfileNotification] containing duration, + # slowest_examples and slowest_example_groups + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:25 + def dump_profile(profile); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:16 + def output; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:62 + def bold(text); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:44 + def dump_profile_slowest_example_groups(profile); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:32 + def dump_profile_slowest_examples(profile); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/profile_formatter.rb:57 + def format_caller(caller_info); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/progress_formatter.rb:8 +class RSpec::Core::Formatters::ProgressFormatter < ::RSpec::Core::Formatters::BaseTextFormatter + # pkg:gem/rspec-core#lib/rspec/core/formatters/progress_formatter.rb:19 + def example_failed(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/progress_formatter.rb:11 + def example_passed(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/progress_formatter.rb:15 + def example_pending(_notification); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/progress_formatter.rb:23 + def start_dump(_notification); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:5 +class RSpec::Core::Formatters::SnippetExtractor + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:35 + def initialize(source, beginning_line_number, max_line_count = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:24 + def beginning_line_number; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:41 + def expression_lines; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:24 + def max_line_count; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:24 + def source; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:95 + def expression_node; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:107 + def expression_outmost_node?(node); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:55 + def line_range_of_expression; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:87 + def line_range_of_location_nodes_in_expression; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:117 + def location_nodes_at_beginning_line; end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:70 + def unclosed_tokens_in_line_range(line_range); end + + class << self + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:26 + def extract_expression_lines_at(file_path, beginning_line_number, max_line_count = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:9 + def extract_line_at(file_path, line_number); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:128 + def least_indentation_from(lines); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:16 + def source_from_file(path); end + end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:22 +class RSpec::Core::Formatters::SnippetExtractor::NoExpressionAtLineError < ::StandardError; end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:6 +class RSpec::Core::Formatters::SnippetExtractor::NoSuchFileError < ::StandardError; end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/snippet_extractor.rb:7 +class RSpec::Core::Formatters::SnippetExtractor::NoSuchLineError < ::StandardError; end + +# @private +# Provides terminal syntax highlighting of code snippets +# when coderay is available. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:7 +class RSpec::Core::Formatters::SyntaxHighlighter + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:8 + def initialize(configuration); end + + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:12 + def highlight(lines); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:50 + def color_enabled_implementation; end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:44 + def implementation; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:18 + def attempt_to_add_rspec_terms_to_coderay_keywords; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:61 +module RSpec::Core::Formatters::SyntaxHighlighter::CodeRayImplementation + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:64 + def highlight_syntax(lines); end + end +end + +# pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:62 +RSpec::Core::Formatters::SyntaxHighlighter::CodeRayImplementation::RESET_CODE = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:78 +module RSpec::Core::Formatters::SyntaxHighlighter::NoSyntaxHighlightingImplementation + class << self + # pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:79 + def highlight_syntax(lines); end + end +end + +# @private +# Not sure why, but our code above (and/or coderay itself) does not work +# on Windows, so we disable the feature on Windows. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/syntax_highlighter.rb:87 +RSpec::Core::Formatters::SyntaxHighlighter::WindowsImplementation = RSpec::Core::Formatters::SyntaxHighlighter::NoSyntaxHighlightingImplementation + +# Mixin that makes the including class imitate a hash for backwards +# compatibility. The including class should use `attr_accessor` to +# declare attributes. +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:349 +module RSpec::Core::HashImitatable + mixes_in_class_methods ::RSpec::Core::HashImitatable::ClassMethods + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def <(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def <=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def >(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def >=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:388 + def [](key); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:398 + def []=(key, value); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def all?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def any?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def assoc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def chain(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def chunk(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def chunk_while(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def clear(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def collect(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def collect_concat(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def compact(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def compact!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def compare_by_identity(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def compare_by_identity?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def count(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def cycle(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def deconstruct_keys(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def default(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def default=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def default_proc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def default_proc=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def delete(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def delete_if(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def detect(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def dig(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def drop(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def drop_while(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_cons(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_entry(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_key(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_pair(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_slice(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_value(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_with_index(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def each_with_object(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def empty?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def entries(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def except(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def fetch(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def fetch_values(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def filter(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def filter!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def filter_map(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def find(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def find_all(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def find_index(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def first(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def flat_map(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def flatten(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def grep(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def grep_v(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def group_by(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def has_key?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def has_value?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def include?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def inject(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def invert(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def keep_if(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def key(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def key?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def keys(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def lazy(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def length(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def map(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def max(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def max_by(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def member?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def merge(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def merge!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def min(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def min_by(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def minmax(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def minmax_by(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def none?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def one?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def partition(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def rassoc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def reduce(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def rehash(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def reject(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def reject!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def replace(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def reverse_each(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def select(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def select!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def shift(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def size(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def slice(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def slice_after(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def slice_before(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def slice_when(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def sort(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def sort_by(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def store(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def sum(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def take(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def take_while(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def tally(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def to_a(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:354 + def to_h; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def to_hash(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def to_proc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def to_set(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def transform_keys(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def transform_keys!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def transform_values(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def transform_values!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def uniq(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def update(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def value?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def values(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def values_at(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def zip(*args, &block); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:414 + def directly_supports_attribute?(name); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:410 + def extra_hash_attributes; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:418 + def get_value(name); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:426 + def hash_for_delegation; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:430 + def issue_deprecation(_method_name, *_args); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:422 + def set_value(name, value); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:350 + def included(klass); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:435 +module RSpec::Core::HashImitatable::ClassMethods + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:440 + def attr_accessor(*names); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:436 + def hash_attribute_names; end +end + +# Provides `before`, `after` and `around` hooks as a means of +# supporting common setup and teardown. This module is extended +# onto {ExampleGroup}, making the methods available from any `describe` +# or `context` block and included in {Configuration}, making them +# available off of the configuration object to define global setup +# or teardown logic. +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:9 +module RSpec::Core::Hooks + # @api public + # @overload after(&block) + # @overload after(scope, &block) + # @param scope [Symbol] `:example`, `:context`, or `:suite` (defaults to + # `:example`) + # @overload after(scope, *conditions, &block) + # @param scope [Symbol] `:example`, `:context`, or `:suite` (defaults to + # `:example`) + # @param conditions [Array, Hash] constrains this hook to + # examples matching these conditions e.g. + # `after(:example, :ui => true) { ... }` will only run with examples + # or groups declared with `:ui => true`. Symbols will be transformed + # into hash entries with `true` values. + # @overload after(conditions, &block) + # @param conditions [Hash] + # constrains this hook to examples matching these conditions e.g. + # `after(:example, :ui => true) { ... }` will only run with examples + # or groups declared with `:ui => true`. + # + # @see #before + # @see #around + # @see ExampleGroup + # @see SharedContext + # @see SharedExampleGroup + # @see Configuration + # + # Declare a block of code to be run after each example (using `:example`) + # or once after all examples n the context (using `:context`). See + # {#before} for more information about ordering. + # + # ### Exceptions + # + # `after` hooks are guaranteed to run even when there are exceptions in + # `before` hooks or examples. When an exception is raised in an after + # block, the exception is captured for later reporting, and subsequent + # `after` blocks are run. + # + # ### Order + # + # `after` hooks are stored in three scopes, which are run in order: + # `:example`, `:context`, and `:suite`. They can also be declared in + # several different places: `RSpec.configure`, a parent group, the current + # group. They are run in the following order: + # + # after(:example) # Declared in the current group. + # after(:example) # Declared in a parent group. + # after(:example) # Declared in RSpec.configure. + # after(:context) # Declared in the current group. + # after(:context) # Declared in a parent group. + # after(:context) # Declared in RSpec.configure. + # after(:suite) # Declared in RSpec.configure. + # + # This is the reverse of the order in which `before` hooks are run. + # Similarly, if more than one `after` is declared within any example + # group, they are run in reverse order of that in which they are declared. + # Also `around` hooks will run after any `after` example hooks are + # invoked but before any `after` context hooks. + # + # @note The `:example` and `:context` scopes are also available as + # `:each` and `:all`, respectively. Use whichever you prefer. + # @note The `:suite` scope is only supported for hooks registered on + # `RSpec.configuration` since they exist independently of any + # example or example group. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:277 + def after(*args, &block); end + + # Adds `block` to the back of the list of `after` blocks in the same + # scope (`:example`, `:context`, or `:suite`). + # + # See {#after} for scoping semantics. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:287 + def append_after(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:204 + def append_before(*args, &block); end + + # @api public + # @overload around(&block) + # @overload around(scope, &block) + # @param scope [Symbol] `:example` (defaults to `:example`) + # present for syntax parity with `before` and `after`, but + # `:example`/`:each` is the only supported value. + # @overload around(scope, *conditions, &block) + # @param scope [Symbol] `:example` (defaults to `:example`) + # present for syntax parity with `before` and `after`, but + # `:example`/`:each` is the only supported value. + # @param conditions [Array, Hash] constrains this hook to + # examples matching these conditions e.g. + # `around(:example, :ui => true) { ... }` will only run with examples + # or groups declared with `:ui => true`. Symbols will be transformed + # into hash entries with `true` values. + # @overload around(conditions, &block) + # @param conditions [Hash] constrains this hook to examples matching + # these conditions e.g. `around(:example, :ui => true) { ... }` will + # only run with examples or groups declared with `:ui => true`. + # + # @yield [Example] the example to run + # + # @note the syntax of `around` is similar to that of `before` and `after` + # but the semantics are quite different. `before` and `after` hooks are + # run in the context of the examples with which they are associated, + # whereas `around` hooks are actually responsible for running the + # examples. Consequently, `around` hooks do not have direct access to + # resources that are made available within the examples and their + # associated `before` and `after` hooks. + # + # @note `:example`/`:each` is the only supported scope. + # + # Declare a block of code, parts of which will be run before and parts + # after the example. It is your responsibility to run the example: + # + # around(:example) do |ex| + # # Do some stuff before. + # ex.run + # # Do some stuff after. + # end + # + # The yielded example aliases `run` with `call`, which lets you treat it + # like a `Proc`. This is especially handy when working with libraries + # that manage their own setup and teardown using a block or proc syntax, + # e.g. + # + # around(:example) {|ex| Database.transaction(&ex)} + # around(:example) {|ex| FakeFS(&ex)} + # + # ### Order + # + # The `around` hooks execute surrounding an example and its hooks. + # + # This means after any `before` context hooks, but before any `before` + # example hooks, and similarly after any `after` example hooks but before + # any `after` context hooks. + # + # They are not a synonym for `before`/`after`. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:349 + def around(*args, &block); end + + # @api public + # + # @overload before(&block) + # @overload before(scope, &block) + # @param scope [Symbol] `:example`, `:context`, or `:suite` + # (defaults to `:example`) + # @overload before(scope, *conditions, &block) + # @param scope [Symbol] `:example`, `:context`, or `:suite` + # (defaults to `:example`) + # @param conditions [Array, Hash] constrains this hook to + # examples matching these conditions e.g. + # `before(:example, :ui => true) { ... }` will only run with examples + # or groups declared with `:ui => true`. Symbols will be transformed + # into hash entries with `true` values. + # @overload before(conditions, &block) + # @param conditions [Hash] + # constrains this hook to examples matching these conditions e.g. + # `before(:example, :ui => true) { ... }` will only run with examples + # or groups declared with `:ui => true`. + # + # @see #after + # @see #around + # @see ExampleGroup + # @see SharedContext + # @see SharedExampleGroup + # @see Configuration + # + # Declare a block of code to be run before each example (using `:example`) + # or once before any example (using `:context`). These are usually + # declared directly in the {ExampleGroup} to which they apply, but they + # can also be shared across multiple groups. + # + # You can also use `before(:suite)` to run a block of code before any + # example groups are run. This should be declared in {RSpec.configure}. + # + # Instance variables declared in `before(:example)` or `before(:context)` + # are accessible within each example. + # + # ### Order + # + # `before` hooks are stored in three scopes, which are run in order: + # `:suite`, `:context`, and `:example`. They can also be declared in + # several different places: `RSpec.configure`, a parent group, the current + # group. They are run in the following order: + # + # before(:suite) # Declared in RSpec.configure. + # before(:context) # Declared in RSpec.configure. + # before(:context) # Declared in a parent group. + # before(:context) # Declared in the current group. + # before(:example) # Declared in RSpec.configure. + # before(:example) # Declared in a parent group. + # before(:example) # Declared in the current group. + # + # If more than one `before` is declared within any one example group, they + # are run in the order in which they are declared. Any `around` hooks will + # execute after `before` context hooks but before any `before` example + # hook regardless of where they are declared. + # + # ### Conditions + # + # When you add a conditions hash to `before(:example)` or + # `before(:context)`, RSpec will only apply that hook to groups or + # examples that match the conditions. e.g. + # + # RSpec.configure do |config| + # config.before(:example, :authorized => true) do + # log_in_as :authorized_user + # end + # end + # + # RSpec.describe Something, :authorized => true do + # # The before hook will run in before each example in this group. + # end + # + # RSpec.describe SomethingElse do + # it "does something", :authorized => true do + # # The before hook will run before this example. + # end + # + # it "does something else" do + # # The hook will not run before this example. + # end + # end + # + # Note that filtered config `:context` hooks can still be applied + # to individual examples that have matching metadata. Just like + # Ruby's object model is that every object has a singleton class + # which has only a single instance, RSpec's model is that every + # example has a singleton example group containing just the one + # example. + # + # ### Warning: `before(:suite, :with => :conditions)` + # + # The conditions hash is used to match against specific examples. Since + # `before(:suite)` is not run in relation to any specific example or + # group, conditions passed along with `:suite` are effectively ignored. + # + # ### Exceptions + # + # When an exception is raised in a `before` block, RSpec skips any + # subsequent `before` blocks and the example, but runs all of the + # `after(:example)` and `after(:context)` hooks. + # + # ### Warning: implicit before blocks + # + # `before` hooks can also be declared in shared contexts which get + # included implicitly either by you or by extension libraries. Since + # RSpec runs these in the order in which they are declared within each + # scope, load order matters, and can lead to confusing results when one + # before block depends on state that is prepared in another before block + # that gets run later. + # + # ### Warning: `before(:context)` + # + # It is very tempting to use `before(:context)` to speed things up, but we + # recommend that you avoid this as there are a number of gotchas, as well + # as things that simply don't work. + # + # #### Context + # + # `before(:context)` is run in an example that is generated to provide + # group context for the block. + # + # #### Instance variables + # + # Instance variables declared in `before(:context)` are shared across all + # the examples in the group. This means that each example can change the + # state of a shared object, resulting in an ordering dependency that can + # make it difficult to reason about failures. + # + # #### Unsupported RSpec constructs + # + # RSpec has several constructs that reset state between each example + # automatically. These are not intended for use from within + # `before(:context)`: + # + # * `let` declarations + # * `subject` declarations + # * Any mocking, stubbing or test double declaration + # + # ### other frameworks + # + # Mock object frameworks and database transaction managers (like + # ActiveRecord) are typically designed around the idea of setting up + # before an example, running that one example, and then tearing down. This + # means that mocks and stubs can (sometimes) be declared in + # `before(:context)`, but get torn down before the first real example is + # ever run. + # + # You _can_ create database-backed model objects in a `before(:context)` + # in rspec-rails, but it will not be wrapped in a transaction for you, so + # you are on your own to clean up in an `after(:context)` block. + # + # @example before(:example) declared in an {ExampleGroup} + # + # RSpec.describe Thing do + # before(:example) do + # @thing = Thing.new + # end + # + # it "does something" do + # # Here you can access @thing. + # end + # end + # + # @example before(:context) declared in an {ExampleGroup} + # + # RSpec.describe Parser do + # before(:context) do + # File.open(file_to_parse, 'w') do |f| + # f.write <<-CONTENT + # stuff in the file + # CONTENT + # end + # end + # + # it "parses the file" do + # Parser.parse(file_to_parse) + # end + # + # after(:context) do + # File.delete(file_to_parse) + # end + # end + # + # @note The `:example` and `:context` scopes are also available as + # `:each` and `:all`, respectively. Use whichever you prefer. + # @note The `:suite` scope is only supported for hooks registered on + # `RSpec.configuration` since they exist independently of any + # example or example group. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:200 + def before(*args, &block); end + + # @private + # Holds the various registered hooks. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:355 + def hooks; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:281 + def prepend_after(*args, &block); end + + # Adds `block` to the front of the list of `before` blocks in the same + # scope (`:example`, `:context`, or `:suite`). + # + # See {#before} for scoping semantics. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:210 + def prepend_before(*args, &block); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:379 +class RSpec::Core::Hooks::AfterContextHook < ::RSpec::Core::Hooks::Hook + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:380 + def run(example); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:370 +class RSpec::Core::Hooks::AfterHook < ::RSpec::Core::Hooks::Hook + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:371 + def run(example); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:388 +class RSpec::Core::Hooks::AroundHook < ::RSpec::Core::Hooks::Hook + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:389 + def execute_with(example, procsy); end + + # for 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:397 + def hook_description; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:363 +class RSpec::Core::Hooks::BeforeHook < ::RSpec::Core::Hooks::Hook + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:364 + def run(example); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 +class RSpec::Core::Hooks::Hook < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def block; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def block=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def options; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def options=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:360 + def new(*_arg0); end + end +end + +# @private +# +# This provides the primary API used by other parts of rspec-core. By hiding all +# implementation details behind this facade, it's allowed us to heavily optimize +# this, so that, for example, hook collection objects are only instantiated when +# a hook is added. This allows us to avoid many object allocations for the common +# case of a group having no hooks. +# +# This is only possible because this interface provides a "tell, don't ask"-style +# API, so that callers _tell_ this class what to do with the hooks, rather than +# asking this class for a list of hooks, and then doing something with them. +# +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:420 +class RSpec::Core::Hooks::HookCollections + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:421 + def initialize(owner, filterable_item_repo_class); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:449 + def register(prepend_or_append, position, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:442 + def register_global_singleton_context_hooks(example, globals); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:431 + def register_globals(host, globals); end + + # @private + # + # Runs all of the blocks stored with the hook in the context of the + # example. If no example is provided, just calls the hook directly. + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:475 + def run(position, scope, example_or_group); end + + protected + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:523 + def all_hooks_for(position, scope); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:507 + def matching_hooks_for(position, scope, example_or_group); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:533 + def processable_hooks_for(position, scope, host); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:527 + def run_owned_hooks_for(position, scope, example_or_group); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:553 + def ensure_hooks_initialized_for(position, scope); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:591 + def extract_scope_from(args); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:543 + def hooks_for(position, scope); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:605 + def known_scope?(scope); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:609 + def normalized_scope_for(scope); end + + # Ruby < 2.1 (see https://bugs.ruby-lang.org/issues/8035) + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:633 + def owner_parent_groups; end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:571 + def process(host, parent_groups, globals, position, scope); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:619 + def run_around_example_hooks_for(example); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:613 + def run_example_hooks_for(example, position, each_method); end + + # pkg:gem/rspec-core#lib/rspec/core/hooks.rb:584 + def scope_and_options_from(*args); end +end + +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:505 +RSpec::Core::Hooks::HookCollections::EMPTY_HOOK_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:495 +RSpec::Core::Hooks::HookCollections::HOOK_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:491 +RSpec::Core::Hooks::HookCollections::SCOPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-core#lib/rspec/core/hooks.rb:493 +RSpec::Core::Hooks::HookCollections::SCOPE_ALIASES = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:186 +class RSpec::Core::InclusionRules < ::RSpec::Core::FilterRules + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:187 + def add(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:191 + def add_with_low_priority(*args); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:195 + def include_example?(example); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:203 + def split_file_scoped_rules; end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:199 + def standalone?; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:213 + def apply_standalone_filter(updated); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:226 + def is_standalone_filter?(rules); end + + # pkg:gem/rspec-core#lib/rspec/core/filter_manager.rb:221 + def replace_filters(new_rules); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/invocations.rb:4 +module RSpec::Core::Invocations; end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/invocations.rb:28 +class RSpec::Core::Invocations::Bisect + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:29 + def call(options, err, out); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:45 + def bisect_formatter_klass_for(argument); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/invocations.rb:15 +class RSpec::Core::Invocations::DRbWithFallback + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:16 + def call(options, err, out); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/invocations.rb:6 +class RSpec::Core::Invocations::InitializeProject + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:7 + def call(*_args); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 +class RSpec::Core::Invocations::PrintHelp < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:79 + def call(_options, _err, out); end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def hidden_options; end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def hidden_options=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def parser; end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def parser=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:78 + def new(*_arg0); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/invocations.rb:52 +class RSpec::Core::Invocations::PrintVersion + # pkg:gem/rspec-core#lib/rspec/core/invocations.rb:53 + def call(_options, _err, out); end +end + +# @private +# Together with the example group metadata hash default block, +# provides backwards compatibility for the old `:example_group` +# key. In RSpec 2.x, the computed keys of a group's metadata +# were exposed from a nested subhash keyed by `[:example_group]`, and +# then the parent group's metadata was exposed by sub-subhash +# keyed by `[:example_group][:example_group]`. +# +# In RSpec 3, we reorganized this to that the computed keys are +# exposed directly of the group metadata hash (no nesting), and +# `:parent_example_group` returns the parent group's metadata. +# +# Maintaining backwards compatibility was difficult: we wanted +# `:example_group` to return an object that: +# +# * Exposes the top-level metadata keys that used to be nested +# under `:example_group`. +# * Supports mutation (rspec-rails, for example, assigns +# `metadata[:example_group][:described_class]` when you use +# anonymous controller specs) such that changes are written +# back to the top-level metadata hash. +# * Exposes the parent group metadata as +# `[:example_group][:example_group]`. +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:470 +class RSpec::Core::LegacyExampleGroupHash + include ::RSpec::Core::HashImitatable + extend ::RSpec::Core::HashImitatable::ClassMethods + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:473 + def initialize(metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:479 + def to_h; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:485 + def directly_supports_attribute?(name); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:489 + def get_value(name); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:493 + def set_value(name, value); end +end + +# This module is included in {ExampleGroup}, making the methods +# available to be called from within example blocks. +# +# @see ClassMethods +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:9 +module RSpec::Core::MemoizedHelpers + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:135 + def initialize(*); end + + # Wraps the `subject` in `expect` to make it the target of an expectation. + # Designed to read nicely for one-liners. + # + # @example + # + # describe [1, 2, 3] do + # it { is_expected.to be_an Array } + # it { is_expected.not_to include 4 } + # end + # + # @see #subject + # @see #should + # @see #should_not + # + # @note This only works if you are using rspec-expectations. + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:120 + def is_expected; end + + # When `should` is called with no explicit receiver, the call is + # delegated to the object returned by `subject`. Combined with an + # implicit subject this supports very concise expressions. + # + # @example + # + # RSpec.describe Person do + # it { should be_eligible_to_vote } + # end + # + # @see #subject + # @see #is_expected + # + # @note This only works if you are using rspec-expectations. + # @note If you are using RSpec's newer expect-based syntax you may + # want to use `is_expected.to` instead of `should`. + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:80 + def should(matcher = T.unsafe(nil), message = T.unsafe(nil)); end + + # Just like `should`, `should_not` delegates to the subject (implicit or + # explicit) of the example group. + # + # @example + # + # RSpec.describe Person do + # it { should_not be_eligible_to_vote } + # end + # + # @see #subject + # @see #is_expected + # + # @note This only works if you are using rspec-expectations. + # @note If you are using RSpec's newer expect-based syntax you may + # want to use `is_expected.to_not` instead of `should_not`. + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:100 + def should_not(matcher = T.unsafe(nil), message = T.unsafe(nil)); end + + # @note `subject` was contributed by Joe Ferris to support the one-liner + # syntax embraced by shoulda matchers: + # + # RSpec.describe Widget do + # it { is_expected.to validate_presence_of(:name) } + # # or + # it { should validate_presence_of(:name) } + # end + # + # While the examples below demonstrate how to use `subject` + # explicitly in examples, we recommend that you define a method with + # an intention revealing name instead. + # + # @example + # + # # Explicit declaration of subject. + # RSpec.describe Person do + # subject { Person.new(:birthdate => 19.years.ago) } + # it "should be eligible to vote" do + # subject.should be_eligible_to_vote + # # ^ ^ explicit reference to subject not recommended + # end + # end + # + # # Implicit subject => { Person.new }. + # RSpec.describe Person do + # it "should be eligible to vote" do + # subject.should be_eligible_to_vote + # # ^ ^ explicit reference to subject not recommended + # end + # end + # + # # One-liner syntax - expectation is set on the subject. + # RSpec.describe Person do + # it { is_expected.to be_eligible_to_vote } + # # or + # it { should be_eligible_to_vote } + # end + # + # @note Because `subject` is designed to create state that is reset + # between each example, and `before(:context)` is designed to setup + # state that is shared across _all_ examples in an example group, + # `subject` is _not_ intended to be used in a `before(:context)` hook. + # + # @see #should + # @see #should_not + # @see #is_expected + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:57 + def subject; end + + private + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:141 + def __init_memoized; end + + # @private + # should just be placed in private section, + # but Ruby issues warnings on private attributes. + # and expanding it to the equivalent method upsets Rubocop, + # b/c it should obviously be a reader + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:129 + def __memoized; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:150 + def enforce_value_expectation(matcher, method_name); end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:163 + def matcher_supports_value_expectations?(matcher); end + + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:542 + def define_helpers_on(example_group); end + + # @private + # + # Gets the named constant or yields. + # On 1.9, const_defined? / const_get take into account the + # the inheritance by default, and accept an argument to + # disable this behavior. It's important that we don't + # consider inheritance here; each example group level that + # uses a `let` should get its own `LetDefinitions` module. + # for 1.8 + # @private + # + # Gets the named constant or yields. + # On 1.8, const_defined? / const_get do not take into + # account the inheritance hierarchy. + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:570 + def get_constant_or_yield(example_group, name); end + + # @private + # + # Gets the LetDefinitions module. The module is mixed into + # the example group and is used to hold all let definitions. + # This is done so that the block passed to `let` can be + # forwarded directly on to `define_method`, so that all method + # constructs (including `super` and `return`) can be used in + # a `let` block. + # + # The memoization is provided by a method definition on the + # example group that supers to the LetDefinitions definition + # in order to get the value to memoize. + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:528 + def module_for(example_group); end + end +end + +# This module is extended onto {ExampleGroup}, making the methods +# available to be called from within example group blocks. +# You can think of them as being analagous to class macros. +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:274 +module RSpec::Core::MemoizedHelpers::ClassMethods + # Generates a method whose return value is memoized after the first + # call. Useful for reducing duplication between examples that assign + # values to the same local variable. + # + # @note `let` _can_ enhance readability when used sparingly (1,2, or + # maybe 3 declarations) in any given example group, but that can + # quickly degrade with overuse. YMMV. + # + # @note `let` can be configured to be threadsafe or not. + # If it is threadsafe, it will take longer to access the value. + # If it is not threadsafe, it may behave in surprising ways in examples + # that spawn separate threads. Specify this on `RSpec.configure` + # + # @note Because `let` is designed to create state that is reset between + # each example, and `before(:context)` is designed to setup state that + # is shared across _all_ examples in an example group, `let` is _not_ + # intended to be used in a `before(:context)` hook. + # + # @example + # + # RSpec.describe Thing do + # let(:thing) { Thing.new } + # + # it "does something" do + # # First invocation, executes block, memoizes and returns result. + # thing.do_something + # + # # Second invocation, returns the memoized value. + # thing.should be_something + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:306 + def let(name, &block); end + + # Just like `let`, except the block is invoked by an implicit `before` + # hook. This serves a dual purpose of setting up state and providing a + # memoized reference to that state. + # + # @example + # + # class Thing + # def self.count + # @count ||= 0 + # end + # + # def self.count=(val) + # @count += val + # end + # + # def self.reset_count + # @count = 0 + # end + # + # def initialize + # self.class.count += 1 + # end + # end + # + # RSpec.describe Thing do + # after(:example) { Thing.reset_count } + # + # context "using let" do + # let(:thing) { Thing.new } + # + # it "is not invoked implicitly" do + # Thing.count.should eq(0) + # end + # + # it "can be invoked explicitly" do + # thing + # Thing.count.should eq(1) + # end + # end + # + # context "using let!" do + # let!(:thing) { Thing.new } + # + # it "is invoked implicitly" do + # Thing.count.should eq(1) + # end + # + # it "returns memoized version on first invocation" do + # thing + # Thing.count.should eq(1) + # end + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:400 + def let!(name, &block); end + + # Declares a `subject` for an example group which can then be wrapped + # with `expect` using `is_expected` to make it the target of an + # expectation in a concise, one-line example. + # + # Given a `name`, defines a method with that name which returns the + # `subject`. This lets you declare the subject once and access it + # implicitly in one-liners and explicitly using an intention revealing + # name. + # + # When given a `name`, calling `super` in the block is not supported. + # + # @note `subject` can be configured to be threadsafe or not. + # If it is threadsafe, it will take longer to access the value. + # If it is not threadsafe, it may behave in surprising ways in examples + # that spawn separate threads. Specify this on `RSpec.configure` + # + # @param name [String,Symbol] used to define an accessor with an + # intention revealing name + # @param block defines the value to be returned by `subject` in examples + # + # @example + # + # RSpec.describe CheckingAccount, "with $50" do + # subject { CheckingAccount.new(Money.new(50, :USD)) } + # it { is_expected.to have_a_balance_of(Money.new(50, :USD)) } + # it { is_expected.not_to be_overdrawn } + # end + # + # RSpec.describe CheckingAccount, "with a non-zero starting balance" do + # subject(:account) { CheckingAccount.new(Money.new(50, :USD)) } + # it { is_expected.not_to be_overdrawn } + # it "has a balance equal to the starting balance" do + # account.balance.should eq(Money.new(50, :USD)) + # end + # end + # + # @see MemoizedHelpers#should + # @see MemoizedHelpers#should_not + # @see MemoizedHelpers#is_expected + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:444 + def subject(name = T.unsafe(nil), &block); end + + # Just like `subject`, except the block is invoked by an implicit + # `before` hook. This serves a dual purpose of setting up state and + # providing a memoized reference to that state. + # + # @example + # + # class Thing + # def self.count + # @count ||= 0 + # end + # + # def self.count=(val) + # @count += val + # end + # + # def self.reset_count + # @count = 0 + # end + # + # def initialize + # self.class.count += 1 + # end + # end + # + # RSpec.describe Thing do + # after(:example) { Thing.reset_count } + # + # context "using subject" do + # subject { Thing.new } + # + # it "is not invoked implicitly" do + # Thing.count.should eq(0) + # end + # + # it "can be invoked explicitly" do + # subject + # Thing.count.should eq(1) + # end + # end + # + # context "using subject!" do + # subject!(:thing) { Thing.new } + # + # it "is invoked implicitly" do + # Thing.count.should eq(1) + # end + # + # it "returns memoized version on first invocation" do + # subject + # Thing.count.should eq(1) + # end + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:510 + def subject!(name = T.unsafe(nil), &block); end +end + +# Used internally to customize the behavior of the +# memoized hash when used in a `before(:context)` hook. +# +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:200 +class RSpec::Core::MemoizedHelpers::ContextHookMemoized + class << self + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:222 + def fetch_or_store(key, &_block); end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:201 + def isolate_for_context_hook(example_group_instance); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:256 +class RSpec::Core::MemoizedHelpers::ContextHookMemoized::After < ::RSpec::Core::MemoizedHelpers::ContextHookMemoized + class << self + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:261 + def article; end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:257 + def hook_expression; end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:265 + def hook_intention; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:241 +class RSpec::Core::MemoizedHelpers::ContextHookMemoized::Before < ::RSpec::Core::MemoizedHelpers::ContextHookMemoized + class << self + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:246 + def article; end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:242 + def hook_expression; end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:250 + def hook_intention; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:186 +class RSpec::Core::MemoizedHelpers::NonThreadSafeMemoized + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:187 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:191 + def fetch_or_store(key); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:170 +class RSpec::Core::MemoizedHelpers::ThreadsafeMemoized + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:171 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/memoized_helpers.rb:176 + def fetch_or_store(key); end +end + +# Each ExampleGroup class and Example instance owns an instance of +# Metadata, which is Hash extended to support lazy evaluation of values +# associated with keys that may or may not be used by any example or group. +# +# In addition to metadata that is used internally, this also stores +# user-supplied metadata, e.g. +# +# RSpec.describe Something, :type => :ui do +# it "does something", :slow => true do +# # ... +# end +# end +# +# `:type => :ui` is stored in the Metadata owned by the example group, and +# `:slow => true` is stored in the Metadata owned by the example. These can +# then be used to select which examples are run using the `--tag` option on +# the command line, or several methods on `Configuration` used to filter a +# run (e.g. `filter_run_including`, `filter_run_excluding`, etc). +# +# @see Example#metadata +# @see ExampleGroup.metadata +# @see FilterManager +# @see Configuration#filter_run_including +# @see Configuration#filter_run_excluding +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:27 +module RSpec::Core::Metadata + class << self + # @private + # Returns an enumerator that iteratively walks up the given metadata through all + # example group ancestors, yielding each metadata hash along the way. + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:71 + def ascend(metadata); end + + # @private + # Iteratively walks up from the given metadata through all + # example group ancestors, yielding each metadata hash along the way. + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:58 + def ascending(metadata); end + + # @private + # Used internally to build a hash from an args array. + # Symbols are converted into hash keys with a value of `true`. + # This is done to support simple tagging using a symbol, rather + # than needing to do `:symbol => true`. + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:80 + def build_hash_from(args, warn_about_example_group_filtering = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:94 + def deep_hash_dup(object); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:105 + def id_from(metadata); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:110 + def location_tuple_from(metadata); end + + # @api private + # + # @param line [String] current code line + # @return [String] relative path to line + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:44 + def relative_path(line); end + + # Matches strings either at the beginning of the input or prefixed with a + # whitespace, containing the current path, either postfixed with the + # separator, or at the end of the string. Match groups are the character + # before and the character after the string if any. + # + # http://rubular.com/r/fT0gmX6VJX + # http://rubular.com/r/duOrD4i3wb + # http://rubular.com/r/sbAMHFrOx1 + # + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:36 + def relative_path_regex; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:247 +class RSpec::Core::Metadata::ExampleGroupHash < ::RSpec::Core::Metadata::HashPopulator + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:304 + def described_class; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:311 + def full_description; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:265 + def backwards_compatibility_default_proc(&example_group_selector); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:248 + def create(parent_group_metadata, user_metadata, example_group_index, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:261 + def hash_with_backwards_compatibility_default_proc; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:213 +class RSpec::Core::Metadata::ExampleHash < ::RSpec::Core::Metadata::HashPopulator + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:234 + def described_class; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:238 + def full_description; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:214 + def create(group_metadata, user_metadata, index_provider, description, block); end + end +end + +# @private +# Used internally to populate metadata hashes with computed keys +# managed by RSpec. +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:117 +class RSpec::Core::Metadata::HashPopulator + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:120 + def initialize(metadata, user_metadata, index_provider, description_args, block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:118 + def block; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:118 + def description_args; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:118 + def metadata; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:128 + def populate; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:118 + def user_metadata; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:178 + def build_description_from(parent_description = T.unsafe(nil), my_description = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:185 + def build_scoped_id_for(file_path); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:170 + def description_separator(parent_part, child_part); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:191 + def ensure_valid_user_keys; end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:164 + def file_path_and_line_number_from(backtrace); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:143 + def populate_location_attributes; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/metadata.rb:325 +RSpec::Core::Metadata::RESERVED_KEYS = T.let(T.unsafe(nil), Array) + +# Contains metadata filtering logic. This has been extracted from +# the metadata classes because it operates ON a metadata hash but +# does not manage any of the state in the hash. We're moving towards +# having metadata be a raw hash (not a custom subclass), so externalizing +# this filtering logic helps us move in that direction. +# +# pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:8 +module RSpec::Core::MetadataFilter + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:11 + def apply?(predicate, filters, metadata); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:16 + def filter_applies?(key, filter_value, metadata); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:33 + def silence_metadata_example_group_deprecations; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:42 + def filter_applies_to_any_value?(key, value, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:73 + def filters_apply?(key, value, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:46 + def id_filter_applies?(rerun_paths_to_scoped_ids, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:54 + def location_filter_applies?(locations, metadata); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata_filter.rb:65 + def proc_filter_applies?(key, proc, metadata); end + end +end + +# Provides a single exception instance that provides access to +# multiple sub-exceptions. This is used in situations where a single +# individual spec has multiple exceptions, such as one in the `it` block +# and one in an `after` block. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:459 +class RSpec::Core::MultipleExceptionError < ::StandardError + include ::RSpec::Core::MultipleExceptionError::InterfaceTag + + # @param exceptions [Array] The initial list of exceptions. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:520 + def initialize(*exceptions); end + + # @return [nil] Provided only for interface compatibility with + # `RSpec::Expectations::MultipleExpectationsNotMetError`. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:517 + def aggregation_block_label; end + + # @return [Hash] Metadata used by RSpec for formatting purposes. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:513 + def aggregation_metadata; end + + # @return [Array] The list of failures and other exceptions, combined. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:510 + def all_exceptions; end + + # return [String] A description of the failure/error counts. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:545 + def exception_count_description; end + + # @return [Array] The list of failures. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:504 + def failures; end + + # @return [String] Combines all the exception messages into a single string. + # @note RSpec does not actually use this -- instead it formats each exception + # individually. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:535 + def message; end + + # @return [Array] The list of other errors. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:507 + def other_errors; end + + # @return [String] A summary of the failure, including the block label and a count of failures. + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:540 + def summary; end +end + +# @private +# Used so there is a common module in the ancestor chain of this class +# and `RSpec::Expectations::MultipleExpectationsNotMetError`, which allows +# code to detect exceptions that are instances of either, without first +# checking to see if rspec-expectations is loaded. +# +# pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:465 +module RSpec::Core::MultipleExceptionError::InterfaceTag + # Appends the provided exception to the list. + # @param exception [Exception] Exception to append to the list. + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:469 + def add(exception); end + + class << self + # Provides a way to force `ex` to be something that satisfies the multiple + # exception error interface. If it already satisfies it, it will be returned; + # otherwise it will wrap it in a `MultipleExceptionError`. + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/formatters/exception_presenter.rb:495 + def for(ex); end + end +end + +# Notifications are value objects passed to formatters to provide them +# with information about a particular event of interest. +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:9 +module RSpec::Core::Notifications; end + +# `CustomNotification` is used when sending custom events to formatters / +# other registered listeners, it creates attributes based on supplied hash +# of options. +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:512 +class RSpec::Core::Notifications::CustomNotification < ::Struct + class << self + # @param options [Hash] A hash of method / value pairs to create on this notification + # @return [CustomNotification] + # + # Build a custom notification based on the supplied option key / values. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:517 + def for(options = T.unsafe(nil)); end + end +end + +# The `DeprecationNotification` is issued by the reporter when a deprecated +# part of RSpec is encountered. It represents information about the +# deprecated call site. +# +# @attr message [String] A custom message about the deprecation +# @attr deprecated [String] A custom message about the deprecation (alias of +# message) +# @attr replacement [String] An optional replacement for the deprecation +# @attr call_site [String] An optional call site from which the deprecation +# was issued +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 +class RSpec::Core::Notifications::DeprecationNotification < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def call_site; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def call_site=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def deprecated; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def deprecated=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def message; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def message=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def replacement; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def replacement=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def [](*_arg0); end + + # @api + # Convenience way to initialize the notification + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:499 + def from_hash(data); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def members; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:493 + def new(*_arg0); end + end +end + +# The `ExampleNotification` represents notifications sent by the reporter +# which contain information about the current (or soon to be) example. +# It is used by formatters to access information about that example. +# +# @example +# def example_started(notification) +# puts "Hey I started #{notification.example.description}" +# end +# +# @attr example [RSpec::Core::Example] the current example +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 +class RSpec::Core::Notifications::ExampleNotification < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def example; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def example=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def [](*_arg0); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:41 + def for(example); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def members; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:38 + def new(*_arg0); end + end +end + +# The `ExamplesNotification` represents notifications sent by the reporter +# which contain information about the suites examples. +# +# @example +# def stop(notification) +# puts "Hey I ran #{notification.examples.size}" +# end +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:69 +class RSpec::Core::Notifications::ExamplesNotification + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:70 + def initialize(reporter); end + + # @return [Array] list of examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:75 + def examples; end + + # @return [Array] list of failed examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:80 + def failed_examples; end + + # @return [Array] + # returns failed examples as notifications + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:97 + def failure_notifications; end + + # @return [String] The list of failed examples, fully formatted in the way + # that RSpec's built-in formatters emit. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:110 + def fully_formatted_failed_examples(colorizer = T.unsafe(nil)); end + + # @return [String] The list of pending examples, fully formatted in the + # way that RSpec's built-in formatters emit. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:122 + def fully_formatted_pending_examples(colorizer = T.unsafe(nil)); end + + # @return [Array] + # returns examples as notifications + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:91 + def notifications; end + + # @return [Array] list of pending examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:85 + def pending_examples; end + + # @return [Array] + # returns pending examples as notifications + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:104 + def pending_notifications; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:136 + def format_examples(examples); end +end + +# The `FailedExampleNotification` extends `ExampleNotification` with +# things useful for examples that have failure info -- typically a +# failed or pending spec. +# +# @example +# def example_failed(notification) +# puts "Hey I failed :(" +# puts "Here's my stack trace" +# puts notification.exception.backtrace.join("\n") +# end +# +# @attr [RSpec::Core::Example] example the current example +# @see ExampleNotification +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:156 +class RSpec::Core::Notifications::FailedExampleNotification < ::RSpec::Core::Notifications::ExampleNotification + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:213 + def initialize(example, exception_presenter = T.unsafe(nil)); end + + # Returns the failures colorized formatted backtrace. + # + # @param colorizer [#wrap] An object to colorize the message_lines by + # @return [Array] the examples colorized backtrace lines + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:195 + def colorized_formatted_backtrace(colorizer = T.unsafe(nil)); end + + # Returns the message generated for this failure colorized line by line. + # + # @param colorizer [#wrap] An object to colorize the message_lines by + # @return [Array] The example failure message colorized + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:180 + def colorized_message_lines(colorizer = T.unsafe(nil)); end + + # @return [String] The example description + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:165 + def description; end + + # @return [Exception] The example failure + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:160 + def exception; end + + # Returns the failures formatted backtrace. + # + # @return [Array] the examples backtrace lines + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:187 + def formatted_backtrace; end + + # @return [String] The failure information fully formatted in the way that + # RSpec's built-in formatters emit. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:201 + def fully_formatted(failure_number, colorizer = T.unsafe(nil)); end + + # @return [Array] The failure information fully formatted in the way that + # RSpec's built-in formatters emit, split by line. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:207 + def fully_formatted_lines(failure_number, colorizer = T.unsafe(nil)); end + + # Returns the message generated for this failure line by line. + # + # @return [Array] The example failure message + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:172 + def message_lines; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:157 + def new(*_arg0); end + end +end + +# The `GroupNotification` represents notifications sent by the reporter +# which contain information about the currently running (or soon to be) +# example group. It is used by formatters to access information about that +# group. +# +# @example +# def example_group_started(notification) +# puts "Hey I started #{notification.group.description}" +# end +# @attr group [RSpec::Core::ExampleGroup] the current group +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 +class RSpec::Core::Notifications::GroupNotification < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def group; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def group=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:258 + def new(*_arg0); end + end +end + +# The `MessageNotification` encapsulates generic messages that the reporter +# sends to formatters. +# +# @attr message [String] the message +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 +class RSpec::Core::Notifications::MessageNotification < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def message; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def message=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:264 + def new(*_arg0); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:11 +module RSpec::Core::Notifications::NullColorizer + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:14 + def wrap(line, _code_or_symbol); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:14 + def wrap(line, _code_or_symbol); end + end +end + +# `NullNotification` represents a placeholder value for notifications that +# currently require no information, but we may wish to extend in future. +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:506 +class RSpec::Core::Notifications::NullNotification; end + +# @deprecated Use {FailedExampleNotification} instead. +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:223 +class RSpec::Core::Notifications::PendingExampleFailedAsExpectedNotification < ::RSpec::Core::Notifications::FailedExampleNotification; end + +# @deprecated Use {FailedExampleNotification} instead. +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:220 +class RSpec::Core::Notifications::PendingExampleFixedNotification < ::RSpec::Core::Notifications::FailedExampleNotification; end + +# The `ProfileNotification` holds information about the results of running a +# test suite when profiling is enabled. It is used by formatters to provide +# information at the end of the test run for profiling information. +# +# @attr duration [Float] the time taken (in seconds) to run the suite +# @attr examples [Array] the examples run +# @attr number_of_examples [Fixnum] the number of examples to profile +# @attr example_groups [Array] example groups run +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:429 +class RSpec::Core::Notifications::ProfileNotification + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:430 + def initialize(duration, examples, number_of_examples, example_groups); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:436 + def duration; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:436 + def examples; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:436 + def number_of_examples; end + + # @return [String] the percentage of total time taken + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:455 + def percentage; end + + # @return [Float] the time taken (in seconds) to run the slowest examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:447 + def slow_duration; end + + # @return [Array] the slowest examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:439 + def slowest_examples; end + + # @return [Array] the slowest example groups + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:464 + def slowest_groups; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:470 + def calculate_slowest_groups; end +end + +# The `SeedNotification` holds the seed used to randomize examples and +# whether that seed has been used or not. +# +# @attr seed [Fixnum] the seed used to randomize ordering +# @attr used [Boolean] whether the seed has been used or not +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 +class RSpec::Core::Notifications::SeedNotification < ::Struct + # @return [String] The seed information fully formatted in the way that + # RSpec's built-in formatters emit. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:282 + def fully_formatted; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def seed; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def seed=(_); end + + # @api + # @return [Boolean] has the seed been used? + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:275 + def seed_used?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def used=(_); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def used; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:271 + def new(*_arg0); end + end +end + +# The `SkippedExampleNotification` extends `ExampleNotification` with +# things useful for specs that are skipped. +# +# @attr [RSpec::Core::Example] example the current example +# @see ExampleNotification +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:230 +class RSpec::Core::Notifications::SkippedExampleNotification < ::RSpec::Core::Notifications::ExampleNotification + # @return [String] The pending detail fully formatted in the way that + # RSpec's built-in formatters emit. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:235 + def fully_formatted(pending_number, colorizer = T.unsafe(nil)); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:231 + def new(*_arg0); end + end +end + +# The `StartNotification` represents a notification sent by the reporter +# when the suite is started. It contains the expected amount of examples +# to be executed, and the load time of RSpec. +# +# @attr count [Fixnum] the number counted +# @attr load_time [Float] the number of seconds taken to boot RSpec +# and load the spec files +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 +class RSpec::Core::Notifications::StartNotification < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def count; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def count=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def load_time; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def load_time=(_); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:26 + def new(*_arg0); end + end +end + +# The `SummaryNotification` holds information about the results of running +# a test suite. It is used by formatters to provide information at the end +# of the test run. +# +# @attr duration [Float] the time taken (in seconds) to run the suite +# @attr examples [Array] the examples run +# @attr failed_examples [Array] the failed examples +# @attr pending_examples [Array] the pending examples +# @attr load_time [Float] the number of seconds taken to boot RSpec +# and load the spec files +# @attr errors_outside_of_examples_count [Integer] the number of errors that +# have occurred processing +# the spec suite +# +# pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 +class RSpec::Core::Notifications::SummaryNotification < ::Struct + include ::RSpec::Core::ShellEscape + + # @api public + # + # Formats failures into a rerunable command format. + # + # @param colorizer [#wrap] An object which supports wrapping text with + # specific colors. + # @return [String] A colorized summary line. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:364 + def colorized_rerun_commands(colorizer = T.unsafe(nil)); end + + # @api public + # + # Wraps the results line with colors based on the configured + # colors for failure, pending, and success. Defaults to red, + # yellow, green accordingly. + # + # @param colorizer [#wrap] An object which supports wrapping text with + # specific colors. + # @return [String] A colorized results line. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:347 + def colorized_totals_line(colorizer = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def duration; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def duration=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def errors_outside_of_examples_count; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def errors_outside_of_examples_count=(_); end + + # @api + # @return [Fixnum] the number of examples run + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:306 + def example_count; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def examples; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def examples=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def failed_examples; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def failed_examples=(_); end + + # @api + # @return [Fixnum] the number of failed examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:312 + def failure_count; end + + # @return [String] a formatted version of the time it took to run the + # suite + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:374 + def formatted_duration; end + + # @return [String] a formatted version of the time it took to boot RSpec + # and load the spec files + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:380 + def formatted_load_time; end + + # @return [String] The summary information fully formatted in the way that + # RSpec's built-in formatters emit. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:386 + def fully_formatted(colorizer = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def load_time; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def load_time=(_); end + + # @api + # @return [Fixnum] the number of pending examples + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:318 + def pending_count; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def pending_examples; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def pending_examples=(_); end + + # @api + # @return [String] A line summarising the result totals of the spec run. + # + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:324 + def totals_line; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:408 + def duplicate_rerun_locations; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:402 + def rerun_argument_for(example); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/notifications.rb:300 + def new(*_arg0); end + end +end + +# @private +# # Used in place of a {Reporter} for situations where we don't want reporting output. +# +# pkg:gem/rspec-core#lib/rspec/core/reporter.rb:260 +class RSpec::Core::NullReporter + class << self + private + + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:261 + def method_missing(*); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:4 +module RSpec::Core::Ordering; end + +# @private +# Manages ordering configuration. +# +# @note This is not intended to be used externally. Use +# the APIs provided by `RSpec::Core::Configuration` instead. +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:144 +class RSpec::Core::Ordering::ConfigurationManager + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:147 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:190 + def force(hash); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:164 + def order=(type); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:145 + def ordering_registry; end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:201 + def register_ordering(name, strategy = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:145 + def seed; end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:158 + def seed=(seed); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:154 + def seed_used?; end +end + +# @private +# Orders items based on a custom block. +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:71 +class RSpec::Core::Ordering::Custom + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:72 + def initialize(callable); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:76 + def order(list); end +end + +# @private +# A strategy which delays looking up the ordering until needed +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:83 +class RSpec::Core::Ordering::Delayed + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:84 + def initialize(registry, name); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:89 + def order(list); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:99 + def lookup_strategy; end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:95 + def strategy; end +end + +# @private +# The default global ordering (defined order). +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:7 +class RSpec::Core::Ordering::Identity + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:8 + def order(items); end +end + +# @private +# Orders items randomly. +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:15 +class RSpec::Core::Ordering::Random + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:16 + def initialize(configuration); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:25 + def order(items); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:21 + def used?; end + + private + + # http://en.wikipedia.org/wiki/Jenkins_hash_function + # Jenkins provides a good distribution and is simpler than MD5. + # It's a bit slower than MD5 (primarily because `Digest::MD5` is + # implemented in C) but has the advantage of not requiring us + # to load another part of stdlib, which we try to minimize. + # + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:39 + def jenkins_hash_digest(string); end +end + +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:58 +RSpec::Core::Ordering::Random::MAX_32_BIT = T.let(T.unsafe(nil), Integer) + +# @private +# Orders items by modification time (most recent modified first). +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:63 +class RSpec::Core::Ordering::RecentlyModified + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:64 + def order(list); end +end + +# @private +# Stores the different ordering strategies. +# +# pkg:gem/rspec-core#lib/rspec/core/ordering.rb:107 +class RSpec::Core::Ordering::Registry + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:108 + def initialize(configuration); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:122 + def fetch(name, &fallback); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:126 + def has_strategy?(name); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:130 + def register(sym, strategy); end + + # pkg:gem/rspec-core#lib/rspec/core/ordering.rb:134 + def used_random_seed?; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:4 +class RSpec::Core::OutputWrapper + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:9 + def initialize(output); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def <<(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def advise(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def autoclose=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def autoclose?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def binmode(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def binmode?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def close(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def close_on_exec=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def close_on_exec?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def close_read(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def close_write(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def closed?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def each(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def each_byte(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def each_char(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def each_codepoint(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def each_line(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def eof(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def eof?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def external_encoding(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def fcntl(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def fdatasync(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def fileno(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def flush(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def fsync(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def getbyte(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def getc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def gets(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def inspect(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def internal_encoding(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def ioctl(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def isatty(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def lineno(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def lineno=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:17 + def method_missing(name, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def nonblock(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def nonblock=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def nonblock?(*args, &block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:6 + def output; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:6 + def output=(_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def path(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def pathconf(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def pid(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def pos(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def pos=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def pread(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def print(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def printf(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def putc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def puts(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def pwrite(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def read(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def read_nonblock(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def readbyte(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def readchar(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def readline(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def readlines(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def readpartial(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def reopen(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:13 + def respond_to?(name, priv = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def rewind(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def seek(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def set_encoding(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def set_encoding_by_bom(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def stat(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def sync(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def sync=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def sysread(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def sysseek(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def syswrite(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def tell(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def timeout(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def timeout=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def to_i(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def to_io(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def to_path(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def tty?(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def ungetbyte(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def ungetc(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def wait(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def wait_priority(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def wait_readable(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def wait_writable(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def write(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def write_nonblock(*args, &block); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:6 +class RSpec::Core::Parser + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:13 + def initialize(original_args); end + + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:11 + def original_args; end + + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:17 + def parse(source = T.unsafe(nil)); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:312 + def add_tag_filter(options, filter_type, tag_name, value = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:320 + def configure_only_failures(options); end + + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:39 + def parser(options); end + + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:316 + def set_fail_fast(options, value); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/option_parser.rb:7 + def parse(args, source = T.unsafe(nil)); end + end +end + +# Provides methods to mark examples as pending. These methods are available +# to be called from within any example or hook. +# +# pkg:gem/rspec-core#lib/rspec/core/pending.rb:5 +module RSpec::Core::Pending + # @overload pending() + # @overload pending(message) + # + # Marks an example as pending. The rest of the example will still be + # executed, and if it passes the example will fail to indicate that the + # pending can be removed. + # + # @param message [String] optional message to add to the summary report. + # + # @example + # describe "some behaviour" do + # # reported as "Pending: no reason given" + # it "is pending with no message" do + # pending + # raise "broken" + # end + # + # # reported as "Pending: something else getting finished" + # it "is pending with a custom message" do + # pending("something else getting finished") + # raise "broken" + # end + # end + # + # @note When using `pending` inside an example body using this method + # hooks, such as `before(:example)`, have already be run. This means that + # a failure from the code in the `before` hook will prevent the example + # from being considered pending, as the example body would not be + # executed. If you need to consider hooks as pending as well you can use + # the pending metadata as an alternative, e.g. + # `it "does something", pending: "message"`. + # + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:62 + def pending(message = T.unsafe(nil), &_block); end + + # @overload skip() + # @overload skip(message) + # + # Marks an example as pending and skips execution. + # + # @param message [String] optional message to add to the summary report. + # + # @example + # describe "an example" do + # # reported as "Pending: no reason given" + # it "is skipped with no message" do + # skip + # end + # + # # reported as "Pending: something else getting finished" + # it "is skipped with a custom message" do + # skip "something else getting finished" + # end + # end + # + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:110 + def skip(message = T.unsafe(nil)); end + + class << self + # @private + # + # Mark example as fixed. + # + # @param example [RSpec::Core::Example] the example to mark as fixed + # + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:152 + def mark_fixed!(example); end + + # @private + # + # Mark example as pending. + # + # @param example [RSpec::Core::Example] the example to mark as pending + # @param message_or_bool [Boolean, String] the message to use, or true + # + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:135 + def mark_pending!(example, message_or_bool); end + + # @private + # + # Mark example as skipped. + # + # @param example [RSpec::Core::Example] the example to mark as skipped + # @param message_or_bool [Boolean, String] the message to use, or true + # + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:124 + def mark_skipped!(example, message_or_bool); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/pending.rb:29 +RSpec::Core::Pending::NOT_YET_IMPLEMENTED = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/pending.rb:26 +RSpec::Core::Pending::NO_REASON_GIVEN = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-core#lib/rspec/core/pending.rb:22 +class RSpec::Core::Pending::PendingExampleFixedError < ::StandardError; end + +# Raised in the middle of an example to indicate that it should be marked +# as skipped. +# +# pkg:gem/rspec-core#lib/rspec/core/pending.rb:8 +class RSpec::Core::Pending::SkipDeclaredInExample < ::StandardError + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:11 + def initialize(argument); end + + # pkg:gem/rspec-core#lib/rspec/core/pending.rb:9 + def argument; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/profiler.rb:4 +class RSpec::Core::Profiler + # pkg:gem/rspec-core#lib/rspec/core/profiler.rb:7 + def initialize; end + + # pkg:gem/rspec-core#lib/rspec/core/profiler.rb:20 + def example_group_finished(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/profiler.rb:13 + def example_group_started(notification); end + + # pkg:gem/rspec-core#lib/rspec/core/profiler.rb:11 + def example_groups; end + + # pkg:gem/rspec-core#lib/rspec/core/profiler.rb:28 + def example_started(notification); end +end + +# pkg:gem/rspec-core#lib/rspec/core/profiler.rb:5 +RSpec::Core::Profiler::NOTIFICATIONS = T.let(T.unsafe(nil), Array) + +# A reporter will send notifications to listeners, usually formatters for the +# spec suite run. +# +# pkg:gem/rspec-core#lib/rspec/core/reporter.rb:4 +class RSpec::Core::Reporter + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:14 + def initialize(configuration); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:215 + def abort_with(msg, exit_status); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:194 + def close_after; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:155 + def deprecation(hash); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:143 + def example_failed(example); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:133 + def example_finished(example); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:122 + def example_group_finished(group); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:117 + def example_group_started(group); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:138 + def example_passed(example); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:149 + def example_pending(example); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:127 + def example_started(example); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:28 + def examples; end + + # @param exit_code [Integer] the exit_code to be return by the reporter + # + # Reports a run that exited early without having run any examples. + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:84 + def exit_early(exit_code); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:222 + def fail_fast_limit_met?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:28 + def failed_examples; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:173 + def finish; end + + # @param message [#to_s] A message object to send to formatters + # + # Send a custom message to supporting formatters. + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:99 + def message(message); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:207 + def notify(event, notification); end + + # @private + # Provides a way to notify of an exception that is not tied to any + # particular example (such as an exception encountered in a :suite hook). + # Exceptions will be formatted the same way they normally are. + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:163 + def notify_non_example_exception(exception, context_description); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:28 + def pending_examples; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:45 + def prepare_default(loader, output_stream, deprecation_stream); end + + # @param event [Symbol] Name of the custom event to trigger on formatters + # @param options [Hash] Hash of arguments to provide via `CustomNotification` + # + # Publish a custom event to supporting registered formatters. + # @see RSpec::Core::Notifications::CustomNotification + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:108 + def publish(event, options = T.unsafe(nil)); end + + # Registers a listener to a list of notifications. The reporter will send + # notification of events to all registered listeners. + # + # @param listener [Object] An object that wishes to be notified of reporter + # events + # @param notifications [Array] Array of symbols represents the events a + # listener wishes to subscribe too + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:37 + def register_listener(listener, *notifications); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:52 + def registered_listeners(notification); end + + # @overload report(count, &block) + # @overload report(count, &block) + # @param expected_example_count [Integer] the number of examples being run + # @yield [Block] block yields itself for further reporting. + # + # Initializes the report run and yields itself for further reporting. The + # block is required, so that the reporter can manage cleaning up after the + # run. + # + # @example + # + # reporter.report(group.examples.size) do |r| + # example_groups.map {|g| g.run(r) } + # end + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:71 + def report(expected_example_count); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:89 + def start(expected_example_count, time = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:201 + def stop(notification); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:243 + def close; end + + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:234 + def ensure_listeners_ready; end + + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:247 + def mute_profile_output?; end + + # pkg:gem/rspec-core#lib/rspec/core/reporter.rb:253 + def seed_used?; end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/reporter.rb:6 +RSpec::Core::Reporter::RSPEC_NOTIFICATIONS = T.let(T.unsafe(nil), RSpec::Core::Set) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:7 +module RSpec::Core::RubyProject + private + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:12 + def add_dir_to_load_path(dir); end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:8 + def add_to_load_path(*dirs); end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:28 + def ascend_until; end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:20 + def determine_root; end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:24 + def find_first_parent_containing(dir); end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:16 + def root; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:46 + def add_dir_to_load_path(dir); end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:45 + def add_to_load_path(*dirs); end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:50 + def ascend_until; end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:48 + def determine_root; end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:49 + def find_first_parent_containing(dir); end + + # pkg:gem/rspec-core#lib/rspec/core/ruby_project.rb:47 + def root; end + end +end + +# Provides the main entry point to run a suite of RSpec examples. +# +# pkg:gem/rspec-core#lib/rspec/core/runner.rb:4 +class RSpec::Core::Runner + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:75 + def initialize(options, configuration = T.unsafe(nil), world = T.unsafe(nil)); end + + # @attr_reader + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:7 + def configuration; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:129 + def configure(err, out); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:194 + def exit_code(examples_passed = T.unsafe(nil)); end + + # @attr_reader + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:7 + def options; end + + # Configures and runs a spec suite. + # + # @param err [IO] error stream + # @param out [IO] output stream + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:85 + def run(err, out); end + + # Runs the provided example groups. + # + # @param example_groups [Array] groups to run + # @return [Fixnum] exit status code. 0 if all specs passed, + # or the configured failure exit code (1 by default) if specs + # failed. + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:113 + def run_specs(example_groups); end + + # Wires together the various configuration objects and state holders. + # + # @param err [IO] error stream + # @param out [IO] output stream + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:98 + def setup(err, out); end + + # @attr_reader + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:7 + def world; end + + private + + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:203 + def persist_example_statuses; end + + class << self + # Register an `at_exit` hook that runs the suite when the process exits. + # + # @note This is not generally needed. The `rspec` command takes care + # of running examples for you without involving an `at_exit` + # hook. This is only needed if you are running specs using + # the `ruby` command, and even then, the normal way to invoke + # this is by requiring `rspec/autorun`. + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:16 + def autorun; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:141 + def autorun_disabled?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:136 + def disable_autorun!; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:180 + def handle_interrupt; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:146 + def installed_at_exit?; end + + # Runs the suite of specs and exits the process with an appropriate exit + # code. + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:43 + def invoke; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:29 + def perform_at_exit; end + + # Run a suite of RSpec examples. Does not exit. + # + # This is used internally by RSpec to run a suite, but is available + # for use by any other automation tool. + # + # If you want to run this multiple times in the same process, and you + # want files like `spec_helper.rb` to be reloaded, be sure to load `load` + # instead of `require`. + # + # @param args [Array] command-line-supported arguments + # @param err [IO] error stream + # @param out [IO] output stream + # @return [Fixnum] exit status code. 0 if all specs passed, + # or the configured failure exit code (1 by default) if specs + # failed. + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:64 + def run(args, err = T.unsafe(nil), out = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:151 + def running_in_drb?; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/runner.rb:175 + def trap_interrupt; end + end +end + +# @private +# +# We use this to replace `::Set` so we can have the advantage of +# constant time key lookups for unique arrays but without the +# potential to pollute a developers environment with an extra +# piece of the stdlib. This helps to prevent false positive +# builds. +# +# pkg:gem/rspec-core#lib/rspec/core/set.rb:11 +class RSpec::Core::Set + include ::Enumerable + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:14 + def initialize(array = T.unsafe(nil)); end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:23 + def <<(key); end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:48 + def clear; end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:28 + def delete(key); end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:32 + def each(&block); end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:19 + def empty?; end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:37 + def include?(key); end + + # pkg:gem/rspec-core#lib/rspec/core/set.rb:41 + def merge(values); end +end + +# Exposes {ExampleGroup}-level methods to a module, so you can include that +# module in an {ExampleGroup}. +# +# @example +# +# module LoggedInAsAdmin +# extend RSpec::Core::SharedContext +# before(:example) do +# log_in_as :admin +# end +# end +# +# describe "admin section" do +# include LoggedInAsAdmin +# # ... +# end +# +# pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:19 +module RSpec::Core::SharedContext + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:28 + def __shared_context_recordings; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def after(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def append_after(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def append_before(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def around(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def before(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def context(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def describe(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def hooks(*args, &block); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:21 + def included(group); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def let(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def let!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def prepend_after(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def prepend_before(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def subject(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:42 + def subject!(*args, &block); end + + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:40 + def record(methods); end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 +class RSpec::Core::SharedContext::Recording < ::Struct + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def args; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def args=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def block; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def block=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def method_name; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def method_name=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:34 + def playback_onto(group); end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def [](*_arg0); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def keyword_init?; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def members; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:33 + def new(*_arg0); end + end +end + +# Shared example groups let you define common context and/or common +# examples that you wish to use in multiple example groups. +# +# When defined, the shared group block is stored for later evaluation. +# It can later be included in an example group either explicitly +# (using `include_examples`, `include_context` or `it_behaves_like`) +# or implicitly (via matching metadata). +# +# Named shared example groups are scoped based on where they are +# defined. Shared groups defined in an example group are available +# for inclusion in that example group or any child example groups, +# but not in any parent or sibling example groups. Shared example +# groups defined at the top level can be included from any example group. +# +# pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:57 +module RSpec::Core::SharedExampleGroup + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:100 + def shared_context(name, *args, &block); end + + # @overload shared_examples(name, &block) + # @param name [String, Symbol, Module] identifer to use when looking up + # this shared group + # @param block The block to be eval'd + # @overload shared_examples(name, metadata, &block) + # @param name [String, Symbol, Module] identifer to use when looking up + # this shared group + # @param metadata [Array, Hash] metadata to attach to this + # group; any example group or example with matching metadata will + # automatically include this shared example group. + # @param block The block to be eval'd + # + # Stores the block for later use. The block will be evaluated + # in the context of an example group via `include_examples`, + # `include_context`, or `it_behaves_like`. + # + # @example + # shared_examples "auditable" do + # it "stores an audit record on save!" do + # expect { auditable.save! }.to change(Audit, :count).by(1) + # end + # end + # + # RSpec.describe Account do + # it_behaves_like "auditable" do + # let(:auditable) { Account.new } + # end + # end + # + # @see ExampleGroup.it_behaves_like + # @see ExampleGroup.include_examples + # @see ExampleGroup.include_context + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:90 + def shared_examples(name, *args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:101 + def shared_examples_for(name, *args, &block); end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:149 +class RSpec::Core::SharedExampleGroup::Registry + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:150 + def add(context, name, *metadata_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:174 + def find(lookup_contexts, name); end + + private + + # for 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:257 + def ensure_block_has_source_location(_block); end + + # 1.8.7 + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:245 + def formatted_location(block); end + + # TODO: remove this in RSpec 4. This exists only to support + # `config.shared_context_metadata_behavior == :trigger_inclusion`, + # the legacy behavior of shared context metadata, which we do + # not want to support in RSpec 4. + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:189 + def legacy_add(context, name, *metadata_args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:204 + def shared_example_groups; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:208 + def valid_name?(candidate); end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:215 + def warn_if_key_taken(context, key, new_block); end +end + +# @api private +# +# Shared examples top level DSL. +# +# pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:106 +module RSpec::Core::SharedExampleGroup::TopLevelDSL + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:108 + def definitions; end + + # @api private + # + # Adds the top level DSL methods to Module and the top level binding. + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:126 + def expose_globally!; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:119 + def exposed_globally?; end + + # @api private + # + # Removes the top level DSL methods to Module and the top level binding. + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:135 + def remove_globally!; end + end +end + +# Contains information about the inclusion site of a shared example group. +# +# pkg:gem/rspec-core#lib/rspec/core/example_group.rb:789 +class RSpec::Core::SharedExampleGroupInclusionStackFrame + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:796 + def initialize(shared_group_name, inclusion_location); end + + # @return [String] Description of this stack frame, in the form used by + # RSpec's built-in formatters. + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:812 + def description; end + + # @return [String] The {#inclusion_location}, formatted for display by a formatter. + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:802 + def formatted_inclusion_location; end + + # @return [String] the location where the shared example was included + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:793 + def inclusion_location; end + + # @return [String] the name of the shared example group + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:791 + def shared_group_name; end + + class << self + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:818 + def current_backtrace; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:836 + def shared_example_group_inclusions; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:823 + def with_frame(name, location); end + end +end + +# Represents some functionality that is shared with multiple example groups. +# The functionality is defined by the provided block, which is lazily +# eval'd when the `SharedExampleGroupModule` instance is included in an example +# group. +# +# pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:9 +class RSpec::Core::SharedExampleGroupModule < ::Module + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:13 + def initialize(description, definition, metadata); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:11 + def definition; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:34 + def include_in(klass, inclusion_line, args, customization_block); end + + # Ruby callback for when a module is included in another module is class. + # Our definition evaluates the shared group block in the context of the + # including example group. + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:28 + def included(klass); end + + # Provides a human-readable representation of this module. + # + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:20 + def inspect; end + + # pkg:gem/rspec-core#lib/rspec/core/shared_example_group.rb:23 + def to_s; end +end + +# @private +# Deals with the fact that `shellwords` only works on POSIX systems. +# +# pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:5 +module RSpec::Core::ShellEscape + private + + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:32 + def conditionally_quote(id); end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:19 + def escape(shell_command); end + + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:8 + def quote(argument); end + + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:37 + def shell_allows_unquoted_ids?; end + + class << self + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:32 + def conditionally_quote(id); end + + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:19 + def escape(shell_command); end + + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:8 + def quote(argument); end + + # pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:37 + def shell_allows_unquoted_ids?; end + end +end + +# Known shells that require quoting: zsh, csh, tcsh. +# +# Feel free to add other shells to this list that are known to +# allow `rspec ./some_spec.rb[1:1]` syntax without quoting the id. +# +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/shell_escape.rb:30 +RSpec::Core::ShellEscape::SHELLS_ALLOWING_UNQUOTED_IDS = T.let(T.unsafe(nil), Array) + +# @private +# Provides an execution context for before/after :suite hooks. +# +# pkg:gem/rspec-core#lib/rspec/core/example.rb:651 +class RSpec::Core::SuiteHookContext < ::RSpec::Core::Example + # pkg:gem/rspec-core#lib/rspec/core/example.rb:652 + def initialize(hook_description, reporter); end + + # pkg:gem/rspec-core#lib/rspec/core/example.rb:659 + def set_exception(exception); end +end + +# @private +# This avoids issues with reporting time caused by examples that +# change the value/meaning of Time.now without properly restoring +# it. +# +# pkg:gem/rspec-core#lib/rspec/core.rb:174 +class RSpec::Core::Time + class << self + # pkg:gem/rspec-core#lib/rspec/core.rb:176 + def now(in: T.unsafe(nil)); end + end +end + +# Version information for RSpec Core. +# +# pkg:gem/rspec-core#lib/rspec/core/version.rb:4 +module RSpec::Core::Version; end + +# Current version of RSpec Core, in semantic versioning format. +# +# pkg:gem/rspec-core#lib/rspec/core/version.rb:6 +RSpec::Core::Version::STRING = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/warnings.rb:6 +module RSpec::Core::Warnings + # @private + # + # Used internally to print deprecation warnings. + # + # pkg:gem/rspec-core#lib/rspec/core/warnings.rb:10 + def deprecate(deprecated, data = T.unsafe(nil)); end + + # @private + # + # Used internally to print deprecation warnings. + # + # pkg:gem/rspec-core#lib/rspec/core/warnings.rb:22 + def warn_deprecation(message, opts = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/warnings.rb:27 + def warn_with(message, options = T.unsafe(nil)); end +end + +# @api private +# +# Internal container for global non-configuration data. +# +# pkg:gem/rspec-core#lib/rspec/core/world.rb:6 +class RSpec::Core::World + # pkg:gem/rspec-core#lib/rspec/core/world.rb:26 + def initialize(configuration = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:115 + def all_example_groups; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:120 + def all_examples; end + + # @api private + # + # Add exclusion filters to announcement message. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:226 + def announce_exclusion_filter(announcements); end + + # @api private + # + # Notify reporter of filters. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:171 + def announce_filters; end + + # @api private + # + # Add inclusion filters to announcement message. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:217 + def announce_inclusion_filter(announcements); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:210 + def everything_filtered_message; end + + # @api private + # + # Get count of examples to be run. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:109 + def example_count(groups = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:8 + def example_group_counts_by_spec_file; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:8 + def example_groups; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:102 + def exclusion_filter; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:69 + def filter_manager; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:8 + def filtered_examples; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:97 + def inclusion_filter; end + + # Used internally to signal that a failure outside of an example + # has occurred, and that therefore the exit status should indicate + # the run failed. + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:24 + def non_example_failure; end + + # Used internally to signal that a failure outside of an example + # has occurred, and that therefore the exit status should indicate + # the run failed. + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:24 + def non_example_failure=(_arg0); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:87 + def num_example_groups_defined_in(file); end + + # @api private + # + # Apply ordering strategy from configuration to example groups. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:52 + def ordered_example_groups; end + + # @api private + # + # Find line number of previous declaration. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:140 + def preceding_declaration_line(absolute_file_name, filter_line); end + + # @api public + # + # Prepares filters so that they apply to example groups when they run. + # + # This is a separate method so that filters can be modified/replaced and + # examples refiltered during a process's lifetime, which can be useful for + # a custom runner. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:43 + def prepare_example_filtering; end + + # @api private + # + # Records an example group. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:81 + def record(example_group); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:74 + def registered_example_group_files; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:205 + def report_filter_message(message); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:149 + def reporter; end + + # @api private + # + # Reset world to 'scratch' before running suite. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:60 + def reset; end + + # Used internally to signify that a SystemExit occurred in + # `Configuration#load_file_handling_errors`, and thus examples cannot + # be counted accurately. Specifically, we cannot accurately report + # "No examples found". + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:18 + def rspec_is_quitting; end + + # Used internally to signify that a SystemExit occurred in + # `Configuration#load_file_handling_errors`, and thus examples cannot + # be counted accurately. Specifically, we cannot accurately report + # "No examples found". + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:18 + def rspec_is_quitting=(_arg0); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:92 + def shared_example_group_registry; end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:154 + def source_from_file(path); end + + # @private + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:164 + def syntax_highlighter; end + + # @private + # Traverses the tree of each top level group. + # For each it yields the group, then the children, recursively. + # Halts the traversal of a branch of the tree as soon as the passed block returns true. + # Note that siblings groups and their sub-trees will continue to be explored. + # This is intended to make it easy to find the top-most group that satisfies some + # condition. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:131 + def traverse_example_group_trees_until(&block); end + + # Used internally to determine what to do when a SIGINT is received. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:11 + def wants_to_quit; end + + # Used internally to determine what to do when a SIGINT is received. + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:11 + def wants_to_quit=(_arg0); end + + private + + # pkg:gem/rspec-core#lib/rspec/core/world.rb:234 + def descending_declaration_line_numbers_by_file; end + + # pkg:gem/rspec-core#lib/rspec/core/world.rb:252 + def fail_if_config_and_cli_options_invalid; end +end + +# @private +# Provides a null implementation for initial use by configuration. +# +# pkg:gem/rspec-core#lib/rspec/core/world.rb:264 +module RSpec::Core::World::Null + class << self + # pkg:gem/rspec-core#lib/rspec/core/world.rb:280 + def all_example_groups; end + + # :nocov: + # + # pkg:gem/rspec-core#lib/rspec/core/world.rb:276 + def example_groups; end + + # pkg:gem/rspec-core#lib/rspec/core/world.rb:265 + def non_example_failure; end + + # pkg:gem/rspec-core#lib/rspec/core/world.rb:266 + def non_example_failure=(_); end + + # pkg:gem/rspec-core#lib/rspec/core/world.rb:268 + def registered_example_group_files; end + + # pkg:gem/rspec-core#lib/rspec/core/world.rb:272 + def traverse_example_group_trees_until(&_block); end + end +end + +# @private +# +# Namespace for the example group subclasses generated by top-level +# `describe`. +# +# pkg:gem/rspec-core#lib/rspec/core/example_group.rb:846 +module RSpec::ExampleGroups + extend ::RSpec::Support::RecursiveConstMethods + + class << self + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:849 + def assign_const(group); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:869 + def base_name_for(group); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:857 + def constant_scope_for(group); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:902 + def disambiguate(name, const_scope); end + + # pkg:gem/rspec-core#lib/rspec/core/example_group.rb:863 + def remove_all_constants; end + end +end + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core.rb:187 +RSpec::MODULES_TO_AUTOLOAD = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-core#lib/rspec/core/shared_context.rb:54 +RSpec::SharedContext = RSpec::Core::SharedContext diff --git a/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi b/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi new file mode 100644 index 0000000..6a72619 --- /dev/null +++ b/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi @@ -0,0 +1,6064 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rspec-expectations` gem. +# Please instead update this file by running `bin/tapioca gem rspec-expectations`. + + +# RSpec's top level namespace. All of rspec-expectations is contained +# in the `RSpec::Expectations` and `RSpec::Matchers` namespaces. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/english_phrasing.rb:1 +module RSpec; end + +# RSpec::Expectations provides a simple, readable API to express +# the expected outcomes in a code example. To express an expected +# outcome, wrap an object or block in `expect`, call `to` or `to_not` +# (aliased as `not_to`) and pass it a matcher object: +# +# expect(order.total).to eq(Money.new(5.55, :USD)) +# expect(list).to include(user) +# expect(message).not_to match(/foo/) +# expect { do_something }.to raise_error +# +# The last form (the block form) is needed to match against ruby constructs +# that are not objects, but can only be observed when executing a block +# of code. This includes raising errors, throwing symbols, yielding, +# and changing values. +# +# When `expect(...).to` is invoked with a matcher, it turns around +# and calls `matcher.matches?()`. For example, +# in the expression: +# +# expect(order.total).to eq(Money.new(5.55, :USD)) +# +# ...`eq(Money.new(5.55, :USD))` returns a matcher object, and it results +# in the equivalent of `eq.matches?(order.total)`. If `matches?` returns +# `true`, the expectation is met and execution continues. If `false`, then +# the spec fails with the message returned by `eq.failure_message`. +# +# Given the expression: +# +# expect(order.entries).not_to include(entry) +# +# ...the `not_to` method (also available as `to_not`) invokes the equivalent of +# `include.matches?(order.entries)`, but it interprets `false` as success, and +# `true` as a failure, using the message generated by +# `include.failure_message_when_negated`. +# +# rspec-expectations ships with a standard set of useful matchers, and writing +# your own matchers is quite simple. +# +# See [RSpec::Matchers](../RSpec/Matchers) for more information about the +# built-in matchers that ship with rspec-expectations, and how to write your +# own custom matchers. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:2 +module RSpec::Expectations + class << self + # The configuration object. + # @return [RSpec::Expectations::Configuration] the configuration object + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:237 + def configuration; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/fail_with.rb:13 + def differ; end + + # Raises an RSpec::Expectations::ExpectationNotMetError with message. + # @param [String] message + # @param [Object] expected + # @param [Object] actual + # + # Adds a diff to the failure message when `expected` and `actual` are + # both present. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/fail_with.rb:27 + def fail_with(message, expected = T.unsafe(nil), actual = T.unsafe(nil)); end + end +end + +# @private +# Validates the provided matcher to ensure it supports block +# expectations, in order to avoid user confusion when they +# use a block thinking the expectation will be on the return +# value of the block rather than the block itself. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:136 +class RSpec::Expectations::BlockExpectationTarget < ::RSpec::Expectations::ExpectationTarget + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:142 + def not_to(matcher, message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:137 + def to(matcher, message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:146 + def to_not(matcher, message = T.unsafe(nil), &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:150 + def enforce_block_expectation(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:158 + def supports_block_expectations?(matcher); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:4 +class RSpec::Expectations::BlockSnippetExtractor + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:17 + def initialize(proc, method_name); end + + # Ideally we should properly handle indentations of multiline snippet, + # but it's not implemented yet since because we use result of this method only when it's a + # single line and implementing the logic introduces additional complexity. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:25 + def body_content_lines; end + + # rubocop should properly handle `Struct.new {}` as an inner class definition. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:7 + def method_name; end + + # rubocop should properly handle `Struct.new {}` as an inner class definition. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:7 + def proc; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:62 + def beginning_line_number; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:39 + def block_token_extractor; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:58 + def file_path; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:31 + def raw_body_lines; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:35 + def raw_body_snippet; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:44 + def source; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:66 + def source_location; end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:9 + def try_extracting_single_line_body_of(proc, method_name); end + end +end + +# pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:72 +class RSpec::Expectations::BlockSnippetExtractor::AmbiguousTargetError < ::RSpec::Expectations::BlockSnippetExtractor::Error; end + +# @private +# Locates target block with node information (semantics), which tokens don't have. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 +class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def beginning_line_number; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def beginning_line_number=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:205 + def body_content_locations; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:201 + def method_call_location; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def method_name; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def method_name=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def source; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def source=(_); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:218 + def block_body_node; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:223 + def block_wrapper_node; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:234 + def candidate_block_wrapper_nodes; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:243 + def candidate_method_ident_nodes; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:211 + def method_ident_node; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:249 + def method_ident_node?(node); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def [](*_arg0); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def inspect; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def keyword_init?; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def members; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:200 + def new(*_arg0); end + end +end + +# @private +# Performs extraction of block body snippet using tokens, +# which cannot be done with node information. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 +class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:80 + def initialize(*); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def beginning_line_number; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def beginning_line_number=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:78 + def body_tokens; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def method_name; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def method_name=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def source; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def source=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:78 + def state; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:126 + def after_beginning_of_args_state(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:130 + def after_beginning_of_body_state(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:109 + def after_method_call_state(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:113 + def after_opener_state(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:193 + def block_locator; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:187 + def correct_block?(body_tokens); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:143 + def finalize_pending_tokens!; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:97 + def finish!; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:149 + def finish_or_find_next_block_if_incorrect!; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:170 + def handle_closer_token(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:160 + def handle_opener_token(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:105 + def initial_state(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:101 + def invoke_state_handler(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:166 + def opener_token?(token); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:179 + def opener_token_stack; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:87 + def parse!; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:139 + def pending_tokens; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:183 + def pipe_token?(token); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def [](*_arg0); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def inspect; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def keyword_init?; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def members; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:77 + def new(*_arg0); end + end +end + +# pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:70 +class RSpec::Expectations::BlockSnippetExtractor::Error < ::StandardError; end + +# pkg:gem/rspec-expectations#lib/rspec/expectations/block_snippet_extractor.rb:71 +class RSpec::Expectations::BlockSnippetExtractor::TargetNotFoundError < ::RSpec::Expectations::BlockSnippetExtractor::Error; end + +# Provides configuration options for rspec-expectations. +# If you are using rspec-core, you can access this via a +# block passed to `RSpec::Core::Configuration#expect_with`. +# Otherwise, you can access it via RSpec::Expectations.configuration. +# +# @example +# RSpec.configure do |rspec| +# rspec.expect_with :rspec do |c| +# # c is the config object +# end +# end +# +# # or +# +# RSpec::Expectations.configuration +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:20 +class RSpec::Expectations::Configuration + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:29 + def initialize; end + + # :nocov: Because this is only really _useful_ on 1.8, and hard to test elsewhere. + # + # Adds `should` and `should_not` to the given classes + # or modules. This can be used to ensure `should` works + # properly on things like proxy objects (particular + # `Delegator`-subclassed objects on 1.8). + # + # @param [Array] modules the list of classes or modules + # to add `should` and `should_not` to. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:116 + def add_should_and_should_not_to(*modules); end + + # Sets or gets the backtrace formatter. The backtrace formatter should + # implement `#format_backtrace(Array)`. This is used + # to format backtraces of errors handled by the `raise_error` + # matcher. + # + # If you are using rspec-core, rspec-core's backtrace formatting + # will be used (including respecting the presence or absence of + # the `--backtrace` option). + # + # @!attribute [rw] backtrace_formatter + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:134 + def backtrace_formatter; end + + # Sets or gets the backtrace formatter. The backtrace formatter should + # implement `#format_backtrace(Array)`. This is used + # to format backtraces of errors handled by the `raise_error` + # matcher. + # + # If you are using rspec-core, rspec-core's backtrace formatting + # will be used (including respecting the presence or absence of + # the `--backtrace` option). + # + # @!attribute [rw] backtrace_formatter + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:133 + def backtrace_formatter=(_arg0); end + + # Indicates whether or not diffs should be colored. + # Delegates to rspec-core's color option if rspec-core + # is loaded; otherwise you can set it here. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:88 + def color?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:230 + def false_positives_handler; end + + # Sets if custom matcher descriptions and failure messages + # should include clauses from methods defined using `chain`. + # @param value [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:145 + def include_chain_clauses_in_custom_matcher_descriptions=(_arg0); end + + # Indicates whether or not custom matcher descriptions and failure messages + # should include clauses from methods defined using `chain`. It is + # false by default for backwards compatibility. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:150 + def include_chain_clauses_in_custom_matcher_descriptions?; end + + # Configures the maximum character length that RSpec will print while + # formatting an object. You can set length to nil to prevent RSpec from + # doing truncation. + # @param [Fixnum] length the number of characters to limit the formatted output to. + # @example + # RSpec.configure do |rspec| + # rspec.expect_with :rspec do |c| + # c.max_formatted_output_length = 200 + # end + # end + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:70 + def max_formatted_output_length=(length); end + + # Configures what RSpec will do about matcher use which would potentially cause + # false positives in tests. Defaults to `:warn` since this is generally the desired behavior, + # but can also be set to `:raise` or `:nothing`. + # + # @overload on_potential_false_positives + # @return [Symbol] the behavior setting + # @overload on_potential_false_positives=(value) + # @param [Symbol] behavior can be set to `:warn`, `:raise` or `:nothing` + # @return [Symbol] the behavior setting + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:192 + def on_potential_false_positives; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:194 + def on_potential_false_positives=(behavior); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:155 + def reset_syntaxes_to_default; end + + # Configures RSpec to check predicate matchers to `be(true)` / `be(false)` (strict), + # or `be_truthy` / `be_falsey` (not strict). + # Historically, the default was `false`, but `true` is recommended. + # + # @overload strict_predicate_matchers + # @return [Boolean] + # @overload strict_predicate_matchers? + # @return [Boolean] + # @overload strict_predicate_matchers=(value) + # @param [Boolean] value + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:211 + def strict_predicate_matchers; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:213 + def strict_predicate_matchers=(value); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:218 + def strict_predicate_matchers?; end + + # The list of configured syntaxes. + # @return [Array] the list of configured syntaxes. + # @example + # unless RSpec::Matchers.configuration.syntax.include?(:expect) + # raise "this RSpec extension gem requires the rspec-expectations `:expect` syntax" + # end + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:80 + def syntax; end + + # Configures the supported syntax. + # @param [Array, Symbol] values the syntaxes to enable + # @example + # RSpec.configure do |rspec| + # rspec.expect_with :rspec do |c| + # c.syntax = :should + # # or + # c.syntax = :expect + # # or + # c.syntax = [:should, :expect] + # end + # end + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:46 + def syntax=(values); end + + # Configures whether RSpec will warn about matcher use which will + # potentially cause false positives in tests. + # + # @param [Boolean] boolean + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:173 + def warn_about_potential_false_positives=(boolean); end + + # Indicates whether RSpec will warn about matcher use which will + # potentially cause false positives in tests, generally you want to + # avoid such scenarios so this defaults to `true`. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:225 + def warn_about_potential_false_positives?; end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:22 +RSpec::Expectations::Configuration::FALSE_POSITIVE_BEHAVIOURS = T.let(T.unsafe(nil), Hash) + +# @api private +# Null implementation of a backtrace formatter used by default +# when rspec-core is not loaded. Does no filtering. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:163 +module RSpec::Expectations::Configuration::NullBacktraceFormatter + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:164 + def format_backtrace(backtrace); end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:4 +module RSpec::Expectations::ExpectationHelper + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:5 + def check_message(msg); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:32 + def handle_failure(matcher, message, failure_message_method); end + + # Returns an RSpec-3+ compatible matcher, wrapping a legacy one + # in an adapter if necessary. + # + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:18 + def modern_matcher_from(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:23 + def with_matcher(handler, matcher, message); end + end +end + +# Exception raised when an expectation fails. +# +# @note We subclass Exception so that in a stub implementation if +# the user sets an expectation, it can't be caught in their +# code by a bare `rescue`. +# @api public +# +# pkg:gem/rspec-expectations#lib/rspec/expectations.rb:67 +class RSpec::Expectations::ExpectationNotMetError < ::Exception; end + +# Wraps the target of an expectation. +# +# @example +# expect(something) # => ExpectationTarget wrapping something +# expect { do_something } # => ExpectationTarget wrapping the block +# +# # used with `to` +# expect(actual).to eq(3) +# +# # with `not_to` +# expect(actual).not_to eq(3) +# +# @note `ExpectationTarget` is not intended to be instantiated +# directly by users. Use `expect` instead. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:17 +class RSpec::Expectations::ExpectationTarget + include ::RSpec::Expectations::ExpectationTarget::InstanceMethods + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:31 + def initialize(value); end + + # @note this name aligns with `Minitest::Expectation` so that our + # {InstanceMethods} module can be included in that class when + # used in a Minitest context. + # @return [Object] the target of the expectation + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:28 + def target; end + + class << self + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:36 + def for(value, block); end + end +end + +# Defines instance {ExpectationTarget} instance methods. These are defined +# in a module so we can include it in `Minitest::Expectation` when +# `rspec/expectations/minitest_integration` is loaded in order to +# support usage with Minitest. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:53 +module RSpec::Expectations::ExpectationTarget::InstanceMethods + # Runs the given expectation, passing if `matcher` returns false. + # @example + # expect(value).not_to eq(5) + # @param [Matcher] + # matcher + # @param [String, Proc] message optional message to display when the expectation fails + # @return [Boolean] false if the negative expectation succeeds (else raises) + # @see RSpec::Matchers + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:76 + def not_to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Runs the given expectation, passing if `matcher` returns true. + # @example + # expect(value).to eq(5) + # expect { perform }.to raise_error + # @param [Matcher] + # matcher + # @param [String, Proc] message optional message to display when the expectation fails + # @return [Boolean] true if the expectation succeeds (else raises) + # @see RSpec::Matchers + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:63 + def to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:80 + def to_not(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:84 + def prevent_operator_matchers(verb); end +end + +# @private +# Used as a sentinel value to be able to tell when the user +# did not pass an argument. We can't use `nil` for that because +# `nil` is a valid value to pass. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:22 +module RSpec::Expectations::ExpectationTarget::UndefinedValue; end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:4 +class RSpec::Expectations::FailureAggregator + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:97 + def initialize(block_label, metadata); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:27 + def aggregate; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:5 + def block_label; end + + # This method is defined to satisfy the callable interface + # expected by `RSpec::Support.with_failure_notifier`. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:64 + def call(failure, options); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:54 + def failures; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:5 + def metadata; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:58 + def other_errors; end + + private + + # On JRuby 9.1.x.x and before, `caller` and `raise` produce different backtraces with + # regards to `.java` stack frames. It's important that we use `raise` for JRuby to produce + # a backtrace that has a continuous common section with the raised `MultipleExpectationsNotMetError`, + # so that rspec-core's truncation logic can work properly on it to list the backtrace + # relative to the `aggregate_failures` block. + # :nocov: + # Using `caller` performs better (and is simpler) than `raise` on most Rubies. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:92 + def assign_backtrace(failure); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:103 + def notify_aggregated_failures; end +end + +# pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:25 +RSpec::Expectations::FailureAggregator::AGGREGATED_FAILURE = T.let(T.unsafe(nil), RSpec::Expectations::FailureAggregator::AggregatedFailure) + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:8 +class RSpec::Expectations::FailureAggregator::AggregatedFailure + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:19 + def inspect; end +end + +# :nocov: +# `inspect` was apparently used by some versions early in ruby 3 while constructing +# NoMethodError, but seems to be no longer. +# +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:14 +RSpec::Expectations::FailureAggregator::AggregatedFailure::MESSAGE = T.let(T.unsafe(nil), String) + +# RSpec 3.0 was released with the class name misspelled. For SemVer compatibility, +# we will provide this misspelled alias until 4.0. +# @deprecated Use LegacyMatcherAdapter instead. +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:179 +RSpec::Expectations::LegacyMacherAdapter = RSpec::Expectations::LegacyMatcherAdapter + +# Wraps a matcher written against one of the legacy protocols in +# order to present the current protocol. +# +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:112 +class RSpec::Expectations::LegacyMatcherAdapter < ::RSpec::Matchers::MatcherDelegator + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:113 + def initialize(matcher); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:123 + def wrap(matcher); end + end +end + +# Before RSpec 1.2, the failure message protocol was: +# * `failure_message` +# * `negative_failure_message` +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:156 +class RSpec::Expectations::LegacyMatcherAdapter::RSpec1 < ::RSpec::Expectations::LegacyMatcherAdapter + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:157 + def failure_message; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:161 + def failure_message_when_negated; end + + class << self + # Note: `failure_message` is part of the RSpec 3 protocol + # (paired with `failure_message_when_negated`), so we don't check + # for `failure_message` here. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:168 + def interface_matches?(matcher); end + end +end + +# Starting in RSpec 1.2 (and continuing through all 2.x releases), +# the failure message protocol was: +# * `failure_message_for_should` +# * `failure_message_for_should_not` +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:132 +class RSpec::Expectations::LegacyMatcherAdapter::RSpec2 < ::RSpec::Expectations::LegacyMatcherAdapter + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:133 + def failure_message; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:137 + def failure_message_when_negated; end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:141 + def interface_matches?(matcher); end + end +end + +# Exception raised from `aggregate_failures` when multiple expectations fail. +# +# @note The constant is defined here but the extensive logic of this class +# is lazily defined when `FailureAggregator` is autoloaded, since we do +# not need to waste time defining that functionality unless +# `aggregate_failures` is used. +# Exception raised from `aggregate_failures` when multiple expectations fail. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations.rb:76 +class RSpec::Expectations::MultipleExpectationsNotMetError < ::RSpec::Expectations::ExpectationNotMetError + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:160 + def initialize(failure_aggregator); end + + # @return [String] The user-assigned label for the aggregation block. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:135 + def aggregation_block_label; end + + # @return [Hash] The metadata hash passed to `aggregate_failures`. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:140 + def aggregation_metadata; end + + # @return [Array] The list of expectation failures and other exceptions, combined. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:132 + def all_exceptions; end + + # return [String] A description of the failure/error counts. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:151 + def exception_count_description; end + + # @return [Array] The list of expectation failures. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:122 + def failures; end + + # @return [String] The fully formatted exception message. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:117 + def message; end + + # @return [Array] The list of other exceptions. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:127 + def other_errors; end + + # @return [String] A summary of the failure, including the block label and a count of failures. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:145 + def summary; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:192 + def backtrace_line(line); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:165 + def block_description; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:174 + def enumerated(exceptions, index_offset); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:204 + def enumerated_errors; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:200 + def enumerated_failures; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:182 + def exclusion_patterns; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:188 + def format_backtrace(backtrace); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:219 + def indentation; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:210 + def indented(failure_message, index); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:231 + def index_label(index); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:223 + def longest_index_label_width; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:170 + def pluralize(noun, count); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/failure_aggregator.rb:227 + def width_of_label(index); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:73 +class RSpec::Expectations::NegativeExpectationHandler + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:87 + def does_not_match?(matcher, actual, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:74 + def handle_matcher(actual, initial_matcher, custom_message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:103 + def opposite_should_method; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:99 + def should_method; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:95 + def verb; end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:45 +class RSpec::Expectations::PositiveExpectationHandler + class << self + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:46 + def handle_matcher(actual, initial_matcher, custom_message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:67 + def opposite_should_method; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:63 + def should_method; end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/handler.rb:59 + def verb; end + end +end + +# @api private +# Provides methods for enabling and disabling the available +# syntaxes provided by rspec-expectations. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:6 +module RSpec::Expectations::Syntax + private + + # @api private + # Determines where we add `should` and `should_not`. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:11 + def default_should_host; end + + # @api private + # Disables the `expect` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:80 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # @api private + # Disables the `should` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:57 + def disable_should(syntax_host = T.unsafe(nil)); end + + # @api private + # Enables the `expect` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:68 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # @api private + # Enables the `should` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:38 + def enable_should(syntax_host = T.unsafe(nil)); end + + # @api private + # Indicates whether or not the `expect` syntax is enabled. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:96 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # @api private + # Indicates whether or not the `should` syntax is enabled. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:90 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # @api private + # Instructs rspec-expectations to warn on first usage of `should` or `should_not`. + # Enabled by default. This is largely here to facilitate testing. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:18 + def warn_about_should!; end + + # @api private + # Generates a deprecation warning for the given method if no warning + # has already been issued. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:25 + def warn_about_should_unless_configured(method_name); end + + class << self + # @api private + # Determines where we add `should` and `should_not`. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:11 + def default_should_host; end + + # @api private + # Disables the `expect` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:80 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # @api private + # Disables the `should` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:57 + def disable_should(syntax_host = T.unsafe(nil)); end + + # @api private + # Enables the `expect` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:68 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # @api private + # Enables the `should` syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:38 + def enable_should(syntax_host = T.unsafe(nil)); end + + # @api private + # Indicates whether or not the `expect` syntax is enabled. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:96 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # @api private + # Indicates whether or not the `should` syntax is enabled. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:90 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # @api private + # Instructs rspec-expectations to warn on first usage of `should` or `should_not`. + # Enabled by default. This is largely here to facilitate testing. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:18 + def warn_about_should!; end + + # @api private + # Generates a deprecation warning for the given method if no warning + # has already been issued. + # + # pkg:gem/rspec-expectations#lib/rspec/expectations/syntax.rb:25 + def warn_about_should_unless_configured(method_name); end + end +end + +# @private +# Validates the provided matcher to ensure it supports block +# expectations, in order to avoid user confusion when they +# use a block thinking the expectation will be on the return +# value of the block rather than the block itself. +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:98 +class RSpec::Expectations::ValueExpectationTarget < ::RSpec::Expectations::ExpectationTarget + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:104 + def not_to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:99 + def to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:111 + def enforce_value_expectation(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/expectation_target.rb:126 + def supports_value_expectations?(matcher); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/expectations/version.rb:4 +module RSpec::Expectations::Version; end + +# pkg:gem/rspec-expectations#lib/rspec/expectations/version.rb:5 +RSpec::Expectations::Version::STRING = T.let(T.unsafe(nil), String) + +# RSpec::Matchers provides a number of useful matchers we use to define +# expectations. Any object that implements the [matcher protocol](Matchers/MatcherProtocol) +# can be used as a matcher. +# +# ## Predicates +# +# In addition to matchers that are defined explicitly, RSpec will create +# custom matchers on the fly for any arbitrary predicate, giving your specs a +# much more natural language feel. +# +# A Ruby predicate is a method that ends with a "?" and returns true or false. +# Common examples are `empty?`, `nil?`, and `instance_of?`. +# +# All you need to do is write `expect(..).to be_` followed by the predicate +# without the question mark, and RSpec will figure it out from there. +# For example: +# +# expect([]).to be_empty # => [].empty?() | passes +# expect([]).not_to be_empty # => [].empty?() | fails +# +# In addition to prefixing the predicate matchers with "be_", you can also use "be_a_" +# and "be_an_", making your specs read much more naturally: +# +# expect("a string").to be_an_instance_of(String) # =>"a string".instance_of?(String) # passes +# +# expect(3).to be_a_kind_of(Integer) # => 3.kind_of?(Numeric) | passes +# expect(3).to be_a_kind_of(Numeric) # => 3.kind_of?(Numeric) | passes +# expect(3).to be_an_instance_of(Integer) # => 3.instance_of?(Integer) | passes +# expect(3).not_to be_an_instance_of(Numeric) # => 3.instance_of?(Numeric) | fails +# +# RSpec will also create custom matchers for predicates like `has_key?`. To +# use this feature, just state that the object should have_key(:key) and RSpec will +# call has_key?(:key) on the target. For example: +# +# expect(:a => "A").to have_key(:a) +# expect(:a => "A").to have_key(:b) # fails +# +# You can use this feature to invoke any predicate that begins with "has_", whether it is +# part of the Ruby libraries (like `Hash#has_key?`) or a method you wrote on your own class. +# +# Note that RSpec does not provide composable aliases for these dynamic predicate +# matchers. You can easily define your own aliases, though: +# +# RSpec::Matchers.alias_matcher :a_user_who_is_an_admin, :be_an_admin +# expect(user_list).to include(a_user_who_is_an_admin) +# +# ## Alias Matchers +# +# With {RSpec::Matchers.alias_matcher}, you can easily create an +# alternate name for a given matcher. +# +# The description will also change according to the new name: +# +# RSpec::Matchers.alias_matcher :a_list_that_sums_to, :sum_to +# sum_to(3).description # => "sum to 3" +# a_list_that_sums_to(3).description # => "a list that sums to 3" +# +# or you can specify a custom description like this: +# +# RSpec::Matchers.alias_matcher :a_list_sorted_by, :be_sorted_by do |description| +# description.sub("be sorted by", "a list sorted by") +# end +# +# be_sorted_by(:age).description # => "be sorted by age" +# a_list_sorted_by(:age).description # => "a list sorted by age" +# +# ## Custom Matchers +# +# When you find that none of the stock matchers provide a natural feeling +# expectation, you can very easily write your own using RSpec's matcher DSL +# or writing one from scratch. +# +# ### Matcher DSL +# +# Imagine that you are writing a game in which players can be in various +# zones on a virtual board. To specify that bob should be in zone 4, you +# could say: +# +# expect(bob.current_zone).to eql(Zone.new("4")) +# +# But you might find it more expressive to say: +# +# expect(bob).to be_in_zone("4") +# +# and/or +# +# expect(bob).not_to be_in_zone("3") +# +# You can create such a matcher like so: +# +# RSpec::Matchers.define :be_in_zone do |zone| +# match do |player| +# player.in_zone?(zone) +# end +# end +# +# This will generate a be_in_zone method that returns a matcher +# with logical default messages for failures. You can override the failure +# messages and the generated description as follows: +# +# RSpec::Matchers.define :be_in_zone do |zone| +# match do |player| +# player.in_zone?(zone) +# end +# +# failure_message do |player| +# # generate and return the appropriate string. +# end +# +# failure_message_when_negated do |player| +# # generate and return the appropriate string. +# end +# +# description do +# # generate and return the appropriate string. +# end +# end +# +# Each of the message-generation methods has access to the block arguments +# passed to the create method (in this case, zone). The +# failure message methods (failure_message and +# failure_message_when_negated) are passed the actual value (the +# receiver of expect(..) or expect(..).not_to). +# +# ### Custom Matcher from scratch +# +# You could also write a custom matcher from scratch, as follows: +# +# class BeInZone +# def initialize(expected) +# @expected = expected +# end +# +# def matches?(target) +# @target = target +# @target.current_zone.eql?(Zone.new(@expected)) +# end +# +# def failure_message +# "expected #{@target.inspect} to be in Zone #{@expected}" +# end +# +# def failure_message_when_negated +# "expected #{@target.inspect} not to be in Zone #{@expected}" +# end +# end +# +# ... and a method like this: +# +# def be_in_zone(expected) +# BeInZone.new(expected) +# end +# +# And then expose the method to your specs. This is normally done +# by including the method and the class in a module, which is then +# included in your spec: +# +# module CustomGameMatchers +# class BeInZone +# # ... +# end +# +# def be_in_zone(expected) +# # ... +# end +# end +# +# describe "Player behaviour" do +# include CustomGameMatchers +# # ... +# end +# +# or you can include in globally in a spec_helper.rb file required +# from your spec file(s): +# +# RSpec::configure do |config| +# config.include(CustomGameMatchers) +# end +# +# ### Making custom matchers composable +# +# RSpec's built-in matchers are designed to be composed, in expressions like: +# +# expect(["barn", 2.45]).to contain_exactly( +# a_value_within(0.1).of(2.5), +# a_string_starting_with("bar") +# ) +# +# Custom matchers can easily participate in composed matcher expressions like these. +# Include {RSpec::Matchers::Composable} in your custom matcher to make it support +# being composed (matchers defined using the DSL have this included automatically). +# Within your matcher's `matches?` method (or the `match` block, if using the DSL), +# use `values_match?(expected, actual)` rather than `expected == actual`. +# Under the covers, `values_match?` is able to match arbitrary +# nested data structures containing a mix of both matchers and non-matcher objects. +# It uses `===` and `==` to perform the matching, considering the values to +# match if either returns `true`. The `Composable` mixin also provides some helper +# methods for surfacing the matcher descriptions within your matcher's description +# or failure messages. +# +# RSpec's built-in matchers each have a number of aliases that rephrase the matcher +# from a verb phrase (such as `be_within`) to a noun phrase (such as `a_value_within`), +# which reads better when the matcher is passed as an argument in a composed matcher +# expressions, and also uses the noun-phrase wording in the matcher's `description`, +# for readable failure messages. You can alias your custom matchers in similar fashion +# using {RSpec::Matchers.alias_matcher}. +# +# ## Negated Matchers +# +# Sometimes if you want to test for the opposite using a more descriptive name +# instead of using `not_to`, you can use {RSpec::Matchers.define_negated_matcher}: +# +# RSpec::Matchers.define_negated_matcher :exclude, :include +# include(1, 2).description # => "include 1 and 2" +# exclude(1, 2).description # => "exclude 1 and 2" +# +# While the most obvious negated form may be to add a `not_` prefix, +# the failure messages you get with that form can be confusing (e.g. +# "expected [actual] to not [verb], but did not"). We've found it works +# best to find a more positive name for the negated form, such as +# `avoid_changing` rather than `not_change`. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/english_phrasing.rb:2 +module RSpec::Matchers + extend ::RSpec::Matchers::DSL + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_changing(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_outputting(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_raising(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_throwing(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_control(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_successive_args(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_with_args(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_with_no_args(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_containing_exactly(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_ending_with(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_including(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_starting_with(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_falsey_value(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_falsy_value(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_hash_including(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_kind_of(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_nil_value(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_range_covering(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_ending_with(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_including(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_matching(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_starting_with(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_truthy_value(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_value(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_value_between(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_value_within(*args, **, &block); end + + # Allows multiple expectations in the provided block to fail, and then + # aggregates them into a single exception, rather than aborting on the + # first expectation failure like normal. This allows you to see all + # failures from an entire set of expectations without splitting each + # off into its own example (which may slow things down if the example + # setup is expensive). + # + # @param label [String] label for this aggregation block, which will be + # included in the aggregated exception message. + # @param metadata [Hash] additional metadata about this failure aggregation + # block. If multiple expectations fail, it will be exposed from the + # {Expectations::MultipleExpectationsNotMetError} exception. Mostly + # intended for internal RSpec use but you can use it as well. + # @yield Block containing as many expectation as you want. The block is + # simply yielded to, so you can trust that anything that works outside + # the block should work within it. + # @raise [Expectations::MultipleExpectationsNotMetError] raised when + # multiple expectations fail. + # @raise [Expectations::ExpectationNotMetError] raised when a single + # expectation fails. + # @raise [Exception] other sorts of exceptions will be raised as normal. + # + # @example + # aggregate_failures("verifying response") do + # expect(response.status).to eq(200) + # expect(response.headers).to include("Content-Type" => "text/plain") + # expect(response.body).to include("Success") + # end + # + # @note The implementation of this feature uses a thread-local variable, + # which means that if you have an expectation failure in another thread, + # it'll abort like normal. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:305 + def aggregate_failures(label = T.unsafe(nil), metadata = T.unsafe(nil), &block); end + + # Passes if the provided matcher passes when checked against all + # elements of the collection. + # + # @example + # expect([1, 3, 5]).to all be_odd + # expect([1, 3, 6]).to all be_odd # fails + # + # @note The negative form `not_to all` is not supported. Instead + # use `not_to include` or pass a negative form of a matcher + # as the argument (e.g. `all exclude(:foo)`). + # + # @note You can also use this with compound matchers as well. + # + # @example + # expect([1, 3, 5]).to all( be_odd.and be_an(Integer) ) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:662 + def all(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_array_matching(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_instance_of(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_eq_to(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_eql_to(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_equal_to(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_existing(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_having_attributes(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_matching(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_responding_to(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_satisfying(*args, **, &block); end + + # @example + # expect(actual).to be_truthy + # expect(actual).to be_falsey + # expect(actual).to be_nil + # expect(actual).to be_[arbitrary_predicate](*args) + # expect(actual).not_to be_nil + # expect(actual).not_to be_[arbitrary_predicate](*args) + # + # Given true, false, or nil, will pass if actual value is true, false or + # nil (respectively). Given no args means the caller should satisfy an if + # condition (to be or not to be). + # + # Predicates are any Ruby method that ends in a "?" and returns true or + # false. Given be_ followed by arbitrary_predicate (without the "?"), + # RSpec will match convert that into a query against the target object. + # + # The arbitrary_predicate feature will handle any predicate prefixed with + # "be_an_" (e.g. be_an_instance_of), "be_a_" (e.g. be_a_kind_of) or "be_" + # (e.g. be_empty), letting you choose the prefix that best suits the + # predicate. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:349 + def be(*args); end + + # passes if target.kind_of?(klass) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:355 + def be_a(klass); end + + # Passes if actual.kind_of?(expected) + # + # @example + # expect(5).to be_a_kind_of(Integer) + # expect(5).to be_a_kind_of(Numeric) + # expect(5).not_to be_a_kind_of(Float) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:378 + def be_a_kind_of(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:358 + def be_an(klass); end + + # Passes if actual.instance_of?(expected) + # + # @example + # expect(5).to be_an_instance_of(Integer) + # expect(5).not_to be_an_instance_of(Numeric) + # expect(5).not_to be_an_instance_of(Float) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:366 + def be_an_instance_of(expected); end + + # Passes if actual.between?(min, max). Works with any Comparable object, + # including String, Symbol, Time, or Numeric (Fixnum, Bignum, Integer, + # Float, Complex, and Rational). + # + # By default, `be_between` is inclusive (i.e. passes when given either the max or min value), + # but you can make it `exclusive` by chaining that off the matcher. + # + # @example + # expect(5).to be_between(1, 10) + # expect(11).not_to be_between(1, 10) + # expect(10).not_to be_between(1, 10).exclusive + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:395 + def be_between(min, max); end + + # Passes if actual is falsey (false or nil) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:316 + def be_falsey; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def be_falsy(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:369 + def be_instance_of(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:381 + def be_kind_of(expected); end + + # Passes if actual is nil + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:324 + def be_nil; end + + # Passes if actual is truthy (anything but false or nil) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:310 + def be_truthy; end + + # Passes if actual == expected +/- delta + # + # @example + # expect(result).to be_within(0.5).of(3.0) + # expect(result).not_to be_within(0.5).of(3.0) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:405 + def be_within(delta); end + + # Applied to a proc, specifies that its execution will cause some value to + # change. + # + # @param [Object] receiver + # @param [Symbol] message the message to send the receiver + # + # You can either pass receiver and message, or a block, + # but not both. + # + # When passing a block, it must use the `{ ... }` format, not + # do/end, as `{ ... }` binds to the `change` method, whereas do/end + # would errantly bind to the `expect(..).to` or `expect(...).not_to` method. + # + # You can chain any of the following off of the end to specify details + # about the change: + # + # * `from` + # * `to` + # + # or any one of: + # + # * `by` + # * `by_at_least` + # * `by_at_most` + # + # @example + # expect { + # team.add_player(player) + # }.to change(roster, :count) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_least(1) + # + # expect { + # team.add_player(player) + # }.to change(roster, :count).by_at_most(1) + # + # string = "string" + # expect { + # string.reverse! + # }.to change { string }.from("string").to("gnirts") + # + # string = "string" + # expect { + # string + # }.not_to change { string }.from("string") + # + # expect { + # person.happy_birthday + # }.to change(person, :birthday).from(32).to(33) + # + # expect { + # employee.develop_great_new_social_networking_app + # }.to change(employee, :title).from("Mail Clerk").to("CEO") + # + # expect { + # doctor.leave_office + # }.to change(doctor, :sign).from(/is in/).to(/is out/) + # + # user = User.new(:type => "admin") + # expect { + # user.symbolize_type + # }.to change(user, :type).from(String).to(Symbol) + # + # == Notes + # + # Evaluates `receiver.message` or `block` before and after it + # evaluates the block passed to `expect`. If the value is the same + # object, its before/after `hash` value is used to see if it has changed. + # Therefore, your object needs to properly implement `hash` to work correctly + # with this matcher. + # + # `expect( ... ).not_to change` supports the form that specifies `from` + # (which specifies what you expect the starting, unchanged value to be) + # but does not support forms with subsequent calls to `by`, `by_at_least`, + # `by_at_most` or `to`. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:492 + def change(receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def changing(*args, **, &block); end + + # Passes if actual contains all of the expected regardless of order. + # This works for collections. Pass in multiple args and it will only + # pass if all args are found in collection. + # + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # + # @see #match_array + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:510 + def contain_exactly(*items); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def containing_exactly(*args, **, &block); end + + # Passes if actual covers expected. This works for + # Ranges. You can also pass in multiple args + # and it will only pass if all args are found in Range. + # + # @example + # expect(1..10).to cover(5) + # expect(1..10).to cover(4, 6) + # expect(1..10).to cover(4, 6, 11) # fails + # expect(1..10).not_to cover(11) + # expect(1..10).not_to cover(5) # fails + # + # ### Warning:: Ruby >= 1.9 only + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:528 + def cover(*values); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def covering(*args, **, &block); end + + # Matches if the actual value ends with the expected value(s). In the case + # of a string, matches against the last `expected.length` characters of the + # actual string. In the case of an array, matches against the last + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to end_with "string" + # expect([0, 1, 2, 3, 4]).to end_with 4 + # expect([0, 2, 3, 4, 4]).to end_with 3, 4 + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:543 + def end_with(*expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def ending_with(*args, **, &block); end + + # Passes if actual == expected. + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eq(5) + # expect(5).not_to eq(3) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:558 + def eq(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def eq_to(*args, **, &block); end + + # Passes if `actual.eql?(expected)` + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to eql(5) + # expect(5).not_to eql(3) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:572 + def eql(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def eql_to(*args, **, &block); end + + # Passes if actual.equal?(expected) (object identity). + # + # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more + # information about equality in Ruby. + # + # @example + # expect(5).to equal(5) # Integers are equal + # expect("5").not_to equal("5") # Strings that look the same are not the same object + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:586 + def equal(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def equal_to(*args, **, &block); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:596 + def exist(*args); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def existing(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/expectations/configuration.rb:48 + def expect(value = T.unsafe(nil), &block); end + + # Passes if actual's attribute values match the expected attributes hash. + # This works no matter how you define your attribute readers. + # + # @example + # Person = Struct.new(:name, :age) + # person = Person.new("Bob", 32) + # + # expect(person).to have_attributes(:name => "Bob", :age => 32) + # expect(person).to have_attributes(:name => a_string_starting_with("B"), :age => (a_value > 30) ) + # + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # @example + # expect(person).to have_attributes(:color => "red") + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:616 + def have_attributes(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def having_attributes(*args, **, &block); end + + # Passes if actual includes expected. This works for + # collections and Strings. You can also pass in multiple args + # and it will only pass if all args are found in collection. + # + # @example + # expect([1,2,3]).to include(3) + # expect([1,2,3]).to include(2,3) + # expect([1,2,3]).to include(2,3,4) # fails + # expect([1,2,3]).not_to include(4) + # expect("spread").to include("read") + # expect("spread").not_to include("red") + # expect(:a => 1, :b => 2).to include(:a) + # expect(:a => 1, :b => 2).to include(:a, :b) + # expect(:a => 1, :b => 2).to include(:a => 1) + # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1) + # expect(:a => 1, :b => 2).to include(:c) # fails + # expect(:a => 1, :b => 2).not_to include(:a => 2) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:639 + def include(*expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def including(*args, **, &block); end + + # Given a `Regexp` or `String`, passes if `actual.match(pattern)` + # Given an arbitrary nested data structure (e.g. arrays and hashes), + # matches if `expected === actual` || `actual == expected` for each + # pair of elements. + # + # @example + # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) + # expect(email).to match("@example.com") + # + # @example + # hash = { + # :a => { + # :b => ["foo", 5], + # :c => { :d => 2.05 } + # } + # } + # + # expect(hash).to match( + # :a => { + # :b => a_collection_containing_exactly( + # a_string_starting_with("f"), + # an_instance_of(Integer) + # ), + # :c => { :d => (a_value < 3) } + # } + # ) + # + # @note The `match_regex` alias is deprecated and is not recommended for use. + # It was added in 2.12.1 to facilitate its use from within custom + # matchers (due to how the custom matcher DSL was evaluated in 2.x, + # `match` could not be used there), but is no longer needed in 3.x. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:697 + def match(expected); end + + # An alternate form of `contain_exactly` that accepts + # the expected contents as a single array arg rather + # than splatted out as individual items. + # + # @example + # expect(results).to contain_exactly(1, 2) + # # is identical to: + # expect(results).to match_array([1, 2]) + # + # @see #contain_exactly + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:715 + def match_array(items); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def match_regex(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def matching(*args, **, &block); end + + # With no arg, passes if the block outputs `to_stdout` or `to_stderr`. + # With a string, passes if the block outputs that specific string `to_stdout` or `to_stderr`. + # With a regexp or matcher, passes if the block outputs a string `to_stdout` or `to_stderr` that matches. + # + # To capture output from any spawned subprocess as well, use `to_stdout_from_any_process` or + # `to_stderr_from_any_process`. Output from any process that inherits the main process's corresponding + # standard stream will be captured. + # + # @example + # expect { print 'foo' }.to output.to_stdout + # expect { print 'foo' }.to output('foo').to_stdout + # expect { print 'foo' }.to output(/foo/).to_stdout + # + # expect { do_something }.to_not output.to_stdout + # + # expect { warn('foo') }.to output.to_stderr + # expect { warn('foo') }.to output('foo').to_stderr + # expect { warn('foo') }.to output(/foo/).to_stderr + # + # expect { do_something }.to_not output.to_stderr + # + # expect { system('echo foo') }.to output("foo\n").to_stdout_from_any_process + # expect { system('echo foo', out: :err) }.to output("foo\n").to_stderr_from_any_process + # + # @note `to_stdout` and `to_stderr` work by temporarily replacing `$stdout` or `$stderr`, + # so they're not able to intercept stream output that explicitly uses `STDOUT`/`STDERR` + # or that uses a reference to `$stdout`/`$stderr` that was stored before the + # matcher was used. + # @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and + # are thus significantly (~30x) slower than `to_stdout` and `to_stderr`. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:752 + def output(expected = T.unsafe(nil)); end + + # With no args, matches if any error is raised. + # With a named error, matches only if that specific error is raised. + # With a named error and message specified as a String, matches only if both match. + # With a named error and message specified as a Regexp, matches only if both match. + # Pass an optional block to perform extra verifications on the exception matched + # + # @example + # expect { do_something_risky }.to raise_error + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error { |error| expect(error.data).to eq 42 } + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, "that was too risky") + # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, /oo ri/) + # expect { do_something_risky }.to raise_error("that was too risky") + # + # expect { do_something_risky }.not_to raise_error + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:773 + def raise_error(error = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:776 + def raise_exception(error = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def raising(*args, **, &block); end + + # Matches if the target object responds to all of the names + # provided. Names can be Strings or Symbols. + # + # @example + # expect("string").to respond_to(:length) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:792 + def respond_to(*names); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def responding_to(*args, **, &block); end + + # Passes if the submitted block returns true. Yields target to the + # block. + # + # Generally speaking, this should be thought of as a last resort when + # you can't find any other way to specify the behaviour you wish to + # specify. + # + # If you do find yourself in such a situation, you could always write + # a custom matcher, which would likely make your specs more expressive. + # + # @param description [String] optional description to be used for this matcher. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:813 + def satisfy(description = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def satisfying(*args, **, &block); end + + # Matches if the actual value starts with the expected value(s). In the + # case of a string, matches against the first `expected.length` characters + # of the actual string. In the case of an array, matches against the first + # `expected.length` elements of the actual array. + # + # @example + # expect("this string").to start_with "this s" + # expect([0, 1, 2, 3, 4]).to start_with 0 + # expect([0, 2, 3, 4, 4]).to start_with 0, 1 + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:828 + def start_with(*expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def starting_with(*args, **, &block); end + + # Given no argument, matches if a proc throws any Symbol. + # + # Given a Symbol, matches if the given proc throws the specified Symbol. + # + # Given a Symbol and an arg, matches if the given proc throws the + # specified Symbol with the specified arg. + # + # @example + # expect { do_something_risky }.to throw_symbol + # expect { do_something_risky }.to throw_symbol(:that_was_risky) + # expect { do_something_risky }.to throw_symbol(:that_was_risky, 'culprit') + # + # expect { do_something_risky }.not_to throw_symbol + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky) + # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:850 + def throw_symbol(expected_symbol = T.unsafe(nil), expected_arg = T.unsafe(nil)); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def throwing(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def within(*args, **, &block); end + + # Passes if the method called in the expect block yields, regardless + # of whether or not arguments are yielded. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_control + # expect { |b| "a".to_sym(&b) }.not_to yield_control + # + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:871 + def yield_control; end + + # Designed for use with methods that repeatedly yield (such as + # iterators). Passes if the method called in the expect block yields + # multiple times with arguments matching those given. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3) + # expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2]) + # expect { |b| [1, 2, 3].each(&b) }.not_to yield_successive_args(1, 2) + # + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:940 + def yield_successive_args(*args); end + + # Given no arguments, matches if the method called in the expect + # block yields with arguments (regardless of what they are or how + # many there are). + # + # Given arguments, matches if the method called in the expect block + # yields with arguments that match the given arguments. + # + # Argument matching is done using `===` (the case match operator) + # and `==`. If the expected and actual arguments match with either + # operator, the matcher will pass. + # + # @example + # expect { |b| 5.tap(&b) }.to yield_with_args # because #tap yields an arg + # expect { |b| 5.tap(&b) }.to yield_with_args(5) # because 5 == 5 + # expect { |b| 5.tap(&b) }.to yield_with_args(Integer) # because Integer === 5 + # expect { |b| File.open("f.txt", &b) }.to yield_with_args(/txt/) # because /txt/ === "f.txt" + # + # expect { |b| User.transaction(&b) }.not_to yield_with_args # because it yields no args + # expect { |b| 5.tap(&b) }.not_to yield_with_args(1, 2, 3) + # + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:919 + def yield_with_args(*args); end + + # Passes if the method called in the expect block yields with + # no arguments. Fails if it does not yield, or yields with arguments. + # + # @example + # expect { |b| User.transaction(&b) }.to yield_with_no_args + # expect { |b| 5.tap(&b) }.not_to yield_with_no_args # because it yields with `5` + # expect { |b| "a".to_sym(&b) }.not_to yield_with_no_args # because it does not yield + # + # @note Your expect block must accept a parameter and pass it on to + # the method-under-test as a block. + # @note This matcher is not designed for use with methods that yield + # multiple times. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:889 + def yield_with_no_args; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_control(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_successive_args(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_with_args(*args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_with_no_args(*args, **, &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:961 + def method_missing(method, *args, **, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:974 + def respond_to_missing?(method, *); end + + class << self + # @!macro [attach] alias_matcher + # @!parse + # alias $1 $2 + # @!visibility private + # We define this override here so we can attach a YARD macro to it. + # It ensures that our docs list all the matcher aliases. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:250 + def alias_matcher(*args, &block); end + + # @api private + # Used by rspec-core to clear the state used to generate + # descriptions after an example. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:11 + def clear_generated_description; end + + # Delegates to {RSpec::Expectations.configuration}. + # This is here because rspec-core's `expect_with` option + # looks for a `configuration` method on the mixin + # (`RSpec::Matchers`) to yield to a block. + # @return [RSpec::Expectations::Configuration] the configuration object + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:951 + def configuration; end + + # @api private + # Generates an an example description based on the last expectation. + # Used by rspec-core's one-liner syntax. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:19 + def generated_description; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:1008 + def is_a_describable_matcher?(obj); end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:988 + def is_a_matcher?(obj); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:25 + def last_description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:5 + def last_expectation_handler; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:5 + def last_expectation_handler=(_arg0); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:5 + def last_matcher; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/generated_descriptions.rb:5 + def last_matcher=(_arg0); end + end +end + +# Decorator that wraps a matcher and overrides `description` +# using the provided block in order to support an alias +# of a matcher. This is intended for use when composing +# matchers, so that you can use an expression like +# `include( a_value_within(0.1).of(3) )` rather than +# `include( be_within(0.1).of(3) )`, and have the corresponding +# description read naturally. +# +# @api private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:12 +class RSpec::Matchers::AliasedMatcher < ::RSpec::Matchers::MatcherDelegator + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:13 + def initialize(base_matcher, description_block); end + + # Provides the description of the aliased matcher. Aliased matchers + # are designed to behave identically to the original matcher except + # for the description and failure messages. The description is different + # to reflect the aliased name. + # + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:36 + def description; end + + # Provides the failure_message of the aliased matcher. Aliased matchers + # are designed to behave identically to the original matcher except + # for the description and failure messages. The failure_message is different + # to reflect the aliased name. + # + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:46 + def failure_message; end + + # Provides the failure_message_when_negated of the aliased matcher. Aliased matchers + # are designed to behave identically to the original matcher except + # for the description and failure messages. The failure_message_when_negated is different + # to reflect the aliased name. + # + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:56 + def failure_message_when_negated; end + + # Forward messages on to the wrapped matcher. + # Since many matchers provide a fluent interface + # (e.g. `a_value_within(0.1).of(3)`), we need to wrap + # the returned value if it responds to `description`, + # so that our override can be applied when it is eventually + # used. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:24 + def method_missing(*); end +end + +# Decorator used for matchers that have special implementations of +# operators like `==` and `===`. +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:64 +class RSpec::Matchers::AliasedMatcherWithOperatorSupport < ::RSpec::Matchers::AliasedMatcher; end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:71 +class RSpec::Matchers::AliasedNegatedMatcher < ::RSpec::Matchers::AliasedMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:80 + def does_not_match?(*args, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:84 + def failure_message; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:88 + def failure_message_when_negated; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:72 + def matches?(*args, &block); end + + private + + # For a matcher that uses the default failure messages, we prefer to + # use the override provided by the `description_block`, because it + # includes the phrasing that the user has expressed a preference for + # by going through the effort of defining a negated matcher. + # + # However, if the override didn't actually change anything, then we + # should return the opposite failure message instead -- the overridden + # message is going to be confusing if we return it as-is, as it represents + # the non-negated failure message for a negated match (or vice versa). + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:105 + def optimal_failure_message(same, inverted); end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers/aliased_matcher.rb:94 +RSpec::Matchers::AliasedNegatedMatcher::DefaultFailureMessages = RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + +# pkg:gem/rspec-expectations#lib/rspec/matchers.rb:957 +RSpec::Matchers::BE_PREDICATE_REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides a base class with as little methods as possible, so that +# most methods can be delegated via `method_missing`. +# +# On Ruby 2.0+ BasicObject could be used for this purpose, but it +# introduce some extra complexity with constant resolution, so the +# BlankSlate pattern was prefered. +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:10 +class RSpec::Matchers::BaseDelegator; end + +# Container module for all built-in matchers. The matcher classes are here +# (rather than directly under `RSpec::Matchers`) in order to prevent name +# collisions, since `RSpec::Matchers` gets included into the user's namespace. +# +# Autoloading is used to delay when the matcher classes get loaded, allowing +# rspec-matchers to boot faster, and avoiding loading matchers the user is +# not using. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:3 +module RSpec::Matchers::BuiltIn; end + +# @api private +# Provides the implementation for `all`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:7 +class RSpec::Matchers::BuiltIn::All < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:11 + def initialize(matcher); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:37 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:17 + def does_not_match?(_actual); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:9 + def failed_objects; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:23 + def failure_message; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:9 + def matcher; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:63 + def add_new_line_if_needed(message); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:58 + def failure_message_for_item(index, failure_message); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:67 + def indent_multiline_message(message); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:50 + def index_failed_objects; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:74 + def initialize_copy(other); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:80 + def iterable?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/all.rb:43 + def match(_expected, _actual); end +end + +# @api private +# +# Used _internally_ as a base class for matchers that ship with +# rspec-expectations and rspec-rails. +# +# ### Warning: +# +# This class is for internal use, and subject to change without notice. +# We strongly recommend that you do not base your custom matchers on this +# class. If/when this changes, we will announce it and remove this warning. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:14 +class RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::Composable + include ::RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting + include ::RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:28 + def initialize(expected = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:23 + def actual; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:97 + def actual_formatted; end + + # @api private + # Generates a description using {EnglishPhrasing}. + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:60 + def description; end + + # @api private + # Matchers are not diffable by default. Override this to make your + # subclass diffable. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:69 + def diffable?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:23 + def expected; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:92 + def expected_formatted; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:87 + def expects_call_stack_jump?; end + + # @api private + # Used to wrap a block of code that will indicate failure by + # raising one of the named exceptions. + # + # This is used by rspec-rails for some of its matchers that + # wrap rails' assertions. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:47 + def match_unless_raises(*exceptions); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:107 + def matcher_name; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:26 + def matcher_name=(_arg0); end + + # @api private + # Indicates if the match is successful. Delegates to `match`, which + # should be defined on a subclass. Takes care of consistently + # initializing the `actual` attribute. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:36 + def matches?(actual); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:23 + def rescued_exception; end + + # @api private + # Most matchers are value matchers (i.e. meant to work with `expect(value)`) + # rather than block matchers (i.e. meant to work with `expect { }`), so + # this defaults to false. Block matchers must override this to return true. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:77 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:82 + def supports_value_expectations?; end + + class << self + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:102 + def matcher_name; end + + private + + # @private + # Borrowed from ActiveSupport. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:117 + def underscore(camel_cased_word); end + end +end + +# @api private +# Provides default implementations of failure messages, based on the `description`. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:193 +module RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + # @api private + # Provides a good generic failure message. Based on `description`. + # When subclassing, if you are not satisfied with this failure message + # you often only need to override `description`. + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:199 + def failure_message; end + + # @api private + # Provides a good generic negative failure message. Based on `description`. + # When subclassing, if you are not satisfied with this failure message + # you often only need to override `description`. + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:208 + def failure_message_when_negated; end + + class << self + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:213 + def has_default_failure_messages?(matcher); end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:128 +module RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting + private + + # `{ :a => 5, :b => 2 }.inspect` produces: + # + # {:a=>5, :b=>2} + # + # ...but it looks much better as: + # + # {:a => 5, :b => 2} + # + # This is idempotent and safe to run on a string multiple times. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:138 + def improve_hash_formatting(inspect_string); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:141 + def improve_hash_formatting(inspect_string); end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:147 +module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting + private + + # @api private + # Formats a String's encoding as a human readable string + # @param value [String] + # @return [String] + # @api private + # Formats a String's encoding as a human readable string + # @param _value [String] + # @return [nil] nil as the curent Ruby version does not support String encoding + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:172 + def format_encoding(value); end + + # @api private + # @return [Boolean] False always as the curent Ruby version does not support String encoding + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:153 + def string_encoding_differs?; end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:186 + def format_encoding(value); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:165 + def string_encoding_differs?; end + end +end + +# @api private +# Used to detect when no arg is passed to `initialize`. +# `nil` cannot be used because it's a valid value to pass. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:20 +RSpec::Matchers::BuiltIn::BaseMatcher::UNDEFINED = T.let(T.unsafe(nil), Object) + +# @api private +# Provides the implementation for `be`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:101 +class RSpec::Matchers::BuiltIn::Be < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:104 + def initialize(*args); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def <(operand); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def <=(operand); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def ==(operand); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def ===(operand); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def =~(operand); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def >(operand); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:121 + def >=(operand); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:110 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:116 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:128 + def match(_, actual); end +end + +# @api private +# Provides the implementation for `be_a_kind_of`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_kind_of.rb:7 +class RSpec::Matchers::BuiltIn::BeAKindOf < ::RSpec::Matchers::BuiltIn::BaseMatcher + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_kind_of.rb:10 + def match(expected, actual); end +end + +# @api private +# Provides the implementation for `be_an_instance_of`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_instance_of.rb:7 +class RSpec::Matchers::BuiltIn::BeAnInstanceOf < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_instance_of.rb:10 + def description; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_instance_of.rb:16 + def match(expected, actual); end +end + +# @api private +# Provides the implementation for `be_between`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:7 +class RSpec::Matchers::BuiltIn::BeBetween < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:8 + def initialize(min, max); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:57 + def description; end + + # @api public + # Makes the between comparison exclusive. + # + # @example + # expect(3).to be_between(2, 4).exclusive + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:33 + def exclusive; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:51 + def failure_message; end + + # @api public + # Makes the between comparison inclusive. + # + # @example + # expect(3).to be_between(2, 3).inclusive + # + # @note The matcher is inclusive by default; this simply provides + # a way to be more explicit about it. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:21 + def inclusive; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:42 + def matches?(actual); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:63 + def comparable?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:71 + def compare; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_between.rb:67 + def not_comparable_clause; end +end + +# @api private +# Provides the implementation of `be value`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:136 +class RSpec::Matchers::BuiltIn::BeComparedTo < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:139 + def initialize(operand, operator); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:178 + def description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:151 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:159 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:166 + def failure_message_when_negated; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:145 + def matches?(actual); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:184 + def perform_match(actual); end +end + +# @api private +# Provides the implementation for `be_falsey`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:30 +class RSpec::Matchers::BuiltIn::BeFalsey < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:33 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:39 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:45 + def match(_, actual); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:74 +module RSpec::Matchers::BuiltIn::BeHelpers + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:77 + def args_to_s; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:93 + def args_to_sentence; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:89 + def expected_to_sentence; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:85 + def inspected_args; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:81 + def parenthesize(string); end +end + +# @api private +# Provides the implementation for `be_nil`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:53 +class RSpec::Matchers::BuiltIn::BeNil < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:56 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:62 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:68 + def match(_, actual); end +end + +# @api private +# Provides the implementation of `be_`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:164 +class RSpec::Matchers::BuiltIn::BePredicate < ::RSpec::Matchers::BuiltIn::DynamicPredicate + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:176 + def failure_to_respond_explanation; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:168 + def predicate; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:184 + def predicate_accessible?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:172 + def predicate_method_name; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:188 + def present_tense_predicate; end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:166 +RSpec::Matchers::BuiltIn::BePredicate::REGEX = T.let(T.unsafe(nil), Regexp) + +# @api private +# Provides the implementation for `be_truthy`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:7 +class RSpec::Matchers::BuiltIn::BeTruthy < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:10 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:16 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be.rb:22 + def match(_, actual); end +end + +# @api private +# Provides the implementation for `be_within`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:7 +class RSpec::Matchers::BuiltIn::BeWithin < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:8 + def initialize(delta); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:52 + def description; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:40 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:46 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:32 + def matches?(actual); end + + # @api public + # Sets the expected value. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:14 + def of(expected); end + + # @api public + # Sets the expected value, and makes the matcher do + # a percent comparison. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:24 + def percent_of(expected); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:62 + def needs_expected; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:66 + def not_numeric_clause; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/be_within.rb:58 + def numeric?; end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:159 +module RSpec::Matchers::BuiltIn::CaptureStderr + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:164 + def capture(block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:160 + def name; end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:139 +module RSpec::Matchers::BuiltIn::CaptureStdout + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:144 + def capture(block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:140 + def name; end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:179 +class RSpec::Matchers::BuiltIn::CaptureStreamToTempfile < ::Struct + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:180 + def capture(block); end +end + +# @api private +# Provides the implementation for `change`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:7 +class RSpec::Matchers::BuiltIn::Change < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:87 + def initialize(receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # @api public + # Specifies the delta of the expected change. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:10 + def by(expected_delta); end + + # @api public + # Specifies a minimum delta of the expected change. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:18 + def by_at_least(minimum); end + + # @api public + # Specifies a maximum delta of the expected change. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:26 + def by_at_most(maximum); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:71 + def description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:50 + def does_not_match?(event_proc); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:57 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:64 + def failure_message_when_negated; end + + # @api public + # Specifies the original value. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:40 + def from(value); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:45 + def matches?(event_proc); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:76 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:81 + def supports_value_expectations?; end + + # @api public + # Specifies the new value you expect. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:34 + def to(value); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:93 + def change_details; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:119 + def negative_failure_reason; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:97 + def perform_change(event_proc); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:114 + def positive_failure_reason; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:109 + def raise_block_syntax_error; end +end + +# @private +# Encapsulates the details of the before/after values. +# +# Note that this class exposes the `actual_after` value, to allow the +# matchers above to derive failure messages, etc from the value on demand +# as needed, but it intentionally does _not_ expose the `actual_before` +# value. Some usages of the `change` matcher mutate a specific object +# returned by the value proc, which means that failure message snippets, +# etc, which are derived from the `before` value may not be accurate if +# they are lazily computed as needed. We must pre-compute them before +# applying the change in the `expect` block. To ensure that all `change` +# matchers do that properly, we do not expose the `actual_before` value. +# Instead, matchers must pass a block to `perform_change`, which yields +# the `actual_before` value before applying the change. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:352 +class RSpec::Matchers::BuiltIn::ChangeDetails + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:357 + def initialize(matcher_name, receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:353 + def actual_after; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:418 + def actual_delta; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:402 + def changed?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:389 + def perform_change(event_proc); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:378 + def value_representation; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:424 + def evaluate_value_proc; end + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:438 + def extract_value_block_snippet; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:428 + def message_notation(receiver, message); end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:355 +module RSpec::Matchers::BuiltIn::ChangeDetails::UNDEFINED; end + +# @api private +# Used to specify a change from a specific value +# (and, optionally, to a specific value). +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:270 +class RSpec::Matchers::BuiltIn::ChangeFromValue < ::RSpec::Matchers::BuiltIn::SpecificValuesChange + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:271 + def initialize(change_details, expected_before); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:285 + def does_not_match?(event_proc); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:295 + def failure_message_when_negated; end + + # @api public + # Specifies the new value you expect. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:278 + def to(value); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:303 + def change_description; end +end + +# Used to specify a relative change. +# @api private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:128 +class RSpec::Matchers::BuiltIn::ChangeRelatively < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:129 + def initialize(change_details, expected_delta, relativity, &comparer); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:156 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:150 + def does_not_match?(_event_proc); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:137 + def failure_message; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:144 + def matches?(event_proc); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:162 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:167 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:173 + def failure_reason; end +end + +# @api private +# Used to specify a change to a specific value +# (and, optionally, from a specific value). +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:311 +class RSpec::Matchers::BuiltIn::ChangeToValue < ::RSpec::Matchers::BuiltIn::SpecificValuesChange + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:312 + def initialize(change_details, expected_after); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:326 + def does_not_match?(_event_proc); end + + # @api public + # Specifies the original value. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:319 + def from(value); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:333 + def change_description; end +end + +# @api private +# Base class for `and` and `or` compound matchers. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:6 +class RSpec::Matchers::BuiltIn::Compound < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:10 + def initialize(matcher_1, matcher_2); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:25 + def description; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:49 + def diffable?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:16 + def does_not_match?(_actual); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:8 + def evaluator; end + + # @api private + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:55 + def expected; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:42 + def expects_call_stack_jump?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:8 + def matcher_1; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:8 + def matcher_2; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:30 + def supports_block_expectations?; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:36 + def supports_value_expectations?; end + + protected + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:62 + def diffable_matcher_list; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:96 + def compound_failure_message; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:128 + def diffable_matcher_list_for(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:90 + def indent_multiline_message(message); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:71 + def initialize_copy(other); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:77 + def match(_expected, actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:102 + def matcher_1_matches?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:106 + def matcher_2_matches?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:122 + def matcher_is_diffable?(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:110 + def matcher_supports_block_expectations?(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:116 + def matcher_supports_value_expectations?(matcher); end +end + +# @api public +# Matcher used to represent a compound `and` expectation. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:245 +class RSpec::Matchers::BuiltIn::Compound::And < ::RSpec::Matchers::BuiltIn::Compound + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:248 + def failure_message; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:265 + def conjunction; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:260 + def match(*); end +end + +# Normally, we evaluate the matching sequentially. For an expression like +# `expect(x).to foo.and bar`, this becomes: +# +# expect(x).to foo +# expect(x).to bar +# +# For block expectations, we need to nest them instead, so that +# `expect { x }.to foo.and bar` becomes: +# +# expect { +# expect { x }.to foo +# }.to bar +# +# This is necessary so that the `expect` block is only executed once. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:159 +class RSpec::Matchers::BuiltIn::Compound::NestedEvaluator + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:160 + def initialize(actual, matcher_1, matcher_2); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:173 + def matcher_matches?(matcher); end + + private + + # Some block matchers (such as `yield_xyz`) pass args to the `expect` block. + # When such a matcher is used as the outer matcher, we need to forward the + # the args on to the `expect` block. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:187 + def inner_matcher_block(outer_args); end + + # For a matcher like `raise_error` or `throw_symbol`, where the block will jump + # up the call stack, we need to order things so that it is the inner matcher. + # For example, we need it to be this: + # + # expect { + # expect { + # x += 1 + # raise "boom" + # }.to raise_error("boom") + # }.to change { x }.by(1) + # + # ...rather than: + # + # expect { + # expect { + # x += 1 + # raise "boom" + # }.to change { x }.by(1) + # }.to raise_error("boom") + # + # In the latter case, the after-block logic in the `change` matcher would never + # get executed because the `raise "boom"` line would jump to the `rescue` in the + # `raise_error` logic, so only the former case will work properly. + # + # This method figures out which matcher should be the inner matcher and which + # should be the outer matcher. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:227 + def order_block_matchers; end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:236 + def matcher_expects_call_stack_jump?(matcher); end + end +end + +# @api public +# Matcher used to represent a compound `or` expectation. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:272 +class RSpec::Matchers::BuiltIn::Compound::Or < ::RSpec::Matchers::BuiltIn::Compound + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:275 + def failure_message; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:286 + def conjunction; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:281 + def match(*); end +end + +# For value expectations, we can evaluate the matchers sequentially. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:135 +class RSpec::Matchers::BuiltIn::Compound::SequentialEvaluator + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:136 + def initialize(actual, *); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/compound.rb:140 + def matcher_matches?(matcher); end +end + +# @api private +# Provides the implementation for `contain_exactly` and `match_array`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:8 +class RSpec::Matchers::BuiltIn::ContainExactly < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:29 + def description; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:11 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:22 + def failure_message_when_negated; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:34 + def matches?(actual); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:56 + def actual_collection_line; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:137 + def best_solution; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:94 + def convert_actual_to_an_array; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:68 + def describe_collection(collection, surface_descriptions = T.unsafe(nil)); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:52 + def expected_collection_line; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:64 + def extra_elements_line; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:131 + def extra_items; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:44 + def generate_failure_message; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:81 + def match(_expected, _actual); end + + # This cannot always work (e.g. when dealing with unsortable items, + # or matchers as expected items), but it's practically free compared to + # the slowness of the full matching algorithm, and in common cases this + # works, so it's worth a try. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:90 + def match_when_sorted?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:76 + def message_line(prefix, collection, surface_descriptions = T.unsafe(nil)); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:60 + def missing_elements_line; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:125 + def missing_items; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:141 + def pairings_maximizer; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:104 + def safe_sort(array); end + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:120 + def to_a_disallowed?(object); end +end + +# Once we started supporting composing matchers, the algorithm for this matcher got +# much more complicated. Consider this expression: +# +# expect(["fool", "food"]).to contain_exactly(/foo/, /fool/) +# +# This should pass (because we can pair /fool/ with "fool" and /foo/ with "food"), but +# the original algorithm used by this matcher would pair the first elements it could +# (/foo/ with "fool"), which would leave /fool/ and "food" unmatched. When we have +# an expected element which is a matcher that matches a superset of actual items +# compared to another expected element matcher, we need to consider every possible pairing. +# +# This class is designed to maximize the number of actual/expected pairings -- or, +# conversely, to minimize the number of unpaired items. It's essentially a brute +# force solution, but with a few heuristics applied to reduce the size of the +# problem space: +# +# * Any items which match none of the items in the other list are immediately +# placed into the `unmatched_expected_indexes` or `unmatched_actual_indexes` array. +# The extra items and missing items in the matcher failure message are derived +# from these arrays. +# * Any items which reciprocally match only each other are paired up and not +# considered further. +# +# What's left is only the items which match multiple items from the other list +# (or vice versa). From here, it performs a brute-force depth-first search, +# looking for a solution which pairs all elements in both lists, or, barring that, +# that produces the fewest unmatched items. +# +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:188 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:225 + def initialize(expected_to_actual_matched_indexes, actual_to_expected_matched_indexes); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:223 + def actual_to_expected_matched_indexes; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:223 + def expected_to_actual_matched_indexes; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:239 + def find_best_solution; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:223 + def solution; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:301 + def apply_pairing_to(indeterminates, original_matches, other_list_index); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:285 + def best_solution_for_pairing(expected_index, actual_index); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:265 + def categorize_indexes(indexes_to_categorize, other_indexes); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:280 + def reciprocal_single_match?(matches, index, other_list); end +end + +# @private +# Starting solution that is worse than any other real solution. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:259 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::NullSolution + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:260 + def worse_than?(_other); end + end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < ::Struct + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:212 + def +(derived_candidate_solution); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:196 + def candidate?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:201 + def ideal?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def indeterminate_actual_indexes; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def indeterminate_actual_indexes=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def indeterminate_expected_indexes; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def indeterminate_expected_indexes=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def unmatched_actual_indexes; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def unmatched_actual_indexes=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def unmatched_expected_indexes; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def unmatched_expected_indexes=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:208 + def unmatched_item_count; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:192 + def worse_than?(other); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def [](*_arg0); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def inspect; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def keyword_init?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def members; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/contain_exactly.rb:190 + def new(*_arg0); end + end +end + +# @api private +# Abstract class to implement `once`, `at_least` and other +# count constraints. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:7 +module RSpec::Matchers::BuiltIn::CountExpectation + # @api public + # Specifies the minimum number of times the method is expected to match + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:42 + def at_least(number); end + + # @api public + # Specifies the maximum number of times the method is expected to match + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:35 + def at_most(number); end + + # @api public + # Specifies that the method is expected to match the given number of times. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:28 + def exactly(number); end + + # @api public + # Specifies that the method is expected to match once. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:10 + def once; end + + # @api public + # Specifies that the method is expected to match thrice. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:22 + def thrice; end + + # @api public + # No-op. Provides syntactic sugar. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:49 + def times; end + + # @api public + # Specifies that the method is expected to match twice. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:16 + def twice; end + + protected + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:55 + def count_expectation_type; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:55 + def expected_count; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:122 + def count_constraint_to_number(n); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:141 + def count_expectation_description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:145 + def count_failure_reason(action); end + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:60 + def cover?(count, number); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:71 + def expected_count_matches?(actual_count); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:79 + def has_expected_count?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:159 + def human_readable_count(count); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:150 + def human_readable_expectation_type; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:102 + def raise_impossible_count_expectation(count); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:111 + def raise_unsupported_count_expectation; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:83 + def set_expected_count(relativity, n); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/count_expectation.rb:134 + def unsupported_count_expectation?(relativity); end +end + +# @api private +# Provides the implementation for `cover`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/cover.rb:7 +class RSpec::Matchers::BuiltIn::Cover < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/cover.rb:8 + def initialize(*expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/cover.rb:17 + def does_not_match?(range); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/cover.rb:12 + def matches?(range); end +end + +# @api private +# Provides the implementation for dynamic predicate matchers. +# Not intended to be inherited directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:7 +class RSpec::Matchers::BuiltIn::DynamicPredicate < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:10 + def initialize(method_name, *args, **, &block); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:43 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:23 + def does_not_match?(actual, &block); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:31 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:37 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:16 + def matches?(actual, &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:126 + def expectation_of(value); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:121 + def failure_message_expecting(value); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:142 + def failure_to_respond_explanation; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:117 + def method_description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:88 + def methods_include?(method); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:68 + def predicate_accessible?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:101 + def predicate_matches?(value = T.unsafe(nil)); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:97 + def predicate_method_name; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:93 + def predicate_result; end + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:84 + def private_predicate?; end + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:62 + def really_responds_to?(method); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:109 + def root; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:136 + def validity_message; end +end + +# @api private +# Provides the implementation for `end_with`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:81 +class RSpec::Matchers::BuiltIn::EndWith < ::RSpec::Matchers::BuiltIn::StartOrEndWith + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:88 + def element_matches?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:84 + def subset_matches?; end +end + +# @api private +# Provides the implementation for `eq`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eq.rb:7 +class RSpec::Matchers::BuiltIn::Eq < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eq.rb:26 + def description; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eq.rb:32 + def diffable?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eq.rb:10 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eq.rb:20 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eq.rb:38 + def match(expected, actual); end +end + +# @api private +# Provides the implementation for `eql`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eql.rb:7 +class RSpec::Matchers::BuiltIn::Eql < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eql.rb:26 + def diffable?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eql.rb:10 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eql.rb:20 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/eql.rb:32 + def match(expected, actual); end +end + +# @api private +# Provides the implementation for `equal`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:7 +class RSpec::Matchers::BuiltIn::Equal < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:33 + def diffable?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:10 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:20 + def failure_message_when_negated; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:49 + def actual_inspected; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:61 + def detailed_failure_message; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:45 + def expected_is_a_literal_singleton?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:75 + def inspect_object(o); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:39 + def match(expected, actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:57 + def simple_failure_message; end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/equal.rb:43 +RSpec::Matchers::BuiltIn::Equal::LITERAL_SINGLETONS = T.let(T.unsafe(nil), Array) + +# @api private +# Provides the implementation for `exist`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:7 +class RSpec::Matchers::BuiltIn::Exist < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:8 + def initialize(*expected); end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:22 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:30 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:36 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:14 + def matches?(actual); end +end + +# @api private +# Simple class for memoizing actual/expected for this matcher +# and examining the match +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:43 +class RSpec::Matchers::BuiltIn::Exist::ExistenceTest < ::Struct + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:52 + def actual_exists?; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:46 + def valid_test?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:58 + def validity_message; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:83 + def deprecated(predicate, actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:75 + def existence_values; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:79 + def predicates; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/exist.rb:71 + def uniq_truthy_values; end +end + +# @api private +# Provides the implementation for `has_`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:152 +class RSpec::Matchers::BuiltIn::Has < ::RSpec::Matchers::BuiltIn::DynamicPredicate + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:156 + def predicate; end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/has.rb:154 +RSpec::Matchers::BuiltIn::Has::REGEX = T.let(T.unsafe(nil), Regexp) + +# @api private +# Provides the implementation for `have_attributes`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:7 +class RSpec::Matchers::BuiltIn::HaveAttributes < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:11 + def initialize(expected); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:19 + def actual; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:43 + def description; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:50 + def diffable?; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:34 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:56 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:64 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:25 + def matches?(actual); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:9 + def respond_to_failed; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:85 + def actual_has_attribute?(attribute_key, attribute_value); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:70 + def cache_all_values; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:107 + def formatted_values; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:78 + def perform_match(predicate); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:89 + def respond_to_attributes?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:99 + def respond_to_failure_message_or; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/have_attributes.rb:95 + def respond_to_matcher; end +end + +# @api private +# Provides the implementation for `include`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:9 +class RSpec::Matchers::BuiltIn::Include < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::CountExpectation + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:15 + def initialize(*expecteds); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:44 + def description; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:62 + def diffable?; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:33 + def does_not_match?(actual); end + + # @api private + # @return [Array, Hash] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:68 + def expected; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:12 + def expecteds; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:50 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:56 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:22 + def matches?(actual); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:168 + def actual_collection_includes?(expected_item); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:154 + def actual_hash_has_key?(expected_key); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:142 + def actual_hash_includes?(expected_key, expected_value); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:78 + def check_actual?(actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:84 + def check_expected_count?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:150 + def comparing_hash_keys?(expected_item); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:138 + def comparing_hash_to_a_subset?(expected_item); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:212 + def convert_to_hash?(obj); end + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:185 + def count_enumerable(expected_item); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:190 + def count_inclusions; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:202 + def diff_would_wrongly_highlight_matched_item?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:121 + def excluded_from_actual; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:96 + def format_failure_message(preposition); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:116 + def perform_match(&block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/include.rb:107 + def readable_list_of(items); end +end + +# @api private +# Provides the implementation for `match`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:7 +class RSpec::Matchers::BuiltIn::Match < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:8 + def initialize(expected); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:15 + def description; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:25 + def diffable?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:38 + def failure_message; end + + # Used to specify the captures we match against + # @return [self] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:31 + def with_captures(*captures); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:57 + def can_safely_call_match?(expected, actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:49 + def match(expected, actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:64 + def match_captures(expected, actual); end +end + +# @private +# Handles operator matcher for `should_not`. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:116 +class RSpec::Matchers::BuiltIn::NegativeOperatorMatcher < ::RSpec::Matchers::BuiltIn::OperatorMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:117 + def __delegate_operator(actual, operator, expected); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:128 +module RSpec::Matchers::BuiltIn::NullCapture + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:133 + def capture(_block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:129 + def name; end + end +end + +# @api private +# Provides the implementation for operator matchers. +# Not intended to be instantiated directly. +# Only available for use with `should`. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:10 +class RSpec::Matchers::BuiltIn::OperatorMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:41 + def initialize(actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:57 + def !=(_expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:57 + def !~(_expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def <(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def <=(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def ==(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def ===(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def =~(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def >(expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:47 + def >=(expected); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:76 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:70 + def fail_with_message(message); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:88 + def eval_match(actual, operator, expected); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:82 + def has_non_generic_implementation_of?(op); end + + class << self + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:29 + def get(klass, operator); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:18 + def register(klass, operator, matcher); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:13 + def registry; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:24 + def unregister(klass, operator); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:46 + def use_custom_matcher_or_delegate(operator); end + end +end + +# @api private +# Provides the implementation for `output`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:9 +class RSpec::Matchers::BuiltIn::Output < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:10 + def initialize(expected); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:76 + def description; end + + # @api private + # @return [Boolean] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:86 + def diffable?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:24 + def does_not_match?(block); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:64 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:70 + def failure_message_when_negated; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:17 + def matches?(block); end + + # @api private + # Indicates this matcher matches against a block. + # @return [True] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:93 + def supports_block_expectations?; end + + # @api private + # Indicates this matcher matches against a block only. + # @return [False] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:100 + def supports_value_expectations?; end + + # @api public + # Tells the matcher to match against stderr. + # Works only when the main Ruby process prints to stderr + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:39 + def to_stderr; end + + # @api public + # Tells the matcher to match against stderr. + # Works when subprocesses print to stderr as well. + # This is significantly (~30x) slower than `to_stderr` + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:57 + def to_stderr_from_any_process; end + + # @api public + # Tells the matcher to match against stdout. + # Works only when the main Ruby process prints to stdout + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:31 + def to_stdout; end + + # @api public + # Tells the matcher to match against stdout. + # Works when subprocesses print to stdout as well. + # This is significantly (~30x) slower than `to_stdout` + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:48 + def to_stdout_from_any_process; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:121 + def actual_output_description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:106 + def captured?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:116 + def negative_failure_reason; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/output.rb:110 + def positive_failure_reason; end +end + +# @private +# Handles operator matcher for `should`. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:97 +class RSpec::Matchers::BuiltIn::PositiveOperatorMatcher < ::RSpec::Matchers::BuiltIn::OperatorMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/operators.rb:98 + def __delegate_operator(actual, operator, expected); end +end + +# @api private +# Provides the implementation for `raise_error`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:9 +class RSpec::Matchers::BuiltIn::RaiseError + include ::RSpec::Matchers::Composable + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:22 + def initialize(expected_error_or_message, expected_message, &block); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:117 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:83 + def does_not_match?(given_proc); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:99 + def expects_call_stack_jump?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:105 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:111 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:52 + def matches?(given_proc, negative_expectation = T.unsafe(nil), &block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:89 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:94 + def supports_value_expectations?; end + + # @api public + # Specifies the expected error message. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:43 + def with_message(expected_message); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:123 + def actual_error_message; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:137 + def block_matches?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:133 + def error_and_message_match?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:145 + def eval_block; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:129 + def expectation_matched?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:226 + def expected_error; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:257 + def expecting_specific_exception?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:241 + def format_backtrace(backtrace); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:246 + def given_error; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:176 + def handle_warning(message); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:261 + def raise_message_already_set; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:141 + def ready_to_eval_block?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:155 + def verify_message; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:188 + def warn_about_bare_error!; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:180 + def warn_about_bare_error?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:214 + def warn_about_negative_false_positive!(expression); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:201 + def warn_about_nil_error!; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:184 + def warn_about_nil_error?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:160 + def warn_for_negative_false_positives!; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:266 + def warning; end +end + +# Used as a sentinel value to be able to tell when the user did not pass an +# argument. We can't use `nil` for that because we need to warn when `nil` is +# passed in a different way. It's an Object, not a Module, since Module's `===` +# does not evaluate to true when compared to itself. +# +# Note; this _is_ the default value supplied for expected_error_or_message, but +# because there are two method-calls involved, that default is actually supplied +# in the definition of the _matcher_ method, `RSpec::Matchers#raise_error` +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/raise_error.rb:20 +RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue = T.let(T.unsafe(nil), Object) + +# @api private +# Used to wrap match data and make it reliable for 1.8.7 +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:84 +class RSpec::Matchers::BuiltIn::ReliableMatchData + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:85 + def initialize(match_data); end + + # @api private + # returns an array of captures from the match data + # @return Array + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:110 + def captures; end + + # @api private + # Returns match data names for named captures + # @return Array + # :nocov: + # @api private + # Returns match data names for named captures + # @return Array + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:102 + def names; end + + protected + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/match.rb:116 + def match_data; end +end + +# @api private +# Provides the implementation for `respond_to`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:9 +class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:10 + def initialize(*names); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:52 + def and_any_keywords; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:40 + def and_keywords(*keywords); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:64 + def and_unlimited_arguments; end + + # @api public + # No-op. Intended to be used as syntactic sugar when using `with`. + # + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:71 + def argument; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:74 + def arguments; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:100 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:82 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:88 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:94 + def failure_message_when_negated; end + + # @api private + # Used by other matchers to suppress a check + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:106 + def ignoring_method_signature_failure!; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:77 + def matches?(actual); end + + # @api public + # Specifies the number of expected arguments. + # + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:24 + def with(n); end + + # @api public + # Specifies that the method accepts any keyword, i.e. the method has + # a splatted keyword parameter of the form **kw_args. + # + # @example + # expect(obj).to respond_to(:message).with_any_keywords + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:48 + def with_any_keywords; end + + # @api public + # Specifies keyword arguments, if any. + # + # @example + # expect(obj).to respond_to(:message).with_keywords(:color, :shape) + # @example with an expected number of arguments + # expect(obj).to respond_to(:message).with(3).arguments.and_keywords(:color, :shape) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:36 + def with_keywords(*keywords); end + + # @api public + # Specifies that the number of arguments has no upper limit, i.e. the + # method has a splatted parameter of the form *args. + # + # @example + # expect(obj).to respond_to(:message).with_unlimited_arguments + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:60 + def with_unlimited_arguments; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:112 + def find_failing_method_names(actual, filter_method); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:119 + def matches_arity?(actual, name); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:156 + def pp_names; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:130 + def with_arity; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:139 + def with_arity_string; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:143 + def with_keywords_string; end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:161 +class RSpec::Matchers::BuiltIn::RespondTo::ArityCheck + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:162 + def initialize(expected_arity, expected_keywords, arbitrary_keywords, unlimited_arguments); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:178 + def matches?(actual, name); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:187 + def method_signature_for(actual, name); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/respond_to.rb:183 + def verifier_for(actual, name); end +end + +# @api private +# Provides the implementation for `satisfy`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:7 +class RSpec::Matchers::BuiltIn::Satisfy < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:8 + def initialize(description = T.unsafe(nil), &block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:21 + def description; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:27 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:33 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:14 + def matches?(actual, &block); end + + private + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:40 + def block_representation; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/satisfy.rb:48 + def extract_block_snippet; end +end + +# @api private +# Base class for specifying a change from and/or to specific values. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:181 +class RSpec::Matchers::BuiltIn::SpecificValuesChange < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:185 + def initialize(change_details, from, to); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:197 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:202 + def failure_message; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:192 + def matches?(event_proc); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:210 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:215 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:244 + def after_value_failure; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:238 + def before_value_failure; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:255 + def did_change_failure; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:250 + def did_not_change_failure; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:234 + def matches_after?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:261 + def not_given_a_block_failure; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:221 + def perform_change(event_proc); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/change.rb:183 +RSpec::Matchers::BuiltIn::SpecificValuesChange::MATCH_ANYTHING = BasicObject + +# For RSpec 3.1, the base class was named `StartAndEndWith`. For SemVer reasons, +# we still provide this constant until 4.0. +# @deprecated Use StartOrEndWith instead. +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:61 +RSpec::Matchers::BuiltIn::StartAndEndWith = RSpec::Matchers::BuiltIn::StartOrEndWith + +# @api private +# Base class for the `end_with` and `start_with` matchers. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:7 +class RSpec::Matchers::BuiltIn::StartOrEndWith < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:8 + def initialize(*expected); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:27 + def description; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:15 + def failure_message; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:36 + def match(_expected, actual); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:48 + def subsets_comparable?; end +end + +# @api private +# Provides the implementation for `start_with`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:66 +class RSpec::Matchers::BuiltIn::StartWith < ::RSpec::Matchers::BuiltIn::StartOrEndWith + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:73 + def element_matches?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/start_or_end_with.rb:69 + def subset_matches?; end +end + +# @api private +# Provides the implementation for `throw_symbol`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:7 +class RSpec::Matchers::BuiltIn::ThrowSymbol + include ::RSpec::Matchers::Composable + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:10 + def initialize(expected_symbol = T.unsafe(nil), expected_arg = T.unsafe(nil)); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:86 + def description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:68 + def does_not_match?(given_proc); end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:103 + def expects_call_stack_jump?; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:74 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:80 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:18 + def matches?(given_proc); end + + # @api private + # Indicates this matcher matches against a block. + # @return [True] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:93 + def supports_block_expectations?; end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:98 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:109 + def actual_result; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:118 + def caught; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:114 + def expected(symbol_desc = T.unsafe(nil)); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/throw_symbol.rb:122 + def throw_description(symbol, arg); end +end + +# @api private +# Provides the implementation for `yield_control`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:101 +class RSpec::Matchers::BuiltIn::YieldControl < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::CountExpectation + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:111 + def does_not_match?(block); end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:117 + def failure_message; end + + # @api private + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:123 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:104 + def matches?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:128 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:133 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:139 + def failure_reason; end +end + +# @private +# Object that is yielded to `expect` when one of the +# yield matchers is used. Provides information about +# the yield behavior of the object-under-test. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:12 +class RSpec::Matchers::BuiltIn::YieldProbe + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:21 + def initialize(block, &callback); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:68 + def assert_used!; end + + # :nocov: + # On 1.8.7, `lambda { }.arity` and `lambda { |*a| }.arity` both return -1, + # so we can't distinguish between accepting no args and an arg splat. + # It's OK to skip, this, though; it just provides a nice error message + # when the user forgets to accept an arg in their block. They'll still get + # the `assert_used!` error message from above, which is sufficient. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:78 + def assert_valid_expect_block!; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:29 + def has_block?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:19 + def num_yields; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:19 + def num_yields=(_arg0); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:33 + def probe; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:53 + def single_yield_args; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:40 + def to_proc; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:19 + def yielded_args; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:19 + def yielded_args=(_arg0); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:57 + def yielded_once?(matcher_name); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:13 + def probe(block, &callback); end + end +end + +# @api private +# Provides the implementation for `yield_successive_args`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:296 +class RSpec::Matchers::BuiltIn::YieldSuccessiveArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:297 + def initialize(*args); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:337 + def description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:320 + def does_not_match?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:325 + def failure_message; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:331 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:302 + def matches?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:342 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:347 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:353 + def expected_arg_description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:365 + def negative_failure_reason; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:357 + def positive_failure_reason; end +end + +# @api private +# Provides the implementation for `yield_with_args`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:199 +class RSpec::Matchers::BuiltIn::YieldWithArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:200 + def initialize(*args); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:233 + def description; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:218 + def does_not_match?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:223 + def failure_message; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:228 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:205 + def matches?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:240 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:245 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:288 + def all_args_match?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:273 + def args_currently_match?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:257 + def expected_arg_description; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:261 + def negative_failure_reason; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:251 + def positive_failure_reason; end +end + +# @api private +# Provides the implementation for `yield_with_no_args`. +# Not intended to be instantiated directly. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:149 +class RSpec::Matchers::BuiltIn::YieldWithNoArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:158 + def does_not_match?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:163 + def failure_message; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:168 + def failure_message_when_negated; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:151 + def matches?(block); end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:173 + def supports_block_expectations?; end + + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:178 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:190 + def negative_failure_reason; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/yield.rb:184 + def positive_failure_reason; end +end + +# Mixin designed to support the composable matcher features +# of RSpec 3+. Mix it into your custom matcher classes to +# allow them to be used in a composable fashion. +# +# @api public +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:10 +module RSpec::Matchers::Composable + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:25 + def &(matcher); end + + # Delegates to `#matches?`. Allows matchers to be used in composable + # fashion and also supports using matchers in case statements. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:45 + def ===(value); end + + # Creates a compound `and` expectation. The matcher will + # only pass if both sub-matchers pass. + # This can be chained together to form an arbitrarily long + # chain of matchers. + # + # @example + # expect(alphabet).to start_with("a").and end_with("z") + # expect(alphabet).to start_with("a") & end_with("z") + # + # @note The negative form (`expect(...).not_to matcher.and other`) + # is not supported at this time. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:22 + def and(matcher); end + + # Creates a compound `or` expectation. The matcher will + # pass if either sub-matcher passes. + # This can be chained together to form an arbitrarily long + # chain of matchers. + # + # @example + # expect(stoplight.color).to eq("red").or eq("green").or eq("yellow") + # expect(stoplight.color).to eq("red") | eq("green") | eq("yellow") + # + # @note The negative form (`expect(...).not_to matcher.or other`) + # is not supported at this time. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:38 + def or(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:41 + def |(matcher); end + + private + + # Returns the description of the given object in a way that is + # aware of composed matchers. If the object is a matcher with + # a `description` method, returns the description; otherwise + # returns `object.inspect`. + # + # You are encouraged to use this in your custom matcher's + # `description`, `failure_message` or + # `failure_message_when_negated` implementation if you are + # supporting matcher arguments. + # + # @!visibility public + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:82 + def description_of(object); end + + # @api private + # We should enumerate arrays as long as they are not recursive. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:142 + def should_enumerate?(item); end + + # Transforms the given data structure (typically a hash or array) + # into a new data structure that, when `#inspect` is called on it, + # will provide descriptions of any contained matchers rather than + # the normal `#inspect` output. + # + # You are encouraged to use this in your custom matcher's + # `description`, `failure_message` or + # `failure_message_when_negated` implementation if you are + # supporting any arguments which may be a data structure + # containing matchers. + # + # @!visibility public + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:98 + def surface_descriptions_in(item); end + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:147 + def unreadable_io?(object); end + + # This provides a generic way to fuzzy-match an expected value against + # an actual value. It understands nested data structures (e.g. hashes + # and arrays) and is able to match against a matcher being used as + # the expected value or within the expected value at any level of + # nesting. + # + # Within a custom matcher you are encouraged to use this whenever your + # matcher needs to match two values, unless it needs more precise semantics. + # For example, the `eq` matcher _does not_ use this as it is meant to + # use `==` (and only `==`) for matching. + # + # @param expected [Object] what is expected + # @param actual [Object] the actual value + # + # @!visibility public + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:66 + def values_match?(expected, actual); end + + # @private + # Historically, a single matcher instance was only checked + # against a single value. Given that the matcher was only + # used once, it's been common to memoize some intermediate + # calculation that is derived from the `actual` value in + # order to reuse that intermediate result in the failure + # message. + # + # This can cause a problem when using such a matcher as an + # argument to another matcher in a composed matcher expression, + # since the matcher instance may be checked against multiple + # values and produce invalid results due to the memoization. + # + # To deal with this, we clone any matchers in `expected` via + # this method when using `values_match?`, so that any memoization + # does not "leak" between checks. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:128 + def with_matchers_cloned(object); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:154 + def should_enumerate?(item); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:154 + def surface_descriptions_in(item); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:154 + def unreadable_io?(object); end + end +end + +# Wraps an item in order to surface its `description` via `inspect`. +# @api private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 +class RSpec::Matchers::Composable::DescribableItem < ::Struct + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:160 + def inspect; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def item; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def item=(_); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:165 + def pretty_print(pp); end + + class << self + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def [](*_arg0); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def inspect; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def keyword_init?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def members; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/composable.rb:158 + def new(*_arg0); end + end +end + +# Defines the custom matcher DSL. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:6 +module RSpec::Matchers::DSL + # Defines a matcher alias. The returned matcher's `description` will be overridden + # to reflect the phrasing of the new name, which will be used in failure messages + # when passed as an argument to another matcher in a composed matcher expression. + # + # @example + # RSpec::Matchers.alias_matcher :a_list_that_sums_to, :sum_to + # sum_to(3).description # => "sum to 3" + # a_list_that_sums_to(3).description # => "a list that sums to 3" + # + # @example + # RSpec::Matchers.alias_matcher :a_list_sorted_by, :be_sorted_by do |description| + # description.sub("be sorted by", "a list sorted by") + # end + # + # be_sorted_by(:age).description # => "be sorted by age" + # a_list_sorted_by(:age).description # => "a list sorted by age" + # + # @param new_name [Symbol] the new name for the matcher + # @param old_name [Symbol] the original name for the matcher + # @param options [Hash] options for the aliased matcher + # @option options [Class] :klass the ruby class to use as the decorator. (Not normally used). + # @yield [String] optional block that, when given, is used to define the overridden + # logic. The yielded arg is the original description or failure message. If no + # block is provided, a default override is used based on the old and new names. + # @see RSpec::Matchers + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:32 + def alias_matcher(new_name, old_name, options = T.unsafe(nil), &description_override); end + + # Defines a custom matcher. + # + # @param name [Symbol] the name for the matcher + # @yield [Object] block that is used to define the matcher. + # The block is evaluated in the context of your custom matcher class. + # When args are passed to your matcher, they will be yielded here, + # usually representing the expected value(s). + # @see RSpec::Matchers + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:73 + def define(name, &declarations); end + + # Defines a negated matcher. The returned matcher's `description` and `failure_message` + # will be overridden to reflect the phrasing of the new name, and the match logic will + # be based on the original matcher but negated. + # + # @example + # RSpec::Matchers.define_negated_matcher :exclude, :include + # include(1, 2).description # => "include 1 and 2" + # exclude(1, 2).description # => "exclude 1 and 2" + # + # @param negated_name [Symbol] the name for the negated matcher + # @param base_name [Symbol] the name of the original matcher that will be negated + # @yield [String] optional block that, when given, is used to define the overridden + # logic. The yielded arg is the original description or failure message. If no + # block is provided, a default override is used based on the old and new names. + # @see RSpec::Matchers + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:61 + def define_negated_matcher(negated_name, base_name, &description_override); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:79 + def matcher(name, &declarations); end + + private + + # :nocov: + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:84 + def warn_about_block_args(name, declarations); end +end + +# Defines default implementations of the matcher +# protocol methods for custom matchers. You can +# override any of these using the {RSpec::Matchers::DSL::Macros Macros} methods +# from within an `RSpec::Matchers.define` block. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:385 +module RSpec::Matchers::DSL::DefaultImplementations + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + + # The default description. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:395 + def description; end + + # @api private + # Used internally by objects returns by `should` and `should_not`. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:390 + def diffable?; end + + # Most matchers do not expect call stack jumps. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:412 + def expects_call_stack_jump?; end + + # Matchers do not support block expectations by default. You + # must opt-in. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:403 + def supports_block_expectations?; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:407 + def supports_value_expectations?; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:418 + def chained_method_clause_sentences; end +end + +# Contains the methods that are available from within the +# `RSpec::Matchers.define` DSL for creating custom matchers. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:104 +module RSpec::Matchers::DSL::Macros + # Convenience for defining methods on this matcher to create a fluent + # interface. The trick about fluent interfaces is that each method must + # return self in order to chain methods together. `chain` handles that + # for you. If the method is invoked and the + # `include_chain_clauses_in_custom_matcher_descriptions` config option + # hash been enabled, the chained method name and args will be added to the + # default description and failure message. + # + # In the common case where you just want the chained method to store some + # value(s) for later use (e.g. in `match`), you can provide one or more + # attribute names instead of a block; the chained method will store its + # arguments in instance variables with those names, and the values will + # be exposed via getters. + # + # @example + # + # RSpec::Matchers.define :have_errors_on do |key| + # chain :with do |message| + # @message = message + # end + # + # match do |actual| + # actual.errors[key] == @message + # end + # end + # + # expect(minor).to have_errors_on(:age).with("Not old enough to participate") + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:298 + def chain(method_name, *attr_names, &definition); end + + # Customize the description to use for one-liners. Only use this when + # the description generated by default doesn't suit your needs. + # + # @example + # + # RSpec::Matchers.define :qualify_for do |expected| + # match { your_match_logic } + # + # description do + # "qualify for #{expected}" + # end + # end + # + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:253 + def description(&definition); end + + # Tells the matcher to diff the actual and expected values in the failure + # message. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:259 + def diffable; end + + # Customizes the failure message to use when this matcher is + # asked to positively match. Only use this when the message + # generated by default doesn't suit your needs. + # + # @example + # + # RSpec::Matchers.define :have_strength do |expected| + # match { your_match_logic } + # + # failure_message do |actual| + # "Expected strength of #{expected}, but had #{actual.strength}" + # end + # end + # + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:216 + def failure_message(&definition); end + + # Customize the failure message to use when this matcher is asked + # to negatively match. Only use this when the message generated by + # default doesn't suit your needs. + # + # @example + # + # RSpec::Matchers.define :have_strength do |expected| + # match { your_match_logic } + # + # failure_message_when_negated do |actual| + # "Expected not to have strength of #{expected}, but did" + # end + # end + # + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:235 + def failure_message_when_negated(&definition); end + + # Stores the block that is used to determine whether this matcher passes + # or fails. The block should return a boolean value. When the matcher is + # passed to `expect(...).to` and the block returns `true`, then the expectation + # passes. Similarly, when the matcher is passed to `expect(...).not_to` and the + # block returns `false`, then the expectation passes. + # + # @example + # + # RSpec::Matchers.define :be_even do + # match do |actual| + # actual.even? + # end + # end + # + # expect(4).to be_even # passes + # expect(3).not_to be_even # passes + # expect(3).to be_even # fails + # expect(4).not_to be_even # fails + # + # By default the match block will swallow expectation errors (e.g. + # caused by using an expectation such as `expect(1).to eq 2`), if you + # wish to allow these to bubble up, pass in the option + # `:notify_expectation_failures => true`. + # + # @param [Hash] options for defining the behavior of the match block. + # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:131 + def match(options = T.unsafe(nil), &match_block); end + + # Use this instead of `match` when the block will raise an exception + # rather than returning false to indicate a failure. + # + # @example + # + # RSpec::Matchers.define :accept_as_valid do |candidate_address| + # match_unless_raises ValidationException do |validator| + # validator.validate(candidate_address) + # end + # end + # + # expect(email_validator).to accept_as_valid("person@company.com") + # + # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:188 + def match_unless_raises(expected_exception = T.unsafe(nil), &match_block); end + + # Use this to define the block for a negative expectation (`expect(...).not_to`) + # when the positive and negative forms require different handling. This + # is rarely necessary, but can be helpful, for example, when specifying + # asynchronous processes that require different timeouts. + # + # By default the match block will swallow expectation errors (e.g. + # caused by using an expectation such as `expect(1).to eq 2`), if you + # wish to allow these to bubble up, pass in the option + # `:notify_expectation_failures => true`. + # + # @param [Hash] options for defining the behavior of the match block. + # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:160 + def match_when_negated(options = T.unsafe(nil), &match_block); end + + # Declares that the matcher can be used in a block expectation. + # Users will not be able to use your matcher in a block + # expectation without declaring this. + # (e.g. `expect { do_something }.to matcher`). + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:267 + def supports_block_expectations; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:312 + def assign_attributes(attr_names); end + + # Does the following: + # + # - Defines the named method using a user-provided block + # in @user_method_defs, which is included as an ancestor + # in the singleton class in which we eval the `define` block. + # - Defines an overridden definition for the same method + # usign the provided `our_def` block. + # - Provides a default `our_def` block for the common case + # of needing to call the user's definition with `@actual` + # as an arg, but only if their block's arity can handle it. + # + # This compiles the user block into an actual method, allowing + # them to use normal method constructs like `return` + # (e.g. for an early guard statement), while allowing us to define + # an override that can provide the wrapped handling + # (e.g. assigning `@actual`, rescueing errors, etc) and + # can `super` to the user's definition. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:346 + def define_user_override(method_name, user_def, &our_def); end +end + +# Defines deprecated macro methods from RSpec 2 for backwards compatibility. +# @deprecated Use the methods from {Macros} instead. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:354 +module RSpec::Matchers::DSL::Macros::Deprecated + # @deprecated Use {Macros#failure_message} instead. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:368 + def failure_message_for_should(&definition); end + + # @deprecated Use {Macros#failure_message_when_negated} instead. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:374 + def failure_message_for_should_not(&definition); end + + # @deprecated Use {Macros#match} instead. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:356 + def match_for_should(&definition); end + + # @deprecated Use {Macros#match_when_negated} instead. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:362 + def match_for_should_not(&definition); end +end + +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:146 +RSpec::Matchers::DSL::Macros::RAISE_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# The class used for custom matchers. The block passed to +# `RSpec::Matchers.define` will be evaluated in the context +# of the singleton class of an instance, and will have the +# {RSpec::Matchers::DSL::Macros Macros} methods available. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:433 +class RSpec::Matchers::DSL::Matcher + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + include ::RSpec::Matchers::DSL::DefaultImplementations + include ::RSpec::Matchers + include ::RSpec::Matchers::Composable + extend ::RSpec::Matchers::DSL::Macros + extend ::RSpec::Matchers::DSL::Macros::Deprecated + + # @api private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:462 + def initialize(name, declarations, matcher_execution_context, *expected, &block_arg); end + + # Exposes the value being matched against -- generally the object + # object wrapped by `expect`. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:449 + def actual; end + + # The block parameter used in the expectation + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:456 + def block_arg; end + + # Provides the expected value. This will return an array if + # multiple arguments were passed to the matcher; otherwise it + # will return a single value. + # @see #expected_as_array + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:483 + def expected; end + + # Returns the expected value as an an array. This exists primarily + # to aid in upgrading from RSpec 2.x, since in RSpec 2, `expected` + # always returned an array. + # @see #expected + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:495 + def expected_as_array; end + + # Adds the name (rather than a cryptic hex number) + # so we can identify an instance of + # the matcher in error messages (e.g. for `NoMethodError`) + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:500 + def inspect; end + + # The name of the matcher. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:459 + def name; end + + # Exposes the exception raised during the matching by `match_unless_raises`. + # Could be useful to extract details for a failure message. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:453 + def rescued_exception; end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:523 + def actual_arg_for(block); end + + # Takes care of forwarding unhandled messages to the + # `@matcher_execution_context` (typically the current + # running `RSpec::Core::Example`). This is needed by + # rspec-rails so that it can define matchers that wrap + # Rails' test helper methods, but it's also a useful + # feature in its own right. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:533 + def method_missing(method, *args, **, &block); end + + # Indicates that this matcher responds to messages + # from the `@matcher_execution_context` as well. + # Also, supports getting a method object for such methods. + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/dsl.rb:508 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers.rb:959 +RSpec::Matchers::DYNAMIC_MATCHER_REGEX = T.let(T.unsafe(nil), Regexp) + +# Facilitates converting ruby objects to English phrases. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/english_phrasing.rb:4 +module RSpec::Matchers::EnglishPhrasing + class << self + # @note The returned string has a leading space except + # when given an empty list. + # + # Converts an object (often a collection of objects) + # into an English list. + # + # list(['banana', 'kiwi', 'mango']) + # #=> " \"banana\", \"kiwi\", and \"mango\"" + # + # Given an empty collection, returns the empty string. + # + # list([]) #=> "" + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/english_phrasing.rb:26 + def list(obj); end + + # Converts a symbol into an English expression. + # + # split_words(:banana_creme_pie) #=> "banana creme pie" + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/english_phrasing.rb:9 + def split_words(sym); end + end +end + +# pkg:gem/rspec-expectations#lib/rspec/matchers.rb:958 +RSpec::Matchers::HAS_REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides the necessary plumbing to wrap a matcher with a decorator. +# @private +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:31 +class RSpec::Matchers::MatcherDelegator < ::RSpec::Matchers::BaseDelegator + include ::RSpec::Matchers::Composable + + # pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:35 + def initialize(base_matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:33 + def base_matcher; end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:39 + def method_missing(*args, &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:55 + def initialize_copy(other); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/matcher_delegator.rb:44 + def respond_to_missing?(name, include_all = T.unsafe(nil)); end +end + +# @api private +# Handles list of expected and actual value pairs when there is a need +# to render multiple diffs. Also can handle one pair. +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:6 +class RSpec::Matchers::MultiMatcherDiff + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:16 + def initialize(expected_list); end + + # @api private + # Returns message with diff(s) appended for provided differ + # factory and actual value if there are any + # @param [String] message original failure message + # @param [Proc] differ + # @return [String] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:47 + def message_with_diff(message, differ); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:68 + def diffs(differ); end + + class << self + # @api private + # Wraps provided matcher list in instance of + # MultiMatcherDiff. + # @param [Array] matchers list of matchers to wrap + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:37 + def for_many_matchers(matchers); end + + # @api private + # Wraps provided expected value in instance of + # MultiMatcherDiff. If provided value is already an + # MultiMatcherDiff then it just returns it. + # @param [Any] expected value to be wrapped + # @param [Any] actual value + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:27 + def from(expected, actual); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:58 + def diff_label_for(matcher); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:62 + def truncated(description); end + end +end + +# @private +# Default diff label when there is only one matcher in diff +# output +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:10 +RSpec::Matchers::MultiMatcherDiff::DEFAULT_DIFF_LABEL = T.let(T.unsafe(nil), String) + +# @private +# Maximum readable matcher description length +# +# pkg:gem/rspec-expectations#lib/rspec/matchers/multi_matcher_diff.rb:14 +RSpec::Matchers::MultiMatcherDiff::DESCRIPTION_MAX_LENGTH = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi b/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi new file mode 100644 index 0000000..33d9d75 --- /dev/null +++ b/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi @@ -0,0 +1,4783 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rspec-mocks` gem. +# Please instead update this file by running `bin/tapioca gem rspec-mocks`. + + +# Share the top-level RSpec namespace, because we are a core supported +# extension. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:1 +module RSpec; end + +# Contains top-level utility methods. While this contains a few +# public methods, these are not generally meant to be called from +# a test or example. They exist primarily for integration with +# test frameworks (such as rspec-core). +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:2 +module RSpec::Mocks + class << self + # Adds an allowance (stub) on `subject` + # + # @param subject the subject to which the message will be added + # @param message a symbol, representing the message that will be + # added. + # @param opts a hash of options, :expected_from is used to set the + # original call site + # @yield an optional implementation for the allowance + # + # @example Defines the implementation of `foo` on `bar`, using the passed block + # x = 0 + # RSpec::Mocks.allow_message(bar, :foo) { x += 1 } + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:69 + def allow_message(subject, message, opts = T.unsafe(nil), &block); end + + # Mocks specific configuration, as distinct from `RSpec.configuration` + # which is core RSpec configuration. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:206 + def configuration; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:386 + def error_generator; end + + # Sets a message expectation on `subject`. + # @param subject the subject on which the message will be expected + # @param message a symbol, representing the message that will be + # expected. + # @param opts a hash of options, :expected_from is used to set the + # original call site + # @yield an optional implementation for the expectation + # + # @example Expect the message `foo` to receive `bar`, then call it + # RSpec::Mocks.expect_message(bar, :foo) + # bar.foo + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:84 + def expect_message(subject, message, opts = T.unsafe(nil), &block); end + + # Performs per-test/example setup. This should be called before + # an test or example begins. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:38 + def setup; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:106 + def space; end + + # Cleans up all test double state (including any methods that were + # redefined on partial doubles). This _must_ be called after + # each example, even if an error was raised during the example. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:51 + def teardown; end + + # Verifies any message expectations that were set during the + # test or example. This should be called at the end of an example. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:44 + def verify; end + + # Call the passed block and verify mocks after it has executed. This allows + # mock usage in arbitrary places, such as a `before(:all)` hook. + # + # @return [Object] the return value from the block + # + # pkg:gem/rspec-mocks#lib/rspec/mocks.rb:92 + def with_temporary_scope; end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:92 +class RSpec::Mocks::AllowanceTarget < ::RSpec::Mocks::TargetBase + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:93 + def expression; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:29 + def not_to(matcher, *_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:6 + def to(matcher, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:29 + def to_not(matcher, *_args); end +end + +# Handles the implementation of an `and_invoke` implementation. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:772 +class RSpec::Mocks::AndInvokeImplementation + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:773 + def initialize(procs_to_invoke); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:777 + def call(*args, **, &block); end +end + +# Handles the implementation of an `and_return` implementation. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:756 +class RSpec::Mocks::AndReturnImplementation + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:757 + def initialize(values_to_return); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:761 + def call(*_args_to_ignore, &_block); end +end + +# Represents an `and_call_original` implementation. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:815 +class RSpec::Mocks::AndWrapOriginalImplementation + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:816 + def initialize(method, block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:843 + def call(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:823 + def initial_action=(_value); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:839 + def inner_action; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:827 + def inner_action=(_value); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:835 + def present?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:831 + def terminal_action=(_value); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:850 + def cannot_modify_further_error; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:821 +class RSpec::Mocks::AndWrapOriginalImplementation::CannotModifyFurtherError < ::StandardError; end + +# Handles the implementation of an `and_yield` declaration. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:729 +class RSpec::Mocks::AndYieldImplementation + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:730 + def initialize(args_to_yield, eval_context, error_generator); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:736 + def call(*_args_to_ignore, &block); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:4 +module RSpec::Mocks::AnyInstance + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/error_generator.rb:26 + def error_generator; end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:6 +class RSpec::Mocks::AnyInstance::Chain + include ::RSpec::Mocks::AnyInstance::Chain::Customizations + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:7 + def initialize(recorder, *args, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:61 + def constrained_to_any_of?(*constraints); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:75 + def expectation_fulfilled!; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:70 + def matches_args?(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:79 + def never; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:53 + def playback!(instance); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:84 + def with(*args, &block); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:99 + def last_message; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:95 + def messages; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:91 + def negated?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:103 + def record(rspec_method_name, *args, &block); end +end + +# @private +# +# Provides convenience methods for recording customizations on message +# expectations. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:18 +module RSpec::Mocks::AnyInstance::Chain::Customizations + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def and_call_original(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def and_raise(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def and_return(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def and_throw(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def and_wrap_original(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def and_yield(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def at_least(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def at_most(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def exactly(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def never(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def once(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def thrice(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def time(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def times(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def twice(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:27 + def with(*args, &block); end + + class << self + # @macro [attach] record + # @method $1(*args, &block) + # Records the `$1` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#$1 + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/chain.rb:26 + def record(method_name); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/error_generator.rb:5 +class RSpec::Mocks::AnyInstance::ErrorGenerator < ::RSpec::Mocks::ErrorGenerator + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/error_generator.rb:11 + def raise_does_not_implement_error(klass, method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/error_generator.rb:15 + def raise_message_already_received_by_other_instance_error(method_name, object_inspect, invoked_instance); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/error_generator.rb:20 + def raise_not_supported_with_prepend_error(method_name, problem_mod); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/error_generator.rb:6 + def raise_second_instance_received_message_error(unfulfilled_expectations); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expect_chain_chain.rb:5 +class RSpec::Mocks::AnyInstance::ExpectChainChain < ::RSpec::Mocks::AnyInstance::StubChain + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expect_chain_chain.rb:6 + def initialize(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expect_chain_chain.rb:11 + def expectation_fulfilled?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expect_chain_chain.rb:15 + def playback!(instance); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expect_chain_chain.rb:21 + def create_message_expectation_on(instance); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expect_chain_chain.rb:25 + def invocation_order; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:5 +class RSpec::Mocks::AnyInstance::ExpectationChain < ::RSpec::Mocks::AnyInstance::Chain + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:10 + def initialize(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:6 + def expectation_fulfilled?; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:17 + def verify_invocation_order(_rspec_method_name, *_args, &_block); end +end + +# @private +# Delegates messages to each of the given targets in order to +# provide the fluent interface that is available off of message +# expectations when dealing with `any_instance`. +# +# `targets` will typically contain 1 of the `AnyInstance::Recorder` +# return values and N `MessageExpectation` instances (one per instance +# of the `any_instance` klass). +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:103 +class RSpec::Mocks::AnyInstance::FluentInterfaceProxy < ::BasicObject + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:104 + def initialize(targets); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:118 + def method_missing(*args, &block); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:109 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:5 +class RSpec::Mocks::AnyInstance::MessageChains + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:6 + def initialize; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:11 + def [](method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:16 + def add(method_name, chain); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:43 + def all_expectations_fulfilled?; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:36 + def each_unfulfilled_expectation_matching(method_name, *args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:29 + def has_expectation?(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:64 + def playback!(instance, method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:57 + def received_expected_message!(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:22 + def remove_stub_chains_for!(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:50 + def unfulfilled_expectations; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/message_chains.rb:73 + def raise_if_second_instance_to_receive_message(instance); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:22 +class RSpec::Mocks::AnyInstance::PositiveExpectationChain < ::RSpec::Mocks::AnyInstance::ExpectationChain + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:25 + def create_message_expectation_on(instance); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:44 + def invocation_order; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/expectation_chain.rb:38 +RSpec::Mocks::AnyInstance::PositiveExpectationChain::ExpectationInvocationOrder = T.let(T.unsafe(nil), Hash) + +# @private +# The `AnyInstance::Recorder` is responsible for redefining the klass's +# instance method in order to add any stubs/expectations the first time +# the method is called. It's not capable of updating a stub on an instance +# that's already been previously stubbed (either directly, or via +# `any_instance`). +# +# This proxy sits in front of the recorder and delegates both to it +# and to the `RSpec::Mocks::Proxy` for each already mocked or stubbed +# instance of the class, in order to propagates changes to the instances. +# +# Note that unlike `RSpec::Mocks::Proxy`, this proxy class is stateless +# and is not persisted in `RSpec::Mocks.space`. +# +# Proxying for the message expectation fluent interface (typically chained +# off of the return value of one of these methods) is provided by the +# `FluentInterfaceProxy` class below. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:21 +class RSpec::Mocks::AnyInstance::Proxy + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:22 + def initialize(recorder, target_proxies); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:55 + def expect_chain(*chain, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:27 + def klass; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:71 + def should_not_receive(method_name, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:61 + def should_receive(method_name, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:31 + def stub(method_name_or_method_map, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:49 + def stub_chain(*chain, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:43 + def unstub(method_name); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/proxy.rb:79 + def perform_proxying(method_name, args, block, &target_proxy_block); end +end + +# Given a class `TheClass`, `TheClass.any_instance` returns a `Recorder`, +# which records stubs and message expectations for later playback on +# instances of `TheClass`. +# +# Further constraints are stored in instances of [Chain](Chain). +# +# @see AnyInstance +# @see Chain +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:12 +class RSpec::Mocks::AnyInstance::Recorder + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:16 + def initialize(klass); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:127 + def already_observing?(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:122 + def build_alias_method_name(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:53 + def expect_chain(*method_names_and_optional_return_values, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:117 + def instance_that_received(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:14 + def klass; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:14 + def message_chains; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:132 + def notify_received_message(_object, message, args, _blk); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:109 + def playback!(instance, method_name); end + + # The opposite of `should_receive` + # + # @see Methods#should_not_receive + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:75 + def should_not_receive(method_name, &block); end + + # Initializes the recording a message expectation to be played back + # against any instance of this object that invokes the submitted + # method. + # + # @see Methods#should_receive + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:66 + def should_receive(method_name, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:104 + def stop_all_observation!; end + + # Initializes the recording a stub to be played back against any + # instance of this object that invokes the submitted method. + # + # @see Methods#stub + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:35 + def stub(method_name, &block); end + + # Initializes the recording a stub chain to be played back against any + # instance of this object that invokes the method matching the first + # argument. + # + # @see Methods#stub_chain + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:45 + def stub_chain(*method_names_and_optional_return_values, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:14 + def stubs; end + + # Removes any previously recorded stubs, stub_chains or message + # expectations that use `method_name`. + # + # @see Methods#unstub + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:83 + def unstub(method_name); end + + # @api private + # + # Used internally to verify that message expectations have been + # fulfilled. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:96 + def verify; end + + protected + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:148 + def stop_observing!(method_name); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:284 + def allow_no_prepended_module_definition_of(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:159 + def ancestor_is_an_observer?(ancestor, method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:235 + def backup_method!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:271 + def mark_invoked!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:178 + def normalize_chain(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:249 + def observe!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:245 + def public_protected_or_private_method_defined?(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:183 + def received_expected_message!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:229 + def remove_dummy_method!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:189 + def restore_method!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:197 + def restore_original_method!(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:166 + def super_class_observers_for(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/recorder.rb:172 + def super_class_observing?(method_name); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:5 +class RSpec::Mocks::AnyInstance::StubChain < ::RSpec::Mocks::AnyInstance::Chain + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:7 + def expectation_fulfilled?; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:13 + def create_message_expectation_on(instance); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:40 + def invocation_order; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:44 + def verify_invocation_order(rspec_method_name, *_args, &_block); end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:38 +RSpec::Mocks::AnyInstance::StubChain::EmptyInvocationOrder = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain.rb:28 +RSpec::Mocks::AnyInstance::StubChain::InvocationOrder = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain_chain.rb:5 +class RSpec::Mocks::AnyInstance::StubChainChain < ::RSpec::Mocks::AnyInstance::StubChain + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain_chain.rb:6 + def initialize(*args); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain_chain.rb:13 + def create_message_expectation_on(instance); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/any_instance/stub_chain_chain.rb:17 + def invocation_order; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:103 +class RSpec::Mocks::AnyInstanceAllowanceTarget < ::RSpec::Mocks::TargetBase + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:104 + def expression; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:29 + def not_to(matcher, *_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:6 + def to(matcher, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:29 + def to_not(matcher, *_args); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:114 +class RSpec::Mocks::AnyInstanceExpectationTarget < ::RSpec::Mocks::TargetBase + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:115 + def expression; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:16 + def not_to(matcher, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:6 + def to(matcher, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:16 + def to_not(matcher, &block); end +end + +# Wrapper for matching arguments against a list of expected values. Used by +# the `with` method on a `MessageExpectation`: +# +# expect(object).to receive(:message).with(:a, 'b', 3) +# object.message(:a, 'b', 3) +# +# Values passed to `with` can be literal values or argument matchers that +# match against the real objects .e.g. +# +# expect(object).to receive(:message).with(hash_including(:a => 'b')) +# +# Can also be used directly to match the contents of any `Array`. This +# enables 3rd party mocking libs to take advantage of rspec's argument +# matching without using the rest of rspec-mocks. +# +# require 'rspec/mocks/argument_list_matcher' +# include RSpec::Mocks::ArgumentMatchers +# +# arg_list_matcher = RSpec::Mocks::ArgumentListMatcher.new(123, hash_including(:a => 'b')) +# arg_list_matcher.args_match?(123, :a => 'b') +# +# This class is immutable. +# +# @see ArgumentMatchers +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:33 +class RSpec::Mocks::ArgumentListMatcher + # @api public + # @param [Array] expected_args a list of expected literals and/or argument matchers + # + # Initializes an `ArgumentListMatcher` with a collection of literal + # values and/or argument matchers. + # + # @see ArgumentMatchers + # @see #args_match? + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:45 + def initialize(*expected_args, **); end + + # @api public + # @param [Array] actual_args + # + # Matches each element in the `expected_args` against the element in the same + # position of the arguments passed to `new`. + # + # @see #initialize + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:58 + def args_match?(*actual_args, **); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:35 + def expected_args; end + + # @private + # Resolves abstract arg placeholders like `no_args` and `any_args` into + # a more concrete arg list based on the provided `actual_args`. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:81 + def resolve_expected_args_based_on(actual_args); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:100 + def ensure_expected_args_valid!; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:92 + def replace_any_args_with_splat_of_anything(before_count, actual_args_count); end +end + +# Value that will match all argument lists. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_list_matcher.rb:114 +RSpec::Mocks::ArgumentListMatcher::MATCH_ALL = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentListMatcher) + +# ArgumentMatchers are placeholders that you can include in message +# expectations to match arguments against a broader check than simple +# equality. +# +# With the exception of `any_args` and `no_args`, they all match against +# the arg in same position in the argument list. +# +# @see ArgumentListMatcher +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:16 +module RSpec::Mocks::ArgumentMatchers + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:125 + def a_kind_of(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:115 + def an_instance_of(klass); end + + # Acts like an arg splat, matching any number of args at any point in an arg list. + # + # @example + # expect(object).to receive(:message).with(1, 2, any_args) + # + # # matches any of these: + # object.message(1, 2) + # object.message(1, 2, 3) + # object.message(1, 2, 3, 4) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:26 + def any_args; end + + # Matches any argument at all. + # + # @example + # expect(object).to receive(:message).with(anything) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:34 + def anything; end + + # Matches an array that excludes the specified items. + # + # @example + # expect(object).to receive(:message).with(array_excluding(1,2,3)) + # expect(object).to receive(:message).with(array_excluding([1,2,3])) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:100 + def array_excluding(*args); end + + # Matches an array that includes the specified items at least once. + # Ignores duplicates and additional values + # + # @example + # expect(object).to receive(:message).with(array_including(1,2,3)) + # expect(object).to receive(:message).with(array_including([1,2,3])) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:90 + def array_including(*args); end + + # Matches a boolean value. + # + # @example + # expect(object).to receive(:message).with(boolean()) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:59 + def boolean; end + + # Matches if the actual argument responds to the specified messages. + # + # @example + # expect(object).to receive(:message).with(duck_type(:hello)) + # expect(object).to receive(:message).with(duck_type(:hello, :goodbye)) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:51 + def duck_type(*args); end + + # Matches a hash that doesn't include the specified key(s) or key/value. + # + # @example + # expect(object).to receive(:message).with(hash_excluding(:key => val)) + # expect(object).to receive(:message).with(hash_excluding(:key)) + # expect(object).to receive(:message).with(hash_excluding(:key, :key2 => :val2)) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:80 + def hash_excluding(*args); end + + # Matches a hash that includes the specified key(s) or key/value pairs. + # Ignores any additional keys. + # + # @example + # expect(object).to receive(:message).with(hash_including(:key => val)) + # expect(object).to receive(:message).with(hash_including(:key)) + # expect(object).to receive(:message).with(hash_including(:key, :key2 => val2)) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:70 + def hash_including(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:105 + def hash_not_including(*args); end + + # Matches if `arg.instance_of?(klass)` + # + # @example + # expect(object).to receive(:message).with(instance_of(Thing)) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:111 + def instance_of(klass); end + + # Matches if `arg.kind_of?(klass)` + # + # @example + # expect(object).to receive(:message).with(kind_of(Thing)) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:121 + def kind_of(klass); end + + # Matches no arguments. + # + # @example + # expect(object).to receive(:message).with(no_args) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:42 + def no_args; end + + class << self + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:128 + def anythingize_lonely_keys(*args); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:159 +class RSpec::Mocks::ArgumentMatchers::AnyArgMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:160 + def ===(_other); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:164 + def description; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:147 +RSpec::Mocks::ArgumentMatchers::AnyArgMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::AnyArgMatcher) + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:152 +class RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:153 + def description; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:147 +RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher) + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:274 +class RSpec::Mocks::ArgumentMatchers::ArrayExcludingMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:275 + def initialize(unexpected); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:279 + def ===(actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:292 + def description; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:298 + def formatted_unexpected_values; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:242 +class RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:243 + def initialize(expected); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:247 + def ===(actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:260 + def description; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:266 + def formatted_expected_values; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:188 +class RSpec::Mocks::ArgumentMatchers::BaseHashMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:189 + def initialize(expected); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:193 + def ===(predicate, actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:201 + def description(name); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:207 + def formatted_expected_hash; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:177 +class RSpec::Mocks::ArgumentMatchers::BooleanMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:178 + def ===(value); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:182 + def description; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:147 +RSpec::Mocks::ArgumentMatchers::BooleanMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::BooleanMatcher) + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:306 +class RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:307 + def initialize(*methods_to_respond_to); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:311 + def ===(value); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:315 + def description; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:231 +class RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher < ::RSpec::Mocks::ArgumentMatchers::BaseHashMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:232 + def ===(actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:236 + def description; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:220 +class RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher < ::RSpec::Mocks::ArgumentMatchers::BaseHashMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:221 + def ===(actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:225 + def description; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:321 +class RSpec::Mocks::ArgumentMatchers::InstanceOf + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:322 + def initialize(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:326 + def ===(actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:330 + def description; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:336 +class RSpec::Mocks::ArgumentMatchers::KindOf + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:337 + def initialize(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:341 + def ===(actual); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:345 + def description; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:170 +class RSpec::Mocks::ArgumentMatchers::NoArgsMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:171 + def description; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:147 +RSpec::Mocks::ArgumentMatchers::NoArgsMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::NoArgsMatcher) + +# Intended to be subclassed by stateless, immutable argument matchers. +# Provides a `::INSTANCE` constant for accessing a global +# singleton instance of the matcher. There is no need to construct +# multiple instance since there is no state. It also facilities the +# special case logic we need for some of these matchers, by making it +# easy to do comparisons like: `[klass::INSTANCE] == args` rather than +# `args.count == 1 && klass === args.first`. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:143 +class RSpec::Mocks::ArgumentMatchers::SingletonMatcher + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:146 + def inherited(subklass); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/argument_matchers.rb:144 + def new(*_arg0); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:7 +class RSpec::Mocks::CallbackInvocationStrategy + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:8 + def call(doubled_module); end +end + +# Raised for situations that RSpec cannot support due to mutations made +# externally on arguments that RSpec is holding onto to use for later +# comparisons. +# +# @deprecated We no longer raise this error but the constant remains until +# RSpec 4 for SemVer reasons. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:26 +class RSpec::Mocks::CannotSupportArgMutationsError < ::StandardError; end + +# When a class's `.new` method is stubbed, we want to use the method +# signature from `#initialize` because `.new`'s signature is a generic +# `def new(*args)` and it simply delegates to `#initialize` and forwards +# all args...so the method with the actually used signature is `#initialize`. +# +# This method reference implementation handles that specific case. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:184 +class RSpec::Mocks::ClassNewMethodReference < ::RSpec::Mocks::ObjectMethodReference + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:207 + def with_signature; end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:185 + def applies_to?(method_name); end + + # Ruby 2's Method#== is too strict + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:198 + def uses_class_new?(klass); end + end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:196 +RSpec::Mocks::ClassNewMethodReference::CLASS_NEW = T.let(T.unsafe(nil), UnboundMethod) + +# Effectively the same as an ObjectVerifyingDouble (since a class is a type +# of object), except with Module in the inheritance chain so that +# transferring nested constants to work. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:121 +class RSpec::Mocks::ClassVerifyingDouble < ::Module + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + include ::RSpec::Mocks::ObjectVerifyingDoubleMethods +end + +# Provides configuration options for rspec-mocks. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:4 +class RSpec::Mocks::Configuration + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:5 + def initialize; end + + # Adds `stub` and `should_receive` to the given + # modules or classes. This is usually only necessary + # if you application uses some proxy classes that + # "strip themselves down" to a bare minimum set of + # methods and remove `stub` and `should_receive` in + # the process. + # + # @example + # RSpec.configure do |rspec| + # rspec.mock_with :rspec do |mocks| + # mocks.add_stub_and_should_receive_to Delegator + # end + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:62 + def add_stub_and_should_receive_to(*modules); end + + # Sets whether RSpec will warn, ignore, or fail a test when + # expectations are set on nil. + # By default, when this flag is not set, warning messages are issued when + # expectations are set on nil. This is to prevent false-positives and to + # catch potential bugs early on. + # When set to `true`, warning messages are suppressed. + # When set to `false`, it will raise an error. + # + # @example + # RSpec.configure do |config| + # config.mock_with :rspec do |mocks| + # mocks.allow_message_expectations_on_nil = false + # end + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:29 + def allow_message_expectations_on_nil; end + + # Sets whether RSpec will warn, ignore, or fail a test when + # expectations are set on nil. + # By default, when this flag is not set, warning messages are issued when + # expectations are set on nil. This is to prevent false-positives and to + # catch potential bugs early on. + # When set to `true`, warning messages are suppressed. + # When set to `false`, it will raise an error. + # + # @example + # RSpec.configure do |config| + # config.mock_with :rspec do |mocks| + # mocks.allow_message_expectations_on_nil = false + # end + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:29 + def allow_message_expectations_on_nil=(_arg0); end + + # Provides a way to perform customisations when verifying doubles. + # + # @example + # RSpec::Mocks.configuration.before_verifying_doubles do |ref| + # ref.some_method! + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:128 + def before_verifying_doubles(&block); end + + # Indicates whether or not diffs should be colored. + # Delegates to rspec-core's color option if rspec-core + # is loaded; otherwise you can set it here. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:164 + def color?; end + + # Monkey-patch `Marshal.dump` to enable dumping of mocked or stubbed + # objects. By default this will not work since RSpec mocks works by + # adding singleton methods that cannot be serialized. This patch removes + # these singleton methods before serialization. Setting to falsey removes + # the patch. + # + # This method is idempotent. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:188 + def patch_marshal_to_support_partial_doubles=(val); end + + # @api private + # Resets the configured syntax to the default. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:198 + def reset_syntaxes_to_default; end + + # Returns an array with a list of syntaxes + # that are enabled. + # + # @example + # unless RSpec::Mocks.configuration.syntax.include?(:expect) + # raise "this RSpec extension gem requires the rspec-mocks `:expect` syntax" + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:104 + def syntax; end + + # Provides the ability to set either `expect`, + # `should` or both syntaxes. RSpec uses `expect` + # syntax by default. This is needed if you want to + # explicitly enable `should` syntax and/or explicitly + # disable `expect` syntax. + # + # @example + # RSpec.configure do |rspec| + # rspec.mock_with :rspec do |mocks| + # mocks.syntax = [:expect, :should] + # end + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:81 + def syntax=(*values); end + + # @private + # Used to track whether we are temporarily suppressing verifying partial + # doubles with `without_partial_double_verification { ... }` + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:161 + def temporarily_suppress_partial_double_verification; end + + # @private + # Used to track whether we are temporarily suppressing verifying partial + # doubles with `without_partial_double_verification { ... }` + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:161 + def temporarily_suppress_partial_double_verification=(_arg0); end + + # Sets the default for the `transfer_nested_constants` option when + # stubbing constants. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:145 + def transfer_nested_constants=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:139 + def transfer_nested_constants?; end + + # When this is set to true, an error will be raised when + # `instance_double` or `class_double` is given the name of an undefined + # constant. You probably only want to set this when running your entire + # test suite, with all production code loaded. Setting this for an + # isolated unit test will prevent you from being able to isolate it! + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:120 + def verify_doubled_constant_names=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:111 + def verify_doubled_constant_names?; end + + # When set to true, partial mocks will be verified the same as object + # doubles. Any stubs will have their arguments checked against the original + # method, and methods that do not exist cannot be stubbed. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:150 + def verify_partial_doubles=(val); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:154 + def verify_partial_doubles?; end + + # @api private + # Returns an array of blocks to call when verifying doubles + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:135 + def verifying_double_callbacks; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:131 + def when_declaring_verifying_double(&block); end + + # Sets whether or not RSpec will yield the receiving instance of a + # message to blocks that are used for any_instance stub implementations. + # When set, the first yielded argument will be the receiving instance. + # Defaults to `true`. + # + # @example + # RSpec.configure do |rspec| + # rspec.mock_with :rspec do |mocks| + # mocks.yield_receiver_to_any_instance_implementation_blocks = false + # end + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:46 + def yield_receiver_to_any_instance_implementation_blocks=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:31 + def yield_receiver_to_any_instance_implementation_blocks?; end +end + +# Provides information about constants that may (or may not) +# have been mutated by rspec-mocks. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:7 +class RSpec::Mocks::Constant + extend ::RSpec::Support::RecursiveConstMethods + + # @api private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:11 + def initialize(name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:29 + def hidden=(_arg0); end + + # @return [Boolean] Whether or not rspec-mocks has hidden + # this constant. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:51 + def hidden?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:65 + def inspect; end + + # @return [Boolean] Whether or not rspec-mocks has mutated + # (stubbed or hidden) this constant. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:39 + def mutated?; end + + # @return [String] The fully qualified name of the constant. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:21 + def name; end + + # @return [Object, nil] The original value (e.g. before it + # was mutated by rspec-mocks) of the constant, or + # nil if the constant was not previously defined. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:26 + def original_value; end + + # @return [Object, nil] The original value (e.g. before it + # was mutated by rspec-mocks) of the constant, or + # nil if the constant was not previously defined. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:26 + def original_value=(_arg0); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:29 + def previously_defined=(_arg0); end + + # @return [Boolean] Whether or not the constant was defined + # before the current example. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:33 + def previously_defined?; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:29 + def stubbed=(_arg0); end + + # @return [Boolean] Whether or not rspec-mocks has stubbed + # this constant. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:45 + def stubbed?; end + + # The default `to_s` isn't very useful, so a custom version is provided. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:62 + def to_s; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:29 + def valid_name=(_arg0); end + + # @return [Boolean] Whether or not the provided constant name + # is a valid Ruby constant name. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:57 + def valid_name?; end + + class << self + # Queries rspec-mocks to find out information about the named constant. + # + # @param [String] name the name of the constant + # @return [Constant] an object containing information about the named + # constant. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:86 + def original(name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:68 + def unmutated(name); end + end +end + +# Provides a means to stub constants. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:93 +class RSpec::Mocks::ConstantMutator + extend ::RSpec::Support::RecursiveConstMethods + + class << self + # Hides a constant. + # + # @param (see ExampleMethods#hide_const) + # + # @see ExampleMethods#hide_const + # @note It's recommended that you use `hide_const` in your + # examples. This is an alternate public API that is provided + # so you can hide constants in other contexts (e.g. helper + # classes). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:131 + def hide(constant_name); end + + # Uses the mutator to mutate (stub or hide) a constant. Ensures that + # the mutator is correctly registered so it can be backed out at the end + # of the test. + # + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:320 + def mutate(mutator); end + + # Used internally by the constant stubbing to raise a helpful + # error when a constant like "A::B::C" is stubbed and A::B is + # not a module (and thus, it's impossible to define "A::B::C" + # since only modules can have nested constants). + # + # @api private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:331 + def raise_on_invalid_const; end + + # Stubs a constant. + # + # @param (see ExampleMethods#stub_const) + # @option (see ExampleMethods#stub_const) + # @return (see ExampleMethods#stub_const) + # + # @see ExampleMethods#stub_const + # @note It's recommended that you use `stub_const` in your + # examples. This is an alternate public API that is provided + # so you can stub constants in other contexts (e.g. helper + # classes). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:107 + def stub(constant_name, value, options = T.unsafe(nil)); end + end +end + +# Contains common functionality used by all of the constant mutators. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:139 +class RSpec::Mocks::ConstantMutator::BaseMutator + include ::RSpec::Support::RecursiveConstMethods + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:144 + def initialize(full_constant_name, mutated_value, transfer_nested_constants); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:142 + def full_constant_name; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:160 + def idempotently_reset; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:142 + def original_value; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:153 + def to_constant; end +end + +# Hides a defined constant for the duration of an example. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:169 +class RSpec::Mocks::ConstantMutator::ConstantHider < ::RSpec::Mocks::ConstantMutator::BaseMutator + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:170 + def mutate; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:188 + def reset; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:178 + def to_constant; end +end + +# Replaces a defined constant for the duration of an example. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:197 +class RSpec::Mocks::ConstantMutator::DefinedConstantReplacer < ::RSpec::Mocks::ConstantMutator::BaseMutator + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:198 + def initialize(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:203 + def mutate; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:223 + def reset; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:268 + def should_transfer_nested_constants?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:215 + def to_constant; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:232 + def transfer_nested_constants; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:238 + def verify_constants_to_transfer!; end +end + +# Sets an undefined constant for the duration of an example. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:278 +class RSpec::Mocks::ConstantMutator::UndefinedConstantSetter < ::RSpec::Mocks::ConstantMutator::BaseMutator + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:279 + def mutate; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:299 + def reset; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:291 + def to_constant; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/mutate_const.rb:305 + def name_for(parent, name); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:104 +RSpec::Mocks::DEFAULT_CALLBACK_INVOCATION_STRATEGY = T.let(T.unsafe(nil), RSpec::Mocks::CallbackInvocationStrategy) + +# An implementation of rspec-mocks' reference interface. +# Used when an object is passed to {ExampleMethods#object_double}, or +# an anonymous class or module is passed to {ExampleMethods#instance_double} +# or {ExampleMethods#class_double}. +# Represents a reference to that object. +# @see NamedObjectReference +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:56 +class RSpec::Mocks::DirectObjectReference + # @param object [Object] the object to which this refers + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:58 + def initialize(object); end + + # Defined for interface parity with the other object reference + # implementations. Raises an `ArgumentError` to indicate that `as_stubbed_const` + # is invalid when passing an object argument to `object_double`. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:70 + def const_to_replace; end + + # Always returns true for an object as the class is defined. + # + # @return [true] + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:85 + def defined?; end + + # @return [String] the object's description (via `#inspect`). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:63 + def description; end + + # The target of the verifying double (the object itself). + # + # @return [Object] + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:78 + def target; end + + # Yields if the reference target is loaded, providing a generic mechanism + # to optionally run a bit of code only when a reference's target is + # loaded. + # + # This specific implementation always yields because direct references + # are always loaded. + # + # @yield [Object] the target of this reference. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:97 + def when_loaded; end +end + +# A generic test double object. `double`, `instance_double` and friends +# return an instance of this. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:135 +class RSpec::Mocks::Double + include ::RSpec::Mocks::TestDouble +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:36 +class RSpec::Mocks::ErrorGenerator + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:39 + def initialize(target = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:71 + def default_error_message(expectation, expected_args, actual_args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:132 + def describe_expectation(verb, message, expected_received_count, _actual_received_count, args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:215 + def expectation_on_nil_message(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:222 + def intro(unwrapped = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:235 + def method_call_args_description(args, generic_prefix = T.unsafe(nil), matcher_prefix = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:44 + def opts; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:37 + def opts=(_arg0); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:203 + def raise_already_invoked_error(message, calling_customization); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:193 + def raise_cant_constrain_count_for_negated_have_received_error(count_constraint); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:170 + def raise_double_negation_error(wrapped_expression); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:77 + def raise_expectation_error(message, expected_received_count, argument_list_matcher, actual_received_count, expectation_count_type, args, backtrace_line = T.unsafe(nil), source_id = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:164 + def raise_expectation_on_mocked_method(method); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:211 + def raise_expectation_on_nil_error(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:158 + def raise_expectation_on_unstubbed_method(method); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:123 + def raise_expired_test_double_error; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:187 + def raise_have_received_disallowed(type, reason); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:118 + def raise_invalid_arguments_error(verifier); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:198 + def raise_method_not_stubbed_error(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:142 + def raise_missing_block_error(args_to_yield); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:59 + def raise_missing_default_stub_error(expectation, args_for_multiple_calls); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:111 + def raise_non_public_error(method_name, visibility); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:152 + def raise_only_valid_on_a_partial_double(method); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:137 + def raise_out_of_order_error(message); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:67 + def raise_similar_message_args_error(expectation, args_for_multiple_calls, backtrace_line = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:54 + def raise_unexpected_message_args_error(expectation, args_for_multiple_calls, source_id = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:49 + def raise_unexpected_message_error(message, args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:87 + def raise_unimplemented_error(doubled_module, method_name, object); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:178 + def raise_verifying_double_not_defined_error(ref); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:147 + def raise_wrong_arity_error(args_to_yield, signature); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:328 + def __raise(message, backtrace_line = T.unsafe(nil), source_id = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:356 + def arg_list(args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:366 + def count_message(count, expectation_count_type = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:302 + def diff_message(expected_args, actual_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:324 + def differ; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:268 + def error_message(expectation, args_for_multiple_calls); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:257 + def expected_part_of_expectation_error(expected_received_count, expectation_count_type, argument_list_matcher); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:351 + def format_args(args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:360 + def format_received_args(args_for_multiple_calls); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:380 + def group_count(index, args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:376 + def grouped_args(args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:320 + def list_of_exactly_one_string?(args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:347 + def notify(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:342 + def prepend_to_backtrace(exception, line); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:250 + def received_part_of_expectation_error(actual_received_count, args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:372 + def times(count); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:264 + def unexpected_arguments_message(expected_args_string, actual_args_string); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:312 + def unpack_string_args(formatted_expected_args, actual_args); end +end + +# Contains methods intended to be used from within code examples. +# Mix this in to your test context (such as a test framework base class) +# to use rspec-mocks with your test framework. If you're using rspec-core, +# it'll take care of doing this for you. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:9 +module RSpec::Mocks::ExampleMethods + include ::RSpec::Mocks::ArgumentMatchers + include ::RSpec::Mocks::ExampleMethods::ExpectHost + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def allow(target); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def allow_any_instance_of(klass); end + + # Disables warning messages about expectations being set on nil. + # + # By default warning messages are issued when expectations are set on + # nil. This is to prevent false-positives and to catch potential bugs + # early on. + # @deprecated Use {RSpec::Mocks::Configuration#allow_message_expectations_on_nil} instead. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:201 + def allow_message_expectations_on_nil; end + + # @overload class_double(doubled_class) + # @param doubled_class [String, Module] + # @overload class_double(doubled_class, name) + # @param doubled_class [String, Module] + # @param name [String/Symbol] name or description to be used in failure messages + # @overload class_double(doubled_class, stubs) + # @param doubled_class [String, Module] + # @param stubs [Hash] hash of message/return-value pairs + # @overload class_double(doubled_class, name, stubs) + # @param doubled_class [String, Module] + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs [Hash] hash of message/return-value pairs + # @return ClassVerifyingDouble + # + # Constructs a test double against a specific class. If the given class + # name has been loaded, only class methods defined on the class are + # allowed to be stubbed. In all other ways it behaves like a + # [double](double). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:79 + def class_double(doubled_class, *args); end + + # @overload class_spy(doubled_class) + # @param doubled_class [String, Module] + # @overload class_spy(doubled_class, name) + # @param doubled_class [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @overload class_spy(doubled_class, stubs) + # @param doubled_class [String, Module] + # @param stubs [Hash] hash of message/return-value pairs + # @overload class_spy(doubled_class, name, stubs) + # @param doubled_class [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs [Hash] hash of message/return-value pairs + # @return ClassVerifyingDouble + # + # Constructs a test double that is optimized for use with `have_received` + # against a specific class. If the given class name has been loaded, + # only class methods defined on the class are allowed to be stubbed. + # With a normal double one has to stub methods in order to be able to spy + # them. An class_spy automatically spies on all class methods to which the + # class responds. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:191 + def class_spy(*args); end + + # @overload double() + # @overload double(name) + # @param name [String/Symbol] name or description to be used in failure messages + # @overload double(stubs) + # @param stubs (Hash) hash of message/return-value pairs + # @overload double(name, stubs) + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs (Hash) hash of message/return-value pairs + # @return (Double) + # + # Constructs an instance of [RSpec::Mocks::Double](RSpec::Mocks::Double) configured + # with an optional name, used for reporting in failure messages, and an optional + # hash of message/return-value pairs. + # + # @example + # book = double("book", :title => "The RSpec Book") + # book.title #=> "The RSpec Book" + # + # card = double("card", :suit => "Spades", :rank => "A") + # card.suit #=> "Spades" + # card.rank #=> "A" + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:34 + def double(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def expect_any_instance_of(klass); end + + # Verifies that the given object received the expected message during the + # course of the test. On a spy objects or as null object doubles this + # works for any method, on other objects the method must have + # been stubbed beforehand in order for messages to be verified. + # + # Stubbing and verifying messages received in this way implements the + # Test Spy pattern. + # + # @param method_name [Symbol] name of the method expected to have been + # called. + # + # @example + # invitation = double('invitation', accept: true) + # user.accept_invitation(invitation) + # expect(invitation).to have_received(:accept) + # + # # You can also use most message expectations: + # expect(invitation).to have_received(:accept).with(mailer).once + # + # @note `have_received(...).with(...)` is unable to work properly when + # passed arguments are mutated after the spy records the received message. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:281 + def have_received(method_name, &block); end + + # Hides the named constant with the given value. The constant will be + # undefined for the duration of the test. + # + # Like method stubs, the constant will be restored to its original value + # when the example completes. + # + # @param constant_name [String] The fully qualified name of the constant. + # The current constant scoping at the point of call is not considered. + # + # @example + # hide_const("MyClass") # => MyClass is now an undefined constant + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:256 + def hide_const(constant_name); end + + # @overload instance_double(doubled_class) + # @param doubled_class [String, Class] + # @overload instance_double(doubled_class, name) + # @param doubled_class [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @overload instance_double(doubled_class, stubs) + # @param doubled_class [String, Class] + # @param stubs [Hash] hash of message/return-value pairs + # @overload instance_double(doubled_class, name, stubs) + # @param doubled_class [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs [Hash] hash of message/return-value pairs + # @return InstanceVerifyingDouble + # + # Constructs a test double against a specific class. If the given class + # name has been loaded, only instance methods defined on the class are + # allowed to be stubbed. In all other ways it behaves like a + # [double](double). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:56 + def instance_double(doubled_class, *args); end + + # @overload instance_spy(doubled_class) + # @param doubled_class [String, Class] + # @overload instance_spy(doubled_class, name) + # @param doubled_class [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @overload instance_spy(doubled_class, stubs) + # @param doubled_class [String, Class] + # @param stubs [Hash] hash of message/return-value pairs + # @overload instance_spy(doubled_class, name, stubs) + # @param doubled_class [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs [Hash] hash of message/return-value pairs + # @return InstanceVerifyingDouble + # + # Constructs a test double that is optimized for use with `have_received` + # against a specific class. If the given class name has been loaded, only + # instance methods defined on the class are allowed to be stubbed. With + # a normal double one has to stub methods in order to be able to spy + # them. An instance_spy automatically spies on all instance methods to + # which the class responds. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:144 + def instance_spy(*args); end + + # @overload object_double(object_or_name) + # @param object_or_name [String, Object] + # @overload object_double(object_or_name, name) + # @param object_or_name [String, Object] + # @param name [String/Symbol] name or description to be used in failure messages + # @overload object_double(object_or_name, stubs) + # @param object_or_name [String, Object] + # @param stubs [Hash] hash of message/return-value pairs + # @overload object_double(object_or_name, name, stubs) + # @param object_or_name [String, Object] + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs [Hash] hash of message/return-value pairs + # @return ObjectVerifyingDouble + # + # Constructs a test double against a specific object. Only the methods + # the object responds to are allowed to be stubbed. If a String argument + # is provided, it is assumed to reference a constant object which is used + # for verification. In all other ways it behaves like a [double](double). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:102 + def object_double(object_or_name, *args); end + + # @overload object_spy(object_or_name) + # @param object_or_name [String, Object] + # @overload object_spy(object_or_name, name) + # @param object_or_name [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @overload object_spy(object_or_name, stubs) + # @param object_or_name [String, Object] + # @param stubs [Hash] hash of message/return-value pairs + # @overload object_spy(object_or_name, name, stubs) + # @param object_or_name [String, Class] + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs [Hash] hash of message/return-value pairs + # @return ObjectVerifyingDouble + # + # Constructs a test double that is optimized for use with `have_received` + # against a specific object. Only instance methods defined on the object + # are allowed to be stubbed. With a normal double one has to stub + # methods in order to be able to spy them. An object_spy automatically + # spies on all methods to which the object responds. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:167 + def object_spy(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def receive(method_name, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def receive_message_chain(*messages, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def receive_messages(message_return_value_hash, &_block); end + + # @overload spy() + # @overload spy(name) + # @param name [String/Symbol] name or description to be used in failure messages + # @overload spy(stubs) + # @param stubs (Hash) hash of message/return-value pairs + # @overload spy(name, stubs) + # @param name [String/Symbol] name or description to be used in failure messages + # @param stubs (Hash) hash of message/return-value pairs + # @return (Double) + # + # Constructs a test double that is optimized for use with + # `have_received`. With a normal double one has to stub methods in order + # to be able to spy them. A spy automatically spies on all methods. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:120 + def spy(*args); end + + # Stubs the named constant with the given value. + # Like method stubs, the constant will be restored + # to its original value (or lack of one, if it was + # undefined) when the example completes. + # + # @param constant_name [String] The fully qualified name of the constant. The current + # constant scoping at the point of call is not considered. + # @param value [Object] The value to make the constant refer to. When the + # example completes, the constant will be restored to its prior state. + # @param options [Hash] Stubbing options. + # @option options :transfer_nested_constants [Boolean, Array] Determines + # what nested constants, if any, will be transferred from the original value + # of the constant to the new value of the constant. This only works if both + # the original and new values are modules (or classes). + # @return [Object] the stubbed value of the constant + # + # @example + # stub_const("MyClass", Class.new) # => Replaces (or defines) MyClass with a new class object. + # stub_const("SomeModel::PER_PAGE", 5) # => Sets SomeModel::PER_PAGE to 5. + # + # class CardDeck + # SUITS = [:Spades, :Diamonds, :Clubs, :Hearts] + # NUM_CARDS = 52 + # end + # + # stub_const("CardDeck", Class.new) + # CardDeck::SUITS # => uninitialized constant error + # CardDeck::NUM_CARDS # => uninitialized constant error + # + # stub_const("CardDeck", Class.new, :transfer_nested_constants => true) + # CardDeck::SUITS # => our suits array + # CardDeck::NUM_CARDS # => 52 + # + # stub_const("CardDeck", Class.new, :transfer_nested_constants => [:SUITS]) + # CardDeck::SUITS # => our suits array + # CardDeck::NUM_CARDS # => uninitialized constant error + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:241 + def stub_const(constant_name, value, options = T.unsafe(nil)); end + + # Turns off the verifying of partial doubles for the duration of the + # block, this is useful in situations where methods are defined at run + # time and you wish to define stubs for them but not turn off partial + # doubles for the entire run suite. (e.g. view specs in rspec-rails). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:289 + def without_partial_double_verification; end + + class << self + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:423 + def declare_double(type, *args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:408 + def declare_verifying_double(type, ref, *args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:401 + def extended(object); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:392 + def included(klass); end + end +end + +# This module exists to host the `expect` method for cases where +# rspec-mocks is used w/o rspec-expectations. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/example_methods.rb:430 +module RSpec::Mocks::ExampleMethods::ExpectHost + # pkg:gem/rspec-mocks#lib/rspec/mocks/configuration.rb:84 + def expect(target); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:61 +class RSpec::Mocks::ExpectChain < ::RSpec::Mocks::MessageChain + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:69 + def expectation(object, message, &return_block); end + + class << self + # @api private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:63 + def expect_chain_on(object, *chain, &blk); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:87 +class RSpec::Mocks::ExpectationTarget < ::RSpec::Mocks::TargetBase + include ::RSpec::Mocks::ExpectationTargetMethods +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:73 +module RSpec::Mocks::ExpectationTargetMethods + include ::RSpec::Mocks::TargetDelegationInstanceMethods + extend ::RSpec::Mocks::TargetDelegationClassMethods + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:81 + def expression; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:16 + def not_to(matcher, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:6 + def to(matcher, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:16 + def to_not(matcher, &block); end +end + +# Raised when a test double is used after it has been torn +# down (typically at the end of an rspec-core example). +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:10 +class RSpec::Mocks::ExpiredTestDoubleError < ::RSpec::Mocks::MockExpectationError; end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks.rb:112 +RSpec::Mocks::IGNORED_BACKTRACE_LINE = T.let(T.unsafe(nil), String) + +# Represents a configured implementation. Takes into account +# any number of sub-implementations. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:792 +class RSpec::Mocks::Implementation + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:795 + def call(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:793 + def initial_action; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:793 + def initial_action=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:793 + def inner_action; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:793 + def inner_action=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:802 + def present?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:793 + def terminal_action; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:793 + def terminal_action=(_arg0); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:808 + def actions; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:113 +class RSpec::Mocks::InstanceMethodReference < ::RSpec::Mocks::MethodReference + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:138 + def find_method(mod); end + + # Ideally, we'd use `respond_to?` for `method_implemented?` but we need a + # reference to an instance to do that and we don't have one. Note that + # we may get false negatives: if the method is implemented via + # `method_missing`, we'll return `false` even though it meets our + # definition of "implemented". However, it's the best we can do. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:125 + def method_defined?(mod); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:116 + def method_implemented?(mod); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:143 + def visibility_from(mod); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:4 +class RSpec::Mocks::InstanceMethodStasher + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:5 + def initialize(object, method); end + + # ruby 2.0.0-p247 and 2.0.0-p195 both have a bug that we can't work around :(. + # https://bugs.ruby-lang.org/issues/8686 + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:91 + def handle_restoration_failures; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:49 + def method_is_stashed?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:14 + def original_method; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:61 + def restore; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:54 + def stash; end + + private + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:100 + def method_defined_directly_on_klass?; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:105 + def method_defined_on_klass?(klass = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:109 + def method_owned_by_klass?; end +end + +# A mock providing a custom proxy that can verify the validity of any +# method stubs or expectations against the public instance methods of the +# given class. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:73 +class RSpec::Mocks::InstanceVerifyingDouble + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:77 + def __build_mock_proxy(order_group); end +end + +# Support for `patch_marshal_to_support_partial_doubles` configuration. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/marshal_extension.rb:6 +class RSpec::Mocks::MarshalExtension + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/marshal_extension.rb:7 + def patch!; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/marshal_extension.rb:27 + def unpatch!; end + end +end + +# Namespace for mock-related matchers. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks.rb:122 +module RSpec::Mocks::Matchers; end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/expectation_customization.rb:5 +class RSpec::Mocks::Matchers::ExpectationCustomization + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/expectation_customization.rb:8 + def initialize(method_name, args, block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/expectation_customization.rb:6 + def block; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/expectation_customization.rb:6 + def block=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/expectation_customization.rb:14 + def playback_onto(expectation); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:5 +class RSpec::Mocks::Matchers::HaveReceived + include ::RSpec::Mocks::Matchers::Matcher + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:12 + def initialize(method_name, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def at_least(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def at_most(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:48 + def description; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:32 + def does_not_match?(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def exactly(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:40 + def failure_message; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:44 + def failure_message_when_negated; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:19 + def matcher_name; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:23 + def matches?(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def once(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def ordered(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:67 + def setup_allowance(_subject, &_block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:71 + def setup_any_instance_allowance(_subject, &_block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:75 + def setup_any_instance_expectation(_subject, &_block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:79 + def setup_any_instance_negative_expectation(_subject, &_block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:59 + def setup_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:63 + def setup_negative_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def thrice(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def time(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def times(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def twice(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:53 + def with(*args); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:95 + def apply_constraints_to(expectation); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:112 + def capture_failure_message; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:106 + def count_constraint; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:85 + def disallow(type, reason = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:101 + def ensure_count_unconstrained; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:89 + def expect; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:123 + def expected_messages_received_in_order?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:128 + def mock_proxy; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:118 + def notify_failure_message; end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:9 +RSpec::Mocks::Matchers::HaveReceived::ARGS_CONSTRAINTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:10 +RSpec::Mocks::Matchers::HaveReceived::CONSTRAINTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/have_received.rb:8 +RSpec::Mocks::Matchers::HaveReceived::COUNT_CONSTRAINTS = T.let(T.unsafe(nil), Array) + +# @private +# just a "tag" for rspec-mock matchers detection +# +# pkg:gem/rspec-mocks#lib/rspec/mocks.rb:125 +module RSpec::Mocks::Matchers::Matcher; end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:7 +class RSpec::Mocks::Matchers::Receive + include ::RSpec::Mocks::Matchers::Matcher + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:10 + def initialize(message, block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_call_original(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_invoke(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_raise(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_return(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_throw(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_wrap_original(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_yield(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def at_least(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def at_most(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:20 + def description; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:39 + def does_not_match?(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def exactly(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def inspect(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:16 + def matcher_name; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:28 + def matches?(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def never(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def once(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def ordered(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:41 + def setup_allowance(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:54 + def setup_any_instance_allowance(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:46 + def setup_any_instance_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:50 + def setup_any_instance_negative_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:24 + def setup_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:30 + def setup_negative_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def thrice(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def time(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def times(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def to_s(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def twice(*args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def with(*args, **, &block); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:71 + def describable; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:108 + def move_block_to_last_customization(block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:91 + def setup_any_instance_method_substitute(subject, method, block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:96 + def setup_method_substitute(host, method, block, *args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:86 + def setup_mock_proxy_method_substitute(subject, method, block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:75 + def warn_if_any_instance(expression, subject); end +end + +# MessageExpectation objects are able to describe themselves in detail. +# We use this as a fall back when a MessageExpectation is not available. +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:119 +class RSpec::Mocks::Matchers::Receive::DefaultDescribable + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:120 + def initialize(message); end + + # This is much simpler for the `any_instance` case than what the + # user may want, but I'm not up for putting a bunch of effort + # into full descriptions for `any_instance` expectations at this point :(. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:127 + def description_for(verb); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:7 +class RSpec::Mocks::Matchers::ReceiveMessageChain + include ::RSpec::Mocks::Matchers::Matcher + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:10 + def initialize(chain, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def and_call_original(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def and_invoke(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def and_raise(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def and_return(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def and_throw(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def and_yield(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:27 + def description; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:60 + def does_not_match?(*_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:23 + def matcher_name; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:59 + def matches?(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:31 + def setup_allowance(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:36 + def setup_any_instance_allowance(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:42 + def setup_any_instance_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:48 + def setup_expectation(subject, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:53 + def setup_negative_expectation(*_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:17 + def with(*args, &block); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:70 + def formatted_chain; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_message_chain.rb:64 + def replay_customizations(chain); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:5 +class RSpec::Mocks::Matchers::ReceiveMessages + include ::RSpec::Mocks::Matchers::Matcher + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:8 + def initialize(message_return_value_hash); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:17 + def description; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:34 + def does_not_match?(_subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:13 + def matcher_name; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:27 + def matches?(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:36 + def setup_allowance(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:50 + def setup_any_instance_allowance(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:43 + def setup_any_instance_expectation(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:21 + def setup_expectation(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:29 + def setup_negative_expectation(_subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:55 + def warn_about_block; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:65 + def any_instance_of(subject); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:69 + def each_message_on(host); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive_messages.rb:61 + def proxy_on(subject); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:4 +class RSpec::Mocks::MessageChain + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:7 + def initialize(object, *chain, &blk); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:5 + def block; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:5 + def chain; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:5 + def object; end + + # @api private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:13 + def setup_chain; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:33 + def chain_on(object, *chain, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:54 + def find_matching_expectation; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:49 + def find_matching_stub; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:38 + def format_chain(*chain, &blk); end +end + +# Represents an individual method stub or message expectation. The methods +# defined here can be used to configure how it behaves. The methods return +# `self` so that they can be chained together to form a fluent interface. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:44 +class RSpec::Mocks::MessageExpectation + include ::RSpec::Mocks::MessageExpectation::ImplementationDetails + + # Tells the object to delegate to the original unmodified method + # when it receives the message. + # + # @note This is only available on partial doubles. + # + # @return [nil] No further chaining is supported after this. + # @example + # expect(counter).to receive(:increment).and_call_original + # original_count = counter.count + # counter.increment + # expect(counter.count).to eq(original_count + 1) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:141 + def and_call_original; end + + # Tells the object to invoke a Proc when it receives the message. Given + # more than one value, the result of the first Proc is returned the first + # time the message is received, the result of the second Proc is returned + # the next time, etc, etc. + # + # If the message is received more times than there are Procs, the result of + # the last Proc is returned for every subsequent call. + # + # @return [nil] No further chaining is supported after this. + # @example + # allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout }) + # api.get_foo # => raises ApiTimeout + # api.get_foo # => raises ApiTimeout + # + # allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout }, -> { raise ApiTimeout }, -> { :a_foo }) + # api.get_foo # => raises ApiTimeout + # api.get_foo # => raises ApiTimeout + # api.get_foo # => :a_foo + # api.get_foo # => :a_foo + # api.get_foo # => :a_foo + # # etc + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:109 + def and_invoke(first_proc, *procs, &_block); end + + # @overload and_raise + # @overload and_raise(ExceptionClass) + # @overload and_raise(ExceptionClass, message) + # @overload and_raise(exception_instance) + # + # Tells the object to raise an exception when the message is received. + # + # @return [nil] No further chaining is supported after this. + # @note + # When you pass an exception class, the MessageExpectation will raise + # an instance of it, creating it with `exception` and passing `message` + # if specified. If the exception class initializer requires more than + # one parameters, you must pass in an instance and not the class, + # otherwise this method will raise an ArgumentError exception. + # + # @example + # allow(car).to receive(:go).and_raise + # allow(car).to receive(:go).and_raise(OutOfGas) + # allow(car).to receive(:go).and_raise(OutOfGas, "At least 2 oz of gas needed to drive") + # allow(car).to receive(:go).and_raise(OutOfGas.new(2, :oz)) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:186 + def and_raise(*args); end + + # @overload and_return(value) + # @overload and_return(first_value, second_value) + # + # Tells the object to return a value when it receives the message. Given + # more than one value, the first value is returned the first time the + # message is received, the second value is returned the next time, etc, + # etc. + # + # If the message is received more times than there are values, the last + # value is returned for every subsequent call. + # + # @return [nil] No further chaining is supported after this. + # @example + # allow(counter).to receive(:count).and_return(1) + # counter.count # => 1 + # counter.count # => 1 + # + # allow(counter).to receive(:count).and_return(1,2,3) + # counter.count # => 1 + # counter.count # => 2 + # counter.count # => 3 + # counter.count # => 3 + # counter.count # => 3 + # # etc + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:71 + def and_return(first_value, *values, &_block); end + + # @overload and_throw(symbol) + # @overload and_throw(symbol, object) + # + # Tells the object to throw a symbol (with the object if that form is + # used) when the message is received. + # + # @return [nil] No further chaining is supported after this. + # @example + # allow(car).to receive(:go).and_throw(:out_of_gas) + # allow(car).to receive(:go).and_throw(:out_of_gas, :level => 0.1) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:202 + def and_throw(*args); end + + # Decorates the stubbed method with the supplied block. The original + # unmodified method is passed to the block along with any method call + # arguments so you can delegate to it, whilst still being able to + # change what args are passed to it and/or change the return value. + # + # @note This is only available on partial doubles. + # + # @return [nil] No further chaining is supported after this. + # @example + # expect(api).to receive(:large_list).and_wrap_original do |original_method, *args, &block| + # original_method.call(*args, &block).first(10) + # end + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:162 + def and_wrap_original(&block); end + + # Tells the object to yield one or more args to a block when the message + # is received. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # stream.stub(:open).and_yield(StringIO.new) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:214 + def and_yield(*args, &block); end + + # Constrain a message expectation to be received at least a specific + # number of times. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(dealer).to receive(:deal_card).at_least(9).times + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:249 + def at_least(n, &block); end + + # Constrain a message expectation to be received at most a specific + # number of times. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(dealer).to receive(:deal_card).at_most(10).times + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:268 + def at_most(n, &block); end + + # Constrain a message expectation to be received a specific number of + # times. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(dealer).to receive(:deal_card).exactly(10).times + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:236 + def exactly(n, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:401 + def inspect; end + + # Expect a message not to be received at all. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(car).to receive(:stop).never + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:293 + def never; end + + # Expect a message to be received exactly one time. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(car).to receive(:go).once + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:304 + def once(&block); end + + # Expect messages to be received in a specific order. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(api).to receive(:prepare).ordered + # expect(api).to receive(:run).ordered + # expect(api).to receive(:finish).ordered + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:379 + def ordered(&block); end + + # Expect a message to be received exactly three times. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(car).to receive(:go).thrice + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:326 + def thrice(&block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:286 + def time(&block); end + + # Syntactic sugar for `exactly`, `at_least` and `at_most` + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(dealer).to receive(:deal_card).exactly(10).times + # expect(dealer).to receive(:deal_card).at_least(10).times + # expect(dealer).to receive(:deal_card).at_most(10).times + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:282 + def times(&block); end + + # @return [String] a nice representation of the message expectation + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:396 + def to_s; end + + # Expect a message to be received exactly two times. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # expect(car).to receive(:go).twice + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:315 + def twice(&block); end + + # Constrains a stub or message expectation to invocations with specific + # arguments. + # + # With a stub, if the message might be received with other args as well, + # you should stub a default value first, and then stub or mock the same + # message using `with` to constrain to specific arguments. + # + # A message expectation will fail if the message is received with different + # arguments. + # + # @return [MessageExpectation] self, to support further chaining. + # @example + # allow(cart).to receive(:add) { :failure } + # allow(cart).to receive(:add).with(Book.new(:isbn => 1934356379)) { :success } + # cart.add(Book.new(:isbn => 1234567890)) + # # => :failure + # cart.add(Book.new(:isbn => 1934356379)) + # # => :success + # + # expect(cart).to receive(:add).with(Book.new(:isbn => 1934356379)) { :success } + # cart.add(Book.new(:isbn => 1234567890)) + # # => failed expectation + # cart.add(Book.new(:isbn => 1934356379)) + # # => passes + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:359 + def with(*args, **, &block); end +end + +# @private +# Contains the parts of `MessageExpectation` that aren't part of +# rspec-mocks' public API. The class is very big and could really use +# some collaborators it delegates to for this stuff but for now this was +# the simplest way to split the public from private stuff to make it +# easier to publish the docs for the APIs we want published. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:412 +module RSpec::Mocks::MessageExpectation::ImplementationDetails + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:423 + def initialize(error_generator, expectation_ordering, expected_from, method_double, type = T.unsafe(nil), opts = T.unsafe(nil), &implementation_block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:602 + def actual_received_count_matters?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:589 + def additional_expected_calls; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:546 + def advise(*args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:459 + def and_yield_receiver_to_implementation; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:416 + def argument_list_matcher=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:501 + def called_max_times?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:578 + def description_for(verb); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:521 + def ensure_expected_ordering_received!; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:413 + def error_generator; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:572 + def expectation_count_type; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:455 + def expected_args; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:517 + def expected_messages_received?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:554 + def generate_error; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:526 + def ignoring_args?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:413 + def implementation; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:606 + def increase_actual_received_count!; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:478 + def invoke(parent_stub, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:492 + def invoke_without_incrementing_received_count(parent_stub, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:468 + def matches?(message, *args, **); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:530 + def matches_at_least_count?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:534 + def matches_at_most_count?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:538 + def matches_exact_count?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:508 + def matches_name_but_not_args(message, *args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:414 + def message; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:497 + def negative?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:598 + def negative_expectation_for?(message); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:594 + def ordered?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:415 + def orig_object; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:585 + def raise_out_of_order_error; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:568 + def raise_unexpected_message_args_error(args_for_multiple_calls); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:473 + def safe_invoke(parent_stub, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:487 + def safe_invoke_without_incrementing_received_count(parent_stub, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:542 + def similar_messages; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:420 + def type; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:550 + def unadvise(args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:512 + def verify_messages_received; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:464 + def yield_receiver_to_implementation_block?; end + + protected + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:413 + def error_generator=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:416 + def expected_from=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:416 + def expected_received_count=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:413 + def implementation=(_arg0); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:614 + def exception_source_id; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:666 + def has_been_invoked?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:689 + def initial_implementation_action=(action); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:693 + def inner_implementation_action=(action); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:633 + def invoke_incrementing_actual_calls_by(increment, allowed_to_fail, parent_stub, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:618 + def invoking_internals; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:622 + def invoking_internals=(value); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:670 + def raise_already_invoked_error_if_necessary(calling_customization); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:676 + def set_expected_received_count(relativity, n); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:699 + def terminal_implementation_action=(action); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:703 + def warn_about_stub_override; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:710 + def wrap_original(method_name, &block); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:4 +class RSpec::Mocks::MethodDouble + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:12 + def initialize(object, method_name, proxy); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:216 + def add_default_stub(*args, &implementation); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:166 + def add_expectation(error_generator, expectation_ordering, expected_from, opts, &implementation); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:202 + def add_simple_expectation(method_name, response, error_generator, backtrace_line); end + + # A simple stub can only return a concrete value for a message, and + # cannot match on arguments. It is used as an optimization over + # `add_stub` / `add_expectation` where it is known in advance that this + # is all that will be required of a stub, such as when passing attributes + # to the `double` example method. They do not stash or restore existing method + # definitions. + # + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:197 + def add_simple_stub(method_name, response); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:181 + def add_stub(error_generator, expectation_ordering, expected_from, opts = T.unsafe(nil), &implementation); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:175 + def build_expectation(error_generator, expectation_ordering); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:152 + def clear; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:61 + def configure_method; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:68 + def define_proxy_method; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:9 + def expectations; end + + # The type of message expectation to create has been extracted to its own + # method so that subclasses can override it. + # + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:161 + def message_expectation_class; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:41 + def method_missing_block; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:9 + def method_name; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:9 + def method_stasher; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:9 + def object; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:56 + def object_singleton_class; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:24 + def original_implementation_callable; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:34 + def original_method; end + + # The implementation of the proxied method. Subclasses may override this + # method to perform additional operations. + # + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:97 + def proxy_method_invoked(_obj, *args, **, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:233 + def raise_method_not_stubbed_error; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:222 + def remove_stub; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:228 + def remove_stub_if_present; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:146 + def reset; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:103 + def restore_original_method; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:133 + def restore_original_visibility; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:32 + def save_original_implementation_callable!; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:207 + def setup_simple_method_double(method_name, response, collection, error_generator = T.unsafe(nil), backtrace_line = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:122 + def show_frozen_warning; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:9 + def stubs; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:141 + def verify; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:51 + def visibility; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:255 + def definition_target; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:275 + def new_rspec_prepended_module; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:293 + def remove_method_from_definition_target; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:259 + def usable_rspec_prepended_module; end +end + +# @private TODO: drop in favor of FrozenError in ruby 2.5+ +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:6 +RSpec::Mocks::MethodDouble::FROZEN_ERROR_MSG = T.let(T.unsafe(nil), Regexp) + +# We subclass `Module` in order to be able to easily detect our prepended module. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_double.rb:253 +class RSpec::Mocks::MethodDouble::RSpecPrependedModule < ::Module; end + +# Represents a method on an object that may or may not be defined. +# The method may be an instance method on a module or a method on +# any object. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:10 +class RSpec::Mocks::MethodReference + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:15 + def initialize(object_reference, method_name); end + + # A method is defined if we are able to get a `Method` object for it. + # In that case, we can assert against metadata like the arity. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:46 + def defined?; end + + # A method is implemented if sending the message does not result in + # a `NoMethodError`. It might be dynamically implemented by + # `method_missing`. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:23 + def implemented?; end + + # Returns true if we definitively know that sending the method + # will result in a `NoMethodError`. + # + # This is not simply the inverse of `implemented?`: there are + # cases when we don't know if a method is implemented and + # both `implemented?` and `unimplemented?` will return false. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:35 + def unimplemented?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:57 + def visibility; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:52 + def with_signature; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:105 + def original_method; end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:11 + def for(object_reference, method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:67 + def instance_method_visibility_for(klass, method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:78 + def method_defined_at_any_visibility?(klass, method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:81 + def method_visibility_for(object, method_name); end + end +end + +# Raised when an expectation customization method (e.g. `with`, +# `and_return`) is called on a message expectation which has already been +# invoked. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:18 +class RSpec::Mocks::MockExpectationAlreadyInvokedError < ::Exception; end + +# Raised when a message expectation is not satisfied. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:6 +class RSpec::Mocks::MockExpectationError < ::Exception; end + +# An implementation of rspec-mocks' reference interface. +# Used when a string is passed to {ExampleMethods#object_double}, +# and when a string, named class or named module is passed to +# {ExampleMethods#instance_double}, or {ExampleMethods#class_double}. +# Represents a reference to the object named (via a constant lookup) +# by the string. +# @see DirectObjectReference +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:109 +class RSpec::Mocks::NamedObjectReference + # @param const_name [String] constant name + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:111 + def initialize(const_name); end + + # @return [String] the constant name to replace with a double. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:121 + def const_to_replace; end + + # @return [Boolean] true if the named constant is defined, false otherwise. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:116 + def defined?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:124 + def description; end + + # @return [Object, nil] the target of the verifying double (the named object), or + # nil if it is not defined. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:128 + def target; end + + # Yields if the reference target is loaded, providing a generic mechanism + # to optionally run a bit of code only when a reference's target is + # loaded. + # + # @yield [Object] the target object + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:137 + def when_loaded; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:143 + def object; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:31 +class RSpec::Mocks::NegationUnsupportedError < ::StandardError; end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:209 +class RSpec::Mocks::NestedSpace < ::RSpec::Mocks::Space + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:210 + def initialize(parent); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:219 + def constant_mutator_for(name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:215 + def proxies_of(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:223 + def registered?(object); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:233 + def any_instance_recorder_not_found_for(id, klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:229 + def proxy_not_found_for(id, object); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:16 +class RSpec::Mocks::NoCallbackInvocationStrategy + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:17 + def call(_doubled_module); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:149 +class RSpec::Mocks::ObjectMethodReference < ::RSpec::Mocks::MethodReference + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:168 + def find_method(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:164 + def method_defined?(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:160 + def method_implemented?(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:172 + def visibility_from(object); end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/method_reference.rb:150 + def for(object_reference, method_name); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:4 +class RSpec::Mocks::ObjectReference + class << self + # Returns an appropriate Object or Module reference based + # on the given argument. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:7 + def for(object_module_or_name, allow_direct_object_refs = T.unsafe(nil)); end + + private + + # 1.8.7 + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:31 + def anonymous_module?(mod); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:41 + def name_of(mod); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/object_reference.rb:47 +RSpec::Mocks::ObjectReference::MODULE_NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# Similar to an InstanceVerifyingDouble, except that it verifies against +# public methods of the given object. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:112 +class RSpec::Mocks::ObjectVerifyingDouble + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + include ::RSpec::Mocks::ObjectVerifyingDoubleMethods +end + +# An awkward module necessary because we cannot otherwise have +# ClassVerifyingDouble inherit from Module and still share these methods. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:89 +module RSpec::Mocks::ObjectVerifyingDoubleMethods + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:93 + def as_stubbed_const(options = T.unsafe(nil)); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:100 + def __build_mock_proxy(order_group); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:6 +class RSpec::Mocks::OrderGroup + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:7 + def initialize; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:53 + def clear; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:31 + def consume; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:61 + def empty?; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:42 + def handle_order_constraint(expectation); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:19 + def invoked(message); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:26 + def ready_for?(expectation); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:15 + def register(expectation); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:48 + def verify_invocation_order(expectation); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:87 + def expectation_for(message); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:71 + def expectations_invoked_in_order?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:81 + def expected_invocations; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:75 + def invoked_expectations; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/order_group.rb:67 + def remaining_expectations; end +end + +# Raised when doubles or partial doubles are used outside of the per-test lifecycle. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:13 +class RSpec::Mocks::OutsideOfExampleError < ::StandardError; end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:456 +class RSpec::Mocks::PartialClassDoubleProxy < ::RSpec::Mocks::PartialDoubleProxy + include ::RSpec::Mocks::PartialClassDoubleProxyMethods +end + +# @private +# When we mock or stub a method on a class, we have to treat it a bit different, +# because normally singleton method definitions only affect the object on which +# they are defined, but on classes they affect subclasses, too. As a result, +# we need some special handling to get the original method. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:380 +module RSpec::Mocks::PartialClassDoubleProxyMethods + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:381 + def initialize(source_space, *args); end + + # Consider this situation: + # + # class A; end + # class B < A; end + # + # allow(A).to receive(:new) + # expect(B).to receive(:new).and_call_original + # + # When getting the original definition for `B.new`, we cannot rely purely on + # using `B.method(:new)` before our redefinition is defined on `B`, because + # `B.method(:new)` will return a method that will execute the stubbed version + # of the method on `A` since singleton methods on classes are in the lookup + # hierarchy. + # + # To do it properly, we need to find the original definition of `new` from `A` + # from _before_ `A` was stubbed, and we need to rebind it to `B` so that it will + # run with the proper `self`. + # + # That's what this method (together with `original_unbound_method_handle_from_ancestor_for`) + # does. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:406 + def original_method_handle_for(message); end + + protected + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:434 + def method_double_from_ancestor_for(message); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:429 + def original_unbound_method_handle_from_ancestor_for(message); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:444 + def superclass_proxy; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:317 +class RSpec::Mocks::PartialDoubleProxy < ::RSpec::Mocks::Proxy + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:331 + def add_simple_expectation(method_name, response, location); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:337 + def add_simple_stub(method_name, response); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:354 + def message_received(message, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:318 + def original_method_handle_for(message); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:349 + def reset; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:343 + def visibility_for(method_name); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:364 + def any_instance_class_recorder_observing_method?(klass, method_name); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:6 +class RSpec::Mocks::Proxy + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:20 + def initialize(object, order_group, options = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:65 + def add_message_expectation(method_name, opts = T.unsafe(nil), &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:79 + def add_simple_expectation(method_name, response, location); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:140 + def add_simple_stub(method_name, response); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:134 + def add_stub(method_name, opts = T.unsafe(nil), &implementation); end + + # @private + # Tells the object to ignore any messages that aren't explicitly set as + # stubs or message expectations. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:52 + def as_null_object; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:84 + def build_expectation(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:117 + def check_for_unexpected_arguments(expectation); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:34 + def ensure_can_be_proxied!(object); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:15 + def ensure_implemented(*_args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:181 + def has_negative_expectation?(message); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:195 + def message_received(message, *args, **, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:174 + def messages_arg_list; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:260 + def method_double_if_exists_for_message(message); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:45 + def null_object?; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:42 + def object; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:58 + def original_method_handle_for(_message); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:254 + def prepended_modules_of_singleton_class; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:233 + def raise_missing_default_stub_error(expectation, args_for_multiple_calls); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:228 + def raise_unexpected_message_error(method_name, args); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:167 + def received_message?(method_name, *args, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:186 + def record_message_received(message, *args, **, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:145 + def remove_stub(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:150 + def remove_stub_if_present(method_name); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:94 + def replay_received_message_on(expectation, &block); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:160 + def reset; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:155 + def verify; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:238 + def visibility_for(_method_name); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:277 + def find_almost_matching_expectation(method_name, *args, **); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:301 + def find_almost_matching_stub(method_name, *args, **); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:284 + def find_best_matching_expectation_for(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:270 + def find_matching_expectation(method_name, *args, **); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:296 + def find_matching_method_stub(method_name, *args, **); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:266 + def method_double_for(message); end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:244 + def prepended_modules_of(klass); end + end +end + +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:62 +RSpec::Mocks::Proxy::DEFAULT_MESSAGE_EXPECTATION_OPTS = T.let(T.unsafe(nil), Hash) + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 +class RSpec::Mocks::Proxy::SpecificMessage < ::Struct + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:9 + def ==(expectation); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def args; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def args=(_); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def message; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def message=(_); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def object; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def object=(_); end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def [](*_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def inspect; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def keyword_init?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def members; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:8 + def new(*_arg0); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:461 +class RSpec::Mocks::ProxyForNil < ::RSpec::Mocks::PartialDoubleProxy + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:462 + def initialize(order_group); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:470 + def add_message_expectation(method_name, opts = T.unsafe(nil), &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:475 + def add_stub(method_name, opts = T.unsafe(nil), &implementation); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:467 + def disallow_expectations; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:467 + def disallow_expectations=(_arg0); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:468 + def warn_about_expectations; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:468 + def warn_about_expectations=(_arg0); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:512 + def raise_error(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:482 + def set_expectation_behavior; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:507 + def warn(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:496 + def warn_or_raise!(method_name); end +end + +# @private +# Provides a default space implementation for outside +# the scope of an example. Called "root" because it serves +# as the root of the space stack. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:9 +class RSpec::Mocks::RootSpace + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:18 + def any_instance_proxy_for(*_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:14 + def any_instance_recorder_for(*_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:26 + def any_instance_recorders_from_ancestry_of(_object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:44 + def new_scope; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:10 + def proxy_for(*_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:22 + def register_constant_mutator(_mutator); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:36 + def registered?(_object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:30 + def reset_all; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:40 + def superclass_proxy_for(*_args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:33 + def verify_all; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:50 + def raise_lifecycle_message; end +end + +# A message expectation that only allows concrete return values to be set +# for a message. While this same effect can be achieved using a standard +# MessageExpectation, this version is much faster and so can be used as an +# optimization. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:11 +class RSpec::Mocks::SimpleMessageExpectation + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:12 + def initialize(message, response, error_generator, backtrace_line = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:26 + def called_max_times?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:17 + def invoke(*_); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:22 + def matches?(message, *_); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:37 + def unadvise(_); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:30 + def verify_messages_received; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:57 +class RSpec::Mocks::Space + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:60 + def initialize; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:58 + def any_instance_mutex; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:103 + def any_instance_proxy_for(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:93 + def any_instance_recorder_for(klass, only_return_existing = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:58 + def any_instance_recorders; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:131 + def any_instance_recorders_from_ancestry_of(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:89 + def constant_mutator_for(name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:125 + def ensure_registered(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:69 + def new_scope; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:58 + def proxies; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:107 + def proxies_of(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:111 + def proxy_for(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:58 + def proxy_mutex; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:85 + def register_constant_mutator(mutator); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:127 + def registered?(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:78 + def reset_all; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:118 + def superclass_proxy_for(klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:73 + def verify_all; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:184 + def any_instance_recorder_not_found_for(id, klass); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:171 + def class_proxy_with_callback_verification_strategy(object, strategy); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:202 + def id_for(object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:147 + def new_mutex; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:151 + def proxy_not_found_for(id, object); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/space.rb:166 + def superclass_proxy_not_found_for(id, object); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:75 +class RSpec::Mocks::StubChain < ::RSpec::Mocks::MessageChain + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:82 + def expectation(object, message, &return_block); end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_chain.rb:76 + def stub_chain_on(object, *chain, &blk); end + end +end + +# @api private +# Provides methods for enabling and disabling the available syntaxes +# provided by rspec-mocks. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:6 +module RSpec::Mocks::Syntax + class << self + # @api private + # Determines where the methods like `should_receive`, and `stub` are added. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:181 + def default_should_syntax_host; end + + # @api private + # Disables the expect syntax (`expect(dbl).to receive`, `allow(dbl).to receive`, etc). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:150 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # @api private + # Disables the should syntax (`dbl.stub`, `dbl.should_receive`, etc). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:89 + def disable_should(syntax_host = T.unsafe(nil)); end + + # @api private + # Enables the expect syntax (`expect(dbl).to receive`, `allow(dbl).to receive`, etc). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:110 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # @api private + # Enables the should syntax (`dbl.stub`, `dbl.should_receive`, etc). + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:26 + def enable_should(syntax_host = T.unsafe(nil)); end + + # @api private + # Indicates whether or not the expect syntax is enabled. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:175 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # @api private + # Indicates whether or not the should syntax is enabled. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:169 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:8 + def warn_about_should!; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/syntax.rb:13 + def warn_unless_should_configured(method_name, replacement = T.unsafe(nil)); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:63 +class RSpec::Mocks::TargetBase + include ::RSpec::Mocks::TargetDelegationInstanceMethods + extend ::RSpec::Mocks::TargetDelegationClassMethods + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:64 + def initialize(target); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:4 +module RSpec::Mocks::TargetDelegationClassMethods + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:14 + def delegate_not_to(matcher_method, options = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:5 + def delegate_to(matcher_method); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:28 + def disallow_negation(method_name); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:36 +module RSpec::Mocks::TargetDelegationInstanceMethods + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:37 + def target; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:45 + def define_matcher(matcher, name, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:41 + def matcher_allowed?(matcher); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:55 + def raise_negation_unsupported(method_name, matcher); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/targets.rb:49 + def raise_unsupported_matcher(method_name, matcher); end +end + +# Implements the methods needed for a pure test double. RSpec::Mocks::Double +# includes this module, and it is provided for cases where you want a +# pure test double without subclassing RSpec::Mocks::Double. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:6 +module RSpec::Mocks::TestDouble + # Creates a new test double with a `name` (that will be used in error + # messages only) + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:9 + def initialize(name = T.unsafe(nil), stubs = T.unsafe(nil)); end + + # This allows for comparing the mock to other objects that proxy such as + # ActiveRecords belongs_to proxy objects. By making the other object run + # the comparison, we're sure the call gets delegated to the proxy + # target. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:36 + def ==(other); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:58 + def __build_mock_proxy_unless_expired(order_group); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:63 + def __disallow_further_usage!; end + + # Tells the object to respond to all messages. If specific stub values + # are declared, they'll work as expected. If not, the receiver is + # returned. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:23 + def as_null_object; end + + # Override for default freeze implementation to prevent freezing of test + # doubles. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:69 + def freeze; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:41 + def inspect; end + + # Returns true if this object has received `as_null_object` + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:28 + def null_object?; end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:51 + def respond_to?(message, incl_private = T.unsafe(nil)); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:46 + def to_s; end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:118 + def __build_mock_proxy(order_group); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:114 + def __mock_proxy; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:122 + def __raise_expired_error; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:108 + def assign_stubs(stubs); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:127 + def initialize_copy(other); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:76 + def method_missing(message, *args, &block); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:140 +module RSpec::Mocks::TestDoubleFormatter + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:141 + def format(dbl, unwrap = T.unsafe(nil)); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:167 + def name_desc(dbl); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:150 + def type_desc(dbl); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/test_double.rb:162 + def verified_module_desc(dbl); end + end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:308 +class RSpec::Mocks::TestDoubleProxy < ::RSpec::Mocks::Proxy + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:309 + def reset; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:29 +class RSpec::Mocks::UnsupportedMatcherError < ::StandardError; end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:6 +module RSpec::Mocks::VerifyingDouble + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:55 + def initialize(doubled_module, *args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:40 + def __send__(name, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:20 + def method_missing(message, *args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:7 + def respond_to?(message, include_private = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_double.rb:50 + def send(name, *args, **, &block); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/error_generator.rb:33 +class RSpec::Mocks::VerifyingDoubleNotDefinedError < ::StandardError; end + +# Used in place of a `VerifyingExistingMethodDouble` for the specific case +# of mocking or stubbing a `new` method on a class. In this case, we substitute +# the method signature from `#initialize` since new's signature is just `*args`. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:215 +class RSpec::Mocks::VerifyingExistingClassNewMethodDouble < ::RSpec::Mocks::VerifyingExistingMethodDouble + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:216 + def with_signature; end +end + +# A VerifyingMethodDouble fetches the method to verify against from the +# original object, using a MethodReference. This works for pure doubles, +# but when the original object is itself the one being modified we need to +# collapse the reference and the method double into a single object so that +# we can access the original pristine method definition. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:180 +class RSpec::Mocks::VerifyingExistingMethodDouble < ::RSpec::Mocks::VerifyingMethodDouble + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:181 + def initialize(object, method_name, proxy); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:195 + def unimplemented?; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:191 + def with_signature; end + + class << self + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:199 + def for(object, method_name, proxy); end + end +end + +# A message expectation that knows about the real implementation of the +# message being expected, so that it can verify that any expectations +# have the valid arguments. +# @api private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_message_expectation.rb:9 +class RSpec::Mocks::VerifyingMessageExpectation < ::RSpec::Mocks::MessageExpectation + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_message_expectation.rb:20 + def initialize(*args); end + + # A level of indirection is used here rather than just passing in the + # method itself, since method look up is expensive and we only want to + # do it if actually needed. + # + # Conceptually the method reference makes more sense as a constructor + # argument since it should be immutable, but it is significantly more + # straight forward to build the object in pieces so for now it stays as + # an accessor. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_message_expectation.rb:18 + def method_reference; end + + # A level of indirection is used here rather than just passing in the + # method itself, since method look up is expensive and we only want to + # do it if actually needed. + # + # Conceptually the method reference makes more sense as a constructor + # argument since it should be immutable, but it is significantly more + # straight forward to build the object in pieces so for now it stays as + # an accessor. + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_message_expectation.rb:18 + def method_reference=(_arg0); end + + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_message_expectation.rb:25 + def with(*args, **, &block); end + + private + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_message_expectation.rb:38 + def validate_expected_arguments!; end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:139 +class RSpec::Mocks::VerifyingMethodDouble < ::RSpec::Mocks::MethodDouble + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:140 + def initialize(object, method_name, proxy, method_reference); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:149 + def add_expectation(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:154 + def add_stub(*args, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:145 + def message_expectation_class; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:159 + def proxy_method_invoked(obj, *args, **, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:165 + def validate_arguments!(actual_args); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:134 +class RSpec::Mocks::VerifyingPartialClassDoubleProxy < ::RSpec::Mocks::VerifyingPartialDoubleProxy + include ::RSpec::Mocks::PartialClassDoubleProxyMethods +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:107 +class RSpec::Mocks::VerifyingPartialDoubleProxy < ::RSpec::Mocks::PartialDoubleProxy + include ::RSpec::Mocks::VerifyingProxyMethods + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:110 + def initialize(object, expectation_ordering, optional_callback_invocation_strategy = T.unsafe(nil)); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:123 + def ensure_implemented(_method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:128 + def method_reference; end +end + +# A verifying proxy mostly acts like a normal proxy, except that it +# contains extra logic to try and determine the validity of any expectation +# set on it. This includes whether or not methods have been defined and the +# validity of arguments on method calls. +# +# In all other ways this behaves like a normal proxy. It only adds the +# verification behaviour to specific methods then delegates to the parent +# implementation. +# +# These checks are only activated if the doubled class has already been +# loaded, otherwise they are disabled. This allows for testing in +# isolation. +# +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:71 +class RSpec::Mocks::VerifyingProxy < ::RSpec::Mocks::TestDoubleProxy + include ::RSpec::Mocks::VerifyingProxyMethods + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:74 + def initialize(object, order_group, doubled_module, method_reference_class); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:88 + def method_reference; end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:98 + def validate_arguments!(method_name, args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:94 + def visibility_for(method_name); end +end + +# @private +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:22 +module RSpec::Mocks::VerifyingProxyMethods + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:33 + def add_message_expectation(method_name, opts = T.unsafe(nil), &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:28 + def add_simple_stub(method_name, *args); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:23 + def add_stub(method_name, opts = T.unsafe(nil), &implementation); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:38 + def ensure_implemented(method_name); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/verifying_proxy.rb:48 + def ensure_publicly_implemented(method_name, _object); end +end + +# Version information for RSpec mocks. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/version.rb:4 +module RSpec::Mocks::Version; end + +# Version of RSpec mocks currently in use in SemVer format. +# +# pkg:gem/rspec-mocks#lib/rspec/mocks/version.rb:6 +RSpec::Mocks::Version::STRING = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rspec-support@3.13.7.rbi b/sorbet/rbi/gems/rspec-support@3.13.7.rbi new file mode 100644 index 0000000..7d979a8 --- /dev/null +++ b/sorbet/rbi/gems/rspec-support@3.13.7.rbi @@ -0,0 +1,1272 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rspec-support` gem. +# Please instead update this file by running `bin/tapioca gem rspec-support`. + + +# pkg:gem/rspec-support#lib/rspec/support.rb:3 +module RSpec + extend ::RSpec::Support::Warnings +end + +# Consistent implementation for "cleaning" the caller method to strip out +# non-rspec lines. This enables errors to be reported at the call site in +# the code using the library, which is far more useful than the particular +# internal method that raised an error. +# +# pkg:gem/rspec-support#lib/rspec/support/caller_filter.rb:10 +class RSpec::CallerFilter + class << self + # Earlier rubies do not support the two argument form of `caller`. This + # fallback is logically the same, but slower. + # This supports args because it's more efficient when the caller specifies + # these. It allows us to skip frames the caller knows are part of RSpec, + # and to decrease the increment size if the caller is confident the line will + # be found in a small number of stack frames from `skip_frames`. + # + # Note that there is a risk to passing a `skip_frames` value that is too high: + # If it skipped the first non-rspec line, then this method would return the + # 2nd or 3rd (or whatever) non-rspec line. Thus, you generally shouldn't pass + # values for these parameters, particularly since most places that use this are + # not hot spots (generally it gets used for deprecation warnings). However, + # if you do have a hot spot that calls this, passing `skip_frames` can make + # a significant difference. Just make sure that that particular use is tested + # so that if the provided `skip_frames` changes to no longer be accurate in + # such a way that would return the wrong stack frame, a test will fail to tell you. + # + # See benchmarks/skip_frames_for_caller_filter.rb for measurements. + # + # pkg:gem/rspec-support#lib/rspec/support/caller_filter.rb:49 + def first_non_rspec_line(skip_frames = T.unsafe(nil), increment = T.unsafe(nil)); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/caller_filter.rb:20 +RSpec::CallerFilter::ADDITIONAL_TOP_LEVEL_FILES = T.let(T.unsafe(nil), Array) + +# rubygems/core_ext/kernel_require.rb isn't actually part of rspec (obviously) but we want +# it ignored when we are looking for the first meaningful line of the backtrace outside +# of RSpec. It can show up in the backtrace as the immediate first caller +# when `CallerFilter.first_non_rspec_line` is called from the top level of a required +# file, but it depends on if rubygems is loaded or not. We don't want to have to deal +# with this complexity in our `RSpec.deprecate` calls, so we ignore it here. +# +# pkg:gem/rspec-support#lib/rspec/support/caller_filter.rb:30 +RSpec::CallerFilter::IGNORE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rspec-support#lib/rspec/support/caller_filter.rb:22 +RSpec::CallerFilter::LIB_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rspec-support#lib/rspec/support/caller_filter.rb:11 +RSpec::CallerFilter::RSPEC_LIBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-support#lib/rspec/support.rb:4 +module RSpec::Support + class << self + # @api private + # + # Used internally to get a class of a given object, even if it does not respond to #class. + # + # pkg:gem/rspec-support#lib/rspec/support.rb:86 + def class_of(object); end + + # @api private + # + # Defines a helper method that is optimized to require files from the + # named lib. The passed block MUST be `{ |f| require_relative f }` + # because for `require_relative` to work properly from within the named + # lib the line of code must be IN that lib. + # + # `require_relative` is preferred when available because it is always O(1), + # regardless of the number of dirs in $LOAD_PATH. `require`, on the other + # hand, does a linear O(N) search over the dirs in the $LOAD_PATH until + # it can resolve the file relative to one of the dirs. + # + # pkg:gem/rspec-support#lib/rspec/support.rb:16 + def define_optimized_require_for_rspec(lib, &require_relative); end + + # Remove a previously registered matcher. Useful for cleaning up after + # yourself in specs. + # + # @private + # + # pkg:gem/rspec-support#lib/rspec/support/matcher_definition.rb:24 + def deregister_matcher_definition(&block); end + + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:113 + def failure_notifier; end + + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:105 + def failure_notifier=(callable); end + + # @private + # + # pkg:gem/rspec-support#lib/rspec/support/matcher_definition.rb:29 + def is_a_matcher?(object); end + + # @private + # + # pkg:gem/rspec-support#lib/rspec/support/matcher_definition.rb:6 + def matcher_definitions; end + + # pkg:gem/rspec-support#lib/rspec/support.rb:54 + def method_handle_for(object, method_name); end + + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:118 + def notify_failure(failure, options = T.unsafe(nil)); end + + # Used internally to break cyclic dependency between mocks, expectations, + # and support. We don't currently have a consistent implementation of our + # matchers, though we are considering changing that: + # https://github.com/rspec/rspec-mocks/issues/513 + # + # @private + # + # pkg:gem/rspec-support#lib/rspec/support/matcher_definition.rb:16 + def register_matcher_definition(&block); end + + # pkg:gem/rspec-support#lib/rspec/support.rb:25 + def require_rspec_support(f); end + + # @api private + # + # gives a string representation of an object for use in RSpec descriptions + # + # pkg:gem/rspec-support#lib/rspec/support/matcher_definition.rb:36 + def rspec_description_for_object(object); end + + # pkg:gem/rspec-support#lib/rspec/support.rb:95 + def thread_local_data; end + + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:140 + def warning_notifier; end + + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:133 + def warning_notifier=(_arg0); end + + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:123 + def with_failure_notifier(callable); end + end +end + +# @private +# +# pkg:gem/rspec-support#lib/rspec/support.rb:145 +module RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue + class << self + # pkg:gem/rspec-support#lib/rspec/support.rb:150 + def ===(exception); end + end +end + +# These exceptions are dangerous to rescue as rescuing them +# would interfere with things we should not interfere with. +# +# pkg:gem/rspec-support#lib/rspec/support.rb:148 +RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue::AVOID_RESCUING = T.let(T.unsafe(nil), Array) + +# Deals with the slightly different semantics of block arguments. +# For methods, arguments are required unless a default value is provided. +# For blocks, arguments are optional, even if no default value is provided. +# +# However, we want to treat block args as required since you virtually +# always want to pass a value for each received argument and our +# `and_yield` has treated block args as required for many years. +# +# @api private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:293 +class RSpec::Support::BlockSignature < ::RSpec::Support::MethodSignature + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:295 + def classify_parameters; end +end + +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/comparable_version.rb:6 +class RSpec::Support::ComparableVersion + include ::Comparable + + # pkg:gem/rspec-support#lib/rspec/support/comparable_version.rb:11 + def initialize(string); end + + # pkg:gem/rspec-support#lib/rspec/support/comparable_version.rb:15 + def <=>(other); end + + # pkg:gem/rspec-support#lib/rspec/support/comparable_version.rb:37 + def segments; end + + # pkg:gem/rspec-support#lib/rspec/support/comparable_version.rb:9 + def string; end +end + +# @private +# +# pkg:gem/rspec-support#lib/rspec/support.rb:110 +RSpec::Support::DEFAULT_FAILURE_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# @private +# +# pkg:gem/rspec-support#lib/rspec/support.rb:137 +RSpec::Support::DEFAULT_WARNING_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# pkg:gem/rspec-support#lib/rspec/support/differ.rb:11 +class RSpec::Support::Differ + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:68 + def initialize(opts = T.unsafe(nil)); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:64 + def color?; end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:12 + def diff(actual, expected); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:58 + def diff_as_object(actual, expected); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:29 + def diff_as_string(actual, expected); end + + private + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:129 + def add_old_hunk_to_hunk(hunk, oldhunk); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:125 + def add_to_output(output, string); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:79 + def all_strings?(*args); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:83 + def any_multiline_strings?(*args); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:154 + def blue(text); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:116 + def build_hunks(actual, expected); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:91 + def coerce_to_string(string_or_array); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:142 + def color(text, color_code); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:162 + def color_diff(diff); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:96 + def diffably_stringify(array); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:120 + def finalize_output(output, final_line); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:138 + def format_type; end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:150 + def green(text); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:203 + def handle_encoding_errors(actual, expected); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:193 + def hash_to_string(hash); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:107 + def multiline?(string); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:87 + def no_numbers?(*args); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:75 + def no_procs?(*args); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:158 + def normal(text); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:179 + def object_to_string(object); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:146 + def red(text); end + + # pkg:gem/rspec-support#lib/rspec/support/differ.rb:133 + def safely_flatten(array); end +end + +# @api private +# +# Replacement for fileutils#mkdir_p because we don't want to require parts +# of stdlib in RSpec. +# +# pkg:gem/rspec-support#lib/rspec/support/directory_maker.rb:11 +class RSpec::Support::DirectoryMaker + class << self + # @api private + # + # Implements nested directory construction + # + # pkg:gem/rspec-support#lib/rspec/support/directory_maker.rb:15 + def mkdir_p(path); end + + private + + # pkg:gem/rspec-support#lib/rspec/support/directory_maker.rb:57 + def directory_exists?(dirname); end + + # pkg:gem/rspec-support#lib/rspec/support/directory_maker.rb:52 + def generate_path(stack, part); end + + # pkg:gem/rspec-support#lib/rspec/support/directory_maker.rb:49 + def generate_stack(path); end + end +end + +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:6 +class RSpec::Support::EncodedString + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:16 + def initialize(string, encoding = T.unsafe(nil)); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:28 + def <<(string); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:25 + def ==(*args, &block); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:25 + def empty?(*args, &block); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:25 + def encoding(*args, &block); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:25 + def eql?(*args, &block); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:25 + def lines(*args, &block); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:21 + def source_encoding; end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:41 + def split(regex_or_string); end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:46 + def to_s; end + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:49 + def to_str; end + + private + + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:139 + def detect_source_encoding(string); end + + # Encoding Exceptions: + # + # Raised by Encoding and String methods: + # Encoding::UndefinedConversionError: + # when a transcoding operation fails + # if the String contains characters invalid for the target encoding + # e.g. "\x80".encode('UTF-8','ASCII-8BIT') + # vs "\x80".encode('UTF-8','ASCII-8BIT', undef: :replace, replace: '') + # # => '' + # Encoding::CompatibilityError + # when Encoding.compatible?(str1, str2) is nil + # e.g. utf_16le_emoji_string.split("\n") + # e.g. valid_unicode_string.encode(utf8_encoding) << ascii_string + # Encoding::InvalidByteSequenceError: + # when the string being transcoded contains a byte invalid for + # either the source or target encoding + # e.g. "\x80".encode('UTF-8','US-ASCII') + # vs "\x80".encode('UTF-8','US-ASCII', invalid: :replace, replace: '') + # # => '' + # ArgumentError + # when operating on a string with invalid bytes + # e.g."\x80".split("\n") + # TypeError + # when a symbol is passed as an encoding + # Encoding.find(:"UTF-8") + # when calling force_encoding on an object + # that doesn't respond to #to_str + # + # Raised by transcoding methods: + # Encoding::ConverterNotFoundError: + # when a named encoding does not correspond with a known converter + # e.g. 'abc'.force_encoding('UTF-8').encode('foo') + # or a converter path cannot be found + # e.g. "\x80".force_encoding('ASCII-8BIT').encode('Emacs-Mule') + # + # Raised by byte <-> char conversions + # RangeError: out of char range + # e.g. the UTF-16LE emoji: 128169.chr + # + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:93 + def matching_encoding(string); end + + # https://github.com/ruby/ruby/blob/eeb05e8c11/doc/NEWS-2.1.0#L120-L123 + # https://github.com/ruby/ruby/blob/v2_1_0/string.c#L8242 + # https://github.com/hsbt/string-scrub + # https://github.com/rubinius/rubinius/blob/v2.5.2/kernel/common/string.rb#L1913-L1972 + # http://stackoverflow.com/a/8711118/879854 + # Loop over chars in a string replacing chars + # with invalid encoding, which is a pretty good proxy + # for the invalid byte sequence that causes an ArgumentError + # + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:124 + def remove_invalid_bytes(string); end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:143 + def pick_encoding(source_a, source_b); end + end +end + +# Ruby's default replacement string is: +# U+FFFD ("\xEF\xBF\xBD"), for Unicode encoding forms, else +# ? ("\x3F") +# +# pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:14 +RSpec::Support::EncodedString::REPLACE = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:9 +RSpec::Support::EncodedString::US_ASCII = T.let(T.unsafe(nil), String) + +# Reduce allocations by storing constants. +# +# pkg:gem/rspec-support#lib/rspec/support/encoded_string.rb:8 +RSpec::Support::EncodedString::UTF_8 = T.let(T.unsafe(nil), String) + +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:9 +class RSpec::Support::HunkGenerator + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:10 + def initialize(actual, expected); end + + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:15 + def hunks; end + + private + + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:32 + def actual_lines; end + + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:36 + def build_hunk(piece); end + + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:44 + def context_lines; end + + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:24 + def diffs; end + + # pkg:gem/rspec-support#lib/rspec/support/hunk_generator.rb:28 + def expected_lines; end +end + +# @api private +# +# pkg:gem/rspec-support#lib/rspec/support.rb:40 +RSpec::Support::KERNEL_METHOD_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# Allows matchers to be used instead of providing keyword arguments. In +# practice, when this happens only the arity of the method is verified. +# +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:420 +class RSpec::Support::LooseSignatureVerifier < ::RSpec::Support::MethodSignatureVerifier + private + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:423 + def split_args(args); end +end + +# If a matcher is used in a signature in place of keyword arguments, all +# keyword argument validation needs to be skipped since the matcher is +# opaque. +# +# Instead, keyword arguments will be validated when the method is called +# and they are actually known. +# +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:440 +class RSpec::Support::LooseSignatureVerifier::SignatureWithKeywordArgumentsMatcher + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:441 + def initialize(signature); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:461 + def has_kw_args_in?(args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:449 + def invalid_kw_args_from(_kw_args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:445 + def missing_kw_args_from(_kw_args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:453 + def non_kw_args_arity_description; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:457 + def valid_non_kw_args?(*args); end +end + +# Extracts info about the number of arguments and allowed/required +# keyword args of a given method. +# +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:13 +class RSpec::Support::MethodSignature + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:16 + def initialize(method); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:123 + def arbitrary_kw_args?; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:38 + def classify_arity(arity = T.unsafe(nil)); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:131 + def classify_parameters; end + + # Without considering what the last arg is, could it + # contain keyword arguments? + # + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:117 + def could_contain_kw_args?(args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:51 + def description; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:84 + def has_kw_args_in?(args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:77 + def invalid_kw_args_from(given_kw_args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:14 + def max_non_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:14 + def min_non_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:73 + def missing_kw_args_from(given_kw_args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:23 + def non_kw_args_arity_description; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:14 + def optional_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:14 + def required_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:127 + def unlimited_args?; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:31 + def valid_non_kw_args?(positional_arg_count, optional_max_arg_count = T.unsafe(nil)); end +end + +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:187 +RSpec::Support::MethodSignature::INFINITY = T.let(T.unsafe(nil), Float) + +# Encapsulates expectations about the number of arguments and +# allowed/required keyword args of a given method. +# +# @api private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:244 +class RSpec::Support::MethodSignatureExpectation + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:245 + def initialize; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:272 + def empty?; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:256 + def expect_arbitrary_keywords; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:256 + def expect_arbitrary_keywords=(_arg0); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:256 + def expect_unlimited_arguments; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:256 + def expect_unlimited_arguments=(_arg0); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:254 + def keywords; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:279 + def keywords=(values); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:254 + def max_count; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:258 + def max_count=(number); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:254 + def min_count; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:265 + def min_count=(number); end +end + +# Abstract base class for signature verifiers. +# +# @api private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:305 +class RSpec::Support::MethodSignatureVerifier + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:308 + def initialize(signature, args = T.unsafe(nil)); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:351 + def error_message; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:306 + def kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:306 + def max_non_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:306 + def min_non_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:306 + def non_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:343 + def valid?; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:315 + def with_expectation(expectation); end + + private + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:382 + def arbitrary_kw_args?; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:378 + def invalid_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:374 + def missing_kw_args; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:390 + def split_args(args); end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:386 + def unlimited_args?; end + + # pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:370 + def valid_non_kw_args?; end +end + +# On 1.8.7, it's in the stdlib. +# We don't want to load the stdlib, b/c this is a test tool, and can affect +# the test environment, causing tests to pass where they should fail. +# +# So we're transcribing/modifying it from +# https://github.com/ruby/ruby/blob/v1_8_7_374/lib/thread.rb#L56 +# Some methods we don't need are deleted. Anything I don't +# understand (there's quite a bit, actually) is left in. +# +# Some formatting changes are made to appease the robot overlord: +# https://travis-ci.org/rspec/rspec-core/jobs/54410874 +# @private +# On 1.9 and up, this is in core, so we just use the real one +# +# pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:65 +class RSpec::Support::Mutex < ::Thread::Mutex + class << self + # pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:70 + def new; end + end +end + +# If you mock Mutex.new you break our usage of Mutex, so +# instead we capture the original method to return Mutexes. +# +# pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:68 +RSpec::Support::Mutex::NEW_MUTEX_METHOD = T.let(T.unsafe(nil), Method) + +# @api private +# +# Provides query methods for different OS or OS features. +# +# pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:11 +module RSpec::Support::OS + private + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:14 + def windows?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:18 + def windows_file_path?; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:14 + def windows?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:18 + def windows_file_path?; end + end +end + +# Provide additional output details beyond what `inspect` provides when +# printing Time, DateTime, or BigDecimal +# @api private +# +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:10 +class RSpec::Support::ObjectFormatter + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:29 + def initialize(max_formatted_output_length = T.unsafe(nil)); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:34 + def format(object); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:13 + def max_formatted_output_length; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:13 + def max_formatted_output_length=(_arg0); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:72 + def prepare_array(array); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:96 + def prepare_element(element); end + + # Prepares the provided object to be formatted by wrapping it as needed + # in something that, when `inspect` is called on it, will produce the + # desired output. + # + # This allows us to apply the desired formatting to hash/array data structures + # at any level of nesting, simply by walking that structure and replacing items + # with custom items that have `inspect` defined to return the desired output + # for that item. Then we can just use `Array#inspect` or `Hash#inspect` to + # format the entire thing. + # + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:58 + def prepare_for_inspection(object); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:78 + def prepare_hash(input_hash); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:115 + def recursive_structure?(object); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:88 + def sort_hash_keys(input_hash); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:108 + def with_entering_structure(structure); end + + private + + # Returns the substring defined by the start_index and end_index + # If the string ends with a partial ANSI code code then that + # will be removed as printing partial ANSI + # codes to the terminal can lead to corruption + # + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:270 + def truncate_string(str, start_index, end_index); end + + class << self + # Methods are deferred to a default instance of the class to maintain the interface + # For example, calling ObjectFormatter.format is still possible + # + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:17 + def default_instance; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:21 + def format(object); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:25 + def prepare_for_inspection(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 +class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def formatter; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def formatter=(_); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:134 + def inspect; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def object; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def object=(_); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:138 + def pretty_print(pp); end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def [](*_arg0); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:130 + def can_inspect?(_object); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def inspect; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def keyword_init?; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def members; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:129 + def new(*_arg0); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:179 +class RSpec::Support::ObjectFormatter::BigDecimalInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:184 + def inspect; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:180 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:161 +class RSpec::Support::ObjectFormatter::DateTimeInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # ActiveSupport sometimes overrides inspect. If `ActiveSupport` is + # defined use a custom format string that includes more time precision. + # + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:170 + def inspect; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:164 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:162 +RSpec::Support::ObjectFormatter::DateTimeInspector::FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:226 +class RSpec::Support::ObjectFormatter::DelegatorInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:231 + def inspect; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:227 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:189 +class RSpec::Support::ObjectFormatter::DescribableMatcherInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:194 + def inspect; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:190 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:11 +RSpec::Support::ObjectFormatter::ELLIPSIS = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:249 +RSpec::Support::ObjectFormatter::INSPECTOR_CLASSES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 +class RSpec::Support::ObjectFormatter::InspectableItem < ::Struct + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:120 + def inspect; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:124 + def pretty_print(pp); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def text; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def text=(_); end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def [](*_arg0); end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def inspect; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def keyword_init?; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def members; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:119 + def new(*_arg0); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:236 +class RSpec::Support::ObjectFormatter::InspectableObjectInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:244 + def inspect; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:237 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:143 +class RSpec::Support::ObjectFormatter::TimeInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # for 1.8.7 + # + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:151 + def inspect; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:146 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:144 +RSpec::Support::ObjectFormatter::TimeInspector::FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:199 +class RSpec::Support::ObjectFormatter::UninspectableObjectInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:209 + def inspect; end + + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:213 + def klass; end + + # http://stackoverflow.com/a/2818916 + # + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:218 + def native_object_id; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:202 + def can_inspect?(object); end + end +end + +# pkg:gem/rspec-support#lib/rspec/support/object_formatter.rb:200 +RSpec::Support::ObjectFormatter::UninspectableObjectInspector::OBJECT_ID_FORMAT = T.let(T.unsafe(nil), String) + +# Provides recursive constant lookup methods useful for +# constant stubbing. +# +# pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:7 +module RSpec::Support::RecursiveConstMethods + # pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:45 + def const_defined_on?(mod, const_name); end + + # pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:53 + def constants_defined_on(mod); end + + # pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:49 + def get_const_defined_on(mod, const_name); end + + # pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:73 + def normalize_const_name(const_name); end + + # pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:64 + def recursive_const_defined?(const_name); end + + # pkg:gem/rspec-support#lib/rspec/support/recursive_const_methods.rb:58 + def recursive_const_get(const_name); end +end + +# Allows a thread to lock out other threads from a critical section of code, +# while allowing the thread with the lock to reenter that section. +# +# Based on Monitor as of 2.2 - +# https://github.com/ruby/ruby/blob/eb7ddaa3a47bf48045d26c72eb0f263a53524ebc/lib/monitor.rb#L9 +# +# Depends on Mutex, but Mutex is only available as part of core since 1.9.1: +# exists - http://ruby-doc.org/core-1.9.1/Mutex.html +# dne - http://ruby-doc.org/core-1.9.0/Mutex.html +# +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:16 +class RSpec::Support::ReentrantMutex + # pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:17 + def initialize; end + + # pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:23 + def synchronize; end + + private + + # pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:35 + def enter; end + + # pkg:gem/rspec-support#lib/rspec/support/reentrant_mutex.rb:40 + def exit; end +end + +# @api private +# +# Provides query methods for different rubies +# +# pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:26 +module RSpec::Support::Ruby + private + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:29 + def jruby?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:37 + def jruby_9000?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:33 + def jruby_version; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:49 + def mri?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:45 + def non_mri?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:41 + def rbx?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:53 + def truffleruby?; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:29 + def jruby?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:37 + def jruby_9000?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:33 + def jruby_version; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:49 + def mri?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:45 + def non_mri?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:41 + def rbx?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:53 + def truffleruby?; end + end +end + +# @api private +# +# Provides query methods for ruby features that differ among +# implementations. +# +# pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:62 +module RSpec::Support::RubyFeatures + private + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:85 + def caller_locations_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:155 + def distincts_kw_args_from_positional_hash?; end + + # On JRuby 1.7 `--1.8` mode, `Process.respond_to?(:fork)` returns true, + # but when you try to fork, it raises an error: + # NotImplementedError: fork is not available on this platform + # + # When we drop support for JRuby 1.7 and/or Ruby 1.8, we can drop + # this special case. + # + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:76 + def fork_supported?; end + + # https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments + # + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:111 + def kw_arg_separation?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:160 + def kw_args_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:216 + def module_prepends_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:212 + def module_refinement_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:81 + def optional_and_splat_args_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:164 + def required_kw_args_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:146 + def ripper_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:90 + def supports_exception_cause?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:168 + def supports_rebinding_module_methods?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:100 + def supports_syntax_suggest?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:121 + def supports_taint?; end + + class << self + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:85 + def caller_locations_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:155 + def distincts_kw_args_from_positional_hash?; end + + # On JRuby 1.7 `--1.8` mode, `Process.respond_to?(:fork)` returns true, + # but when you try to fork, it raises an error: + # NotImplementedError: fork is not available on this platform + # + # When we drop support for JRuby 1.7 and/or Ruby 1.8, we can drop + # this special case. + # + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:76 + def fork_supported?; end + + # https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments + # + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:111 + def kw_arg_separation?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:160 + def kw_args_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:216 + def module_prepends_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:212 + def module_refinement_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:81 + def optional_and_splat_args_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:164 + def required_kw_args_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:146 + def ripper_supported?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:90 + def supports_exception_cause?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:168 + def supports_rebinding_module_methods?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:100 + def supports_syntax_suggest?; end + + # pkg:gem/rspec-support#lib/rspec/support/ruby_features.rb:121 + def supports_taint?; end + end +end + +# Figures out whether a given method can accept various arguments. +# Surprisingly non-trivial. +# +# @private +# +# pkg:gem/rspec-support#lib/rspec/support/method_signature_verifier.rb:414 +RSpec::Support::StrictSignatureVerifier = RSpec::Support::MethodSignatureVerifier + +# pkg:gem/rspec-support#lib/rspec/support/version.rb:5 +module RSpec::Support::Version; end + +# pkg:gem/rspec-support#lib/rspec/support/version.rb:6 +RSpec::Support::Version::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/rspec-support#lib/rspec/support/warnings.rb:8 +module RSpec::Support::Warnings + # pkg:gem/rspec-support#lib/rspec/support/warnings.rb:9 + def deprecate(deprecated, options = T.unsafe(nil)); end + + # @private + # + # Used internally to print deprecation warnings + # when rspec-core isn't loaded + # + # pkg:gem/rspec-support#lib/rspec/support/warnings.rb:17 + def warn_deprecation(message, options = T.unsafe(nil)); end + + # @private + # + # Used internally to print longer warnings + # + # pkg:gem/rspec-support#lib/rspec/support/warnings.rb:31 + def warn_with(message, options = T.unsafe(nil)); end + + # @private + # + # Used internally to print warnings + # + # pkg:gem/rspec-support#lib/rspec/support/warnings.rb:24 + def warning(text, options = T.unsafe(nil)); end +end + +# pkg:gem/rspec-support#lib/rspec/support/with_keywords_when_needed.rb:7 +module RSpec::Support::WithKeywordsWhenNeeded + private + + # Remove this in RSpec 4 in favour of explicitly passed in kwargs where + # this is used. Works around a warning in Ruby 2.7 + # + # pkg:gem/rspec-support#lib/rspec/support/with_keywords_when_needed.rb:17 + def class_exec(klass, *args, **, &block); end + + class << self + # Remove this in RSpec 4 in favour of explicitly passed in kwargs where + # this is used. Works around a warning in Ruby 2.7 + # + # pkg:gem/rspec-support#lib/rspec/support/with_keywords_when_needed.rb:17 + def class_exec(klass, *args, **, &block); end + end +end diff --git a/sorbet/rbi/gems/rspec@3.13.2.rbi b/sorbet/rbi/gems/rspec@3.13.2.rbi new file mode 100644 index 0000000..65adec4 --- /dev/null +++ b/sorbet/rbi/gems/rspec@3.13.2.rbi @@ -0,0 +1,15 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rspec` gem. +# Please instead update this file by running `bin/tapioca gem rspec`. + + +# pkg:gem/rspec#lib/rspec/version.rb:1 +module RSpec; end + +# pkg:gem/rspec#lib/rspec/version.rb:2 +module RSpec::Version; end + +# pkg:gem/rspec#lib/rspec/version.rb:3 +RSpec::Version::STRING = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rubocop-ast@1.50.0.rbi b/sorbet/rbi/gems/rubocop-ast@1.50.0.rbi new file mode 100644 index 0000000..2551454 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-ast@1.50.0.rbi @@ -0,0 +1,7237 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-ast` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-ast`. + + +class Parser::Source::Range + include ::RuboCop::AST::Ext::Range +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/ext/range.rb:3 +module RuboCop; end + +# ... +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/ext/range.rb:4 +module RuboCop::AST + extend ::RuboCop::AST::RuboCopCompatibility +end + +# A node extension for `alias` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `alias` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/alias_node.rb:8 +class RuboCop::AST::AliasNode < ::RuboCop::AST::Node + # Returns the new identifier as specified by the `alias`. + # + # @return [SymbolNode] the new identifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/alias_node.rb:19 + def new_identifier; end + + # Returns the old identifier as specified by the `alias`. + # + # @return [SymbolNode] the old identifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/alias_node.rb:12 + def old_identifier; end +end + +# A node extension for `op_asgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/and_asgn_node.rb:8 +class RuboCop::AST::AndAsgnNode < ::RuboCop::AST::OpAsgnNode + # The operator being used for assignment as a symbol. + # + # @return [Symbol] the assignment operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/and_asgn_node.rb:12 + def operator; end +end + +# A node extension for `and` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `and` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/and_node.rb:8 +class RuboCop::AST::AndNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BinaryOperatorNode + include ::RuboCop::AST::PredicateOperatorNode + + # Returns the alternate operator of the `and` as a string. + # Returns `and` for `&&` and vice versa. + # + # @return [String] the alternate of the `and` operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/and_node.rb:16 + def alternate_operator; end + + # Returns the inverse keyword of the `and` node as a string. + # Returns `||` for `&&` and `or` for `and`. + # + # @return [String] the inverse of the `and` operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/and_node.rb:24 + def inverse_operator; end +end + +# A node extension for `arg`, `optarg`, `restarg`, `kwarg`, `kwoptarg`, +# `kwrestarg`, `blockarg`, `shadowarg` and `forward_arg` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all `arg` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/arg_node.rb:9 +class RuboCop::AST::ArgNode < ::RuboCop::AST::Node + # Checks whether the argument has a default value + # + # @return [Boolean] whether the argument has a default value + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/arg_node.rb:29 + def default?; end + + # Returns the default value of the argument, if any. + # + # @return [Node, nil] the default value of the argument + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/arg_node.rb:20 + def default_value; end + + # Returns the name of an argument. + # + # @return [Symbol, nil] the name of the argument + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/arg_node.rb:13 + def name; end +end + +# A node extension for `args` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `args` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/args_node.rb:8 +class RuboCop::AST::ArgsNode < ::RuboCop::AST::Node + include ::RuboCop::AST::CollectionNode + + # Yield each argument from the collection. + # Arguments can be inside `mlhs` nodes in the case of destructuring, so this + # flattens the collection to just `arg`, `optarg`, `restarg`, `kwarg`, + # `kwoptarg`, `kwrestarg`, `blockarg`, `forward_arg` and `shadowarg`. + # + # @return [Array] array of argument nodes. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/args_node.rb:34 + def argument_list; end + + # It returns true if arguments are empty and delimiters do not exist. + # @example: + # # true + # def x; end + # x { } + # -> {} + # + # # false + # def x(); end + # def x a; end + # x { || } + # -> () {} + # -> a {} + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/args_node.rb:24 + def empty_and_without_delimiters?; end +end + +# A node extension for `array` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `array` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:8 +class RuboCop::AST::ArrayNode < ::RuboCop::AST::Node + # Checks whether the `array` literal is delimited by either percent or + # square brackets + # + # @return [Boolean] whether the array is enclosed in percent or square + # brackets + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:64 + def bracketed?; end + + # Calls the given block for each `value` node in the `array` literal. + # If no block is given, an `Enumerator` is returned. + # + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:25 + def each_value(&block); end + + # Checks whether the `array` literal is delimited by percent brackets. + # + # @overload percent_literal? + # Check for any percent literal. + # + # @overload percent_literal?(type) + # Check for percent literal of type `type`. + # + # @param type [Symbol] an optional percent literal type + # + # @return [Boolean] whether the array is enclosed in percent brackets + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:51 + def percent_literal?(type = T.unsafe(nil)); end + + # Checks whether the `array` literal is delimited by square brackets. + # + # @return [Boolean] whether the array is enclosed in square brackets + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:36 + def square_brackets?; end + + # Returns an array of all value nodes in the `array` literal. + # + # @return [Array] an array of value nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:18 + def values; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/array_node.rb:9 +RuboCop::AST::ArrayNode::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Hash) + +# A node extension for `lvasgn`, `ivasgn`, `cvasgn`, and `gvasgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/asgn_node.rb:8 +class RuboCop::AST::AsgnNode < ::RuboCop::AST::Node + # The expression being assigned to the variable. + # + # @return [Node] the expression being assigned. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/asgn_node.rb:20 + def expression; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/asgn_node.rb:15 + def lhs; end + + # The name of the variable being assigned as a symbol. + # + # @return [Symbol] the name of the variable being assigned + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/asgn_node.rb:12 + def name; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/asgn_node.rb:23 + def rhs; end +end + +# Common functionality for primitive literal nodes: `sym`, `str`, +# `int`, `float`, `rational`, `complex`... +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/basic_literal_node.rb:7 +module RuboCop::AST::BasicLiteralNode + # Returns the value of the literal. + # + # @return [mixed] the value of the literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/basic_literal_node.rb:11 + def value; end +end + +# Common functionality for nodes that are binary operations: +# `or`, `and` ... +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/binary_operator_node.rb:7 +module RuboCop::AST::BinaryOperatorNode + # Returns all of the conditions, including nested conditions, + # of the binary operation. + # + # @return [Array] the left and right hand side of the binary + # operation and the let and right hand side of any nested binary + # operators + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/binary_operator_node.rb:28 + def conditions; end + + # Returns the left hand side node of the binary operation. + # + # @return [Node] the left hand side of the binary operation + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/binary_operator_node.rb:11 + def lhs; end + + # Returns the right hand side node of the binary operation. + # + # @return [Node] the right hand side of the binary operation + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/binary_operator_node.rb:18 + def rhs; end +end + +# A node extension for `block` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `send` nodes within RuboCop. +# +# A `block` node is essentially a method send with a block. Parser nests +# the `send` node inside the `block` node. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:11 +class RuboCop::AST::BlockNode < ::RuboCop::AST::Node + include ::RuboCop::AST::MethodIdentifierPredicates + + # Returns a collection of all descendants of this node that are + # argument type nodes. See `ArgsNode#argument_list` for details. + # + # @return [Array] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:62 + def argument_list; end + + # The arguments of this block. + # Note that if the block has destructured arguments, `arguments` will + # return a `mlhs` node, whereas `argument_list` will return only + # actual argument nodes. + # + # @return [Array] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:50 + def arguments; end + + # Checks whether this block takes any arguments. + # + # @return [Boolean] whether this `block` node takes any arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:89 + def arguments?; end + + # The body of this block. + # + # @return [Node, nil] the body of the `block` node or `nil` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:75 + def body; end + + # Checks whether the `block` literal is delimited by curly braces. + # + # @return [Boolean] whether the `block` literal is enclosed in braces + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:96 + def braces?; end + + # The closing delimiter for this `block` literal. + # + # @return [String] the closing delimiter for the `block` literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:124 + def closing_delimiter; end + + # The delimiters for this `block` literal. + # + # @return [Array] the delimiters for the `block` literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:110 + def delimiters; end + + # A shorthand for getting the first argument of this block. + # Equivalent to `arguments.first`. + # + # @return [Node, nil] the first argument of this block, + # or `nil` if there are no arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:31 + def first_argument; end + + # Checks whether the `block` literal is delimited by `do`-`end` keywords. + # + # @return [Boolean] whether the `block` literal is enclosed in `do`-`end` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:103 + def keywords?; end + + # Checks whether this `block` literal belongs to a lambda. + # + # @return [Boolean] whether the `block` literal belongs to a lambda + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:147 + def lambda?; end + + # A shorthand for getting the last argument of this block. + # Equivalent to `arguments.last`. + # + # @return [Node, nil] the last argument of this block, + # or `nil` if there are no arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:40 + def last_argument; end + + # The name of the dispatched method as a symbol. + # + # @return [Symbol] the name of the dispatched method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:82 + def method_name; end + + # Checks whether this is a multiline block. This is overridden here + # because the general version in `Node` does not work for `block` nodes. + # + # @return [Boolean] whether the `block` literal is on a several lines + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:140 + def multiline?; end + + # The opening delimiter for this `block` literal. + # + # @return [String] the opening delimiter for the `block` literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:117 + def opening_delimiter; end + + # The `send` node associated with this block. + # + # @return [SendNode] the `send` node associated with the `block` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:22 + def send_node; end + + # Checks whether this is a single line block. This is overridden here + # because the general version in `Node` does not work for `block` nodes. + # + # @return [Boolean] whether the `block` literal is on a single line + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:132 + def single_line?; end + + # Checks whether this node body is a void context. + # + # @return [Boolean] whether the `block` node body is a void context + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:154 + def void_context?; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:160 + def numbered_arguments; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:14 +RuboCop::AST::BlockNode::IT_BLOCK_ARGUMENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/block_node.rb:16 +RuboCop::AST::BlockNode::VOID_CONTEXT_METHODS = T.let(T.unsafe(nil), Array) + +# A node extension for `break` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `break` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/break_node.rb:8 +class RuboCop::AST::BreakNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::WrappedArguments +end + +# `RuboCop::AST::Builder` is an AST builder that is utilized to let `Parser` +# generate ASTs with {RuboCop::AST::Node}. +# +# @example +# buffer = Parser::Source::Buffer.new('(string)') +# buffer.source = 'puts :foo' +# +# builder = RuboCop::AST::Builder.new +# require 'parser/ruby25' +# parser = Parser::Ruby25.new(builder) +# root_node = parser.parse(buffer) +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:129 +class RuboCop::AST::Builder < ::Parser::Builders::Default + include ::RuboCop::AST::BuilderExtensions +end + +# Common functionality between the parser and prism builder +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:7 +module RuboCop::AST::BuilderExtensions + # Generates {Node} from the given information. + # + # @return [Node] the generated node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:101 + def n(type, children, source_map); end + + # Overwrite the base method to allow strings with invalid encoding + # More details here https://github.com/whitequark/parser/issues/283 + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:107 + def string_value(token); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:113 + def node_klass(type); end + + class << self + # pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:8 + def included(base); end + end +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/builder.rb:14 +RuboCop::AST::BuilderExtensions::NODE_MAP = T.let(T.unsafe(nil), Hash) + +# A parser builder, based on the one provided by prism, +# which is capable of emitting AST for more recent Rubies. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/builder_prism.rb:7 +class RuboCop::AST::BuilderPrism < ::Prism::Translation::Parser::Builder + include ::RuboCop::AST::BuilderExtensions +end + +# A node extension for `case_match` nodes. This will be used in place of +# a plain node when the builder constructs the AST, making its methods +# available to all `case_match` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:8 +class RuboCop::AST::CaseMatchNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConditionalNode + + # Returns an array of all the when branches in the `case` statement. + # + # @return [Array] an array of the bodies of the `in` branches + # and the `else` (if any). Note that these bodies could be nil. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:38 + def branches; end + + # @deprecated Use `in_pattern_branches.each` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:19 + def each_in_pattern(&block); end + + # Checks whether this case statement has an `else` branch. + # + # @return [Boolean] whether the `case` statement has an `else` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:59 + def else?; end + + # Returns the else branch of the `case` statement, if any. + # + # @return [Node] the else branch node of the `case` statement + # @return [EmptyElse] the empty else branch node of the `case` statement + # @return [nil] if the case statement does not have an else branch. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:52 + def else_branch; end + + # Returns an array of all the `in` pattern branches in the `case` statement. + # + # @return [Array] an array of `in_pattern` nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:30 + def in_pattern_branches; end + + # Returns the keyword of the `case` statement as a string. + # + # @return [String] the keyword of the `case` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_match_node.rb:14 + def keyword; end +end + +# A node extension for `case` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `case` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:8 +class RuboCop::AST::CaseNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConditionalNode + + # Returns an array of all the when branches in the `case` statement. + # + # @return [Array] an array of the bodies of the when branches + # and the else (if any). Note that these bodies could be nil. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:38 + def branches; end + + # @deprecated Use `when_branches.each` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:19 + def each_when(&block); end + + # Checks whether this case statement has an `else` branch. + # + # @return [Boolean] whether the `case` statement has an `else` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:55 + def else?; end + + # Returns the else branch of the `case` statement, if any. + # + # @return [Node] the else branch node of the `case` statement + # @return [nil] if the case statement does not have an else branch. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:48 + def else_branch; end + + # Returns the keyword of the `case` statement as a string. + # + # @return [String] the keyword of the `case` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:14 + def keyword; end + + # Returns an array of all the when branches in the `case` statement. + # + # @return [Array] an array of `when` nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/case_node.rb:30 + def when_branches; end +end + +# A node extension for `casgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/casgn_node.rb:8 +class RuboCop::AST::CasgnNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConstantNode + + # The expression being assigned to the variable. + # + # @return [Node] the expression being assigned. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/casgn_node.rb:17 + def expression; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/casgn_node.rb:12 + def lhs; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/casgn_node.rb:11 + def name; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/casgn_node.rb:20 + def rhs; end +end + +# A node extension for `class` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `class` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/class_node.rb:8 +class RuboCop::AST::ClassNode < ::RuboCop::AST::Node + # The body of this `class` node. + # + # @return [Node, nil] the body of the class + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/class_node.rb:26 + def body; end + + # The identifier for this `class` node. + # + # @return [Node] the identifier of the class + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/class_node.rb:12 + def identifier; end + + # The parent class for this `class` node. + # + # @return [Node, nil] the parent class of the class + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/class_node.rb:19 + def parent_class; end +end + +# A mixin that helps give collection nodes array polymorphism. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:6 +module RuboCop::AST::CollectionNode + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def &(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def *(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def +(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def -(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def <<(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def [](*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def []=(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def all?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def any?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def append(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def assoc(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def at(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def bsearch(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def bsearch_index(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def chain(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def chunk(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def chunk_while(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def clear(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def collect(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def collect!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def collect_concat(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def combination(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def compact(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def compact!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def concat(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def count(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def cycle(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def deconstruct(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def delete(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def delete_at(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def delete_if(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def detect(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def difference(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def dig(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def drop(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def drop_while(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_cons(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_entry(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_index(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_slice(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_with_index(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_with_object(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def empty?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def entries(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def fetch(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def fetch_values(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def fill(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def filter(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def filter!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def filter_map(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def find(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def find_all(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def find_index(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def first(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def flat_map(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def flatten(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def flatten!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def grep(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def grep_v(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def group_by(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def include?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def index(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def inject(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def insert(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def intersect?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def intersection(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def join(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def keep_if(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def last(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def lazy(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def length(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def map(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def map!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def max(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def max_by(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def member?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def min(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def min_by(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def minmax(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def minmax_by(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def none?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def one?(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def pack(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def partition(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def permutation(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def pop(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def prepend(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def product(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def push(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rassoc(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reduce(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reject(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reject!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def repeated_combination(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def repeated_permutation(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def replace(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reverse(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reverse!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reverse_each(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rfind(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rindex(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rotate(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rotate!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sample(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def select(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def select!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shelljoin(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shift(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shuffle(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shuffle!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def size(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice_after(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice_before(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice_when(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort_by(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort_by!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sum(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def take(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def take_while(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def tally(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def to_ary(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def to_h(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def to_set(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def transpose(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def union(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def uniq(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def uniq!(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def unshift(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def values_at(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def zip(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def |(*, **, &); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:9 +RuboCop::AST::CollectionNode::ARRAY_METHODS = T.let(T.unsafe(nil), Array) + +# A node extension for `complex` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available to +# all `complex` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/complex_node.rb:8 +class RuboCop::AST::ComplexNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode + include ::RuboCop::AST::NumericNode +end + +# Common functionality for nodes that have conditions: +# `if`, `while`, `until`, `case`. +# This currently doesn't include `when` nodes, because they have multiple +# conditions, and need to be checked for that. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/conditional_node.rb:9 +module RuboCop::AST::ConditionalNode + # Returns the body associated with the condition. This works together with + # each node's custom destructuring method to select the correct part of + # the node. + # + # @note For `if` nodes, this is the truthy branch. + # + # @return [Node, nil] the body of the node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/conditional_node.rb:40 + def body; end + + # Returns the condition of the node. This works together with each node's + # custom destructuring method to select the correct part of the node. + # + # @return [Node, nil] the condition of the node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/conditional_node.rb:29 + def condition; end + + # Checks whether the condition of the node is written on more than + # one line. + # + # @return [Boolean] whether the condition is on more than one line + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/conditional_node.rb:21 + def multiline_condition?; end + + # Checks whether the condition of the node is written on a single line. + # + # @return [Boolean] whether the condition is on a single line + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/conditional_node.rb:13 + def single_line_condition?; end +end + +# A node extension for `const` nodes. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/const_node.rb:6 +class RuboCop::AST::ConstNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConstantNode +end + +# Common functionality for nodes that deal with constants: +# `const`, `casgn`. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:7 +module RuboCop::AST::ConstantNode + # @return [Boolean] if the constant starts with `::` (aka s(:cbase)) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:27 + def absolute?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:24 + def class_name?; end + + # Yield nodes for the namespace + # + # For `::Foo::Bar::BAZ` => yields: + # s(:cbase), then + # s(:const, :Foo), then + # s(:const, s(:const, :Foo), :Bar) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:44 + def each_path(&block); end + + # @return [Boolean] if the constant is a Module / Class, according to the standard convention. + # Note: some classes might have uppercase in which case this method + # returns false + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:21 + def module_name?; end + + # @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:9 + def namespace; end + + # @return [Boolean] if the constant does not start with `::` (aka s(:cbase)) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:34 + def relative?; end + + # @return [Symbol] the demodulized name of the constant: "::Foo::Bar" => :Bar + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/constant_node.rb:14 + def short_name; end +end + +# A node extension for `csend` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `csend` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/csend_node.rb:8 +class RuboCop::AST::CsendNode < ::RuboCop::AST::SendNode + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/csend_node.rb:9 + def send_type?; end +end + +# A node extension for `def` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `def` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:8 +class RuboCop::AST::DefNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::MethodIdentifierPredicates + + # Checks whether this method definition node forwards its arguments + # as per the feature added in Ruby 2.7. + # + # @note This is written in a way that may support lead arguments + # which are rumored to be added in a later version of Ruby. + # + # @return [Boolean] whether the `def` node uses argument forwarding + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:26 + def argument_forwarding?; end + + # An array containing the arguments of the method definition. + # + # @return [Array] the arguments of the method definition + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:40 + def arguments; end + + # The body of the method definition. + # + # @note this can be either a `begin` node, if the method body contains + # multiple expressions, or any other node, if it contains a single + # expression. + # + # @return [Node] the body of the method definition + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:51 + def body; end + + # @return [Boolean] if the definition is without an `end` or not. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:63 + def endless?; end + + # The name of the defined method as a symbol. + # + # @return [Symbol] the name of the defined method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:33 + def method_name; end + + # The receiver of the method definition, if any. + # + # @return [Node, nil] the receiver of the method definition, or `nil`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:58 + def receiver; end + + # Checks whether this node body is a void context. + # + # @return [Boolean] whether the `def` node body is a void context + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/def_node.rb:15 + def void_context?; end +end + +# A node extension for `defined?` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `send` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/defined_node.rb:8 +class RuboCop::AST::DefinedNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/defined_node.rb:16 + def arguments; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/defined_node.rb:12 + def node_parts; end +end + +# Common functionality for primitive literal nodes: `sym`, `str`, +# `int`, `float`, ... +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:7 +module RuboCop::AST::Descendence + # Returns an array of child nodes. + # This is a shorthand for `node.each_child_node.to_a`. + # + # @return [Array] an array of child nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:38 + def child_nodes; end + + # Returns an array of descendant nodes. + # This is a shorthand for `node.each_descendant.to_a`. + # + # @return [Array] an array of descendant nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:72 + def descendants; end + + # Calls the given block for each child node. + # If no block is given, an `Enumerator` is returned. + # + # Note that this is different from `node.children.each { |child| ... }` + # which yields all children including non-node elements. + # + # @overload each_child_node + # Yield all nodes. + # @overload each_child_node(type, ...) + # Yield only nodes matching any of the types. + # @param [Symbol] type a node type + # @yieldparam [Node] node each child node + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:22 + def each_child_node(*types); end + + # Calls the given block for each descendant node with depth first order. + # If no block is given, an `Enumerator` is returned. + # + # @overload each_descendant + # Yield all nodes. + # @overload each_descendant(type) + # Yield only nodes matching the type. + # @param [Symbol] type a node type + # @overload each_descendant(type_a, type_b, ...) + # Yield only nodes matching any of the types. + # @param [Symbol] type_a a node type + # @param [Symbol] type_b a node type + # @yieldparam [Node] node each descendant node + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:60 + def each_descendant(*types, &block); end + + # Calls the given block for the receiver and each descendant node in + # depth-first order. + # If no block is given, an `Enumerator` is returned. + # + # This method would be useful when you treat the receiver node as the root + # of a tree and want to iterate over all nodes in the tree. + # + # @overload each_node + # Yield all nodes. + # @overload each_node(type) + # Yield only nodes matching the type. + # @param [Symbol] type a node type + # @overload each_node(type_a, type_b, ...) + # Yield only nodes matching any of the types. + # @param [Symbol] type_a a node type + # @param [Symbol] type_b a node type + # @yieldparam [Node] node each node + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:95 + def each_node(*types, &block); end + + protected + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:115 + def visit_all_descendants(&block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:107 + def visit_descendants(types, &block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/descendence.rb:124 + def visit_descendants_of_types(types, &block); end +end + +# A node extension for `dstr` nodes. This will be used +# in place of a plain node when the builder constructs the AST, making +# its methods available to all `dstr` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/dstr_node.rb:8 +class RuboCop::AST::DstrNode < ::RuboCop::AST::StrNode + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/dstr_node.rb:9 + def value; end +end + +# A node extension for `ensure` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `ensure` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/ensure_node.rb:8 +class RuboCop::AST::EnsureNode < ::RuboCop::AST::Node + # Returns the body of the `ensure` clause. + # + # @return [Node, nil] The body of the `ensure`. + # @deprecated Use `EnsureNode#branch` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/ensure_node.rb:16 + def body; end + + # Returns an the ensure branch in the exception handling statement. + # + # @return [Node, nil] the body of the ensure branch. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/ensure_node.rb:33 + def branch; end + + # Returns the `rescue` node of the `ensure`, if present. + # + # @return [Node, nil] The `rescue` node. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/ensure_node.rb:40 + def rescue_node; end + + # Checks whether this node body is a void context. + # Always `true` for `ensure`. + # + # @return [true] whether the `ensure` node body is a void context + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/ensure_node.rb:48 + def void_context?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/ensure_node.rb:9 +RuboCop::AST::EnsureNode::DEPRECATION_WARNING_LOCATION_CACHE = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/ext/range.rb:5 +module RuboCop::AST::Ext; end + +# Extensions to Parser::AST::Range +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/ext/range.rb:7 +module RuboCop::AST::Ext::Range + # @return [Range] the range of line numbers for the node + # If `exclude_end` is `true`, then the range will be exclusive. + # + # Assume that `node` corresponds to the following array literal: + # + # [ + # :foo, + # :bar + # ] + # + # node.loc.begin.line_span # => 1..1 + # node.source_range.line_span(exclude_end: true) # => 1...4 + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/ext/range.rb:20 + def line_span(exclude_end: T.unsafe(nil)); end +end + +# A node extension for `float` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available to +# all `float` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/float_node.rb:8 +class RuboCop::AST::FloatNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode + include ::RuboCop::AST::NumericNode +end + +# A node extension for `for` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `for` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:8 +class RuboCop::AST::ForNode < ::RuboCop::AST::Node + # Returns the body of the `for` loop. + # + # @return [Node, nil] The body of the `for` loop. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:48 + def body; end + + # Returns the collection the `for` loop is iterating over. + # + # @return [Node] The collection the `for` loop is iterating over + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:41 + def collection; end + + # Checks whether the `for` node has a `do` keyword. + # + # @return [Boolean] whether the `for` node has a `do` keyword + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:19 + def do?; end + + # Returns the keyword of the `for` statement as a string. + # + # @return [String] the keyword of the `for` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:12 + def keyword; end + + # Returns the iteration variable of the `for` loop. + # + # @return [Node] The iteration variable of the `for` loop + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:34 + def variable; end + + # Checks whether this node body is a void context. + # Always `true` for `for`. + # + # @return [true] whether the `for` node body is a void context + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/for_node.rb:27 + def void_context?; end +end + +# A node extension for `forward-args` nodes. This will be used in place +# of a plain node when the builder constructs the AST, making its methods +# available to all `forward-args` nodes within RuboCop. +# +# Not used with modern emitters: +# +# $ ruby-parse -e "def foo(...); end" +# (def :foo +# (args +# (forward-arg)) nil) +# $ ruby-parse --legacy -e "->(foo) { bar }" +# (def :foo +# (forward-args) nil) +# +# Note the extra 's' with legacy form. +# +# The main RuboCop runs in legacy mode; this node is only used +# if user `AST::Builder.modernize` or `AST::Builder.emit_lambda=true` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/forward_args_node.rb:23 +class RuboCop::AST::ForwardArgsNode < ::RuboCop::AST::Node + include ::RuboCop::AST::CollectionNode + + # Node wraps itself in an array to be compatible with other + # enumerable argument types. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/forward_args_node.rb:28 + def to_a; end +end + +# Common functionality for nodes that can be used as hash elements: +# `pair`, `kwsplat` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:7 +module RuboCop::AST::HashElementNode + # Returns the delta between this element's delimiter and the argument's. + # + # @note Pairs with different delimiter styles return a delta of 0 + # + # @return [Integer] the delta between the two delimiters + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:61 + def delimiter_delta(other); end + + # Returns the key of this `hash` element. + # + # @note For keyword splats, this returns the whole node + # + # @return [Node] the key of the hash element + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:13 + def key; end + + # Returns the delta between this pair's key and the argument pair's. + # + # @note Keys on the same line always return a delta of 0 + # @note Keyword splats always return a delta of 0 for right alignment + # + # @param [Symbol] alignment whether to check the left or right side + # @return [Integer] the delta between the two keys + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:43 + def key_delta(other, alignment = T.unsafe(nil)); end + + # Checks whether this `hash` element is on the same line as `other`. + # + # @note A multiline element is considered to be on the same line if it + # shares any of its lines with `other` + # + # @return [Boolean] whether this element is on the same line as `other` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:32 + def same_line?(other); end + + # Returns the value of this `hash` element. + # + # @note For keyword splats, this returns the whole node + # + # @return [Node] the value of the hash element + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:22 + def value; end + + # Returns the delta between this element's value and the argument's. + # + # @note Keyword splats always return a delta of 0 + # + # @return [Integer] the delta between the two values + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:52 + def value_delta(other); end +end + +# A helper class for comparing the positions of different parts of a +# `pair` node. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:67 +class RuboCop::AST::HashElementNode::HashElementDelta + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:68 + def initialize(first, second); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:89 + def delimiter_delta; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:75 + def key_delta(alignment = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:82 + def value_delta; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:108 + def delta(first, second, alignment = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:98 + def first; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:119 + def keyword_splat?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:98 + def second; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/hash_element_node.rb:100 + def valid_argument_types?; end +end + +# A node extension for `hash` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `hash` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:8 +class RuboCop::AST::HashNode < ::RuboCop::AST::Node + # Checks whether the `hash` literal is delimited by curly braces. + # + # @return [Boolean] whether the `hash` literal is enclosed in braces + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:117 + def braces?; end + + # Calls the given block for each `key` node in the `hash` literal. + # If no block is given, an `Enumerator` is returned. + # + # @note `kwsplat` nodes are ignored. + # + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:59 + def each_key; end + + # Calls the given block for each `pair` node in the `hash` literal. + # If no block is given, an `Enumerator` is returned. + # + # @note `kwsplat` nodes are ignored. + # + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:33 + def each_pair; end + + # Calls the given block for each `value` node in the `hash` literal. + # If no block is given, an `Enumerator` is returned. + # + # @note `kwsplat` nodes are ignored. + # + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:83 + def each_value; end + + # Checks whether the `hash` node contains any `pair`- or `kwsplat` nodes. + # + # @return[Boolean] whether the `hash` is empty + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:22 + def empty?; end + + # Returns an array of all the keys in the `hash` literal. + # + # @note `kwsplat` nodes are ignored. + # + # @return [Array] an array of keys in the `hash` literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:48 + def keys; end + + # Checks whether this `hash` uses a mix of hash rocket and colon + # delimiters for its pairs. + # + # @note `kwsplat` nodes are ignored. + # + # @return [Boolean] whether the `hash` uses mixed delimiters + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:110 + def mixed_delimiters?; end + + # Returns an array of all the key value pairs in the `hash` literal. + # + # @note this may be different from children as `kwsplat` nodes are + # ignored. + # + # @return [Array] an array of `pair` nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:15 + def pairs; end + + # Checks whether any of the key value pairs in the `hash` literal are on + # the same line. + # + # @note A multiline `pair` is considered to be on the same line if it + # shares any of its lines with another `pair` + # + # @note `kwsplat` nodes are ignored. + # + # @return [Boolean] whether any `pair` nodes are on the same line + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:100 + def pairs_on_same_line?; end + + # Returns an array of all the values in the `hash` literal. + # + # @note `kwsplat` nodes are ignored. + # + # @return [Array] an array of values in the `hash` literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/hash_node.rb:72 + def values; end +end + +# A node extension for `if` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `if` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:8 +class RuboCop::AST::IfNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConditionalNode + include ::RuboCop::AST::ModifierNode + + # Returns an array of all the branches in the conditional statement. + # + # @return [Array] an array of branch nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:154 + def branches; end + + # @deprecated Use `branches.each` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:171 + def each_branch(&block); end + + # Checks whether the `if` node has an `else` clause. + # + # @note This returns `true` for nodes containing an `elsif` clause. + # This is legacy behavior, and many cops rely on it. + # + # @return [Boolean] whether the node has an `else` clause + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:49 + def else?; end + + # Returns the branch of the `if` node that gets evaluated when its + # condition is falsey. + # + # @note This is normalized for `unless` nodes. + # + # @return [Node] the falsey branch node of the `if` node + # @return [nil] when there is no else branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:133 + def else_branch; end + + # Checks whether the `if` is an `elsif`. Parser handles these by nesting + # `if` nodes in the `else` branch. + # + # @return [Boolean] whether the node is an `elsif` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:39 + def elsif?; end + + # Checks whether the `if` node has at least one `elsif` branch. Returns + # true if this `if` node itself is an `elsif`. + # + # @return [Boolean] whether the `if` node has at least one `elsif` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:111 + def elsif_conditional?; end + + # Checks whether this node is an `if` statement. (This is not true of + # ternary operators and `unless` statements.) + # + # @return [Boolean] whether the node is an `if` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:16 + def if?; end + + # Returns the branch of the `if` node that gets evaluated when its + # condition is truthy. + # + # @note This is normalized for `unless` nodes. + # + # @return [Node] the truthy branch node of the `if` node + # @return [nil] if the truthy branch is empty + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:122 + def if_branch; end + + # Returns the inverse keyword of the `if` node as a string. Returns `if` + # for `unless` nodes and vice versa. Returns an empty string for ternary + # operators. + # + # @return [String] the inverse keyword of the `if` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:73 + def inverse_keyword; end + + # Returns the keyword of the `if` statement as a string. Returns an empty + # string for ternary operators. + # + # @return [String] the keyword of the `if` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:64 + def keyword; end + + # Checks whether the `if` node is in a modifier form, i.e. a condition + # trailing behind an expression. Only `if` and `unless` nodes without + # other branches can be modifiers. + # + # @return [Boolean] whether the `if` node is a modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:87 + def modifier_form?; end + + # Checks whether the `if` node has nested `if` nodes in any of its + # branches. + # + # @note This performs a shallow search. + # + # @return [Boolean] whether the `if` node contains nested conditionals + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:97 + def nested_conditional?; end + + # Custom destructuring method. This is used to normalize the branches + # for `if` and `unless` nodes, to aid comparisons and conversions. + # + # @return [Array] the different parts of the `if` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:141 + def node_parts; end + + # Checks whether the `if` node is a ternary operator. + # + # @return [Boolean] whether the `if` node is a ternary operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:56 + def ternary?; end + + # Checks whether the `if` node has an `then` clause. + # + # @return [Boolean] whether the node has an `then` clause + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:31 + def then?; end + + # Checks whether this node is an `unless` statement. (This is not true + # of ternary operators and `if` statements.) + # + # @return [Boolean] whether the node is an `unless` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/if_node.rb:24 + def unless?; end +end + +# A node extension for `in` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `in` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/in_pattern_node.rb:8 +class RuboCop::AST::InPatternNode < ::RuboCop::AST::Node + # Returns the body of the `in` node. + # + # @return [Node, nil] the body of the `in` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/in_pattern_node.rb:33 + def body; end + + # Returns the index of the `in` branch within the `case` statement. + # + # @return [Integer] the index of the `in` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/in_pattern_node.rb:19 + def branch_index; end + + # Returns a node of the pattern in the `in` branch. + # + # @return [Node] a pattern node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/in_pattern_node.rb:12 + def pattern; end + + # Checks whether the `in` node has a `then` keyword. + # + # @return [Boolean] whether the `in` node has a `then` keyword + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/in_pattern_node.rb:26 + def then?; end +end + +# Used for modern support only! +# Not as thoroughly tested as legacy equivalent +# +# $ ruby-parse -e "foo[:bar]" +# (index +# (send nil :foo) +# (sym :bar)) +# $ ruby-parse --legacy -e "foo[:bar]" +# (send +# (send nil :foo) :[] +# (sym :bar)) +# +# The main RuboCop runs in legacy mode; this node is only used +# if user `AST::Builder.modernize` or `AST::Builder.emit_index=true` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/index_node.rb:19 +class RuboCop::AST::IndexNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::RestArguments + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/index_node.rb:29 + def assignment_method?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/index_node.rb:24 + def attribute_accessor?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/index_node.rb:34 + def method_name; end + + private + + # An array containing the arguments of the dispatched method. + # + # @return [Array] the arguments of the dispatched method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/index_node.rb:43 + def first_argument_index; end +end + +# Used for modern support only! +# Not as thoroughly tested as legacy equivalent +# +# $ ruby-parse -e "foo[:bar] = :baz" +# (indexasgn +# (send nil :foo) +# (sym :bar) +# (sym :baz)) +# $ ruby-parse --legacy -e "foo[:bar] = :baz" +# (send +# (send nil :foo) :[]= +# (sym :bar) +# (sym :baz)) +# +# The main RuboCop runs in legacy mode; this node is only used +# if user `AST::Builder.modernize` or `AST::Builder.emit_index=true` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/indexasgn_node.rb:21 +class RuboCop::AST::IndexasgnNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::RestArguments + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/indexasgn_node.rb:31 + def assignment_method?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/indexasgn_node.rb:26 + def attribute_accessor?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/indexasgn_node.rb:36 + def method_name; end + + private + + # An array containing the arguments of the dispatched method. + # + # @return [Array] the arguments of the dispatched method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/indexasgn_node.rb:45 + def first_argument_index; end +end + +# A node extension for `int` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available to +# all `int` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/int_node.rb:8 +class RuboCop::AST::IntNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode + include ::RuboCop::AST::NumericNode +end + +# A node extension for `kwbegin` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `kwbegin` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_begin_node.rb:8 +class RuboCop::AST::KeywordBeginNode < ::RuboCop::AST::Node + # Returns the body of the `kwbegin` block. Returns `self` if the `kwbegin` contains + # multiple nodes. + # + # @return [Node, nil] The body of the `kwbegin`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_begin_node.rb:13 + def body; end + + # Returns the `rescue` node of the `kwbegin` block, if one is present. + # + # @return [Node, nil] The `rescue` node within `kwbegin`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_begin_node.rb:30 + def ensure_node; end + + # Returns the `rescue` node of the `kwbegin` block, if one is present. + # + # @return [Node, nil] The `rescue` node within `kwbegin`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_begin_node.rb:37 + def rescue_node; end +end + +# A node extension for `kwsplat` and `forwarded_kwrestarg` nodes. This will be used in +# place of a plain node when the builder constructs the AST, making its methods available to +# all `kwsplat` and `forwarded_kwrestarg` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:8 +class RuboCop::AST::KeywordSplatNode < ::RuboCop::AST::Node + include ::RuboCop::AST::HashElementNode + + # This is used for duck typing with `pair` nodes which also appear as + # `hash` elements. + # + # @return [false] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:26 + def colon?; end + + # This is used for duck typing with `pair` nodes which also appear as + # `hash` elements. + # + # @return [false] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:18 + def hash_rocket?; end + + # This provides `forwarded_kwrestarg` node to return true to be compatible with `kwsplat` node. + # + # @return [true] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:48 + def kwsplat_type?; end + + # Custom destructuring method. This is used to normalize the branches + # for `pair` and `kwsplat` nodes, to add duck typing to `hash` elements. + # + # @return [Array] the different parts of the `kwsplat` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:41 + def node_parts; end + + # Returns the operator for the `kwsplat` as a string. + # + # @return [String] the double splat operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:33 + def operator; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/keyword_splat_node.rb:11 +RuboCop::AST::KeywordSplatNode::DOUBLE_SPLAT = T.let(T.unsafe(nil), String) + +# Used for modern support only: +# Not as thoroughly tested as legacy equivalent +# +# $ ruby-parse -e "->(foo) { bar }" +# (block +# (lambda) +# (args +# (arg :foo)) +# (send nil :bar)) +# $ ruby-parse --legacy -e "->(foo) { bar }" +# (block +# (send nil :lambda) +# (args +# (arg :foo)) +# (send nil :bar)) +# +# The main RuboCop runs in legacy mode; this node is only used +# if user `AST::Builder.modernize` or `AST::Builder.emit_lambda=true` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:23 +class RuboCop::AST::LambdaNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::RestArguments + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:43 + def assignment_method?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:38 + def attribute_accessor?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:28 + def lambda?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:33 + def lambda_literal?; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:53 + def method_name; end + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:48 + def receiver; end + + private + + # For similarity with legacy mode + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/lambda_node.rb:60 + def first_argument_index; end +end + +# A node extension for `masgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:8 +class RuboCop::AST::MasgnNode < ::RuboCop::AST::Node + # @return [Array] the assignment nodes of the multiple assignment + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:16 + def assignments; end + + # The RHS (right hand side) of the multiple assignment. This returns + # the nodes as parsed: either a single node if the RHS has a single value, + # or an `array` node containing multiple nodes. + # + # NOTE: Due to how parsing works, `expression` will return the same for + # `a, b = x, y` and `a, b = [x, y]`. + # + # @return [Node] the right hand side of a multiple assignment. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:39 + def expression; end + + # @return [MlhsNode] the `mlhs` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:10 + def lhs; end + + # @return [Array] names of all the variables being assigned + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:21 + def names; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:42 + def rhs; end + + # In contrast to `expression`, `values` always returns a Ruby array + # containing all the nodes being assigned on the RHS. + # + # Literal arrays are considered a singular value; but unlike `expression`, + # implied `array` nodes from assigning multiple values on the RHS are treated + # as separate. + # + # @return [Array] individual values being assigned on the RHS of the multiple assignment + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:52 + def values; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/masgn_node.rb:58 + def multiple_rhs?; end +end + +# Common functionality for nodes that are a kind of method dispatch: +# `send`, `csend`, `super`, `zsuper`, `yield`, `defined?`, +# and (modern only): `index`, `indexasgn`, `lambda` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:8 +module RuboCop::AST::MethodDispatchNode + include ::RuboCop::AST::MethodIdentifierPredicates + extend ::RuboCop::AST::NodePattern::Macros + + # Checks whether the dispatched method is an access modifier. + # + # @return [Boolean] whether the dispatched method is an access modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:64 + def access_modifier?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:272 + def adjacent_def_modifier?(param0 = T.unsafe(nil)); end + + # Checks whether this node is an arithmetic operation + # + # @return [Boolean] whether the dispatched method is an arithmetic + # operation + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:175 + def arithmetic_operation?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:110 + def assignment?; end + + # Checks whether the dispatched method is a bare access modifier that + # affects all methods defined after the macro. + # + # @return [Boolean] whether the dispatched method is a bare + # access modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:73 + def bare_access_modifier?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:277 + def bare_access_modifier_declaration?(param0 = T.unsafe(nil)); end + + # Checks whether this is a binary operation. + # + # @example + # + # foo + bar + # + # @return [Boolean] whether this method is a binary operation + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:247 + def binary_operation?; end + + # Whether this method dispatch has an explicit block. + # + # @return [Boolean] whether the dispatched method has a block + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:167 + def block_literal?; end + + # The `block`, `numblock`, or `itblock` node associated with this method dispatch, if any. + # + # @return [BlockNode, nil] the `block`, `numblock`, or `itblock` node associated with this + # method call or `nil` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:46 + def block_node; end + + # Checks whether the name of the dispatched method matches the argument + # and has an implicit receiver. + # + # @param [Symbol, String] name the method name to check for + # @return [Boolean] whether the method name matches the argument + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:100 + def command?(name); end + + # Checks whether the *explicit* receiver of this method dispatch is a + # `const` node. + # + # @return [Boolean] whether the receiver of this method dispatch + # is a `const` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:152 + def const_receiver?; end + + # Checks if this node is part of a chain of `def` or `defs` modifiers. + # + # @example + # + # private def foo; end + # + # @return [Node | nil] returns the `def|defs` node this is a modifier for, + # or `nil` if it isn't a def modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:199 + def def_modifier(node = T.unsafe(nil)); end + + # Checks if this node is part of a chain of `def` or `defs` modifiers. + # + # @example + # + # private def foo; end + # + # @return whether the `def|defs` node is a modifier or not. + # See also `def_modifier` that returns the node or `nil` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:187 + def def_modifier?(node = T.unsafe(nil)); end + + # Checks whether the dispatched method uses a dot to connect the + # receiver and the method name. + # + # This is useful for comparison operators, which can be called either + # with or without a dot, i.e. `foo == bar` or `foo.== bar`. + # + # @return [Boolean] whether the method was called with a connecting dot + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:119 + def dot?; end + + # Checks whether the dispatched method uses a double colon to connect the + # receiver and the method name. + # + # @return [Boolean] whether the method was called with a connecting dot + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:127 + def double_colon?; end + + # Checks whether the method dispatch is the implicit form of `#call`, + # e.g. `foo.(bar)`. + # + # @return [Boolean] whether the method is the implicit form of `#call` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:160 + def implicit_call?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:256 + def in_macro_scope?(param0 = T.unsafe(nil)); end + + # Checks whether this is a lambda. Some versions of parser parses + # non-literal lambdas as a method send. + # + # @return [Boolean] whether this method is a lambda + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:212 + def lambda?; end + + # Checks whether this is a lambda literal (stabby lambda.) + # + # @example + # + # -> (foo) { bar } + # + # @return [Boolean] whether this method is a lambda literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:223 + def lambda_literal?; end + + # Checks whether the dispatched method is a macro method. A macro method + # is defined as a method that sits in a class, module, or block body and + # has an implicit receiver. + # + # @note This does not include DSLs that use nested blocks, like RSpec + # + # @return [Boolean] whether the dispatched method is a macro method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:57 + def macro?; end + + # The name of the dispatched method as a symbol. + # + # @return [Symbol] the name of the dispatched method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:27 + def method_name; end + + # Checks whether the dispatched method is a non-bare access modifier that + # affects only the method it receives. + # + # @return [Boolean] whether the dispatched method is a non-bare + # access modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:82 + def non_bare_access_modifier?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:282 + def non_bare_access_modifier_declaration?(param0 = T.unsafe(nil)); end + + # The receiving node of the method dispatch. + # + # @return [Node, nil] the receiver of the dispatched method or `nil` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:20 + def receiver; end + + # Checks whether the dispatched method uses a safe navigation operator to + # connect the receiver and the method name. + # + # @return [Boolean] whether the method was called with a connecting dot + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:135 + def safe_navigation?; end + + # The source range for the method name or keyword that dispatches this call. + # + # @return [Parser::Source::Range] the source range for the method name or keyword + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:34 + def selector; end + + # Checks whether the *explicit* receiver of this method dispatch is + # `self`. + # + # @return [Boolean] whether the receiver of this method dispatch is `self` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:143 + def self_receiver?; end + + # Checks whether the dispatched method is a setter method. + # + # @return [Boolean] whether the dispatched method is a setter + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:107 + def setter_method?; end + + # Checks whether the dispatched method is a bare `private` or `protected` + # access modifier that affects all methods defined after the macro. + # + # @return [Boolean] whether the dispatched method is a bare + # `private` or `protected` access modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:91 + def special_modifier?; end + + # Checks whether this is a unary operation. + # + # @example + # + # -foo + # + # @return [Boolean] whether this method is a unary operation + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:234 + def unary_operation?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:12 +RuboCop::AST::MethodDispatchNode::ARITHMETIC_OPERATORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_dispatch_node.rb:14 +RuboCop::AST::MethodDispatchNode::SPECIAL_MODIFIERS = T.let(T.unsafe(nil), Array) + +# Common predicates for nodes that reference method identifiers: +# `send`, `csend`, `def`, `defs`, `super`, `zsuper` +# +# @note this mixin expects `#method_name` and `#receiver` to be implemented +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:9 +module RuboCop::AST::MethodIdentifierPredicates + # Checks whether the method is an assignment method. + # + # @return [Boolean] whether the method is an assignment + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:142 + def assignment_method?; end + + # Checks whether the method is a bang method. + # + # @return [Boolean] whether the method is a bang method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:171 + def bang_method?; end + + # Checks whether the method is a camel case method, + # e.g. `Integer()`. + # + # @return [Boolean] whether the method is a camel case method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:179 + def camel_case_method?; end + + # Checks whether the method is a comparison method. + # + # @return [Boolean] whether the method is a comparison + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:135 + def comparison_method?; end + + # Checks whether the *explicit* receiver of node is a `const` node. + # + # @return [Boolean] whether the receiver of this node is a `const` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:193 + def const_receiver?; end + + # Checks whether the method is an Enumerable method. + # + # @return [Boolean] whether the method is an Enumerable method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:157 + def enumerable_method?; end + + # Checks whether the method is an enumerator method. + # + # @return [Boolean] whether the method is an enumerator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:149 + def enumerator_method?; end + + # Checks whether the method name matches the argument. + # + # @param [Symbol, String] name the method name to check for + # @return [Boolean] whether the method name matches the argument + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:79 + def method?(name); end + + # Checks whether this is a negation method, i.e. `!` or keyword `not`. + # + # @return [Boolean] whether this method is a negation method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:200 + def negation_method?; end + + # Checks whether the method is a nonmutating Array method. + # + # @return [Boolean] whether the method is a nonmutating Array method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:114 + def nonmutating_array_method?; end + + # Checks whether the method is a nonmutating binary operator method. + # + # @return [Boolean] whether the method is a nonmutating binary operator method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:93 + def nonmutating_binary_operator_method?; end + + # Checks whether the method is a nonmutating Hash method. + # + # @return [Boolean] whether the method is a nonmutating Hash method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:121 + def nonmutating_hash_method?; end + + # Checks whether the method is a nonmutating operator method. + # + # @return [Boolean] whether the method is a nonmutating operator method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:107 + def nonmutating_operator_method?; end + + # Checks whether the method is a nonmutating String method. + # + # @return [Boolean] whether the method is a nonmutating String method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:128 + def nonmutating_string_method?; end + + # Checks whether the method is a nonmutating unary operator method. + # + # @return [Boolean] whether the method is a nonmutating unary operator method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:100 + def nonmutating_unary_operator_method?; end + + # Checks whether the method is an operator method. + # + # @return [Boolean] whether the method is an operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:86 + def operator_method?; end + + # Checks whether the method is a predicate method. + # + # @return [Boolean] whether the method is a predicate method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:164 + def predicate_method?; end + + # Checks whether this is a prefix bang method, e.g. `!foo`. + # + # @return [Boolean] whether this method is a prefix bang + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:214 + def prefix_bang?; end + + # Checks whether this is a prefix not method, e.g. `not foo`. + # + # @return [Boolean] whether this method is a prefix not + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:207 + def prefix_not?; end + + # Checks whether the *explicit* receiver of this node is `self`. + # + # @return [Boolean] whether the receiver of this node is `self` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:186 + def self_receiver?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:16 +RuboCop::AST::MethodIdentifierPredicates::ENUMERABLE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:10 +RuboCop::AST::MethodIdentifierPredicates::ENUMERATOR_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:32 +RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_ARRAY_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:24 +RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_BINARY_OPERATOR_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:48 +RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_HASH_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:28 +RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_OPERATOR_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:59 +RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_STRING_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:26 +RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_UNARY_OPERATOR_METHODS = T.let(T.unsafe(nil), Set) + +# http://phrogz.net/programmingruby/language.html#table_18.4 +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/method_identifier_predicates.rb:20 +RuboCop::AST::MethodIdentifierPredicates::OPERATOR_METHODS = T.let(T.unsafe(nil), Set) + +# A node extension for `mlhs` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mlhs_node.rb:8 +class RuboCop::AST::MlhsNode < ::RuboCop::AST::Node + # Returns all the assignment nodes on the left hand side (LHS) of a multiple assignment. + # These are generally assignment nodes (`lvasgn`, `ivasgn`, `cvasgn`, `gvasgn`, `casgn`) + # but can also be `send` nodes in case of `foo.bar, ... =` or `foo[:bar], ... =`, + # or a `splat` node for `*, ... =`. + # + # @return [Array] the assignment nodes of the multiple assignment LHS + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mlhs_node.rb:15 + def assignments; end +end + +# Common functionality for nodes that can be used as modifiers: +# `if`, `while`, `until` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/modifier_node.rb:7 +module RuboCop::AST::ModifierNode + # Checks whether the node is in a modifier form, i.e. a condition + # trailing behind an expression. + # + # @return [Boolean] whether the node is a modifier + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/modifier_node.rb:12 + def modifier_form?; end +end + +# A node extension for `module` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `module` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/module_node.rb:8 +class RuboCop::AST::ModuleNode < ::RuboCop::AST::Node + # The body of this `module` node. + # + # @return [Node, nil] the body of the module + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/module_node.rb:19 + def body; end + + # The identifier for this `module` node. + # + # @return [Node] the identifier of the module + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/module_node.rb:12 + def identifier; end +end + +# A node extension for `next` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `next` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/next_node.rb:8 +class RuboCop::AST::NextNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::WrappedArguments +end + +# `RuboCop::AST::Node` is a subclass of `Parser::AST::Node`. It provides +# access to parent nodes and an object-oriented way to traverse an AST with +# the power of `Enumerable`. +# +# It has predicate methods for every node type, like this: +# +# @example +# node.send_type? # Equivalent to: `node.type == :send` +# node.op_asgn_type? # Equivalent to: `node.type == :op_asgn` +# +# # Non-word characters (other than a-zA-Z0-9_) in type names are omitted. +# node.defined_type? # Equivalent to: `node.type == :defined?` +# +# # Find the first lvar node under the receiver node. +# lvar_node = node.each_descendant.find(&:lvar_type?) +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:21 +class RuboCop::AST::Node < ::Parser::AST::Node + include ::RuboCop::AST::Sexp + include ::RuboCop::AST::Descendence + extend ::RuboCop::AST::NodePattern::Macros + + # @see https://www.rubydoc.info/gems/ast/AST/Node:initialize + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:162 + def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def __ENCODING___type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def __FILE___type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def __LINE___type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def alias_type?; end + + # Returns an array of ancestor nodes. + # This is a shorthand for `node.each_ancestor.to_a`. + # + # @return [Array] an array of ancestor nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:334 + def ancestors; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def and_asgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def and_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:565 + def any_block_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:545 + def any_def_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:569 + def any_match_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:573 + def any_str_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:577 + def any_sym_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def arg_expr_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def arg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def args_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:539 + def argument?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:549 + def argument_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def array_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def array_pattern_with_tail_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def array_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:491 + def assignment?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:441 + def assignment_or_similar?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def back_ref_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:495 + def basic_conditional?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:449 + def basic_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def begin_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def block_pass_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def block_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def blockarg_expr_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def blockarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def blocknilarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:553 + def boolean_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def break_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:531 + def call_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def case_match_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def case_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def casgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def cbase_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:535 + def chained?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:625 + def class_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:643 + def class_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def class_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:231 + def complete!; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:236 + def complete?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def complex_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:499 + def conditional?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:380 + def const_name; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def const_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def const_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def csend_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def cvar_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def cvasgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def def_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:400 + def defined_module; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:405 + def defined_module_name; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def defined_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def defs_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def dstr_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def dsym_type?; end + + # Calls the given block for each ancestor node from parent to root. + # If no block is given, an `Enumerator` is returned. + # + # @overload each_ancestor + # Yield all nodes. + # @overload each_ancestor(type) + # Yield only nodes matching the type. + # @param [Symbol] type a node type + # @overload each_ancestor(type_a, type_b, ...) + # Yield only nodes matching any of the types. + # @param [Symbol] type_a a node type + # @param [Symbol] type_b a node type + # @yieldparam [Node] node each ancestor node + # @return [self] if a block is given + # @return [Enumerator] if no block is given + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:322 + def each_ancestor(*types, &block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def eflipflop_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def empty_else_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:435 + def empty_source?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def ensure_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:483 + def equals_asgn?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def erange_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def false_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:457 + def falsey_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def find_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:348 + def first_line; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def float_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def for_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def forward_arg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def forward_args_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def forwarded_args_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def forwarded_kwrestarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def forwarded_restarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:622 + def global_const?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:581 + def guard_clause?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def gvar_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def gvasgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def hash_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def hash_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def ident_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def if_guard_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def if_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def iflipflop_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:465 + def immutable_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def in_match_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def in_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def index_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def indexasgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def int_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def irange_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def itarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def itblock_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def ivar_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def ivasgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:512 + def keyword?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwargs_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwbegin_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwnilarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwoptarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwrestarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def kwsplat_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:616 + def lambda?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:619 + def lambda_or_proc?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def lambda_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:352 + def last_line; end + + # Use is discouraged, this is a potentially slow method and can lead + # to even slower algorithms + # @return [Node, nil] the left (aka previous) sibling + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:274 + def left_sibling; end + + # Use is discouraged, this is a potentially slow method and can lead + # to even slower algorithms + # @return [Array] the left (aka previous) siblings + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:284 + def left_siblings; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:356 + def line_count; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:445 + def literal?; end + + # Shortcut to safely check if a location is present + # @return [Boolean] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:589 + def loc?(which_loc); end + + # Shortcut to safely test a particular location, even if + # this location does not exist or is `nil` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:597 + def loc_is?(which_loc, str); end + + # NOTE: `loop { }` is a normal method call and thus not a loop keyword. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:508 + def loop_keyword?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def lvar_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def lvasgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def masgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_alt_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_as_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_current_line_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:604 + def match_guard_clause?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_nil_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_pattern_p_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_pattern_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_rest_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_var_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_with_lvasgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def match_with_trailing_comma_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def mlhs_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:650 + def module_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def module_type?; end + + # Predicates + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:427 + def multiline?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:461 + def mutable_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:788 + def new_class_or_module_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def next_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def nil_type?; end + + # Common destructuring method. This can be used to normalize + # destructuring for different variations of the node. + # Some node types override this with their own custom + # destructuring method. + # + # @return [Array] the different parts of the node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:305 + def node_parts; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:362 + def nonempty_line_count; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def not_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def nth_ref_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def numargs_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def numblock_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:557 + def numeric_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def objc_kwarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def objc_restarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def objc_varargs_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def op_asgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:523 + def operator_keyword?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def optarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def or_asgn_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def or_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def pair_type?; end + + # Returns the parent node, or `nil` if the receiver is a root node. + # + # @return [Node, nil] the parent node or `nil` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:213 + def parent; end + + # @return [Boolean] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:222 + def parent?; end + + # Searching the AST + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:411 + def parent_module_name; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:527 + def parenthesized_call?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def pin_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:503 + def post_condition_loop?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def postexe_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def preexe_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:609 + def proc?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def procarg0_type?; end + + # Some expressions are evaluated for their value, some for their side + # effects, and some for both. + # If we know that expressions are useful only for their return values, + # and have no side effects, that means we can reorder them, change the + # number of times they are evaluated, or replace them with other + # expressions which are equivalent in value. + # So, is evaluation of this node free of side effects? + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:693 + def pure?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:561 + def range_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def rational_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:373 + def receiver(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:145 + def recursive_basic_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:145 + def recursive_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def redo_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:479 + def reference?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def regexp_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def regopt_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def resbody_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def rescue_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def restarg_expr_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def restarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def retry_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def return_type?; end + + # Use is discouraged, this is a potentially slow method and can lead + # to even slower algorithms + # @return [Node, nil] the right (aka next) sibling + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:265 + def right_sibling; end + + # Use is discouraged, this is a potentially slow method and can lead + # to even slower algorithms + # @return [Array] the right (aka next) siblings + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:293 + def right_siblings; end + + # @return [Boolean] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:227 + def root?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def sclass_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def self_type?; end + + # Most nodes are of 'send' type, so this method is defined + # separately to make this check as fast as possible. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:206 + def send_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def shadowarg_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:487 + def shorthand_asgn?; end + + # Returns the index of the receiver node in its siblings. (Sibling index + # uses zero based numbering.) + # Use is discouraged, this is a potentially slow method. + # + # @return [Integer, nil] the index of the receiver node in its siblings + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:258 + def sibling_index; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:431 + def single_line?; end + + # NOTE: Some rare nodes may have no source, like `s(:args)` in `foo {}` + # @return [String, nil] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:340 + def source; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:366 + def source_length; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:344 + def source_range; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:519 + def special_keyword?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def splat_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:378 + def str_content(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def str_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:638 + def struct_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def super_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def sym_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def true_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:453 + def truthy_literal?; end + + # Determine if the node is one of several node types in a single query + # Allows specific single node types, as well as "grouped" types + # (e.g. `:boolean` for `:true` or `:false`) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:181 + def type?(*types); end + + # Non-splatting variant of `type?`, used by the traversal hot paths to + # avoid allocating an array per visited node. + # @api private + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:188 + def type_in?(types); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def undef_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def unless_guard_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def until_post_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def until_type?; end + + # Override `AST::Node#updated` so that `AST::Processor` does not try to + # mutate our ASTs. Since we keep references from children to parents and + # not just the other way around, we cannot update an AST and share + # identical subtrees. Rather, the entire AST must be copied any time any + # part of it is changed. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:247 + def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end + + # Some expressions are evaluated for their value, some for their side + # effects, and some for both + # If we know that an expression is useful only for its side effects, that + # means we can transform it in ways which preserve the side effects, but + # change the return value + # So, does the return value of this node matter? If we changed it to + # `(...; nil)`, might that affect anything? + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:663 + def value_used?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:475 + def variable?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def when_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def while_post_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def while_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def xstr_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def yield_type?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:197 + def zsuper_type?; end + + protected + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:217 + def parent=(node); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:727 + def begin_value_used?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:738 + def case_if_value_used?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:391 + def defined_module0(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:732 + def for_value_used?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:774 + def parent_module_name_for_block(ancestor); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:762 + def parent_module_name_for_sclass(sclass_node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:749 + def parent_module_name_part(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:711 + def visit_ancestors(types); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:744 + def while_until_value_used?; end + + class << self + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:141 + def def_recursive_literal_predicate(kind); end + end +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:55 +RuboCop::AST::Node::ASSIGNMENTS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:58 +RuboCop::AST::Node::BASIC_CONDITIONALS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:42 +RuboCop::AST::Node::BASIC_LITERALS = T.let(T.unsafe(nil), Set) + +# @api private +# <=> isn't included here, because it doesn't return a boolean. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:28 +RuboCop::AST::Node::COMPARISON_OPERATORS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:39 +RuboCop::AST::Node::COMPOSITE_LITERALS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:60 +RuboCop::AST::Node::CONDITIONALS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:91 +RuboCop::AST::Node::EMPTY_CHILDREN = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:92 +RuboCop::AST::Node::EMPTY_PROPERTIES = T.let(T.unsafe(nil), Hash) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:50 +RuboCop::AST::Node::EQUALS_ASSIGNMENTS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:35 +RuboCop::AST::Node::FALSEY_LITERALS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:96 +RuboCop::AST::Node::GROUP_FOR_TYPE = T.let(T.unsafe(nil), Hash) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:47 +RuboCop::AST::Node::IMMUTABLE_LITERALS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:70 +RuboCop::AST::Node::KEYWORDS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:37 +RuboCop::AST::Node::LITERALS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:87 +RuboCop::AST::Node::LITERAL_RECURSIVE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:88 +RuboCop::AST::Node::LITERAL_RECURSIVE_TYPES = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:64 +RuboCop::AST::Node::LOOP_TYPES = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:44 +RuboCop::AST::Node::MUTABLE_LITERALS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:76 +RuboCop::AST::Node::OPERATOR_KEYWORDS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:62 +RuboCop::AST::Node::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:68 +RuboCop::AST::Node::REFERENCES = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:53 +RuboCop::AST::Node::SHORTHAND_ASSIGNMENTS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:78 +RuboCop::AST::Node::SPECIAL_KEYWORDS = T.let(T.unsafe(nil), Set) + +# The node types which could have a source matching `SPECIAL_KEYWORDS`: +# `__FILE__` parses as `str`, `__LINE__` as `int` and `__ENCODING__` as +# `const` (or as their own node types when the builder emits them); +# `str` and `sym` also cover word/symbol array elements, string parts +# and hash labels spelling out one of these keywords. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:84 +RuboCop::AST::Node::SPECIAL_KEYWORD_TYPES = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:31 +RuboCop::AST::Node::TRUTHY_LITERALS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node.rb:66 +RuboCop::AST::Node::VARIABLES = T.let(T.unsafe(nil), Set) + +# This class performs a pattern-matching operation on an AST node. +# +# Detailed syntax: /docs/modules/ROOT/pages/node_pattern.adoc +# +# Initialize a new `NodePattern` with `NodePattern.new(pattern_string)`, then +# pass an AST node to `NodePattern#match`. Alternatively, use one of the class +# macros in `NodePattern::Macros` to define your own pattern-matching method. +# +# If the match fails, `nil` will be returned. If the match succeeds, the +# return value depends on whether a block was provided to `#match`, and +# whether the pattern contained any "captures" (values which are extracted +# from a matching AST.) +# +# - With block: #match yields the captures (if any) and passes the return +# value of the block through. +# - With no block, but one capture: the capture is returned. +# - With no block, but multiple captures: captures are returned as an array. +# - With no block and no captures: #match returns `true`. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:5 +class RuboCop::AST::NodePattern + include ::RuboCop::AST::NodePattern::MethodDefiner + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:78 + def initialize(str, compiler: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:91 + def ==(other); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:108 + def as_json(_options = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:74 + def ast; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:76 + def captures(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:112 + def encode_with(coder); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:94 + def eql?(other); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:120 + def freeze; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:116 + def init_with(coder); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:104 + def marshal_dump; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:100 + def marshal_load(pattern); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:86 + def match(*args, **rest, &block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:74 + def match_code; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:76 + def named_parameters(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:74 + def pattern; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:76 + def positional_parameters(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:96 + def to_s; end + + class << self + # Yields its argument and any descendants, depth-first. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:60 + def descend(element, &block); end + end +end + +# Responsible to build the AST nodes for `NodePattern` +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:10 +class RuboCop::AST::NodePattern::Builder + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:17 + def emit_atom(type, value); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:29 + def emit_call(type, selector, args = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:11 + def emit_capture(capture_token, node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:25 + def emit_list(type, _begin, children, _end); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:41 + def emit_subsequence(node_list); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:21 + def emit_unary_op(type, _operator = T.unsafe(nil), *children); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:34 + def emit_union(begin_t, pattern_lists, end_t); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:53 + def n(type, *args); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:49 + def optimizable_as_set?(children); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/builder.rb:57 + def union_children(pattern_lists); end +end + +# A NodePattern comment, simplified version of ::Parser::Source::Comment +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:7 +class RuboCop::AST::NodePattern::Comment + # @param [Parser::Source::Range] range + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:14 + def initialize(range); end + + # Compares comments. Two comments are equal if they + # correspond to the same source range. + # + # @param [Object] other + # @return [Boolean] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:31 + def ==(other); end + + # @return [String] a human-readable representation of this comment + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:39 + def inspect; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:9 + def loc; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:8 + def location; end + + # @return [String] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/comment.rb:20 + def text; end +end + +# The top-level compiler holding the global state +# Defers work to its subcompilers +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:11 +class RuboCop::AST::NodePattern::Compiler + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:16 + def initialize; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:25 + def bind(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:14 + def binding; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:14 + def captures; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:43 + def compile_as_atom(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:47 + def compile_as_node_pattern(node, **options); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:51 + def compile_sequence(sequence, var:); end + + # Enumerates `enum` while keeping track of state across + # union branches (captures and unification). + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:39 + def each_union(enum, &block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:75 + def freeze; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:32 + def named_parameter(name); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:14 + def named_parameters; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:71 + def next_capture; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:55 + def parser; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:27 + def positional_parameter(number); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:14 + def positional_parameters; end + + # Utilities + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:61 + def with_temp_variables(*names, &block); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:82 + def enforce_same_captures(enum); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler.rb:97 + def new_capture; end +end + +# Generates code that evaluates to a value (Ruby object) +# This value responds to `===`. +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:12 +class RuboCop::AST::NodePattern::Compiler::AtomSubcompiler < ::RuboCop::AST::NodePattern::Compiler::Subcompiler + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:28 + def visit_const; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:32 + def visit_named_parameter; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:24 + def visit_number; end + + # Assumes other types are node patterns. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:46 + def visit_other_type; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:36 + def visit_positional_parameter; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:26 + def visit_regexp; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:40 + def visit_set; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:25 + def visit_string; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:21 + def visit_symbol; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:15 + def visit_unify; end +end + +# Holds the list of bound variable names +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/binding.rb:8 +class RuboCop::AST::NodePattern::Compiler::Binding + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/binding.rb:9 + def initialize; end + + # Yields the first time a given name is bound + # + # @return [String] bound variable name + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/binding.rb:16 + def bind(name); end + + # Returns currently bound variable names + # @return [Array] variable names that are currently bound + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/binding.rb:31 + def bound_variables; end + + # Yields for each branch of the given union, forbidding unification of + # bindings which only appear in a subset of the union. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/binding.rb:37 + def union_bind(enum); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/binding.rb:75 + def forbid(names); end +end + +# Variant of the Compiler with tracing information for nodes +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:10 +class RuboCop::AST::NodePattern::Compiler::Debug < ::RuboCop::AST::NodePattern::Compiler + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:118 + def initialize; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:131 + def comments(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:123 + def named_parameters; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:35 + def node_ids; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:127 + def parser; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:131 + def tokens(*, **, &); end +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:38 +class RuboCop::AST::NodePattern::Compiler::Debug::Colorizer + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:98 + def initialize(pattern, compiler: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:96 + def compiler; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:96 + def node_pattern; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:96 + def pattern; end + + # @return [Node] the Ruby AST + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:105 + def test(ruby, trace: T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:113 + def ruby_ast(ruby); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:39 +RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::COLOR_SCHEME = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:94 +RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::Compiler = RuboCop::AST::NodePattern::Compiler::Debug + +# Result of a NodePattern run against a particular AST +# Consider constructor is private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 +class RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::Result < ::Struct + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:58 + def color_map(color_scheme = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:50 + def colorize(color_scheme = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def colorizer; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def colorizer=(_); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:68 + def match_map; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:76 + def matched?(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def returned; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def returned=(_); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def ruby_ast; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def ruby_ast=(_); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def trace; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def trace=(_); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:89 + def ast; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:83 + def color_map_for(node, color); end + + class << self + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def [](*_arg0); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def inspect; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def keyword_init?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def members; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:48 + def new(*_arg0); end + end +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:134 +module RuboCop::AST::NodePattern::Compiler::Debug::InstrumentationSubcompiler + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:135 + def do_compile; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:145 + def node_id; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:141 + def tracer(kind); end +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:151 +class RuboCop::AST::NodePattern::Compiler::Debug::NodePatternSubcompiler < ::RuboCop::AST::NodePattern::Compiler::NodePatternSubcompiler + include ::RuboCop::AST::NodePattern::Compiler::Debug::InstrumentationSubcompiler +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:156 +class RuboCop::AST::NodePattern::Compiler::Debug::SequenceSubcompiler < ::RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler + include ::RuboCop::AST::NodePattern::Compiler::Debug::InstrumentationSubcompiler +end + +# Compiled node pattern requires a named parameter `trace`, +# which should be an instance of this class +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:13 +class RuboCop::AST::NodePattern::Compiler::Debug::Trace + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:14 + def initialize; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:19 + def enter(node_id); end + + # return nil (not visited), false (not matched) or true (matched) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:30 + def matched?(node_id); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/debug.rb:25 + def success(node_id); end +end + +# Compiles code that evalues to true or false +# for a given value `var` (typically a RuboCop::AST::Node) +# or it's `node.type` if `seq_head` is true +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:13 +class RuboCop::AST::NodePattern::Compiler::NodePatternSubcompiler < ::RuboCop::AST::NodePattern::Compiler::Subcompiler + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:16 + def initialize(compiler, var: T.unsafe(nil), access: T.unsafe(nil), seq_head: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:14 + def access; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:14 + def seq_head; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:119 + def access_element; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:123 + def access_node; end + + # @param [Array, nil] + # @return [String, nil] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:113 + def compile_args(arg_list, first: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:129 + def compile_guard_clause; end + + # Compiling helpers + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:107 + def compile_value_match(value); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:133 + def multiple_access(kind); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:30 + def visit_ascend; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:58 + def visit_capture; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:37 + def visit_descend; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:84 + def visit_function_call; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:73 + def visit_intersection; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:25 + def visit_negation; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:88 + def visit_node_type; end + + # Assumes other types are atoms. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:100 + def visit_other_type; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:80 + def visit_predicate; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:92 + def visit_sequence; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:49 + def visit_unify; end + + # Lists + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:64 + def visit_union; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb:45 + def visit_wildcard; end +end + +# Compiles terms within a sequence to code that evalues to true or false. +# Compilation of the nodes that can match only a single term is deferred to +# `NodePatternSubcompiler`; only nodes that can match multiple terms are +# compiled here. +# Assumes the given `var` is a `::RuboCop::AST::Node` +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:16 +class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST::NodePattern::Compiler::Subcompiler + # Calls `compile_sequence`; the actual `compile` method + # will be used for the different terms of the sequence. + # The only case of re-entrant call to `compile` is `visit_capture` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:25 + def initialize(compiler, sequence:, var:); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:31 + def compile_sequence; end + + # @api private + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:256 + def in_sync; end + + protected + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:231 + def compile_terms(children = T.unsafe(nil), last_arity = T.unsafe(nil)); end + + # @api private + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:256 + def cur_index; end + + # yield `sync_code` iff not already in sync + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:247 + def sync; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:59 + def compile(node); end + + # Compilation helpers + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:170 + def compile_and_advance(term); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:133 + def compile_any_order_branches(matched_var); end + + # @return [Array] Else code, and init code (if any) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:142 + def compile_any_order_else; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:185 + def compile_captured_repetition(child_code, child_captures); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:124 + def compile_case(when_branches, else_code); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:366 + def compile_child_nb_guard(arity_range); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:324 + def compile_cur_index; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:330 + def compile_index(cur = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:358 + def compile_loop(term); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:352 + def compile_loop_advance(to = T.unsafe(nil)); end + + # Assumes `@cur_index` is already updated + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:203 + def compile_matched(kind); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:309 + def compile_max_matched; end + + # @return [String] code that evaluates to `false` if the matched arity is too small + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:275 + def compile_min_check; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:290 + def compile_remaining; end + + # Generate initialization code for unification variables + # @param newly_bound [Array] variable names that were newly bound + # @return [String] initialization code + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:424 + def compile_unify_init(newly_bound); end + + # @return [Hash] of {subcompiler => code} + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:378 + def compile_union_forks; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:318 + def empty_loop; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:219 + def handle_prev; end + + # Modifies in place `forks` + # Syncs our state + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:405 + def merge_forks!(forks); end + + # Modifies in place `forks` to insure that `cur_{child|index}_var` are ok + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:389 + def preserve_union_start(forks); end + + # @return [Array] total arities (as Ranges) of remaining children nodes + # E.g. For sequence `(_ _? <_ _>)`, arities are: 1, 0..1, 2 + # and remaining arities are: 3..4, 2..3, 2..2, 0..0 + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:264 + def remaining_arities(children, last_arity); end + + # returns truthy iff `@cur_index` switched to relative from end mode (i.e. < 0) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:346 + def use_index_from_end; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:88 + def visit_any_order; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:155 + def visit_capture; end + + # Single node patterns are all handled here + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:62 + def visit_other_type; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:78 + def visit_repetition; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:164 + def visit_rest; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:109 + def visit_union; end + + # NOTE: assumes `@cur_index != :seq_head`. Node types using `within_loop` must + # have `def in_sequence_head; :raise; end` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:338 + def within_loop; end +end + +# Shift of 1 from standard Ruby indices +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:18 +RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler::DELTA = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb:19 +RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler::POSITIVE = T.let(T.unsafe(nil), Proc) + +# Base class for subcompilers +# Implements visitor pattern +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:12 +class RuboCop::AST::NodePattern::Compiler::Subcompiler + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:15 + def initialize(compiler); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:20 + def compile(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:13 + def compiler; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:34 + def do_compile; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:32 + def node; end + + class << self + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:47 + def inherited(base); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:42 + def method_added(method); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/compiler/subcompiler.rb:40 + def registry; end + end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:27 +class RuboCop::AST::NodePattern::Invalid < ::StandardError; end + +# Lexer class for `NodePattern` +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:18 +class RuboCop::AST::NodePattern::Lexer < ::RuboCop::AST::NodePattern::LexerRex + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:31 + def initialize(source); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:29 + def comments; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:29 + def source_buffer; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:29 + def tokens; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:60 + def do_parse; end + + # @return [token] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:40 + def emit(type); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:48 + def emit_comment; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:52 + def emit_regexp; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:64 + def token(type, value); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:19 +RuboCop::AST::NodePattern::Lexer::Error = RuboCop::AST::NodePattern::LexerRex::ScanError + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rb:21 +RuboCop::AST::NodePattern::Lexer::REGEXP_OPTIONS = T.let(T.unsafe(nil), Hash) + +# The generated lexer RuboCop::AST::NodePattern::LexerRex +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:23 +class RuboCop::AST::NodePattern::LexerRex + # Yields on the current action. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:69 + def action; end + + # The file name / path + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:43 + def filename; end + + # The file name / path + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:43 + def filename=(_arg0); end + + # The current location in the parse. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:103 + def location; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:55 + def match; end + + # The match groups for the current scan. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:60 + def matches; end + + # Lex the next token. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:112 + def next_token; end + + # Parse the given string. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:83 + def parse(str); end + + # Read in and parse the file at +path+. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:93 + def parse_file(path); end + + # The current scanner class. Must be overridden in subclasses. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:76 + def scanner_class; end + + # The StringScanner for this lexer. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:48 + def ss; end + + # The StringScanner for this lexer. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:48 + def ss=(_arg0); end + + # The current lexical state. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:53 + def state; end + + # The current lexical state. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:53 + def state=(_arg0); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:31 +RuboCop::AST::NodePattern::LexerRex::CALL = T.let(T.unsafe(nil), Regexp) + +# :stopdoc: +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:27 +RuboCop::AST::NodePattern::LexerRex::CONST_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:29 +RuboCop::AST::NodePattern::LexerRex::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# :startdoc: +# :stopdoc: +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:36 +class RuboCop::AST::NodePattern::LexerRex::LexerError < ::StandardError; end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:30 +RuboCop::AST::NodePattern::LexerRex::NODE_TYPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:33 +RuboCop::AST::NodePattern::LexerRex::REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:32 +RuboCop::AST::NodePattern::LexerRex::REGEXP_BODY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:28 +RuboCop::AST::NodePattern::LexerRex::SYMBOL_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/lexer.rex.rb:37 +class RuboCop::AST::NodePattern::LexerRex::ScanError < ::RuboCop::AST::NodePattern::LexerRex::LexerError; end + +# Helpers for defining methods based on a pattern string +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:30 +module RuboCop::AST::NodePattern::Macros + # Define a method which applies a pattern to an AST node + # + # The new method will return nil if the node does not match. + # If the node matches, and a block is provided, the new method will + # yield to the block (passing any captures as block arguments). + # If the node matches, and no block is provided, the new method will + # return the captures, or `true` if there were none. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:38 + def def_node_matcher(method_name, pattern_str, **keyword_defaults); end + + # Define a method which recurses over the descendants of an AST node, + # checking whether any of them match the provided pattern + # + # If the method name ends with '?', the new method will return `true` + # as soon as it finds a descendant which matches. Otherwise, it will + # yield all descendants which match. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:48 + def def_node_search(method_name, pattern_str, **keyword_defaults); end +end + +# Functionality to turn `match_code` into methods/lambda +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:7 +module RuboCop::AST::NodePattern::MethodDefiner + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:37 + def as_lambda; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:27 + def compile_as_lambda; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:8 + def def_node_matcher(base, method_name, **defaults); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:21 + def def_node_search(base, method_name, **defaults); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:139 + def compile_init; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:50 + def def_helper(base, method_name, **defaults); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:114 + def emit_keyword_list(forwarding: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:132 + def emit_lambda_code; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:125 + def emit_method_code; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:63 + def emit_node_search(method_name); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:74 + def emit_node_search_body(method_name, prelude:, on_match:); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:110 + def emit_param_list; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:119 + def emit_params(*first, forwarding: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:100 + def emit_retval; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:89 + def emit_yield_capture(when_no_capture = T.unsafe(nil), yield_with: T.unsafe(nil)); end + + # This method minimizes the closure for our method + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/method_definer.rb:44 + def wrapping_block(method_name, **defaults); end +end + +# Base class for AST Nodes of a `NodePattern` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:7 +class RuboCop::AST::NodePattern::Node < ::Parser::AST::Node + include ::RuboCop::AST::Descendence + extend ::RuboCop::SimpleForwardable + + # @return [Integer, Range] An Integer for fixed length terms, otherwise a Range. + # Note: `arity.end` may be `Float::INFINITY` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:28 + def arity; end + + # @return [Range] arity as a Range + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:68 + def arity_range; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:22 + def capture?; end + + # @return [Node] most nodes have only one child + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:47 + def child; end + + # @return [Array] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:42 + def children_nodes; end + + # @return [Array, nil] replace node with result, or `nil` if no change requested. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:33 + def in_sequence_head; end + + # @return [Boolean] returns true for nodes having a Ruby literal equivalent + # that matches within a Set (e.g. `42`, `:sym` but not `/regexp/`) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:63 + def matches_within_set?; end + + # @return [Integer] nb of captures that this node will emit + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:52 + def nb_captures; end + + # To be overridden by subclasses + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:18 + def rest?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:77 + def source_range; end + + # @return [Boolean] returns whether it matches a variable number of elements + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:57 + def variadic?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:73 + def with(type: T.unsafe(nil), children: T.unsafe(nil), location: T.unsafe(nil)); end +end + +# Node class for `` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:179 +class RuboCop::AST::NodePattern::Node::AnyOrder < ::RuboCop::AST::NodePattern::Node + include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:197 + def arity; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:189 + def ends_with_rest?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:193 + def rest_node; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:185 + def term_nodes; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:182 +RuboCop::AST::NodePattern::Node::AnyOrder::ARITIES = T.let(T.unsafe(nil), Hash) + +# Node class for `$something` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:96 +class RuboCop::AST::NodePattern::Node::Capture < ::RuboCop::AST::NodePattern::Node + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:98 + def arity(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:100 + def capture?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:108 + def in_sequence_head; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:104 + def nb_captures; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:98 + def rest?(*, **, &); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:85 +module RuboCop::AST::NodePattern::Node::ForbidInSeqHead + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:86 + def in_sequence_head; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:139 +RuboCop::AST::NodePattern::Node::FunctionCall = RuboCop::AST::NodePattern::Node::Predicate + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:81 +RuboCop::AST::NodePattern::Node::INT_TO_RANGE = T.let(T.unsafe(nil), Hash) + +# Registry +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:255 +RuboCop::AST::NodePattern::Node::MAP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:11 +RuboCop::AST::NodePattern::Node::MATCHES_WITHIN_SET = T.let(T.unsafe(nil), Set) + +# Node class for `predicate?(:arg, :list)` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:130 +class RuboCop::AST::NodePattern::Node::Predicate < ::RuboCop::AST::NodePattern::Node + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:135 + def arg_list; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:131 + def method_name; end +end + +# Node class for `int+` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:142 +class RuboCop::AST::NodePattern::Node::Repetition < ::RuboCop::AST::NodePattern::Node + include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:155 + def arity; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:145 + def operator; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:149 +RuboCop::AST::NodePattern::Node::Repetition::ARITIES = T.let(T.unsafe(nil), Hash) + +# Node class for `...` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:161 +class RuboCop::AST::NodePattern::Node::Rest < ::RuboCop::AST::NodePattern::Node + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:169 + def arity; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:173 + def in_sequence_head; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:165 + def rest?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:162 +RuboCop::AST::NodePattern::Node::Rest::ARITY = T.let(T.unsafe(nil), Range) + +# Node class for `(type first second ...)` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:117 +class RuboCop::AST::NodePattern::Node::Sequence < ::RuboCop::AST::NodePattern::Node + include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:120 + def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end +end + +# A list (potentially empty) of nodes; part of a Union +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:205 +class RuboCop::AST::NodePattern::Node::Subsequence < ::RuboCop::AST::NodePattern::Node + include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:208 + def arity; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:213 + def in_sequence_head; end +end + +# Node class for `{ ... }` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:223 +class RuboCop::AST::NodePattern::Node::Union < ::RuboCop::AST::NodePattern::Node + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:224 + def arity; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:231 + def in_sequence_head; end + + # Each child in a union must contain the same number + # of captures. Only one branch ends up capturing. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/node.rb:249 + def nb_captures; end +end + +# Parser for NodePattern +# Note: class reopened in `parser.racc` +# +# Doc on how this fits in the compiling process: +# /docs/modules/ROOT/pages/node_pattern.adoc +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:12 +class RuboCop::AST::NodePattern::Parser < ::Racc::Parser + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:19 + def initialize(builder = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:335 + def _reduce_10(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:339 + def _reduce_11(val, _values); end + + # reduce 12 omitted + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:345 + def _reduce_13(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:349 + def _reduce_14(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:353 + def _reduce_15(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:357 + def _reduce_16(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:361 + def _reduce_17(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:365 + def _reduce_18(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:369 + def _reduce_19(val, _values); end + + # reduce 1 omitted + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:303 + def _reduce_2(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:373 + def _reduce_20(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:377 + def _reduce_21(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:381 + def _reduce_22(val, _values); end + + # reduce 24 omitted + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:389 + def _reduce_25(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:395 + def _reduce_26(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:307 + def _reduce_3(val, _values); end + + # reduce 32 omitted + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:415 + def _reduce_33(val, _values); end + + # reduce 36 omitted + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:425 + def _reduce_37(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:429 + def _reduce_38(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:433 + def _reduce_39(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:311 + def _reduce_4(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:437 + def _reduce_40(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:441 + def _reduce_41(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:445 + def _reduce_42(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:449 + def _reduce_43(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:453 + def _reduce_44(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:457 + def _reduce_45(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:461 + def _reduce_46(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:315 + def _reduce_5(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:319 + def _reduce_6(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:323 + def _reduce_7(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:327 + def _reduce_8(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:331 + def _reduce_9(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:465 + def _reduce_none(val, _values); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_atom(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_call(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_capture(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_list(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_unary_op(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_union(*, **, &); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:40 + def inspect; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:48 + def next_token(*, **, &); end + + # (Similar API to `parser` gem) + # Parses a source and returns the AST. + # + # @param [Parser::Source::Buffer, String] source_buffer The source buffer to parse. + # @return [NodePattern::Node] + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:31 + def parse(source); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:50 + def enforce_unary(node); end + + # Overrides Racc::Parser's method: + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:59 + def on_error(token, val, _vstack); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:16 +RuboCop::AST::NodePattern::Parser::Builder = RuboCop::AST::NodePattern::Builder + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:17 +RuboCop::AST::NodePattern::Parser::Lexer = RuboCop::AST::NodePattern::Lexer + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:227 +RuboCop::AST::NodePattern::Parser::Racc_arg = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:295 +RuboCop::AST::NodePattern::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.racc.rb:244 +RuboCop::AST::NodePattern::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) + +# Overrides Parser to use `WithMeta` variants and provide additional methods +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:8 +class RuboCop::AST::NodePattern::Parser::WithMeta < ::RuboCop::AST::NodePattern::Parser + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:98 + def comments; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:100 + def do_parse; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:98 + def tokens; end +end + +# Overrides Builder to emit nodes with locations +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:39 +class RuboCop::AST::NodePattern::Parser::WithMeta::Builder < ::RuboCop::AST::NodePattern::Builder + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:40 + def emit_atom(type, token); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:61 + def emit_call(type, selector_t, args = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:55 + def emit_list(type, begin_t, children, end_t); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:49 + def emit_unary_op(type, operator_t = T.unsafe(nil), *children); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:81 + def join_exprs(left_expr, right_expr); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:75 + def loc(token_or_range); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:71 + def n(type, children, source_map); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:85 + def source_map(token_or_range, begin_t: T.unsafe(nil), end_t: T.unsafe(nil), operator_t: T.unsafe(nil), selector_t: T.unsafe(nil)); end +end + +# Overrides Lexer to token locations and comments +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:10 +class RuboCop::AST::NodePattern::Parser::WithMeta::Lexer < ::RuboCop::AST::NodePattern::Lexer + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:13 + def initialize(str_or_buffer); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:27 + def emit_comment; end + + # @return [::Parser::Source::Range] last match's position + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:33 + def pos; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:11 + def source_buffer; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/with_meta.rb:23 + def token(type, value); end +end + +# Utility to assign a set of values to a constant +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:7 +module RuboCop::AST::NodePattern::Sets + class << self + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:31 + def [](set); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:15 + def name(set); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:22 + def uniq(name); end + end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:14 +RuboCop::AST::NodePattern::Sets::MAX = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:8 +RuboCop::AST::NodePattern::Sets::REGISTRY = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_0_1 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_10_10 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_1_1 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_1_2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ADD_DEPENDENCY_ADD_RUNTIME_DEPENDENCY_ADD_DEVELOPMENT_DEPENDENCY = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ALL_CONTEXT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_AND_RETURN_AND_RAISE_AND_THROW_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ANY_EMPTY_NONE_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ANY_NONE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ARRAY_HASH = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ATTR_READER_ATTR_WRITER_ATTR_ACCESSOR_ATTR = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_BASE_COP = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_BE_EQ_EQL_EQUAL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_BE_TRUTHY_BE_FALSEY_BE_FALSY_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_BRANCH_REF_TAG = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CALL_RUN = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CAPTURE2_CAPTURE2E_CAPTURE3_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CIPHER_DIGEST = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CLASS_EVAL_INSTANCE_EVAL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CLASS_EVAL_MODULE_EVAL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CLASS_MODULE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CLASS_MODULE_STRUCT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CLONE_DUP_FREEZE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CONTEXT_CTX = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CONTEXT_CTX_2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_CONTEXT_SHARED_CONTEXT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_COUNT_LENGTH_SIZE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_COVER_INCLUDE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_DEFINE_METHOD_DEFINE_SINGLETON_METHOD = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_DEF_DELEGATORS_DEF_INSTANCE_DELEGATORS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_DEF_DELEGATOR_DEF_INSTANCE_DELEGATOR = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_DESCRIBE_XDESCRIBE_FDESCRIBE_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_DOUBLE_SPY = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EACH_EXAMPLE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EACH_WITH_INDEX_WITH_INDEX = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EACH_WITH_OBJECT_WITH_OBJECT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EQL_EQ_BE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ESCAPE_ENCODE_UNESCAPE_DECODE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EXACTLY_AT_LEAST_AT_MOST = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EXIST_EXISTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EXPECT_ALLOW = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_EXPECT_EXPECT_ANY_INSTANCE_OF = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FILETEST_FILE_DIR_SHELL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FILE_DIR = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FILE_FILETEST = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FILE_TEMPFILE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FILE_TEMPFILE_STRINGIO = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FIND_DETECT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FIRST_LAST__ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FIXNUM_BIGNUM = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_FORMAT_SPRINTF_PRINTF = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_GETHOSTBYADDR_GETHOSTBYNAME = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_GROUP_BY_TO_H_TALLY_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_GSUB_GSUB = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_INCLUDE_EXTEND_PREPEND = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_INSTANCE_EVAL_CLASS_EVAL_MODULE_EVAL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_INSTANCE_EXEC_CLASS_EXEC_MODULE_EXEC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_INTEGER_BIGDECIMAL_COMPLEX_RATIONAL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_IS_EXPECTED_SHOULD_SHOULD_NOT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_KEYS_VALUES = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_KEY_HAS_KEY_FETCH_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_LAST_FIRST = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_LENGTH_SIZE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_LET_LET = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_LOAD_RESTORE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_MAP_COLLECT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_MAP_FILTER_MAP = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_MAX_BY_MIN_BY_MINMAX_BY = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_MEMBER_INCLUDE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_MODULE_FUNCTION_RUBY2_KEYWORDS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_NEW_ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_NEW_COMPILE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_NEW_OPEN = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_NIL_ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ON_SEND_AFTER_SEND = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ON_SEND_AFTER_SEND_2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_PIPELINE_PIPELINE_R_PIPELINE_RW_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_PRIVATE_PROTECTED_PRIVATE_CLASS_METHOD = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_PRIVATE_PROTECTED_PUBLIC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_PROC_LAMBDA = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_PUBLIC_CONSTANT_PRIVATE_CONSTANT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_PUBLIC_PROTECTED_PRIVATE_MODULE_FUNCTION = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RAISE_FAIL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RAISE_FAIL_THROW_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_READ_BINREAD = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RECEIVE_HAVE_RECEIVED = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RECEIVE_MESSAGE_CHAIN_STUB_CHAIN = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RECEIVE_RECEIVE_MESSAGES_RECEIVE_MESSAGE_CHAIN_HAVE_RECEIVED = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RECEIVE_RECEIVE_MESSAGE_CHAIN = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_REDUCE_INJECT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_REJECT_REJECT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_RESOLVER_HASH_KEY = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_REVERSE_REVERSE_EACH = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SELECT_FILTER_FIND_ALL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT_FILTER_FILTER = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SEND_PUBLIC_SEND___SEND__ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SEND___SEND__ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SET_HEADER_GET_HEADER_DELETE_HEADER_HAS_HEADER = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SET_SORTEDSET = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SHOULD_SHOULD_NOT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SKIP_PENDING = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SORT_BY_SORT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SPAWN_SYSTEM = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SPRINTF_FORMAT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SQUISH_SQUISH = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_STDOUT_STDERR = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_STRUCT_CLASS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_SUCC_PRED_NEXT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TASK_NAMESPACE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TO_ENUM_ENUM_FOR = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TO_H_TO_HASH = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TO_H_TO_HASH_MERGE_ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TO_I_TO_F_TO_C_TO_R = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TRUE_FALSE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_TYPE_MEMBER_TYPE_TEMPLATE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_ZERO_POSITIVE_NEGATIVE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__AT_SLICE = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__DUP = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__EQUAL_EQL = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__FETCH = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__GLOB = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET__PUSH_APPEND = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___3 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___4 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___5 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___6 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___7 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___8 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET___METHOD_____CALLEE__ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET____ = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET____2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET____ETC = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET____ETC_2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET____ETC_3 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET____ETC_4 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_____2 = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern.rb:56 +RuboCop::AST::NodePattern::VAR = T.let(T.unsafe(nil), String) + +# Common functionality for primitive numeric nodes: `int`, `float`, `rational`, `complex`... +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/numeric_node.rb:6 +module RuboCop::AST::NumericNode + # Checks whether this literal has a sign. + # + # @example + # + # +42 + # + # @return [Boolean] whether this literal has a sign. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/numeric_node.rb:17 + def sign?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/numeric_node.rb:7 +RuboCop::AST::NumericNode::SIGN_REGEX = T.let(T.unsafe(nil), Regexp) + +# A node extension for `op_asgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:8 +class RuboCop::AST::OpAsgnNode < ::RuboCop::AST::Node + # @return [AsgnNode] the assignment node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:10 + def assignment_node; end + + # The expression being assigned to the variable. + # + # @return [Node] the expression being assigned. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:32 + def expression; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:13 + def lhs; end + + # The name of the variable being assigned as a symbol. + # + # @return [Symbol] the name of the variable being assigned + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:18 + def name; end + + # The operator being used for assignment as a symbol. + # + # @return [Symbol] the assignment operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:25 + def operator; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/op_asgn_node.rb:35 + def rhs; end +end + +# A node extension for `op_asgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/or_asgn_node.rb:8 +class RuboCop::AST::OrAsgnNode < ::RuboCop::AST::OpAsgnNode + # The operator being used for assignment as a symbol. + # + # @return [Symbol] the assignment operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/or_asgn_node.rb:12 + def operator; end +end + +# A node extension for `or` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `or` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/or_node.rb:8 +class RuboCop::AST::OrNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BinaryOperatorNode + include ::RuboCop::AST::PredicateOperatorNode + + # Returns the alternate operator of the `or` as a string. + # Returns `or` for `||` and vice versa. + # + # @return [String] the alternate of the `or` operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/or_node.rb:16 + def alternate_operator; end + + # Returns the inverse keyword of the `or` node as a string. + # Returns `and` for `or` and `&&` for `||`. + # + # @return [String] the inverse of the `or` operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/or_node.rb:24 + def inverse_operator; end +end + +# A node extension for `pair` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `pair` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:8 +class RuboCop::AST::PairNode < ::RuboCop::AST::Node + include ::RuboCop::AST::HashElementNode + + # Checks whether the `pair` uses a colon delimiter. + # + # @return [Boolean] whether this `pair` uses a colon delimiter + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:30 + def colon?; end + + # Returns the delimiter of the `pair` as a string. Returns `=>` for a + # hash rocket delimited `pair` and `:` for a colon delimited `pair`. + # + # @param [Boolean] with_spacing whether to include spacing + # @return [String] the delimiter of the `pair` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:39 + def delimiter(*deprecated, with_spacing: T.unsafe(nil)); end + + # Checks whether the `pair` uses a hash rocket delimiter. + # + # @return [Boolean] whether this `pair` uses a hash rocket delimiter + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:23 + def hash_rocket?; end + + # Returns the inverse delimiter of the `pair` as a string. + # + # @param [Boolean] with_spacing whether to include spacing + # @return [String] the inverse delimiter of the `pair` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:51 + def inverse_delimiter(*deprecated, with_spacing: T.unsafe(nil)); end + + # Checks whether the `pair` uses hash value omission. + # + # @return [Boolean] whether this `pair` uses hash value omission + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:69 + def value_omission?; end + + # Checks whether the value starts on its own line. + # + # @return [Boolean] whether the value in the `pair` starts its own line + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:62 + def value_on_new_line?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:15 +RuboCop::AST::PairNode::COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:11 +RuboCop::AST::PairNode::HASH_ROCKET = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:17 +RuboCop::AST::PairNode::SPACED_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/pair_node.rb:13 +RuboCop::AST::PairNode::SPACED_HASH_ROCKET = T.let(T.unsafe(nil), String) + +# Requires implementing `arguments`. +# +# Common functionality for nodes that are parameterized: +# `send`, `super`, `zsuper`, `def`, `defs` +# and (modern only): `index`, `indexasgn`, `lambda` +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:10 +module RuboCop::AST::ParameterizedNode + # Checks whether this node has any arguments. + # + # @return [Boolean] whether this node has any arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:40 + def arguments?; end + + # Whether the last argument of the node is a block pass, + # i.e. `&block`. + # + # @return [Boolean] whether the last argument of the node is a block pass + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:58 + def block_argument?; end + + # A shorthand for getting the first argument of the node. + # Equivalent to `arguments.first`. + # + # @return [Node, nil] the first argument of the node, + # or `nil` if there are no arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:24 + def first_argument; end + + # A shorthand for getting the last argument of the node. + # Equivalent to `arguments.last`. + # + # @return [Node, nil] the last argument of the node, + # or `nil` if there are no arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:33 + def last_argument; end + + # Checks whether this node's arguments are wrapped in parentheses. + # + # @return [Boolean] whether this node's arguments are + # wrapped in parentheses + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:15 + def parenthesized?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:52 + def rest_argument?; end + + # Checks whether any argument of the node is a splat + # argument, i.e. `*splat`. + # + # @return [Boolean] whether the node is a splat argument + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:48 + def splat_argument?; end +end + +# A specialized `ParameterizedNode`. +# Requires implementing `first_argument_index` +# Implements `arguments` as `children[first_argument_index..-1]` +# and optimizes other calls +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:84 +module RuboCop::AST::ParameterizedNode::RestArguments + include ::RuboCop::AST::ParameterizedNode + + # @return [Array] arguments, if any + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:90 + def arguments; end + + # Checks whether this node has any arguments. + # + # @return [Boolean] whether this node has any arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:120 + def arguments?; end + + # A shorthand for getting the first argument of the node. + # Equivalent to `arguments.first`. + # + # @return [Node, nil] the first argument of the node, + # or `nil` if there are no arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:104 + def first_argument; end + + # A shorthand for getting the last argument of the node. + # Equivalent to `arguments.last`. + # + # @return [Node, nil] the last argument of the node, + # or `nil` if there are no arguments + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:113 + def last_argument; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:87 +RuboCop::AST::ParameterizedNode::RestArguments::EMPTY_ARGUMENTS = T.let(T.unsafe(nil), Array) + +# A specialized `ParameterizedNode` for node that have a single child +# containing either `nil`, an argument, or a `begin` node with all the +# arguments +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:66 +module RuboCop::AST::ParameterizedNode::WrappedArguments + include ::RuboCop::AST::ParameterizedNode + + # @return [Array] The arguments of the node. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/parameterized_node.rb:70 + def arguments; end +end + +# Common functionality for nodes that are predicates: +# `or`, `and` ... +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:7 +module RuboCop::AST::PredicateOperatorNode + # Checks whether this is a logical operator. + # + # @return [Boolean] whether this is a logical operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:32 + def logical_operator?; end + + # Returns the operator as a string. + # + # @return [String] the operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:25 + def operator; end + + # Checks whether this is a semantic operator. + # + # @return [Boolean] whether this is a semantic operator + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:39 + def semantic_operator?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:8 +RuboCop::AST::PredicateOperatorNode::LOGICAL_AND = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:17 +RuboCop::AST::PredicateOperatorNode::LOGICAL_OPERATORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:12 +RuboCop::AST::PredicateOperatorNode::LOGICAL_OR = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:10 +RuboCop::AST::PredicateOperatorNode::SEMANTIC_AND = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:19 +RuboCop::AST::PredicateOperatorNode::SEMANTIC_OPERATORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/predicate_operator_node.rb:14 +RuboCop::AST::PredicateOperatorNode::SEMANTIC_OR = T.let(T.unsafe(nil), String) + +# Extends the prism translation parsers so that the conversion of tokens +# into the `parser` gem's format is deferred until the tokens are first +# accessed. Building the tokens is a significant part of the translation +# cost, and not every caller needs them. +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:33 +module RuboCop::AST::PrismLazyTokens + # Same contract as `Parser::Base#tokenize`, except the tokens are + # returned as a callable that performs the conversion when invoked. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:36 + def tokenize_deferred(source_buffer); end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:54 + def deferred_tokens(source_buffer, tokens, offset_cache); end +end + +# A `Prism` interface's class that provides a fixed `Prism::ParseLexResult` instead of parsing. +# +# This class implements the `parse_lex` method to return a preparsed `Prism::ParseLexResult` +# rather than parsing the source code. When the parse result is already available externally, +# such as in Ruby LSP, the Prism parsing process can be bypassed. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:12 +class RuboCop::AST::PrismPreparsed + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:13 + def initialize(prism_result); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:23 + def parse_lex(_source, **_prism_options); end +end + +# A node extension for `procarg0` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all `arg` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/procarg0_node.rb:8 +class RuboCop::AST::Procarg0Node < ::RuboCop::AST::ArgNode + # Returns the name of an argument. + # + # @return [Symbol, nil] the name of the argument + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/procarg0_node.rb:12 + def name; end +end + +# ProcessedSource contains objects which are generated by Parser +# and other information such as disabled lines for cops. +# It also provides a convenient way to access source lines. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:69 +class RuboCop::AST::ProcessedSource + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:94 + def initialize(source, ruby_version, path = T.unsafe(nil), parser_engine: T.unsafe(nil), prism_result: T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:135 + def [](*args); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def ast; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:114 + def ast_with_comments; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:174 + def blank?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def buffer; end + + # Raw source checksum for tracking infinite loops. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:146 + def checksum; end + + # @return [Comment, nil] the comment at that line, if any. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:179 + def comment_at_line(line); end + + # @deprecated use contains_comment? + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:205 + def commented?(source_range); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def comments; end + + # @deprecated Use `each_comment_in_lines` + # Should have been called `comments_before_or_at_line`. Doubtful it has of any valid use. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:209 + def comments_before_line(line); end + + # @return [Boolean] if any of the lines in the given `source_range` has a comment. + # Consider using `each_comment_in_lines` instead + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:201 + def contains_comment?(source_range); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:225 + def current_line(token); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def diagnostics; end + + # @deprecated Use `comments.each` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:151 + def each_comment(&block); end + + # Enumerates on the comments contained with the given `line_range` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:189 + def each_comment_in_lines(line_range); end + + # @deprecated Use `tokens.each` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:161 + def each_token(&block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:170 + def file_path; end + + # @deprecated Use `comment_at_line`, `each_comment_in_lines`, or `comments.find` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:156 + def find_comment(&block); end + + # @deprecated Use `tokens.find` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:166 + def find_token(&block); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:259 + def first_token_of(range_or_node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:229 + def following_line(token); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:263 + def last_token_of(range_or_node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:233 + def line_indentation(line_number); end + + # @return [Boolean] if the given line number has a comment. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:184 + def line_with_comment?(line); end + + # Returns the source lines, line break characters removed, excluding a + # possible __END__ and everything that comes after. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:122 + def lines; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def parser_engine; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def parser_error; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def path; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:219 + def preceding_line(token); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def raw_source; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:79 + def ruby_version; end + + # The tokens list is always sorted by token position, except for cases when heredoc + # is passed as a method argument. In this case tokens are interleaved by + # heredoc contents' tokens. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:270 + def sorted_tokens; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:213 + def start_with?(string); end + + # The tokens of the source. With the prism engine the tokens are built + # lazily on first access, since their conversion is costly and not + # every caller needs them. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:243 + def tokens; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:253 + def tokens_within(range_or_node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:139 + def valid_syntax?; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:437 + def builder_class(parser_engine); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:301 + def comment_index; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:447 + def create_parser(ruby_version, parser_engine, prism_result); end + + # Prism is used for all Ruby versions it can parse (3.3 and later); + # the Parser gem does not support Ruby 3.5 or later and is not fully + # compatible with Ruby 3.4. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:496 + def default_parser_engine(ruby_version); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:504 + def first_token_index(range_or_node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:509 + def last_token_index(range_or_node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:479 + def normalize_parser_engine(parser_engine, ruby_version); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:307 + def parse(source, ruby_version, parser_engine, prism_result); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:351 + def parse_and_lex(parser); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:369 + def parser_class(ruby_version, parser_engine); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:359 + def parser_tokens; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:514 + def source_range(range_or_node); end + + # The tokens may be an already converted array, or a deferred conversion + # to be performed when the tokens are first accessed. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:328 + def store_tokens(tokens); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:336 + def tokenize(parser); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:284 + def tokens_sorted?; end + + # `__END__` only starts a data section when it isn't nested inside a + # string or heredoc, which is what the last token's line disambiguates. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:290 + def trim_lines_after_data_marker(all_lines); end + + class << self + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:82 + def from_file(path, ruby_version, parser_engine: T.unsafe(nil)); end + + # Subclasses of the prism translation parsers with lazily built tokens. + # @api private + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:89 + def lazy_tokens_parser_class(base); end + end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:73 +RuboCop::AST::ProcessedSource::INVALID_LEVELS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:76 +RuboCop::AST::ProcessedSource::PARSER_ENGINES = T.let(T.unsafe(nil), Array) + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/processed_source.rb:71 +RuboCop::AST::ProcessedSource::STRING_SOURCE_NAME = T.let(T.unsafe(nil), String) + +# A node extension for `irange` and `erange` nodes. This will be used in +# place of a plain node when the builder constructs the AST, making its +# methods available to all `irange` and `erange` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/range_node.rb:8 +class RuboCop::AST::RangeNode < ::RuboCop::AST::Node + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/range_node.rb:9 + def begin; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/range_node.rb:13 + def end; end +end + +# A node extension for `rational` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available to +# all `rational` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/rational_node.rb:8 +class RuboCop::AST::RationalNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode + include ::RuboCop::AST::NumericNode +end + +# A node extension for `regexp` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `regexp` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:8 +class RuboCop::AST::RegexpNode < ::RuboCop::AST::Node + # @return [String] a string of regexp content + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:37 + def content; end + + # @return [Bool] if char is one of the delimiters + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:57 + def delimiter?(char); end + + # @return [String] the regexp delimiters (without %r) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:52 + def delimiters; end + + # @return [Bool] if regexp uses the extended regopt + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:72 + def extended?; end + + # @return [Bool] if regexp uses the fixed-encoding regopt + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:92 + def fixed_encoding?; end + + # @return [Bool] if regexp uses the ignore-case regopt + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:77 + def ignore_case?; end + + # @return [Bool] if regexp contains interpolation + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:62 + def interpolation?; end + + # @return [Bool] if regexp uses the multiline regopt + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:67 + def multiline_mode?; end + + # @return [Bool] if regexp uses the no-encoding regopt + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:87 + def no_encoding?; end + + # NOTE: The 'o' option is ignored. + # + # @return [Integer] the Regexp option bits as returned by Regexp#options + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:32 + def options; end + + # @return [Bool] if the regexp is a %r{...} literal (using any delimiters) + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:47 + def percent_r_literal?; end + + # @return [RuboCop::AST::Node] a regopt node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:25 + def regopt; end + + # @return [Bool] if regexp uses the single-interpolation regopt + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:82 + def single_interpolation?; end + + # @return [Bool] if the regexp is a /.../ literal + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:42 + def slash_literal?; end + + # @return [Regexp] a regexp of this node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:20 + def to_regexp; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:98 + def regopt_include?(option); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/regexp_node.rb:9 +RuboCop::AST::RegexpNode::OPTIONS = T.let(T.unsafe(nil), Hash) + +# A node extension for `resbody` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `resbody` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/resbody_node.rb:8 +class RuboCop::AST::ResbodyNode < ::RuboCop::AST::Node + # Returns the body of the `rescue` clause. + # + # @return [Node, nil] The body of the `resbody`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/resbody_node.rb:12 + def body; end + + # Returns the index of the `resbody` branch within the exception handling statement. + # + # @return [Integer] the index of the `resbody` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/resbody_node.rb:40 + def branch_index; end + + # Returns the exception variable of the `rescue` clause. + # + # @return [Node, nil] The exception variable of the `resbody`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/resbody_node.rb:33 + def exception_variable; end + + # Returns an array of all the exceptions in the `rescue` clause. + # + # @return [Array] an array of exception nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/resbody_node.rb:19 + def exceptions; end +end + +# A node extension for `rescue` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `rescue` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/rescue_node.rb:8 +class RuboCop::AST::RescueNode < ::RuboCop::AST::Node + # Returns the body of the rescue node. + # + # @return [Node, nil] The body of the rescue node. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/rescue_node.rb:12 + def body; end + + # Returns an array of all the rescue branches in the exception handling statement. + # + # @return [Array] an array of the bodies of the rescue branches + # and the else (if any). Note that these bodies could be nil. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/rescue_node.rb:27 + def branches; end + + # Checks whether this exception handling statement has an `else` branch. + # + # @return [Boolean] whether the exception handling statement has an `else` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/rescue_node.rb:44 + def else?; end + + # Returns the else branch of the exception handling statement, if any. + # + # @return [Node] the else branch node of the exception handling statement + # @return [nil] if the exception handling statement does not have an else branch. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/rescue_node.rb:37 + def else_branch; end + + # Returns an array of all the rescue branches in the exception handling statement. + # + # @return [Array] an array of `resbody` nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/rescue_node.rb:19 + def resbody_branches; end +end + +# A node extension for `return` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `return` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/return_node.rb:8 +class RuboCop::AST::ReturnNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::WrappedArguments +end + +# Responsible for compatibility with main gem +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/rubocop_compatibility.rb:8 +module RuboCop::AST::RuboCopCompatibility + # pkg:gem/rubocop-ast#lib/rubocop/ast/rubocop_compatibility.rb:13 + def rubocop_loaded; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/rubocop_compatibility.rb:9 +RuboCop::AST::RuboCopCompatibility::INCOMPATIBLE_COPS = T.let(T.unsafe(nil), Hash) + +# A node extension for `sclass` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `sclass` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/self_class_node.rb:8 +class RuboCop::AST::SelfClassNode < ::RuboCop::AST::Node + # The body of this `sclass` node. + # + # @return [Node, nil] the body of the class + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/self_class_node.rb:19 + def body; end + + # The identifier for this `sclass` node. (Always `self`.) + # + # @return [Node] the identifier of the class + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/self_class_node.rb:12 + def identifier; end +end + +# A node extension for `send` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `send` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/send_node.rb:8 +class RuboCop::AST::SendNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::ParameterizedNode::RestArguments + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/send_node.rb:13 + def attribute_accessor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/send_node.rb:18 + def send_type?; end + + private + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/send_node.rb:24 + def first_argument_index; end +end + +# This module provides a shorthand method to create a {Node} like +# `Parser::AST::Sexp`. +# +# @see https://www.rubydoc.info/gems/ast/AST/Sexp +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/sexp.rb:9 +module RuboCop::AST::Sexp + # Creates a {Node} with type `type` and children `children`. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/sexp.rb:11 + def s(type, *children); end +end + +# A node extension for `str`, `dstr`, and `xstr` nodes. This will be used +# in place of a plain node when the builder constructs the AST, making +# its methods available to all `str` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:8 +class RuboCop::AST::StrNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:26 + def character_literal?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:22 + def double_quoted?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:30 + def heredoc?; end + + # Checks whether the string literal is delimited by percent brackets. + # + # @overload percent_literal? + # Check for any string percent literal. + # + # @overload percent_literal?(type) + # Check for a string percent literal of type `type`. + # + # @param type [Symbol] an optional percent literal type + # + # @return [Boolean] whether the string is enclosed in percent brackets + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:45 + def percent_literal?(type = T.unsafe(nil)); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:18 + def single_quoted?; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/str_node.rb:11 +RuboCop::AST::StrNode::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Hash) + +# A node extension for `super`- and `zsuper` nodes. This will be used in +# place of a plain node when the builder constructs the AST, making its +# methods available to all `super`- and `zsuper` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/super_node.rb:8 +class RuboCop::AST::SuperNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/super_node.rb:20 + def arguments; end + + # Custom destructuring method. This can be used to normalize + # destructuring for different variations of the node. + # + # @return [Array] the different parts of the `super` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/super_node.rb:16 + def node_parts; end +end + +# A node extension for `sym` nodes. This will be used in place of a +# plain node when the builder constructs the AST, making its methods +# available to all `sym` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/symbol_node.rb:8 +class RuboCop::AST::SymbolNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode +end + +# A basic wrapper around Parser's tokens. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:6 +class RuboCop::AST::Token + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:18 + def initialize(pos, type, text); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:33 + def begin_pos; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:29 + def column; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:102 + def comma?; end + + # Type Predicates + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:58 + def comment?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:106 + def dot?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:118 + def end?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:37 + def end_pos; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:122 + def equal_sign?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:66 + def left_array_bracket?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:82 + def left_brace?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:74 + def left_bracket?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:86 + def left_curly_brace?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:94 + def left_parens?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:70 + def left_ref_bracket?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:25 + def line; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:126 + def new_line?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:10 + def pos; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:110 + def regexp_dots?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:114 + def rescue_modifier?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:78 + def right_bracket?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:90 + def right_curly_brace?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:98 + def right_parens?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:62 + def semicolon?; end + + # Checks if there is whitespace after token + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:46 + def space_after?; end + + # Checks if there is whitespace before token + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:51 + def space_before?; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:10 + def text; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:41 + def to_s; end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:10 + def type; end + + class << self + # pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:12 + def from_parser_token(parser_token); end + end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:8 +RuboCop::AST::Token::LEFT_CURLY_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/token.rb:7 +RuboCop::AST::Token::LEFT_PAREN_TYPES = T.let(T.unsafe(nil), Array) + +# Provides methods for traversing an AST. +# Does not transform an AST; for that, use Parser::AST::Processor. +# Override methods to perform custom processing. Remember to call `super` +# if you want to recursively process descendant nodes. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:9 +module RuboCop::AST::Traversal + extend ::RuboCop::AST::Traversal::CallbackCompiler + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on___ENCODING__(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on___FILE__(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on___LINE__(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_alias(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_and(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_and_asgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_arg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_arg_expr(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_args(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_array(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_array_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_array_pattern_with_tail(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_back_ref(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_begin(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_block(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_block_pass(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_blockarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_blocknilarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_break(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_case(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_case_match(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_casgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_cbase(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_class(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_complex(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_const(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_const_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_csend(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_cvar(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_cvasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_def(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_defined?(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_defs(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_dstr(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_dsym(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_eflipflop(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_empty_else(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_ensure(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_erange(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_false(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_find_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_float(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_for(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_forward_arg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_forward_args(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_forwarded_args(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_forwarded_kwrestarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_forwarded_restarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_gvar(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_gvasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_hash(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_hash_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_if(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_if_guard(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_iflipflop(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_in_match(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_in_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_index(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_indexasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_int(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_irange(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_itblock(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_ivar(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_ivasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwargs(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwbegin(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwnilarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwoptarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwrestarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_kwsplat(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_lambda(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_lvar(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_lvasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_masgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_alt(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_as(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_current_line(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_nil_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_pattern(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_pattern_p(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_rest(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_var(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_with_lvasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_match_with_trailing_comma(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_mlhs(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_module(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_mrasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_next(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_nil(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_not(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_nth_ref(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_numblock(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_op_asgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_optarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_or(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_or_asgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_pair(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_pin(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_postexe(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_preexe(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_procarg0(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_rasgn(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_rational(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_redo(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_regexp(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_regopt(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_resbody(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_rescue(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_restarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_retry(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_return(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_sclass(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_self(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_send(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_shadowarg(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_splat(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_str(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_super(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_sym(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_true(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_undef(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_unless_guard(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_until(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_until_post(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_when(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:43 + def on_while(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_while_post(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_xstr(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_yield(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:50 + def on_zsuper(node); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:17 + def walk(node); end +end + +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:25 +module RuboCop::AST::Traversal::CallbackCompiler + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:54 + def body(child_node_types, expected_children_count); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:68 + def children_count_check_code(range); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:38 + def def_callback(type, *child_node_types, expected_children_count: T.unsafe(nil), body: T.unsafe(nil)); end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:26 +RuboCop::AST::Traversal::CallbackCompiler::SEND = T.let(T.unsafe(nil), String) + +# How a particular child node should be visited. For example, if a child node +# can be nil it should be guarded behind a nil check. Or, if a child node is a literal +# (like a symbol) then the literal itself should not be visited. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:32 +RuboCop::AST::Traversal::CallbackCompiler::TEMPLATE = T.let(T.unsafe(nil), Hash) + +# Only for debugging. +# @api private +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:12 +class RuboCop::AST::Traversal::DebugError < ::RuntimeError; end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:110 +RuboCop::AST::Traversal::NO_CHILD_NODES = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/traversal.rb:15 +RuboCop::AST::Traversal::TYPE_TO_METHOD = T.let(T.unsafe(nil), Hash) + +# A node extension for `until` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `until` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/until_node.rb:8 +class RuboCop::AST::UntilNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConditionalNode + include ::RuboCop::AST::ModifierNode + + # Checks whether the `until` node has a `do` keyword. + # + # @return [Boolean] whether the `until` node has a `do` keyword + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/until_node.rb:30 + def do?; end + + # Returns the inverse keyword of the `until` node as a string. + # Returns `while` for `until` nodes and vice versa. + # + # @return [String] the inverse keyword of the `until` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/until_node.rb:23 + def inverse_keyword; end + + # Returns the keyword of the `until` statement as a string. + # + # @return [String] the keyword of the `until` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/until_node.rb:15 + def keyword; end +end + +# A node extension for `lvar`, `ivar`, `cvar` and `gvar` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/var_node.rb:8 +class RuboCop::AST::VarNode < ::RuboCop::AST::Node + # @return [Symbol] The name of the variable. + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/var_node.rb:10 + def name; end +end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/version.rb:5 +module RuboCop::AST::Version; end + +# pkg:gem/rubocop-ast#lib/rubocop/ast/version.rb:6 +RuboCop::AST::Version::STRING = T.let(T.unsafe(nil), String) + +# A node extension for `when` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `when` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/when_node.rb:8 +class RuboCop::AST::WhenNode < ::RuboCop::AST::Node + # Returns the body of the `when` node. + # + # @return [Node, nil] the body of the `when` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/when_node.rb:42 + def body; end + + # Returns the index of the `when` branch within the `case` statement. + # + # @return [Integer] the index of the `when` branch + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/when_node.rb:28 + def branch_index; end + + # Returns an array of all the conditions in the `when` branch. + # + # @return [Array] an array of condition nodes + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/when_node.rb:12 + def conditions; end + + # @deprecated Use `conditions.each` + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/when_node.rb:17 + def each_condition(&block); end + + # Checks whether the `when` node has a `then` keyword. + # + # @return [Boolean] whether the `when` node has a `then` keyword + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/when_node.rb:35 + def then?; end +end + +# A node extension for `while` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `while` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/while_node.rb:8 +class RuboCop::AST::WhileNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConditionalNode + include ::RuboCop::AST::ModifierNode + + # Checks whether the `while` node has a `do` keyword. + # + # @return [Boolean] whether the `while` node has a `do` keyword + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/while_node.rb:30 + def do?; end + + # Returns the inverse keyword of the `while` node as a string. + # Returns `until` for `while` nodes and vice versa. + # + # @return [String] the inverse keyword of the `while` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/while_node.rb:23 + def inverse_keyword; end + + # Returns the keyword of the `while` statement as a string. + # + # @return [String] the keyword of the `while` statement + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/while_node.rb:15 + def keyword; end +end + +# A node extension for `yield` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available +# to all `yield` nodes within RuboCop. +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/node/yield_node.rb:8 +class RuboCop::AST::YieldNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ParameterizedNode + include ::RuboCop::AST::MethodIdentifierPredicates + include ::RuboCop::AST::MethodDispatchNode + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/yield_node.rb:20 + def arguments; end + + # Custom destructuring method. This can be used to normalize + # destructuring for different variations of the node. + # + # @return [Array] the different parts of the `send` node + # + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/yield_node.rb:16 + def node_parts; end +end + +class RuboCop::CommentConfig; end +class RuboCop::Config; end +class RuboCop::ConfigValidator; end + +# Similar to `Forwardable#def_delegators`, but simpler & faster +# +# pkg:gem/rubocop-ast#lib/rubocop/ast/utilities/simple_forwardable.rb:5 +module RuboCop::SimpleForwardable + # pkg:gem/rubocop-ast#lib/rubocop/ast/utilities/simple_forwardable.rb:6 + def def_delegators(accessor, *methods); end +end diff --git a/sorbet/rbi/gems/rubocop-gusto@11.9.0.rbi b/sorbet/rbi/gems/rubocop-gusto@11.9.0.rbi new file mode 100644 index 0000000..b4665f8 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-gusto@11.9.0.rbi @@ -0,0 +1,2722 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-gusto` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-gusto`. + + +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/version.rb:3 +module RuboCop; end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:4 +module RuboCop::Cop; end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:5 +module RuboCop::Cop::Gusto; end + +# Prefer `YAML.load_file`/`JSON.load_file` over reading a file and then +# parsing its contents. Bootsnap caches the parsed result of `load_file`, +# so this improves load time. +# +# @example +# # bad +# YAML.load(File.read("config.yml")) +# File.open("config.yml") { |f| YAML.load(f) } +# +# # good +# YAML.load_file("config.yml") +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:17 +class RuboCop::Cop::Gusto::BootsnapLoadFile < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:25 + def file_read(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:28 + def load_inside_file_open(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:41 + def on_block(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:46 + def on_itblock(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:47 + def on_numblock(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:49 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:22 + def yaml_or_json_load(param0 = T.unsafe(nil)); end + + private + + # Look for File.read as the first argument + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:58 + def on_load(node, constant_node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:18 +RuboCop::Cop::Gusto::BootsnapLoadFile::PROHIBITED_CONSTANTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/bootsnap_load_file.rb:19 +RuboCop::Cop::Gusto::BootsnapLoadFile::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Flags safe navigation (`&.`) called on a constant, covering both +# class/module constants (`Model&.find`) and SCREAMING_CASE constants +# (`CONST&.each`). +# +# A constant reference is never `nil`, an undefined constant raises +# `NameError` before the call is even attempted, so the safe navigation +# operator is always redundant. Use the plain `.` operator instead. +# +# @example +# # bad +# Model&.find(id) +# ENTITY_TYPES&.each { |type| type.to_s } +# Foo::Bar&.call +# ::Foo&.call +# +# # good +# Model.find(id) +# ENTITY_TYPES.each { |type| type.to_s } +# Foo::Bar.call +# ::Foo.call +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/constant_safety.rb:26 +class RuboCop::Cop::Gusto::ConstantSafety < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/constant_safety.rb:31 + def on_csend(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/constant_safety.rb:29 +RuboCop::Cop::Gusto::ConstantSafety::MSG = T.let(T.unsafe(nil), String) + +# Disallow referencing the `Datadog` constant directly. Calls should go +# through an approved wrapper library so instrumentation stays consistent +# and swappable. +# +# @example +# # bad +# Datadog::Tracing.active_trace +# +# # good +# Observability.active_trace +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/datadog_constant.rb:16 +class RuboCop::Cop::Gusto::DatadogConstant < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/datadog_constant.rb:20 + def on_const(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/datadog_constant.rb:17 +RuboCop::Cop::Gusto::DatadogConstant::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/datadog_constant.rb:18 +RuboCop::Cop::Gusto::DatadogConstant::NAMESPACE = T.let(T.unsafe(nil), String) + +# Flags constants that are scoped through `described_class`, e.g. +# `described_class::Worker`. +# +# `described_class` is an RSpec helper method resolved at runtime, so +# Sorbet's static analysis treats `described_class::Worker` as a dynamic +# constant reference and cannot resolve it (`Dynamic constant references +# are unsupported`, https://srb.help/5001). Reference the constant by its +# fully-qualified name instead. A bare `described_class` (with no `::` +# constant lookup) is an ordinary method call and is left alone. +# +# Autocorrection replaces `described_class` with the constant that the +# enclosing example group describes. It is marked unsafe +# (`SafeAutoCorrect: false`) because the rewrite relies on the described +# constant being a statically-written name; review the result before +# committing. In particular, a constant defined on an *ancestor* of the +# described class is qualified against the described class itself, which +# is correct at runtime but which Sorbet cannot resolve through the +# inheritance chain -- re-point those to the defining ancestor by hand. +# +# @example +# # bad +# RSpec.describe Payments::Processor do +# describe described_class::Worker do +# end +# end +# +# # good +# RSpec.describe Payments::Processor do +# describe Payments::Processor::Worker do +# end +# end +# +# # good - `RSpec.describe self` resolves to the enclosing namespace +# module Payments +# RSpec.describe self do +# it { expect(Payments::TIMEOUT).to eq(5) } +# end +# end +# +# # good - a bare `described_class` is not a constant reference +# RSpec.describe Payments::Processor do +# subject { described_class.new } +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:49 +class RuboCop::Cop::Gusto::DescribedClassConstantReference < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:58 + def const_scoped_on_described_class?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:66 + def example_group_described_argument(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:80 + def on_const(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:76 + def scoped_through_described_class?(param0); end + + private + + # The fully-qualified name (as a String) that `described_class` resolves + # to lexically, from the nearest enclosing example group, or nil if it + # cannot be determined statically. + # + # - `describe SomeClass` resolves to that constant's written name. + # - `describe self` resolves to the enclosing module/class namespace. + # - `describe described_class::X` qualifies the describe argument itself + # against the outer group; a reference in such a group's *body* resolves + # at runtime to the scoped (statically unknown) class, so we decline to + # autocorrect it. Once the enclosing `described_class::X` is rewritten, + # a later pass resolves the body reference correctly. + # - Any other describe argument (e.g. a string) is skipped, and the + # search continues at the next enclosing example group. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:105 + def described_class_replacement(node); end + + # The fully-qualified name of the module/class lexically enclosing the + # example group, which is what `self` refers to in `RSpec.describe self`. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:123 + def enclosing_namespace(block_node); end + + # Whether the offending constant is the described constant itself (the + # describe argument) rather than a reference inside the group's body. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:132 + def reference_within_described_constant?(described_constant, node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/described_class_constant_reference.rb:52 +RuboCop::Cop::Gusto::DescribedClassConstantReference::MSG = T.let(T.unsafe(nil), String) + +# Flag installation of discouraged gems (e.g. timecop) in Gemfiles and +# gemspecs. The discouraged gems an advice about alternatives are configured under +# `Gems:`; intended to be enabled in Rails projects via config/rails.yml. +# +# @example Gems: { timecop: "Use Rails' time helpers instead of Timecop." } +# # bad +# gem "timecop" +# +# # good +# # Use Rails' time helpers (freeze_time, travel_to) instead. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:16 +class RuboCop::Cop::Gusto::DiscouragedGem < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:21 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:43 + def advice_for(gem); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:27 + def check_gem_usage(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:35 + def discouraged_gems; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:47 + def gems_config; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:39 + def message_for(gem); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:17 +RuboCop::Cop::Gusto::DiscouragedGem::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/discouraged_gem.rb:19 +RuboCop::Cop::Gusto::DiscouragedGem::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallow `execute` (raw SQL) in migrations. Run raw SQL from a backfill +# rake task, or pass SQL options to `add_column`/`change_column` instead, +# so migrations stay reversible and schema-focused. +# +# @example +# # bad +# def up +# execute("UPDATE users SET active = true") +# end +# +# # good +# def up +# add_column :users, :active, :boolean, default: true +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/execute_migration.rb:20 +class RuboCop::Cop::Gusto::ExecuteMigration < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/execute_migration.rb:24 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/execute_migration.rb:21 +RuboCop::Cop::Gusto::ExecuteMigration::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/execute_migration.rb:22 +RuboCop::Cop::Gusto::ExecuteMigration::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallow defining classes or modules in factory directories. They break +# Rails autoloading/reloading; define shared helpers outside the factories. +# +# @example +# # bad +# # spec/factories/users.rb +# class UserHelper +# end +# +# FactoryBot.define do +# factory :user +# end +# +# # good +# # spec/factories/users.rb +# FactoryBot.define do +# factory :user +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/factory_classes_or_modules.rb:24 +class RuboCop::Cop::Gusto::FactoryClassesOrModules < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/factory_classes_or_modules.rb:27 + def on_class(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/factory_classes_or_modules.rb:31 + def on_module(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/factory_classes_or_modules.rb:25 +RuboCop::Cop::Gusto::FactoryClassesOrModules::MSG = T.let(T.unsafe(nil), String) + +# Enforces that `FeatureFlag.active?` is called with a constant rather than a +# string literal. Defining flag keys as constants keeps them in one place, +# makes typos a load-time error instead of a silent always-off flag, and lets +# tools find every reference to a flag. +# +# `FeatureFlag` is a constant, so it is never nil and safe navigation +# (`FeatureFlag&.active?`) is never used; the cop only handles `on_send`. +# +# @example +# # bad +# FeatureFlag.active?("some_feature_flag") +# +# # good +# FeatureFlag.active?(SomeModule::SOME_FEATURE_FLAG) +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/feature_flag_constants.rb:20 +class RuboCop::Cop::Gusto::FeatureFlagConstants < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/feature_flag_constants.rb:25 + def feature_flag_with_string?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/feature_flag_constants.rb:29 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/feature_flag_constants.rb:21 +RuboCop::Cop::Gusto::FeatureFlagConstants::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/feature_flag_constants.rb:22 +RuboCop::Cop::Gusto::FeatureFlagConstants::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:6 +module RuboCop::Cop::Gusto::Graphql; end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:7 +module RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:32 + def argument_call?(node, &block); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:28 + def field_call?(node, &block); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:46 + def array_id_type?(type_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:78 + def description_from_block(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:68 + def description_from_keyword_argument(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:64 + def description_from_positional_argument(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:58 + def extract_description(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:139 + def find_graphql_name_call(nodes); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:119 + def find_graphql_name_declaration(type_node); end + + # Find the GraphQL type name for the enclosing class or module + # Prefers graphql_name declaration over Ruby class/module name + # Returns nil if the name cannot be determined + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:94 + def find_graphql_type_name(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:38 + def id_type?(type_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:143 + def in_mutation_or_input_object?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:115 + def strip_graphql_suffix(name); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:131 + def type_body_nodes(type_body); end +end + +# Matches a GraphQL argument declaration capturing name and type node. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:17 +RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns::ARGUMENT_CALL_PATTERN = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# Matches a GraphQL field declaration capturing name and type node. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:12 +RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns::FIELD_CALL_PATTERN = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# Mutation / input-object base classes conventionally end in one of these final +# segments (e.g. `Base::PermissionedMutation`, `Gusto::GraphQL::Objects::BaseInputObject`, +# `Base::Input`). We match on the base class's final name segment rather than a substring +# of its source, so unrelated bases that merely *contain* the word (e.g. +# `GraphQLMutationTool`, `MutationHelper`) are not misclassified. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:26 +RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns::MUTATION_OR_INPUT_BASE_SUFFIXES = T.let(T.unsafe(nil), Array) + +# analytics_id is intentionally excluded +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_description_concerns.rb:9 +RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns::PRIMARY_ID_FIELDS = T.let(T.unsafe(nil), Array) + +# Ensures ID type arguments on query fields follow the standardized description template: +# "The identifier of the (``) to filter by" +# "The identifiers of each (``) to filter by" (for arrays) +# +# This cop only applies to arguments on regular GraphQL objects/queries, +# NOT on mutations or input objects (see IdInputArgumentDescription for those). +# +# @example Bad +# argument :employee_id, ID, 'Employee ID', required: true +# +# @example Good +# argument :employee_id, ID, 'The identifier of the Employee (`Employee.id`) to filter by', required: true +# argument :employee_ids, [ID], 'The identifiers of each Employee (`Employee.id`) to filter by', required: true +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:23 +class RuboCop::Cop::Gusto::Graphql::IdFieldArgumentDescription < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:41 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:59 + def valid_argument_description?(desc, is_array); end +end + +# Array: "The identifiers of each (``) to filter by" +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:39 +RuboCop::Cop::Gusto::Graphql::IdFieldArgumentDescription::ARRAY_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:26 +RuboCop::Cop::Gusto::Graphql::IdFieldArgumentDescription::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:29 +RuboCop::Cop::Gusto::Graphql::IdFieldArgumentDescription::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Single: "The identifier of the (``) to filter by" +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:36 +RuboCop::Cop::Gusto::Graphql::IdFieldArgumentDescription::SINGLE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# A single " (``)" reference. Multiple may be joined +# with " or " for arguments that accept an id from more than one entity. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_argument_description.rb:33 +RuboCop::Cop::Gusto::Graphql::IdFieldArgumentDescription::TYPE_REF = T.let(T.unsafe(nil), Regexp) + +# Ensures ID type fields follow the standardized description template: +# "The identifier" +# +# This applies to fields named :id or :uuid with type ID. +# +# @example Bad +# field :id, ID, 'Unique identifier', null: false +# field :id, ID, null: false, description: 'The unique identifier' +# +# @example Good +# field :id, ID, 'The Employee identifier', null: false +# field :id, ID, null: false, description: 'The Employee identifier' +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:22 +class RuboCop::Cop::Gusto::Graphql::IdFieldDescription < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:29 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:44 + def expected_description(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:58 + def report_offense(node, suggested); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:51 + def valid_field_description?(desc, node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:25 +RuboCop::Cop::Gusto::Graphql::IdFieldDescription::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_field_description.rb:27 +RuboCop::Cop::Gusto::Graphql::IdFieldDescription::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Ensures ID type arguments on mutations and input objects follow the standardized description template: +# "The identifier of the (``) to " +# "The identifiers of each (``) to " (for arrays) +# +# This cop only applies to arguments on mutations and input objects, +# NOT on regular GraphQL objects/queries (see IdFieldArgumentDescription for those). +# +# @example Bad +# class UpdateEmployeeMutation < BaseMutation +# argument :employee_id, ID, 'Employee ID', required: true +# end +# +# @example Good +# class UpdateEmployeeMutation < BaseMutation +# argument :employee_id, ID, 'The identifier of the Employee (`Employee.id`) to update', required: true +# end +# +# class DeleteEmployeeInput < BaseInputObject +# argument :employee_ids, [ID], 'The identifiers of each Employee (`Employee.id`) to delete', required: true +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:30 +class RuboCop::Cop::Gusto::Graphql::IdInputArgumentDescription < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Gusto::Graphql::IdDescriptionConcerns + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:48 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:66 + def valid_argument_description?(desc, is_array); end +end + +# Array: "The identifiers of each (``) to " +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:46 +RuboCop::Cop::Gusto::Graphql::IdInputArgumentDescription::ARRAY_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:33 +RuboCop::Cop::Gusto::Graphql::IdInputArgumentDescription::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:36 +RuboCop::Cop::Gusto::Graphql::IdInputArgumentDescription::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:43 +RuboCop::Cop::Gusto::Graphql::IdInputArgumentDescription::SINGLE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Single: "The identifier of the (``) to " +# Also supports multiple types joined by " or ": +# "The identifier of the Employee (`Employee.id`) or Contractor (`Contractor.id`) to " +# The action can be any verb phrase (update, delete, add items to, etc.) +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/id_input_argument_description.rb:42 +RuboCop::Cop::Gusto::Graphql::IdInputArgumentDescription::TYPE_REF = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/paginate_arrays.rb:7 +class RuboCop::Cop::Gusto::Graphql::PaginateArrays < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/paginate_arrays.rb:16 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/paginate_arrays.rb:12 +RuboCop::Cop::Gusto::Graphql::PaginateArrays::ARRAY_FIELD = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/paginate_arrays.rb:8 +RuboCop::Cop::Gusto::Graphql::PaginateArrays::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/paginate_arrays.rb:10 +RuboCop::Cop::Gusto::Graphql::PaginateArrays::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows direct hash access on GraphQL context. +# Use typed context methods instead for better type safety. +# +# @example +# # bad +# context[:user_id] | context["user_id"] +# ctx[:user_id] | ctx["user_id"] +# @context[:user_id] | @context["user_id"] +# @ctx[:user_id] | @ctx["user_id"] +# do |ctx| ctx[:user_id] end +# def resolve(context) context[:user_id] end +# +# # ok +# ctx.user_id | @context.user_id | @ctx.user_id +# +# # preferred +# context.user_id +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:25 +class RuboCop::Cop::Gusto::Graphql::PreventContextHashAccess < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:49 + def on_send(node); end +end + +# Keys allowed to use hash access on context. +# +# current_arguments: +# A runtime metadata key added during field resolution as part of graphql-ruby's API. +# It contains all arguments passed to the current field, providing access to args that are otherwise not available to resolvers, +# for example pagination args (first, last, after, before) that are not directly accessible to resolver via the resolver signature. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:37 +RuboCop::Cop::Gusto::Graphql::PreventContextHashAccess::ALLOWED_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:41 +RuboCop::Cop::Gusto::Graphql::PreventContextHashAccess::CONTEXT_BRACKET_ACCESS = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:45 +RuboCop::Cop::Gusto::Graphql::PreventContextHashAccess::LITERAL_KEY = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:26 +RuboCop::Cop::Gusto::Graphql::PreventContextHashAccess::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_context_hash_access.rb:29 +RuboCop::Cop::Gusto::Graphql::PreventContextHashAccess::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_field_can_can_action.rb:7 +class RuboCop::Cop::Gusto::Graphql::PreventFieldCanCanAction < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_field_can_can_action.rb:17 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_field_can_can_action.rb:13 +RuboCop::Cop::Gusto::Graphql::PreventFieldCanCanAction::FIELD_WITH_CAN_CAN_ACTION = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_field_can_can_action.rb:8 +RuboCop::Cop::Gusto::Graphql::PreventFieldCanCanAction::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/prevent_field_can_can_action.rb:11 +RuboCop::Cop::Gusto::Graphql::PreventFieldCanCanAction::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Flags a field whose resolver cannot reach the node it hangs off: the method body never +# reads `object` or `@object`, and no helper it calls in the same class does either. The +# value is then identical for every node, so the field does not belong on this type. +# +# @example Bad - the value does not depend on the node +# field :eor_coming_soon_countries, [String], null: false +# def eor_coming_soon_countries +# BusinessValues::BusinessValueService.get_value_for("eor.coming_soon_countries", nil) +# end +# +# @example Good - the value depends on the node +# field :eor_coming_soon_countries, [String], null: false +# def eor_coming_soon_countries +# object.eor_coming_soon_countries +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:22 +class RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:61 + def on_class(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:105 + def on_module(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:109 + def delegated_names(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:158 + def node_accessors; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:145 + def propagate(direct, callers_of); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:115 + def scan_resolver(def_node, accessors, resolvers, direct, callers_of); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:162 + def walk(node, boundary, &block); end +end + +# Fields are never declared inside a `def`, so stopping there loses nothing. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:59 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::BODY_BOUNDARY = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:44 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::DELEGATE_TO_OBJECT = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:40 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::EPHEMERAL_BACKING = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:28 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::FIELD_NAME_NODE = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:23 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::MSG = T.let(T.unsafe(nil), String) + +# A concern that `requires_ancestor` reaches the node through `T.bind(self, ...).object`, +# since Sorbet cannot see `object` on the module itself. That reads the node exactly as a +# bare `object` does, so the receiver form has to count too. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:51 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::NODE_READ_THROUGH_RECEIVER = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:30 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::RESOLUTION_ELSEWHERE = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# `resolver_method:` redirects the lookup on the type instance; `method:` names a method on +# the backing object, which this cop does not read. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:36 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::RESOLVER_METHOD = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# A nested class gets its own `on_class`, so the walk must not cross into one. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/resolver_ignores_object.rb:56 +RuboCop::Cop::Gusto::Graphql::ResolverIgnoresObject::SCOPE_BOUNDARY = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/type_variables.rb:7 +class RuboCop::Cop::Gusto::Graphql::TypeVariables < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/type_variables.rb:15 + def on_block(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/type_variables.rb:21 + def on_itblock(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/type_variables.rb:20 + def on_numblock(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/type_variables.rb:8 +RuboCop::Cop::Gusto::Graphql::TypeVariables::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/graphql/type_variables.rb:11 +RuboCop::Cop::Gusto::Graphql::TypeVariables::UNTYPED_OBJECT = T.let(T.unsafe(nil), RuboCop::AST::NodePattern) + +# Flags a hardcoded positive id standing in for a record an example expects to be absent. +# +# Auto-increment climbs across every example on a test node and is not reclaimed by +# transactional rollback, so the counter eventually reaches the literal. From then on a +# real row occupies it, the lookup succeeds, and the example stops testing absence -- +# passing locally, where the counter is low, and failing in CI. A negative id cannot +# collide, because auto-increment never emits one. +# +# An id counts as standing in for an absent record when its own example group either +# asserts absence (`ActiveRecord::RecordNotFound`, a `:not_found` response) or says so in +# its description. Both are read from the group the `let` is written in, not the whole +# file, so a shared id in an outer group is not attributed to a nested example that never +# uses it. +# +# In a list, a literal sitting beside a real `record.id` also qualifies on its own: you +# would write another `record.id` if you wanted one that exists. That matters because +# those groups are usually named for the plural ("with multiple bank account IDs") rather +# than for the gap. +# +# Five shapes are deliberately not offenses, because in none of them can the counter reach +# the literal, or a single replacement would change what the example asserts: +# +# - a group that builds a record carrying that id -- the row is meant to exist, so the +# absence the group describes is about something else, a cache or a header; +# - an `ActiveRecord::RecordNotFound` raised by reloading a row the example just deleted, +# which is a statement about that object rather than about the literal; +# - a literal above `MaxId`, which is a deliberate never-collides sentinel; +# - a group pinning two ids, which are usually pinned to differ from each other, and one +# shared replacement collapses that and inverts the example; and +# - an example group under VCR, whose cassette matches on the id in the request URI. +# +# @safety +# Autocorrection is unsafe. `-1` is right for a primary key, but it also changes the +# value the example feeds to everything else, so an id matched against a stubbed request +# URI or an asserted error message needs those updated to match. `-1` is not free +# everywhere either: a codebase may reserve it as a sentinel of its own, and an unsigned +# column or protobuf field rejects it outright. Where a negative will not do, a sentinel +# above `MaxId` is the sanctioned alternative. +# +# @example +# # bad +# context 'when the company does not exist' do +# let(:company_id) { 123 } +# +# it { expect { subject }.to raise_error(ActiveRecord::RecordNotFound) } +# end +# +# # bad - the literal is there precisely because no record has it +# let(:bank_account_ids) { [bank_account.id, other_account.id, 999_999] } +# +# # good - auto-increment never emits a negative id +# context 'when the company does not exist' do +# let(:company_id) { -1 } +# +# it { expect { subject }.to raise_error(ActiveRecord::RecordNotFound) } +# end +# +# # good - a deleted record's id is a reference, not a magic constant +# context 'when the company does not exist' do +# let(:company_id) { deleted_company.id } +# end +# +# @example AllowedNames: ['wise_id'] (default: []) +# # good - a third-party identifier, not a primary key the counter can reach +# context 'when the transfer does not exist' do +# let(:wise_id) { 5678 } +# end +# +# @example MaxId: 1000000 (default) +# # good - above MaxId the literal is a deliberate never-collides sentinel +# let(:company_id) { 9_999_999_999 } +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:79 +class RuboCop::Cop::Gusto::HardcodedAbsentRecordId < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:105 + def let_definition(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:114 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:110 + def vcr_metadata?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:195 + def absent_context?(group); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:137 + def allowed_names; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:199 + def built_with?(group, name, value); end + + # A cassette keys its recorded interactions off the request URI, so an id in the path is + # what tells two same-route requests apart. Rewriting it makes the example miss the + # recording rather than assert absence, and `record: :none` then fails it outright. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:214 + def cassette_controlled?(node); end + + # Only a lone literal qualifies. Two would both correct to `-1`, and a duplicated id in + # a list collapses on lookup, changing the count the example asserts. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:152 + def check_id_list(node, name, array); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:141 + def check_id_literal(node, name, literal); end + + # A string id reaches the same column as an integer one, so both count; only the sign + # and the magnitude matter. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:179 + def collidable_id(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:191 + def enclosing_example_group(node); end + + # A third-party identifier stored in a `*_id` field is not a primary key the + # auto-increment counter can reach, so a name listed in `AllowedNames` is skipped + # outright -- a named exception in config beats a file-path exclude or a disable. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:133 + def id_name?(name); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:207 + def inspect_group(group); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:165 + def list_qualifies?(array, group); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:187 + def max_id; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:203 + def paired_ids?(group); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:171 + def register(literal); end +end + +# Each phrase is unambiguous on its own: a bare "missing" or "unknown" reads just as +# naturally about a header or a flag, so neither is here. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:90 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::ABSENT_DESCRIPTION = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:101 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::BUILDERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:102 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::DEFAULT_MAX_ID = T.let(T.unsafe(nil), Integer) + +# Answers the group-level questions: does this group say the record is absent, does it +# build the record, and does it pin two ids that are meant to differ? +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:222 +class RuboCop::Cop::Gusto::HardcodedAbsentRecordId::GroupInspector + include ::RuboCop::RSpec::Language + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:231 + def initialize(group, max_id); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:236 + def absent?; end + + # A group that builds a record carrying this id means the row is meant to exist, so + # the absence the group describes is about something else. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:242 + def builds?(name, value); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:227 + def let_definition(param0 = T.unsafe(nil)); end + + # Two ids pinned in one group are usually pinned to differ from each other -- a record + # and the "other company" it must not match. One shared replacement collapses that. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:251 + def paired_ids?; end + + private + + # Matched against the source rather than the value so an interpolated description + # ("when #{model} does not exist") still reads as one. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:261 + def absent_description?; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:298 + def collidable_id(node); end + + # `expect { record.reload }.to raise_error(ActiveRecord::RecordNotFound)` asserts that + # a row the example already holds was deleted by the code under test. That is about + # the object, not about the literal -- which is usually what selected it for deletion. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:291 + def deleted_record_assertion?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:257 + def group; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:257 + def max_id; end + + # Scoped to this group: the walk stops at a nested example group, whose assertions + # belong to whatever that group redefines rather than to this `let`. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:270 + def not_found_assertion?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:277 + def not_found_matcher?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:317 + def own_lets(node, found = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:306 + def references?(node, name); end + + # `create(:evaluation, company_id: 1)` beside `let(:company_id) { 1 }` builds the row + # this id selects, even though the example inlined the literal rather than the `let`. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:312 + def same_id_value?(node, value); end +end + +# `id` itself, or any `_id`, singular or plural. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:86 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::ID_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:82 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:99 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::NOT_FOUND = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:100 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::NOT_FOUND_STATUS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_absent_record_id.rb:83 +RuboCop::Cop::Gusto::HardcodedAbsentRecordId::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Flags a hardcoded `id:` passed to `create`/`create!`/`create_list`. +# +# Forcing a primary key in a spec collides with whatever else occupies that row -- +# fixtures, parallel workers, the table's auto-increment sequence -- and is a common +# source of flaky, order-dependent failures. Let the database assign the id and reference +# the returned record. +# +# Only the persisting builders are flagged: they insert a row, so a forced primary key is +# an outright collision risk. `create_list` is worse still, forcing the identical id onto +# every generated record, which is a guaranteed unique-constraint failure. `build` and +# `build_stubbed` never insert, so they are left alone. +# +# Both `id:` and `'id' =>` are flagged: FactoryBot symbolizes override keys and +# ActiveRecord treats string and symbol attribute keys identically on mass-assignment, so +# a string-rocket key forces the same primary key. +# +# Only literal values are flagged. A value read from another record or a variable +# (`id: company.id`, `id: company_id`) is a reference, not a magic constant. +# +# Two shapes are configured away rather than disabled per site, because in neither is the +# literal a database primary key: +# +# - `AllowedFactories` -- factories that build a value object instead of inserting a row +# (`skip_create` / `initialize_with`), so `id:` is the object's own identity; plus the +# rare table declared `create_table ..., id: false`, whose column has no auto-increment +# and so requires an explicit id. +# - `AllowedReceivers` -- constants whose `create` is not ActiveRecord's, such as a +# `T::Struct` whose `id:` is a required keyword argument. +# +# @example +# # bad +# create(:company, id: 123) +# create(:company, 'id' => 123) +# create_list(:company, 3, id: 123) +# Company.create!(id: '123456789') +# +# # good - let the database assign the id +# company = create(:company) +# +# # good - a transitive record id is a reference, not a magic constant +# create(:employee, id: company.id) +# +# # better - pass the association so the child's own id is never forced +# create(:employee, company:) +# +# @example AllowedFactories: ['money'] (default: []) +# # good - a factory that builds a value object rather than inserting a row +# create(:money, id: 123) +# +# @example AllowedReceivers: ['Reporting::Row'] (default: []) +# # good - a constant whose `create` is not ActiveRecord's +# Reporting::Row.create(id: 123) +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:58 +class RuboCop::Cop::Gusto::HardcodedId < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:73 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:62 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:104 + def allowed_factories; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:93 + def allowed_factory?(node); end + + # `::Foo::Bar` and `Foo::Bar` name the same constant, so compare without the leading + # scope operator. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:86 + def allowed_receiver?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:100 + def allowed_receivers; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:77 + def hardcoded_id?(pair); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:59 +RuboCop::Cop::Gusto::HardcodedId::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/hardcoded_id.rb:60 +RuboCop::Cop::Gusto::HardcodedId::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of `min` or `max` with a proc. Corrects to `min_by` or `max_by`. +# +# @safety This cop is unsafe because it will change the behavior of the code. +# +# @example +# # bad +# arr = [[3, 3, 3], [2, 2], [1]] +# arr.min(&:count) +# => [3, 3, 3] - oh no how did this happen? +# arr = [[2,2],[1,1],[3,3,3]] +# arr.min &:first # => TypeError: no implicit conversion of Array into Integer +# arr = [[1, 1], [3, 3], [2, 2]] +# arr.max { |pair| pair.first } # => [2, 2] (semantically incorrect) +# +# # good +# arr = [[2,2],[1],[3,3,3]] +# arr.min_by &:first # => [1] +# arr = [[1, 1], [3, 3], [2, 2]] +# arr.max_by { |pair| pair.first } # => [3, 3] +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/min_by_max_by.rb:26 +class RuboCop::Cop::Gusto::MinByMaxBy < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/min_by_max_by.rb:41 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/min_by_max_by.rb:32 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/min_by_max_by.rb:29 +RuboCop::Cop::Gusto::MinByMaxBy::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/min_by_max_by.rb:30 +RuboCop::Cop::Gusto::MinByMaxBy::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks and discourages the use of metaprogramming techniques that make code harder to +# understand, debug, and maintain. +# +# @example +# +# # bad - using define_method +# define_method(:my_method) do |arg| +# puts arg +# end +# +# # good - using regular method definition +# def my_method(arg) +# puts arg +# end +# +# # bad - using instance_eval +# object.instance_eval do +# def foo +# bar +# end +# end +# +# # good - defining methods on the class +# class MyClass +# def foo +# bar +# end +# end +# +# # bad - using method_missing +# def method_missing(method, *args) +# if method.to_s.start_with?('find_by_') +# # ... +# end +# end +# +# # bad - using define_singleton_method +# object.define_singleton_method(:foo) { bar } +# +# # good - define class methods directly +# def self.foo +# bar +# end +# +# # bad - using class_eval +# MyClass.class_eval do +# def foo +# bar +# end +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:57 +class RuboCop::Cop::Gusto::NoMetaprogramming < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:61 + def included_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:66 + def inherited_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:105 + def on_def(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:95 + def on_defs(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:111 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:86 + def using_class_eval?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:76 + def using_define_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:91 + def using_define_singleton_method_on_klass_instance?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:81 + def using_instance_eval?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:71 + def using_method_missing?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_metaprogramming.rb:58 +RuboCop::Cop::Gusto::NoMetaprogramming::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the presence of error message checking within rescue blocks. +# +# This is brittle and can break easily. +# +# NOTE: We submitted this upstream here: https://github.com/rubocop/rubocop/pull/13352 +# +# @example +# +# # bad +# begin +# something +# rescue => e +# if e.message.match?(/Duplicate entry/) +# handle_error +# end +# end +# +# # bad +# begin +# something +# rescue => e +# unless e.message.match?(/Duplicate entry/) +# handle_error +# end +# end +# +# # good +# begin +# something +# rescue ActiveRecord::RecordNotUnique => e +# handle_error +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_rescue_error_message_checking.rb:39 +class RuboCop::Cop::Gusto::NoRescueErrorMessageChecking < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_rescue_error_message_checking.rb:43 + def on_rescue(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_rescue_error_message_checking.rb:51 + def message_check?(condition_node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_rescue_error_message_checking.rb:41 +RuboCop::Cop::Gusto::NoRescueErrorMessageChecking::METHODS_TO_CHECK = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_rescue_error_message_checking.rb:40 +RuboCop::Cop::Gusto::NoRescueErrorMessageChecking::MSG = T.let(T.unsafe(nil), String) + +# Do not call a private method via __send__ +# +# @example +# # bad +# foo.__send__(:bar) +# __send__(:run_baz) +# +# # good +# There's no better alternative, don't call private methods. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_send.rb:16 +class RuboCop::Cop::Gusto::NoSend < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_send.rb:21 + def invoke_private_method_send?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_send.rb:28 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_send.rb:25 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_send.rb:17 +RuboCop::Cop::Gusto::NoSend::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/no_send.rb:18 +RuboCop::Cop::Gusto::NoSend::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallow new Paperclip / Attachable attachments. New attachments should +# use ActiveStorage instead. +# +# @example +# # bad +# has_attached_file :avatar +# +# # good +# has_one_attached :avatar +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/paperclip_or_attachable.rb:16 +class RuboCop::Cop::Gusto::PaperclipOrAttachable < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/paperclip_or_attachable.rb:20 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/paperclip_or_attachable.rb:17 +RuboCop::Cop::Gusto::PaperclipOrAttachable::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/paperclip_or_attachable.rb:18 +RuboCop::Cop::Gusto::PaperclipOrAttachable::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for a defined `.perform` class method in Sidekiq workers. These +# are most likely intended to have been instance methods. +# +# @example +# # bad +# class MyWorker +# include Sidekiq::Worker +# +# def self.perform +# # ... +# end +# end +# +# # good +# class MyWorker +# include Sidekiq::Worker +# +# def perform +# # ... +# end +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:28 +class RuboCop::Cop::Gusto::PerformClassMethod < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:38 + def on_def(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:45 + def on_defs(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:34 + def worker_module_include?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:57 + def is_sidekiq_worker?(search_node, method_type); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:49 + def perform_class_method_type(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:65 + def worker_modules; end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:29 +RuboCop::Cop::Gusto::PerformClassMethod::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:30 +RuboCop::Cop::Gusto::PerformClassMethod::WORKER_FALLBACK = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/perform_class_method.rb:31 +RuboCop::Cop::Gusto::PerformClassMethod::WORKER_MODULES = T.let(T.unsafe(nil), String) + +# Do not use `.pluck` on `.select`. +# +# `.select` returns an ActiveRecord relation with only the selected columns marked for +# retrieval. `.pluck` returns an array of column values. When chained, `.pluck` is unaware +# of any directive passed to `.select` (e.g. column aliases or a DISTINCT clause), which +# can cause unexpected behavior. +# +# @example Redundant select +# # bad +# User.select(:id).pluck(:id) +# +# # good +# User.pluck(:id) +# +# @example Column alias: .pluck raises "Unknown column" because it ignores the alias +# # bad +# User.select('id AS id2').pluck('id2') +# +# # good: use .select alone if you need the alias +# User.select(:id, 'id AS id2') +# +# # good: use .pluck alone if you don't need the alias +# User.pluck(:id) +# +# @example DISTINCT: .pluck loads all rows, ignoring the DISTINCT from .select +# # bad +# User.select('DISTINCT email').pluck(:email) +# +# # good +# User.distinct.pluck(:email) +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/pluck_on_select.rb:37 +class RuboCop::Cop::Gusto::PluckOnSelect < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/pluck_on_select.rb:53 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/pluck_on_select.rb:41 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/pluck_on_select.rb:39 +RuboCop::Cop::Gusto::PluckOnSelect::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/pluck_on_select.rb:38 +RuboCop::Cop::Gusto::PluckOnSelect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Require polymorphic relations to validate their `*_type` field with an +# inclusion validation (or `polymorphic_methods_for`). This is needed for +# Tapioca to generate correct Sorbet types. +# +# @example +# # bad +# belongs_to :subscription_detail, polymorphic: true +# +# # good +# VALID_TYPES = T.let([Foo.polymorphic_name, Bar.polymorphic_name].freeze, T::Array[String]) +# belongs_to :subscription_detail, polymorphic: true +# validates :subscription_detail_type, presence: true, inclusion: { in: VALID_TYPES } +# +# # also good +# include PolymorphicCallable +# VALID_TYPES = T.let([Foo.polymorphic_name, Bar.polymorphic_name].freeze, T::Array[String]) +# belongs_to :subscription_detail, polymorphic: true +# polymorphic_methods_for :subscription_detail, VALID_TYPES +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:24 +class RuboCop::Cop::Gusto::PolymorphicTypeValidation < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:69 + def allow_blank?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:59 + def inclusion_in?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:73 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:64 + def polymorphic_methods_for?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:49 + def polymorphic_relation?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:54 + def type_validation?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:46 +RuboCop::Cop::Gusto::PolymorphicTypeValidation::ALLOW_BLANK_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:27 +RuboCop::Cop::Gusto::PolymorphicTypeValidation::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/polymorphic_type_validation.rb:25 +RuboCop::Cop::Gusto::PolymorphicTypeValidation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Don't use the `$?` or `$CHILD_STATUS` global variables. Instead, use `Process.last_status` +# +# @example +# # bad +# $?.exitstatus +# $CHILD_STATUS.success? +# +# # good +# Process.last_status.exit_status +# Process.last_status.success? +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/prefer_process_last_status.rb:17 +class RuboCop::Cop::Gusto::PreferProcessLastStatus < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/prefer_process_last_status.rb:29 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/prefer_process_last_status.rb:23 + def on_gvar(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/prefer_process_last_status.rb:20 +RuboCop::Cop::Gusto::PreferProcessLastStatus::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/prefer_process_last_status.rb:21 +RuboCop::Cop::Gusto::PreferProcessLastStatus::OFFENDERS = T.let(T.unsafe(nil), Set) + +# Disallows the use of `extends` in Rabl templates due to poor caching performance. +# Inline the templating to generate your JSON instead. +# +# @example +# # bad +# extends 'path/to/template' +# +# # bad - but not covered by this rule +# partial 'path/to/template' +# +# # good - inline your templating +# node 'some_node' +# attributes :foo, :bar +# child(:baz) { attributes :qux } +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:21 +class RuboCop::Cop::Gusto::RablExtends < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:31 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:27 + def rabl_extends?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:37 + def relevant_file?(file); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:22 +RuboCop::Cop::Gusto::RablExtends::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:23 +RuboCop::Cop::Gusto::RablExtends::RABL_EXTENSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rabl_extends.rb:24 +RuboCop::Cop::Gusto::RablExtends::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Detects constants in a rake file because they are defined at the top level. +# It is confusing because the scope looks like it would be in the task or namespace, +# but actually it is defined at the top level. +# +# @example +# # bad +# task :foo do +# class C +# end +# end +# +# # bad +# namespace :foo do +# module M +# end +# end +# +# # good - It is also defined at the top level, +# # but it looks like intended behavior. +# class C +# end +# task :foo do +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:30 +class RuboCop::Cop::Gusto::RakeConstants < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:42 + def on_casgn(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:48 + def on_class(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:54 + def on_module(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:34 + def task_or_namespace?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:62 + def in_task_or_namespace?(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rake_constants.rb:31 +RuboCop::Cop::Gusto::RakeConstants::MSG = T.let(T.unsafe(nil), String) + +# Flags an inline `require 'spec_helper'` / `require 'rails_helper'` (or the +# `require_relative` equivalent) that the governing `.rspec` already loads via +# `--require`, making the inline require a redundant no-op. +# +# Correctness is per file: the cop resolves the `.rspec` that governs the file by walking +# up to the nearest ancestor `.rspec`, but stops at a project boundary (a directory holding +# a `*.gemspec` or `Gemfile`). A project with no `.rspec` of its own is therefore never +# attributed a parent project's `.rspec` -- e.g. a standalone gem/engine that boots its own +# test environment keeps its inline require. Packs (no gemspec/Gemfile) still resolve to the +# repo-root `.rspec`. +# +# `spec_helper.rb` / `rails_helper.rb` themselves are never edited (they are the definitions +# and the `rails_helper` -> `spec_helper` shim). +# +# `rails_helper` is treated as redundant only when the governing `.rspec` auto-requires it +# directly, or auto-requires `spec_helper` AND the project's `spec/rails_helper.rb` is a pure +# shim (nothing but `require 'spec_helper'`). Otherwise it is kept, since a `rails_helper` +# that does real setup (e.g. boots Rails) is not covered by `spec_helper`. +# +# @example +# # bad (the governing .rspec already `--require`s it) +# require 'spec_helper' +# RSpec.describe Foo do +# end +# +# # good +# RSpec.describe Foo do +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:35 +class RuboCop::Cop::Gusto::RedundantSpecHelperRequire < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:60 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:48 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:44 + def require_path(param0 = T.unsafe(nil)); end + + private + + # Helper basenames the `.rspec` auto-requires via `--require`/`-r`. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:116 + def auto_required_helpers(rspec_path); end + + # The `.rspec` that governs this file: nearest ancestor `.rspec`, not crossing a project + # boundary (a dir with a `*.gemspec` or `Gemfile`). Returns nil when the file's project + # has no `.rspec` of its own. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:95 + def governing_rspec; end + + # Never edit the helper/shim files themselves. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:72 + def helper_definition_file?; end + + # 'spec_helper' | 'rails_helper' | nil, from 'spec_helper', 'rails_helper', + # 'rails_helper.rb', or a require_relative path such as '../spec_helper'. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:66 + def helper_name(path); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:109 + def project_boundary?(dir); end + + # True when /spec/rails_helper.rb exists and is a pure shim whose only executable + # line is `require 'spec_helper'` (magic comments / blank lines / comments ignored). + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:127 + def rails_helper_shim?(root_dir); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:76 + def redundant?(name); end + + # Remove the require line, absorbing one immediately-following blank line so the fix does + # not leave a stray/duplicate blank. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:137 + def removal_range(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:40 +RuboCop::Cop::Gusto::RedundantSpecHelperRequire::HELPERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:39 +RuboCop::Cop::Gusto::RedundantSpecHelperRequire::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/redundant_spec_helper_require.rb:41 +RuboCop::Cop::Gusto::RedundantSpecHelperRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Ensures that regular expressions use `\A` and `\z` anchors instead +# of `^` and `$` when matching the start or end of a string. This is +# critical for security validations as `^` and `$` will match the start/end +# of any line in a string, not just the start/end of the entire string. +# +# @example +# # bad - validating only a single line of input which could be split across multiple lines +# /^foo/ +# /foo$/ +# /^foo$/ +# +# # good +# /\Afoo/ +# /foo\z/ +# /\Afoo\z/ +# +# # good - multiline mode is allowed +# /^foo/m +# /foo$/m +# +# # okay - anchors in the middle of the pattern are not flagged +# /foo^bar/ +# /foo$bar/ +# +# @safety +# We choose to consider this cop safe even though the code is not equivalent. +# Replacing `^` and `$` with `\A` and `\z` will make the regex more strict, +# which is the intended behavior for securely validating input. +# +# @see https://ruby-doc.org/core/Regexp.html +# @see https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/regexp_bypass.rb:38 +class RuboCop::Cop::Gusto::RegexpBypass < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/regexp_bypass.rb:45 + def on_regexp(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/regexp_bypass.rb:41 +RuboCop::Cop::Gusto::RegexpBypass::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/regexp_bypass.rb:42 +RuboCop::Cop::Gusto::RegexpBypass::PROHIBITED_ANCHOR = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/regexp_bypass.rb:43 +RuboCop::Cop::Gusto::RegexpBypass::PROHIBITED_END_ANCHOR = T.let(T.unsafe(nil), String) + +# Never mock time in specs. Use Rails Testing Time Helpers (eg `freeze_time` and `travel_to`) instead. +# .and_call_original is allowed. +# +# @example +# # bad +# context 'time specific tests' do +# before { allow(Time).to receive(:now).and_return(current_time) } +# it 'does stuff in a fixed time' do +# subject +# end +# end +# +# # good +# context 'time specific tests' do +# it 'does stuff in a fixed time' do +# freeze_time do +# subject +# end +# end +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:27 +class RuboCop::Cop::Gusto::RspecDateTimeMock < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:37 + def and_call_original?(param0); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:59 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:48 + def time_mock?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:92 + def and_call_original_in_chain?(node); end + + # Returns true if the given node is a const or a call chain whose root receiver + # is one of the protected time classes (Date/Time/DateTime) + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:74 + def rooted_in_time_class?(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:28 +RuboCop::Cop::Gusto::RspecDateTimeMock::CLASSES = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:33 +RuboCop::Cop::Gusto::RspecDateTimeMock::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/rspec_date_time_mock.rb:34 +RuboCop::Cop::Gusto::RspecDateTimeMock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallow keyword arguments on Sidekiq `perform` methods. Sidekiq +# serializes job arguments as JSON and replays them positionally, so +# keyword arguments are not preserved. +# +# @example +# # bad +# def perform(user_id:, force: false) +# end +# +# # good +# def perform(user_id, force = false) +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sidekiq_params.rb:18 +class RuboCop::Cop::Gusto::SidekiqParams < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sidekiq_params.rb:26 + def on_def(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sidekiq_params.rb:22 + def perform_with_kwargs?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sidekiq_params.rb:19 +RuboCop::Cop::Gusto::SidekiqParams::MSG = T.let(T.unsafe(nil), String) + +# Enforces SmartTodo syntax (via the upstream `SmartTodo/SmartTodoCop`) and, +# in addition, requires every TODO's `to:` assignee to name a valid team as +# defined by CodeTeams (`config/teams/**/*.yml`). +# +# All of the upstream cop's failure modes are preserved verbatim via `super`. +# The only additional offense is raised when an otherwise-valid SmartTodo +# comment is assigned to an unknown team. +# +# @example +# # bad - assigned to an unknown team +# # TODO(on: date('2025-01-01'), to: 'NotATeam') +# # Remove this +# +# # good - assigned to a team in config/teams +# # TODO(on: date('2025-01-01'), to: 'Payroll') +# # Remove this +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/smart_todo_team.rb:25 +class RuboCop::Cop::Gusto::SmartTodoTeam < ::RuboCop::Cop::SmartTodo::SmartTodoCop + # @param processed_source [RuboCop::ProcessedSource] + # @return [void] + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/smart_todo_team.rb:30 + def on_new_investigation; end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/smart_todo_team.rb:26 +RuboCop::Cop::Gusto::SmartTodoTeam::TEAM_HELP = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:6 +module RuboCop::Cop::Gusto::Sorbet; end + +# Checks that predicate methods (methods ending with ?) in Sorbet-typed files +# return boolean values (T::Boolean or true/false literals). +# +# This cop categorizes offenses into: +# - Methods returning nil +# - Methods returning other non-boolean values +# +# A `sig { void }` predicate is left alone. `void` is an explicit declaration that +# the return value is not meaningful, which is how validator-style methods that only +# call `errors.add` are annotated. +# +# It also provides an unsafe autocorrect feature to change the signature +# to `returns(T::Boolean)` and coerce the return value to a boolean. +# +# @safety +# This cop's autocorrect is unsafe because it changes method signatures +# and coerces return values using `!!()`, which may alter the behavior +# of the code in subtle ways. +# +# @example +# # bad (returns nil) +# sig { returns(T.nilable(String)) } +# def valid? +# nil +# end +# +# # bad (returns non-boolean) +# sig { returns(String) } +# def valid? +# 'yes' +# end +# +# # good +# sig { returns(T::Boolean) } +# def valid? +# true +# end +# +# # good (also acceptable) +# sig { returns(T.any(TrueClass, FalseClass)) } +# def valid? +# true +# end +# +# # good (void declares the return value meaningless) +# sig { void } +# def valid_state? +# errors.add(:state, 'is invalid') unless state_ok? +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:56 +class RuboCop::Cop::Gusto::Sorbet::PredicateBooleanReturn < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:68 + def on_def(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:74 + def on_defs(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:137 + def already_boolean_coerced?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:110 + def autocorrect(corrector, node, return_type_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:209 + def boolean_type?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:82 + def check_predicate_method(node); end + + # An expression that is already negated (`!foo` / `!!foo`) is boolean, so it needs + # no coercion. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:119 + def coerce_last_expression(corrector, method_body); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:230 + def extract_const_name(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:169 + def extract_return_type(sig_node); end + + # Walks left siblings past `private` modifiers to find the method's `sig` block. + # A `private_class_method def self.foo?` wrapper shifts the starting point to the + # wrapping send. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:145 + def find_sig_node(method_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:244 + def format_send_type(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:238 + def format_type(return_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:257 + def format_type_arg(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:128 + def last_expression_in_body(body_node); end + + # `private_class_method def self.foo?` still reads as a plain definition; any other + # wrapping send (e.g. a custom decorator) hides the real return type. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:270 + def method_has_non_private_class_method_wrapper?(method_node); end + + # `T.untyped` can be nil but is reported as non-boolean rather than nilable. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:205 + def nil_type?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:189 + def nilable_type?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:183 + def returns_boolean?(return_node); end + + # `void` is filtered out before this point, so the node is always `returns(...)`. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:176 + def returns_nil?(return_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:165 + def sig_block?(node); end + + # `T.any(TrueClass, FalseClass)` is the only `T.` send that is boolean. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:221 + def t_boolean_union?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:78 + def typed_file?; end +end + +# Guards `find_sig_node`'s left-sibling walk against a pathological node list +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:66 +RuboCop::Cop::Gusto::Sorbet::PredicateBooleanReturn::MAX_SIBLING_LOOKBACK = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:59 +RuboCop::Cop::Gusto::Sorbet::PredicateBooleanReturn::MSG_RETURNS_NIL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:60 +RuboCop::Cop::Gusto::Sorbet::PredicateBooleanReturn::MSG_RETURNS_NON_BOOLEAN = T.let(T.unsafe(nil), String) + +# Starts with `!` or `!!` but not `!=` / `!==` +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:64 +RuboCop::Cop::Gusto::Sorbet::PredicateBooleanReturn::NEGATION_PREFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sorbet/predicate_boolean_return.rb:62 +RuboCop::Cop::Gusto::Sorbet::PredicateBooleanReturn::TYPED_SIGIL = T.let(T.unsafe(nil), Regexp) + +# Detects Rails association definitions called on other classes from outside their class bodies. +# This kind of sudden monkey-patching can lead to unexpected behavior. +# +# @example +# # bad +# Company.has_one :onboarding_benefits_survey +# User.belongs_to :company +# Post.has_many :comments +# Student.has_and_belongs_to_many :courses +# +# # good +# class Company +# has_one :onboarding_benefits_survey +# end +# +# class User +# belongs_to :company +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sudden_associations.rb:24 +class RuboCop::Cop::Gusto::SuddenAssociations < ::RuboCop::Cop::Base + # Matches association method calls on a class constant + # Examples matched: + # Company.has_one :onboarding_benefits_survey + # User.belongs_to :company + # ::Company.has_many :users + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sudden_associations.rb:38 + def on_send(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sudden_associations.rb:25 +RuboCop::Cop::Gusto::SuddenAssociations::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/sudden_associations.rb:26 +RuboCop::Cop::Gusto::SuddenAssociations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that no top-level constants (excluding classes and modules) +# are defined. This rule exists to prevent accidental pollution of the +# global namespace as well as cases where application code has +# accidentally depended on test code. +# +# By default, this check is limited to files in `app/`, `lib/`, and +# `spec/` directories, except in the root of `lib/` and in support files +# in `spec/support/`. +# +# @example when in a checked directory +# # bad +# FOO = 'bar' # lib/foo/bar.rb +# +# # bad +# FOO = 'bar' # app/models/foo.rb +# +# # bad +# FOO = 'bar' # spec/foo.rb +# +# # good +# FOO = 'bar' # spec/spec_helper.rb +# +# # good +# class MyClass # lib/foo/bar.rb +# FOO = 'bar' +# end +# +# @example when in a `spec/support/` file +# # good +# FOO = 'bar' # spec/support/foo/bar.rb +# +# @example when in a `config/` file +# # good +# FOO = 'bar' # config/initializers/foo.rb +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/toplevel_constants.rb:41 +class RuboCop::Cop::Gusto::ToplevelConstants < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/toplevel_constants.rb:44 + def on_casgn(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/toplevel_constants.rb:42 +RuboCop::Cop::Gusto::ToplevelConstants::MSG = T.let(T.unsafe(nil), String) + +# Flags lazy `let` declarations whose name is never referenced. A lazy `let(:name) { ... }` +# is only evaluated when `name` is called, so an unreferenced one is dead code -- its block +# never runs -- and is deleted. +# +# Eager `let!` is intentionally out of scope: it runs its block before every example for its +# side effect even when unreferenced, so it cannot simply be deleted. Only plain `let` is +# handled here. +# +# Detection is file-scoped: a `let` referenced only from another file (through a shared +# example or an included test harness) cannot be seen, so the cop stays conservative and +# prefers false negatives over false positives: +# - a name defined more than once in the file by `let`/`let!`/`subject` (an override / +# `super` chain, including a `subject` that overrides a `let` of the same name) is never +# flagged; +# - a `let` declared lexically inside a `shared_examples` / `shared_examples_for` / +# `shared_context` block is skipped (its consumers live in other files); +# - every `let` in a file that uses `it_behaves_like` / `it_should_behave_like` / +# `include_examples` / `include_context` is skipped, because an included shared block may +# reference the binding by a name we cannot follow statically; +# - any `let` whose name is also defined as a `let`/`subject` in a `spec/support/**` helper is +# skipped, because it is almost certainly overriding a contract an included harness consumes; +# - `let(:cop_config)` is skipped: it is a rubocop-rspec contract consumed by the `:config` +# shared context, not by a reference in the spec file; and +# - every `let` in a file that reflectively dispatches through a name we cannot resolve +# statically (e.g. `send("expected_#{type}")`) is skipped, since any `let` could be the +# target. +# A name counts as referenced if it is called bare (`foo`), appears as a symbol (`:foo`) +# anywhere but the let's own name argument, or appears as an identifier-shaped token inside +# any string/heredoc literal -- covering dynamic dispatch, `:foo` entries in data tables the +# spec later dispatches on, and bindings named only inside raw SQL/GraphQL text. +# +# Because a bare `:foo` symbol anywhere counts as a reference, commonly-named lets +# (`let(:user)`, `let(:company)`, `let(:id)`) are essentially never flagged -- `create(:user)`, +# `:name` hash keys, and the like saturate the file. This conservative bias means the cop +# realistically only deletes distinctively-named dead lets; it is not a complete dead-`let` +# finder. +# +# @example +# # bad (name never referenced -- deleted, the block never runs) +# let(:unused) { create(:thing) } +# +# # good +# let(:thing) { create(:thing) } +# it { expect(thing).to be_present } +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:53 +class RuboCop::Cop::Gusto::UnreferencedLet < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:79 + def definition_name(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:115 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:175 + def absorbable_comment?(source_line); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:180 + def blank_line?(source_line); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:200 + def consumes_shared_examples?; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:259 + def definition_name_argument?(sym_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:225 + def definitions_by_name; end + + # True when the file reflectively dispatches through a name we cannot resolve statically -- + # `send`/`public_send`/`method`/etc. called with anything other than a `sym` or plain `str` + # first argument (most commonly an interpolated string, `send("expected_#{type}")`). In + # that case any `let` in the file could be the dispatch target, so none are deleted. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:210 + def dynamic_dispatch?; end + + # A lazy `let` is exempt from deletion whenever file-scoped analysis cannot prove its name + # is dead: its name is a framework-reserved contract (e.g. `cop_config`), the file + # dispatches through a name we cannot resolve statically, it consumes shared examples, the + # `let` is lexically inside a shared-example definition, its name is a `spec/support/**` + # framework contract, it is overridden by another definition of the same name, or it is + # referenced somewhere in the file. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:140 + def exempt_from_deletion?(name, block); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:184 + def let_or_subject_line?(source_line); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:221 + def overridden?(name); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:188 + def preceding_sig(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:232 + def referenced?(name); end + + # A name is "referenced" if it is called as a bare method (`foo`), appears as a symbol + # literal (`:foo`) other than the let/subject's own name argument, or appears as an + # identifier-shaped token inside any string/heredoc literal. The symbol and string cases + # cover indirect invocation -- `send(:foo)` / `send("foo")`, a `:foo`/`"foo"` listed in a + # data table the spec later dispatches on, or a binding named only inside raw SQL/GraphQL + # text the spec executes -- which file-scoped analysis cannot otherwise follow. (Tokenizing + # string bodies, rather than matching the whole string, keeps a `let` referenced only from + # inside a multi-word heredoc from being deleted.) Interpolated-string *dispatch* is handled + # separately by `dynamic_dispatch?`, which exempts the whole file. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:245 + def referenced_names; end + + # Delete the `let` block, plus: + # - an immediately-preceding `sig { ... }` (so a Sorbet signature is not left dangling), + # - explanatory comment lines attached directly above it (so they are not orphaned), and + # - a single trailing blank line where removal would otherwise leave a stray/duplicate + # blank -- unless the line above is a `let`/`subject`, where that blank is the required + # separator after the now-final let and must stay. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:156 + def removal_range(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:196 + def within_shared_definition?(node); end + + class << self + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:103 + def extract_let_names(source, names); end + + # Names defined as `let`/`subject` anywhere under `spec/support/**`. Computed once per + # process (lazily, after boot) and shared across every file the cop inspects. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:86 + def framework_let_names; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:108 + def read_source(path); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:97 + def scan_framework_let_names(paths); end + + # Enumerate `spec/support/**/*.rb`. No git dependency: some environments (e.g. a build + # step's working directory) are not a git work tree at all, and shelling out to `git` + # there is unreliable and noisy. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:93 + def support_file_paths; end + end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:57 +RuboCop::Cop::Gusto::UnreferencedLet::DEFINITION_METHODS = T.let(T.unsafe(nil), Set) + +# Reflective dispatch methods whose target is the first argument. When that argument is not +# a statically-resolvable name (a `sym` or plain `str`) -- e.g. `send("expected_#{type}")` -- +# the called name cannot be known, so the whole file is left untouched. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:65 +RuboCop::Cop::Gusto::UnreferencedLet::DYNAMIC_DISPATCH_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:66 +RuboCop::Cop::Gusto::UnreferencedLet::FRAMEWORK_LET_PATTERN = T.let(T.unsafe(nil), Regexp) + +# `let`s consumed by a test framework rather than by a reference in the spec file. The +# rubocop-rspec `:config` shared context reads `cop_config`, so it is live even though the +# spec never names it. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:61 +RuboCop::Cop::Gusto::UnreferencedLet::FRAMEWORK_RESERVED_NAMES = T.let(T.unsafe(nil), Array) + +# Identifier-shaped tokens inside a string/heredoc literal. A `let` whose name appears only +# inside string text -- e.g. a binding or column referenced in raw SQL/GraphQL the spec +# later executes -- counts as referenced, so it is not deleted. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:70 +RuboCop::Cop::Gusto::UnreferencedLet::IDENTIFIER_IN_STRING = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:71 +RuboCop::Cop::Gusto::UnreferencedLet::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:72 +RuboCop::Cop::Gusto::UnreferencedLet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:73 +RuboCop::Cop::Gusto::UnreferencedLet::SUPPORT_FILES_GLOB = T.let(T.unsafe(nil), String) + +# Requires the use of the `paint` gem for terminal color methods on strings +# +# @safety +# This cop's autocorrection is unsafe because it replaces colorize gem +# methods with Paint gem methods. If the Paint gem is not included in the +# project's dependencies, the corrected code will fail at runtime with a +# NameError (uninitialized constant Paint). +# +# @example +# +# # bad +# "string".cyan +# "string".red +# "string".green +# str = "hello" +# str.cyan +# "string".colorize(:blue) +# "string".colorize(:color => :blue) +# "string".colorize(:color => :blue, :background => :red) +# "string".blue.on_red +# "string".colorize(:blue).on_red +# "string".blue.underline +# +# # good +# "string" +# +# # if color is needed, use `paint` gem +# Paint["string", :cyan] +# Paint["string", :red] +# Paint["string", :green] +# Paint[str, :cyan] +# Paint["string", :blue] +# Paint["string", :blue, :red] +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:40 +class RuboCop::Cop::Gusto::UsePaintNotColorize < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:114 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:105 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:219 + def build_paint_call(string_node, foreground, background, styles); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:130 + def colorized_string?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:136 + def correction(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:199 + def extract_string_and_operations(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:122 + def string_or_colorized_receiver?(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:126 + def string_receiver?(node); end +end + +# Common terminal color methods that should be prevented +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:44 +RuboCop::Cop::Gusto::UsePaintNotColorize::COLOR_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:101 +RuboCop::Cop::Gusto::UsePaintNotColorize::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:102 +RuboCop::Cop::Gusto::UsePaintNotColorize::PROHIBITED_CLASS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:103 +RuboCop::Cop::Gusto::UsePaintNotColorize::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Style modifiers that are applied as additional options in Paint +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/use_paint_not_colorize.rb:90 +RuboCop::Cop::Gusto::UsePaintNotColorize::STYLE_MODIFIERS = T.let(T.unsafe(nil), Set) + +# Requires VCR to be set to not record in tests. +# +# @example +# # bad +# vcr: {record: :all} +# +# # good +# vcr: {record: :none} +# +# @see https://github.com/vcr/vcr +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/vcr_recordings.rb:17 +class RuboCop::Cop::Gusto::VcrRecordings < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/vcr_recordings.rb:27 + def on_pair(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/vcr_recordings.rb:23 + def vcr_recording?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/vcr_recordings.rb:43 + def recording_enabled?(option, value); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/vcr_recordings.rb:39 + def vcr_setting?(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/vcr_recordings.rb:20 +RuboCop::Cop::Gusto::VcrRecordings::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/assignment_first.rb:5 +module RuboCop::Cop::InternalAffairs; end + +# Check for assignment as the first action in a cop hook. +# +# @example +# # bad +# def on_send(node) +# foo = 1 +# do_something +# end +# +# # good +# def on_send(node) +# do_something +# foo = 1 +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/assignment_first.rb:21 +class RuboCop::Cop::InternalAffairs::AssignmentFirst < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/assignment_first.rb:43 + def on_def(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/assignment_first.rb:22 +RuboCop::Cop::InternalAffairs::AssignmentFirst::HOOKS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/assignment_first.rb:41 +RuboCop::Cop::InternalAffairs::AssignmentFirst::MSG = T.let(T.unsafe(nil), String) + +# Check for missing `RESTRICT_ON_SEND`. +# +# @example +# # bad +# class FooCop +# def on_send(node) +# # ... +# end +# end +# +# # good +# class FooCop +# RESTRICT_ON_SEND = %i[bad_method].freeze +# def on_send(node) +# # ... +# end +# end +# +# NOTE: This works for us because we do not write cops that investigate every send node. +# Upstream Rubocop chose not to implement this as there are many cops in Core that investigate every node. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb:26 +class RuboCop::Cop::InternalAffairs::RequireRestrictOnSend < ::RuboCop::Cop::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb:45 + def cop_class_def(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb:30 + def defined_send_callback?(param0); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb:51 + def on_class(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb:39 + def restrict_on_send?(param0); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb:27 +RuboCop::Cop::InternalAffairs::RequireRestrictOnSend::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:7 +module RuboCop::Cop::RSpec; end + +# Patches the upstream `RSpec/ScatteredLet` cop so that Sorbet `sig` +# declarations attached to `let`/`let!` blocks (Sorbet's RSpec mode) +# do not interrupt the consecutive-let chain. +# +# Without this patch the upstream cop flags valid `sig`+`let` +# arrangements because the intervening `sig` block breaks the +# consecutive-sibling check. (The sig-aware `MoveNode` patch in +# `lib/rubocop/gusto/move_node_patch.rb` handles dragging the `sig` +# along during autocorrect.) +# +# @example +# # good (no longer flagged) +# context "..." do +# sig { returns(Something) } +# let(:thing) { create(:something) } +# +# sig { returns(Other) } +# let(:other) { create(:other) } +# end +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:27 +class RuboCop::Cop::RSpec::ScatteredLet < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:32 + def sig_block?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:60 + def build_let_units(children); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:38 + def check_let_declarations(body); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 +class RuboCop::Cop::RSpec::ScatteredLet::LetUnit < ::Struct + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def length; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def length=(_); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def let; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def let=(_); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def start_index; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def start_index=(_); end + + class << self + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def [](*_arg0); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def inspect; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def keyword_init?; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def members; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rspec/scattered_let.rb:28 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:5 +module RuboCop::Cop::Rack; end + +# Detects HTTP response headers with uppercase characters. +# HTTP response header keys should be lowercase for compatibility +# with HTTP/2 and modern web standards. +# +# HTTP/2 (RFC 9113) requires all header field names to be lowercase. +# Using lowercase keys ensures compatibility across HTTP versions +# and Rack implementations. +# +# @example +# # bad +# headers['Content-Type'] = 'application/json' +# response.headers['Location'] = '/redirect' +# response.set_header('X-Custom', 'value') +# response.headers['Content-Security-Policy'] += policy +# +# # good +# headers['content-type'] = 'application/json' +# response.headers['location'] = '/redirect' +# response.set_header('x-custom', 'value') +# response.headers['content-security-policy'] += policy +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:27 +class RuboCop::Cop::Rack::LowercaseHeaderKeys < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:54 + def on_csend(node); end + + # Handle compound assignment: headers['Key'] += val + # Ruby parses this as an op_asgn node, not a []= send + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:58 + def on_op_asgn(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:47 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:34 + def response_header_method?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:123 + def add_offense_for_header(node, key_value); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:73 + def check_bracket_access(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:83 + def check_header_method(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:88 + def check_key(key_node); end + + # Matches headers receivers that are response-related: + # headers (bare method call in controller) + # response.headers + # self.headers + # Does NOT match: + # conn.headers, request.headers, client.headers, etc. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:102 + def response_headers_receiver?(receiver); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:30 +RuboCop::Cop::Rack::LowercaseHeaderKeys::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/rack/lowercase_header_keys.rb:31 +RuboCop::Cop::Rack::LowercaseHeaderKeys::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:5 +module RuboCop::Cop::Sidekiq; end + +# Checks that `perform_async` calls to enqueue Sidekiq jobs are not stubbed +# +# @example +# # bad +# allow(Foo).to receive(:perform_async) +# expect(Foo).to receive(:perform_async) +# expect(Foo).not_to receive(:perform_async) +# +# # bad - the stub it verifies is itself the offense, and it may have been +# # set up in a shared context this cop cannot see +# expect(Foo).to have_received(:perform_async) +# +# # good (still invokes the real method) +# allow(Foo).to receive(:perform_async).and_call_original +# expect(Foo).to receive(:perform_async).with(arg).and_call_original +# allow(Foo).to receive(:perform_async).and_wrap_original { |m, *args| m.call(*args) } +# +# # good (checking enqueued jobs) +# expect { subject }.to change(Foo.jobs, :count).by(n) +# expect { subject }.not_to change(Foo.jobs, :count) +# expect(Foo.jobs.count).to eq(n) +# +# # good - there is no other way to make an enqueue fail. Sidekiq's testing API +# # pushes onto Foo.jobs and offers no failure injection, so a spec covering the +# # rescue around an enqueue has to raise from the stub. +# allow(Foo).to receive(:perform_async).and_raise(StandardError, "redis down") +# +# @safety +# Autocorrect is unsafe: it appends `.and_call_original` on positive `receive` only, which runs +# the real `perform_async` during the example (may enqueue jobs, hit external code, or +# change expectations vs a pure stub). There is no autocorrect for `not_to` / `to_not receive`, +# since `.and_call_original` would not apply to a negative expectation, nor for +# `have_received`, whose stub lives elsewhere. Autocorrect is also suppressed when the +# expectation uses a block, since appending `.and_call_original` would rebind the block to +# the wrong method. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:41 +class RuboCop::Cop::Sidekiq::PerformAsyncStub < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:88 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:59 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:55 + def stub_perform_async?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:92 + def message_expectation_chain_tail(node); end +end + +# Chain modifiers that leave the real `perform_async` reachable, so the example is not +# replacing the enqueue with a canned result. `and_raise` belongs here even though it +# never calls the original: simulating a failed enqueue is the one thing Sidekiq's +# testing API cannot express, so a spec covering the rescue has no other route. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:52 +RuboCop::Cop::Sidekiq::PerformAsyncStub::ALLOWED_CHAIN = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:44 +RuboCop::Cop::Sidekiq::PerformAsyncStub::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:45 +RuboCop::Cop::Sidekiq::PerformAsyncStub::MSG_RECEIVE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:46 +RuboCop::Cop::Sidekiq::PerformAsyncStub::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# RuboCop Gusto project namespace. +# +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/version.rb:4 +module RuboCop::Gusto; end + +# A plugin that integrates Gusto's standard RuboCop cops and rules. +# +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/plugin.rb:8 +class RuboCop::Gusto::Plugin < ::LintRoller::Plugin + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/plugin.rb:9 + def about; end + + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/plugin.rb:22 + def rules(_context); end + + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/plugin.rb:18 + def supported?(context); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/version.rb:5 +RuboCop::Gusto::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:6 +module RuboCop::RSpec; end + +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:7 +module RuboCop::RSpec::Corrector; end + +class RuboCop::RSpec::Corrector::MoveNode + include ::RuboCop::RSpec::Corrector::SigAwareMoveNode +end + +# Patches `MoveNode` to treat Sorbet `sig { ... }` blocks as part of the +# `let`/`subject`/hook they precede. +# +# Sorbet's RSpec mode attaches type signatures to memoized helpers via a +# `sig` block immediately above the declaration: +# +# sig { returns(Something) } +# let(:thing) { create(:something) } +# +# Several rubocop-rspec cops use `MoveNode` to relocate `let`/`subject`/ +# hook nodes (`ScatteredLet`, `LeadingSubject`, `LetBeforeExamples`, +# `HooksBeforeExamples`). Without this patch, the move strands the `sig` +# at the original location. This patch: +# +# 1. Extends the source range of the moved node to include a preceding +# `sig` block, so `sig` is carried with the move. +# 2. In `move_before`, redirects the insertion point above a preceding +# `sig` on the destination, so the destination's `sig` pairing stays +# intact. +# +# pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:27 +module RuboCop::RSpec::Corrector::SigAwareMoveNode + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:35 + def move_before(other); end + + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:31 + def sig_block?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:42 + def node_range(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/gusto/move_node_patch.rb:53 + def preceding_sig_block(node); end +end diff --git a/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi b/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi new file mode 100644 index 0000000..6d0fc57 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-performance` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-performance`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi b/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi new file mode 100644 index 0000000..2fedfa1 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-rake` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-rake`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rubocop-rspec@3.10.2.rbi b/sorbet/rbi/gems/rubocop-rspec@3.10.2.rbi new file mode 100644 index 0000000..32c9646 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-rspec@3.10.2.rbi @@ -0,0 +1,7873 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-rspec` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-rspec`. + + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec.rb:3 +module RuboCop; end + +class RuboCop::AST::Node < ::Parser::AST::Node + include ::RuboCop::RSpec::Node +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/file_help.rb:4 +module RuboCop::Cop; end + +# NOTE: Originally based on the `Rails/Output` cop. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/file_help.rb:5 +module RuboCop::Cop::RSpec; end + +# Checks that left braces for adjacent single line lets are aligned. +# +# @example +# # bad +# let(:foobar) { blahblah } +# let(:baz) { bar } +# let(:a) { b } +# +# # good +# let(:foobar) { blahblah } +# let(:baz) { bar } +# let(:a) { b } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_left_let_brace.rb:19 +class RuboCop::Cop::RSpec::AlignLeftLetBrace < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_left_let_brace.rb:28 + def on_new_investigation; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_left_let_brace.rb:43 + def token_aligner; end + + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_left_let_brace.rb:24 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_left_let_brace.rb:22 +RuboCop::Cop::RSpec::AlignLeftLetBrace::MSG = T.let(T.unsafe(nil), String) + +# Checks that right braces for adjacent single line lets are aligned. +# +# @example +# # bad +# let(:foobar) { blahblah } +# let(:baz) { bar } +# let(:a) { b } +# +# # good +# let(:foobar) { blahblah } +# let(:baz) { bar } +# let(:a) { b } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_right_let_brace.rb:19 +class RuboCop::Cop::RSpec::AlignRightLetBrace < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_right_let_brace.rb:28 + def on_new_investigation; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_right_let_brace.rb:43 + def token_aligner; end + + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_right_let_brace.rb:24 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/align_right_let_brace.rb:22 +RuboCop::Cop::RSpec::AlignRightLetBrace::MSG = T.let(T.unsafe(nil), String) + +# Check that instances are not being stubbed globally. +# +# Prefer instance doubles over stubbing any instance of a class +# +# @example +# # bad +# describe MyClass do +# before { allow_any_instance_of(MyClass).to receive(:foo) } +# end +# +# # good +# describe MyClass do +# let(:my_instance) { instance_double(MyClass) } +# +# before do +# allow(MyClass).to receive(:new).and_return(my_instance) +# allow(my_instance).to receive(:foo) +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/any_instance.rb:26 +class RuboCop::Cop::RSpec::AnyInstance < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/any_instance.rb:34 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/any_instance.rb:27 +RuboCop::Cop::RSpec::AnyInstance::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/any_instance.rb:28 +RuboCop::Cop::RSpec::AnyInstance::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that around blocks actually run the test. +# +# @example +# # bad +# around do +# some_method +# end +# +# around do |test| +# some_method +# end +# +# # good +# around do |test| +# some_method +# test.call +# end +# +# around do |test| +# some_method +# test.run +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:29 +class RuboCop::Cop::RSpec::AroundBlock < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:50 + def find_arg_usage(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:35 + def hook_block(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:45 + def hook_itblock(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:40 + def hook_numblock(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:54 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:70 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:64 + def on_numblock(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:78 + def add_no_arg_offense(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:104 + def check_for_itblock(block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:93 + def check_for_numblock(block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:82 + def check_for_unused_proxy(block, proxy); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:30 +RuboCop::Cop::RSpec::AroundBlock::MSG_NO_ARG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/around_block.rb:31 +RuboCop::Cop::RSpec::AroundBlock::MSG_UNUSED_ARG = T.let(T.unsafe(nil), String) + +# @abstract parent class to RSpec cops +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/base.rb:7 +class RuboCop::Cop::RSpec::Base < ::RuboCop::Cop::Base + include ::RuboCop::RSpec::Language + + # Set the config for dynamic DSL configuration-aware helpers + # that have no other means of accessing the configuration. + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/base.rb:19 + def on_new_investigation; end + + class << self + # Invoke the original inherited hook so our cops are recognized + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/base.rb:13 + def inherited(subclass); end + end +end + +# Check for expectations where `be` is used without argument. +# +# The `be` matcher is too generic, as it pass on everything that is not +# nil or false. If that is the exact intend, use `be_truthy`. In all other +# cases it's better to specify what exactly is the expected value. +# +# @example +# # bad +# expect(foo).to be +# +# # good +# expect(foo).to be_truthy +# expect(foo).to be 1.0 +# expect(foo).to be(true) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be.rb:21 +class RuboCop::Cop::RSpec::Be < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be.rb:27 + def be_without_args(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be.rb:31 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be.rb:22 +RuboCop::Cop::RSpec::Be::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be.rb:24 +RuboCop::Cop::RSpec::Be::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Prefer using `be_empty` when checking for an empty array. +# +# @example +# # bad +# expect(array).to contain_exactly +# expect(array).to match_array([]) +# +# # good +# expect(array).to be_empty +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_empty.rb:16 +class RuboCop::Cop::RSpec::BeEmpty < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_empty.rb:23 + def expect_array_matcher?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_empty.rb:35 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_empty.rb:19 +RuboCop::Cop::RSpec::BeEmpty::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_empty.rb:20 +RuboCop::Cop::RSpec::BeEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check for expectations where `be(...)` can replace `eq(...)`. +# +# The `be` matcher compares by identity while the `eq` matcher compares +# using `==`. Booleans and nil can be compared by identity and therefore +# the `be` matcher is preferable as it is a more strict test. +# +# @safety +# This cop is unsafe because it changes how values are compared. +# +# @example +# # bad +# expect(foo).to eq(true) +# expect(foo).to eq(false) +# expect(foo).to eq(nil) +# +# # good +# expect(foo).to be(true) +# expect(foo).to be(false) +# expect(foo).to be(nil) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eq.rb:26 +class RuboCop::Cop::RSpec::BeEq < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eq.rb:33 + def eq_type_with_identity?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eq.rb:37 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eq.rb:29 +RuboCop::Cop::RSpec::BeEq::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eq.rb:30 +RuboCop::Cop::RSpec::BeEq::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check for expectations where `be(...)` can replace `eql(...)`. +# +# The `be` matcher compares by identity while the `eql` matcher +# compares using `eql?`. Integers, floats, booleans, symbols, and nil +# can be compared by identity and therefore the `be` matcher is +# preferable as it is a more strict test. +# +# @safety +# This cop is unsafe because it changes how values are compared. +# +# @example +# # bad +# expect(foo).to eql(1) +# expect(foo).to eql(1.0) +# expect(foo).to eql(true) +# expect(foo).to eql(false) +# expect(foo).to eql(:bar) +# expect(foo).to eql(nil) +# +# # good +# expect(foo).to be(1) +# expect(foo).to be(1.0) +# expect(foo).to be(true) +# expect(foo).to be(false) +# expect(foo).to be(:bar) +# expect(foo).to be(nil) +# +# This cop only looks for instances of `expect(...).to eql(...)`. We +# do not check `to_not` or `not_to` since `!eql?` is more strict +# than `!equal?`. We also do not try to flag `eq` because if +# `a == b`, and `b` is comparable by identity, `a` is still not +# necessarily the same type as `b` since the `#==` operator can +# coerce objects for comparison. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eql.rb:40 +class RuboCop::Cop::RSpec::BeEql < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eql.rb:47 + def eql_type_with_identity(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eql.rb:51 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eql.rb:43 +RuboCop::Cop::RSpec::BeEql::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_eql.rb:44 +RuboCop::Cop::RSpec::BeEql::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Ensures a consistent style is used when matching `nil`. +# +# You can either use the more specific `be_nil` matcher, or the more +# generic `be` matcher with a `nil` argument. +# +# This cop can be configured using the `EnforcedStyle` option +# +# @example `EnforcedStyle: be_nil` (default) +# # bad +# expect(foo).to be(nil) +# +# # good +# expect(foo).to be_nil +# +# @example `EnforcedStyle: be` +# # bad +# expect(foo).to be_nil +# +# # good +# expect(foo).to be(nil) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:27 +class RuboCop::Cop::RSpec::BeNil < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:36 + def be_nil_matcher?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:41 + def nil_value_expectation?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:45 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:68 + def check_be_nil_style(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:60 + def check_be_style(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:31 +RuboCop::Cop::RSpec::BeNil::BE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:32 +RuboCop::Cop::RSpec::BeNil::BE_NIL_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/be_nil.rb:33 +RuboCop::Cop::RSpec::BeNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check that before/after(:all/:context) isn't being used. +# +# @example +# # bad - Faster but risk of state leaking between examples +# describe MyClass do +# before(:all) { Widget.create } +# after(:context) { Widget.delete_all } +# end +# +# # good - Slower but examples are properly isolated +# describe MyClass do +# before(:each) { Widget.create } +# after(:each) { Widget.delete_all } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/before_after_all.rb:21 +class RuboCop::Cop::RSpec::BeforeAfterAll < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/before_after_all.rb:30 + def before_or_after_all(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/before_after_all.rb:34 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/before_after_all.rb:22 +RuboCop::Cop::RSpec::BeforeAfterAll::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/before_after_all.rb:27 +RuboCop::Cop::RSpec::BeforeAfterAll::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Prefer negated matchers over `to change.by(0)`. +# +# In the case of composite expectations, cop suggest using the +# negation matchers of `RSpec::Matchers#change`. +# +# By default the cop does not support autocorrect of +# compound expectations, but if you set the +# negated matcher for `change`, e.g. `not_change` with +# the `NegatedMatcher` option, the cop will perform the autocorrection. +# +# @example NegatedMatcher: ~ (default) +# # bad +# expect { run }.to change(Foo, :bar).by(0) +# expect { run }.to change { Foo.bar }.by(0) +# +# # bad - compound expectations (does not support autocorrection) +# expect { run } +# .to change(Foo, :bar).by(0) +# .and change(Foo, :baz).by(0) +# expect { run } +# .to change { Foo.bar }.by(0) +# .and change { Foo.baz }.by(0) +# +# # good +# expect { run }.not_to change(Foo, :bar) +# expect { run }.not_to change { Foo.bar } +# +# # good - compound expectations +# define_negated_matcher :not_change, :change +# expect { run } +# .to not_change(Foo, :bar) +# .and not_change(Foo, :baz) +# expect { run } +# .to not_change { Foo.bar } +# .and not_change { Foo.baz } +# +# @example NegatedMatcher: not_change +# # bad (support autocorrection to good case) +# expect { run } +# .to change(Foo, :bar).by(0) +# .and change(Foo, :baz).by(0) +# expect { run } +# .to change { Foo.bar }.by(0) +# .and change { Foo.baz }.by(0) +# +# # good +# define_negated_matcher :not_change, :change +# expect { run } +# .to not_change(Foo, :bar) +# .and not_change(Foo, :baz) +# expect { run } +# .to not_change { Foo.bar } +# .and not_change { Foo.baz } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:60 +class RuboCop::Cop::RSpec::ChangeByZero < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:88 + def change_nodes(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:71 + def expect_change_with_arguments(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:78 + def expect_change_with_block(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:92 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:133 + def autocorrect(corrector, node, change_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:140 + def autocorrect_compound(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:120 + def compound_expectations?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:150 + def insert_operator(corrector, node, change_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:124 + def message(change_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:128 + def message_compound(change_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:174 + def negated_matcher; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:178 + def preferred_method; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:104 + def register_offense(node, change_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:163 + def remove_by_zero(corrector, node, change_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:159 + def replace_node(node, change_node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:67 +RuboCop::Cop::RSpec::ChangeByZero::CHANGE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:64 +RuboCop::Cop::RSpec::ChangeByZero::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:65 +RuboCop::Cop::RSpec::ChangeByZero::MSG_COMPOUND = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/change_by_zero.rb:68 +RuboCop::Cop::RSpec::ChangeByZero::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Enforces consistent use of `be_a` or `be_kind_of`. +# +# @example EnforcedStyle: be_a (default) +# # bad +# expect(object).to be_kind_of(String) +# expect(object).to be_a_kind_of(String) +# +# # good +# expect(object).to be_a(String) +# expect(object).to be_an(String) +# +# @example EnforcedStyle: be_kind_of +# # bad +# expect(object).to be_a(String) +# expect(object).to be_an(String) +# +# # good +# expect(object).to be_kind_of(String) +# expect(object).to be_a_kind_of(String) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:26 +class RuboCop::Cop::RSpec::ClassCheck < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:54 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:67 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:71 + def format_message(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:79 + def offending?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:87 + def preferred_method_name; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:83 + def preferred_method_name?(method_name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:91 + def preferred_method_names; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:32 +RuboCop::Cop::RSpec::ClassCheck::METHOD_NAMES_FOR_BE_A = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:37 +RuboCop::Cop::RSpec::ClassCheck::METHOD_NAMES_FOR_KIND_OF = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:30 +RuboCop::Cop::RSpec::ClassCheck::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:42 +RuboCop::Cop::RSpec::ClassCheck::PREFERRED_METHOD_NAME_BY_STYLE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/class_check.rb:47 +RuboCop::Cop::RSpec::ClassCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Help methods for working with nodes containing comments. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/comments_help.rb:7 +module RuboCop::Cop::RSpec::CommentsHelp + include ::RuboCop::Cop::RSpec::FinalEndLocation + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/comments_help.rb:17 + def begin_pos_with_comment(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/comments_help.rb:32 + def buffer; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/comments_help.rb:27 + def end_line_position(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/comments_help.rb:10 + def source_range_with_comment(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/comments_help.rb:23 + def start_line_position(node); end +end + +# Checks where `contain_exactly` is used. +# +# This cop checks for the following: +# +# - Prefer `match_array` when matching array values. +# - Prefer `be_empty` when using `contain_exactly` with no arguments. +# +# @example +# # bad +# it { is_expected.to contain_exactly(*array) } +# +# # good +# it { is_expected.to match_array(array) } +# +# # good +# it { is_expected.to contain_exactly(*array1, *array2) } +# +# # good +# it { is_expected.to contain_exactly(content, *array) } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/contain_exactly.rb:26 +class RuboCop::Cop::RSpec::ContainExactly < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/contain_exactly.rb:32 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/contain_exactly.rb:29 +RuboCop::Cop::RSpec::ContainExactly::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/contain_exactly.rb:30 +RuboCop::Cop::RSpec::ContainExactly::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# `context` should not be used for specifying methods. +# +# @example +# # bad +# context '#foo_bar' do +# # ... +# end +# +# context '.foo_bar' do +# # ... +# end +# +# # good +# describe '#foo_bar' do +# # ... +# end +# +# describe '.foo_bar' do +# # ... +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_method.rb:27 +class RuboCop::Cop::RSpec::ContextMethod < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_method.rb:33 + def context_method(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_method.rb:41 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_method.rb:51 + def method_name?(description); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_method.rb:30 +RuboCop::Cop::RSpec::ContextMethod::MSG = T.let(T.unsafe(nil), String) + +# Checks that `context` docstring starts with an allowed prefix. +# +# The default list of prefixes is minimal. Users are encouraged to tailor +# the configuration to meet project needs. Other acceptable prefixes may +# include `if`, `unless`, `for`, `before`, `after`, or `during`. +# They may consist of multiple words if desired. +# +# @see http://www.betterspecs.org/#contexts +# +# If both `Prefixes` and `AllowedPatterns` are empty, this cop will always +# report an offense. So you need to set at least one of them. +# +# @example `Prefixes` configuration +# # .rubocop.yml +# # RSpec/ContextWording: +# # Prefixes: +# # - when +# # - with +# # - without +# # - if +# # - unless +# # - for +# +# @example +# # bad +# context 'the display name not present' do +# # ... +# end +# +# # good +# context 'when the display name is not present' do +# # ... +# end +# +# This cop can be customized allowed context description pattern +# with `AllowedPatterns`. By default, there are no checking by pattern. +# +# @example `AllowedPatterns` configuration +# +# # .rubocop.yml +# # RSpec/ContextWording: +# # AllowedPatterns: +# # - とき$ +# +# @example +# # bad +# context '条件を満たす' do +# # ... +# end +# +# # good +# context '条件を満たすとき' do +# # ... +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:61 +class RuboCop::Cop::RSpec::ContextWording < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:69 + def context_wording(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:73 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:83 + def allowed_patterns; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:91 + def description(context); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:107 + def expect_patterns; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:99 + def message; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:87 + def prefix_regexes; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:117 + def prefixes; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:65 +RuboCop::Cop::RSpec::ContextWording::MSG_ALWAYS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/context_wording.rb:64 +RuboCop::Cop::RSpec::ContextWording::MSG_MATCH = T.let(T.unsafe(nil), String) + +# Check that the first argument to the top-level describe is a constant. +# +# It can be configured to ignore strings when certain metadata is passed. +# +# Ignores Rails and Aruba `type` metadata by default. +# +# @example `IgnoredMetadata` configuration +# # .rubocop.yml +# # RSpec/DescribeClass: +# # IgnoredMetadata: +# # type: +# # - request +# # - controller +# +# @example +# # bad +# describe 'Do something' do +# end +# +# # good +# describe TestedClass do +# subject { described_class } +# end +# +# describe 'TestedClass::VERSION' do +# subject { Object.const_get(self.class.description) } +# end +# +# describe "A feature example", type: :feature do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:37 +class RuboCop::Cop::RSpec::DescribeClass < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:44 + def example_group_with_ignored_metadata?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:49 + def not_a_const_described(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:58 + def on_top_level_group(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:54 + def sym_pair(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:79 + def ignored_metadata; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:68 + def ignored_metadata?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:74 + def string_constant?(described); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_class.rb:40 +RuboCop::Cop::RSpec::DescribeClass::MSG = T.let(T.unsafe(nil), String) + +# Checks that the second argument to `describe` specifies a method. +# +# @example +# # bad +# describe MyClass, 'do something' do +# end +# +# # good +# describe MyClass, '#my_instance_method' do +# end +# +# describe MyClass, '.my_class_method' do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_method.rb:20 +class RuboCop::Cop::RSpec::DescribeMethod < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_method.rb:34 + def method_name?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_method.rb:38 + def on_top_level_group(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_method.rb:27 + def second_string_literal_argument(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_method.rb:46 + def method_name_prefix?(description); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_method.rb:23 +RuboCop::Cop::RSpec::DescribeMethod::MSG = T.let(T.unsafe(nil), String) + +# Avoid describing symbols. +# +# @example +# # bad +# describe :my_method do +# # ... +# end +# +# # good +# describe '#my_method' do +# # ... +# end +# +# @see https://github.com/rspec/rspec-core/issues/1610 +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_symbol.rb:20 +class RuboCop::Cop::RSpec::DescribeSymbol < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_symbol.rb:25 + def describe_symbol?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_symbol.rb:29 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_symbol.rb:21 +RuboCop::Cop::RSpec::DescribeSymbol::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/describe_symbol.rb:22 +RuboCop::Cop::RSpec::DescribeSymbol::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that tests use `described_class`. +# +# If the first argument of describe is a class, the class is exposed to +# each example via described_class. +# +# This cop can be configured using the `EnforcedStyle`, `SkipBlocks` +# and `OnlyStaticConstants` options. +# `OnlyStaticConstants` is only relevant when `EnforcedStyle` is +# `described_class`. +# +# There's a known caveat with rspec-rails's `controller` helper that +# runs its block in a different context, and `described_class` is not +# available to it. `SkipBlocks` option excludes detection in all +# non-RSpec related blocks. +# +# To narrow down this setting to only a specific directory, it is +# possible to use an overriding configuration file local to that +# directory. +# +# @safety +# Autocorrection is unsafe when `SkipBlocks: false` because +# `described_class` might not be available within the block (for +# example, in rspec-rails's `controller` helper). +# +# @example `EnforcedStyle: described_class` (default) +# # bad +# describe MyClass do +# subject { MyClass.do_something } +# end +# +# # good +# describe MyClass do +# subject { described_class.do_something } +# end +# +# @example `OnlyStaticConstants: true` (default) +# # good +# describe MyClass do +# subject { MyClass::CONSTANT } +# end +# +# @example `OnlyStaticConstants: false` +# # bad +# describe MyClass do +# subject { MyClass::CONSTANT } +# end +# +# @example `EnforcedStyle: explicit` +# # bad +# describe MyClass do +# subject { described_class.do_something } +# end +# +# # good +# describe MyClass do +# subject { MyClass.do_something } +# end +# +# @example `SkipBlocks: true` +# # spec/controllers/.rubocop.yml +# # RSpec/DescribedClass: +# # SkipBlocks: true +# +# # acceptable +# describe MyConcern do +# controller(ApplicationController) do +# include MyConcern +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:76 +class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RSpec::Namespace + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:85 + def common_instance_exec_closure?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:110 + def contains_described_class?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:105 + def described_constant(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:113 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:98 + def rspec_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:102 + def scope_changing_syntax?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:149 + def allowed?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:130 + def autocorrect(corrector, match); end + + # @param namespace [Array] + # @param const [Array] + # @return [Array] + # @example + # # nil represents base constant + # collapse_namespace([], [:C]) # => [:C] + # collapse_namespace([:A, :B], [:C]) # => [:A, :B, :C] + # collapse_namespace([:A, :B], [:B, :C]) # => [:A, :B, :C] + # collapse_namespace([:A, :B], [nil, :C]) # => [nil, :C] + # collapse_namespace([:A, :B], [nil, :B, :C]) # => [nil, :B, :C] + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:215 + def collapse_namespace(namespace, const); end + + # @param node [RuboCop::AST::Node] + # @return [Array] + # @example + # const_name(s(:const, nil, :C)) # => [:C] + # const_name(s(:const, s(:const, nil, :M), :C)) # => [:M, :C] + # const_name(s(:const, s(:cbase), :C)) # => [nil, :C] + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:232 + def const_name(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:140 + def find_usage(node, &block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:200 + def full_const_name(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:153 + def message(offense); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:178 + def offensive?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:186 + def offensive_described_class?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:174 + def only_static_constants?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:162 + def scope_change?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:168 + def skippable_block?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:81 +RuboCop::Cop::RSpec::DescribedClass::DESCRIBED_CLASS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class.rb:82 +RuboCop::Cop::RSpec::DescribedClass::MSG = T.let(T.unsafe(nil), String) + +# Avoid opening modules and defining specs within them. +# +# @example +# # bad +# module MyModule +# RSpec.describe MyClass do +# # ... +# end +# end +# +# # good +# RSpec.describe MyModule::MyClass do +# # ... +# end +# +# @see https://github.com/rubocop/rubocop-rspec/issues/735 +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class_module_wrapping.rb:22 +class RuboCop::Cop::RSpec::DescribedClassModuleWrapping < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class_module_wrapping.rb:26 + def include_rspec_blocks?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class_module_wrapping.rb:30 + def on_module(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/described_class_module_wrapping.rb:23 +RuboCop::Cop::RSpec::DescribedClassModuleWrapping::MSG = T.let(T.unsafe(nil), String) + +# Enforces custom RSpec dialects. +# +# A dialect can be based on the following RSpec methods: +# +# - describe, context, feature, example_group +# - xdescribe, xcontext, xfeature +# - fdescribe, fcontext, ffeature +# - shared_examples, shared_examples_for, shared_context +# - it, specify, example, scenario, its +# - fit, fspecify, fexample, fscenario, focus +# - xit, xspecify, xexample, xscenario, skip +# - pending +# - prepend_before, before, append_before, +# - around +# - prepend_after, after, append_after +# - let, let! +# - subject, subject! +# - expect, is_expected, expect_any_instance_of +# - raise_error, raise_exception +# +# By default all of the RSpec methods and aliases are allowed. By setting +# a config like: +# +# RSpec/Dialect: +# PreferredMethods: +# context: describe +# +# If you were previously using the `RSpec/Capybara/FeatureMethods` cop and +# want to keep disabling all Capybara-specific methods that have the same +# native RSpec method (e.g. are just aliases), use the following config: +# +# RSpec/Dialect: +# PreferredMethods: +# background: :before +# scenario: :it +# xscenario: :xit +# given: :let +# given!: :let! +# feature: :describe +# +# You can expect the following behavior: +# +# @example +# # bad +# context 'display name presence' do +# # ... +# end +# +# # good +# describe 'display name presence' do +# # ... +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/dialect.rb:59 +class RuboCop::Cop::RSpec::Dialect < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::MethodPreference + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/dialect.rb:68 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/dialect.rb:66 + def rspec_method?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/dialect.rb:63 +RuboCop::Cop::RSpec::Dialect::MSG = T.let(T.unsafe(nil), String) + +# Checks for matchers that are used in void context. +# +# Matcher calls like `change`, `receive`, etc. that appear as +# standalone expressions have their result silently discarded. +# This usually means a missing `.and` to chain compound matchers. +# +# The list of matcher methods can be configured +# with `CustomMatcherMethods`. +# +# @example +# # bad +# specify do +# expect { result } +# .to change { obj.foo }.from(1).to(2) +# change { obj.bar }.from(3).to(4) +# end +# +# # good +# specify do +# expect { result } +# .to change { obj.foo }.from(1).to(2) +# .and change { obj.bar }.from(3).to(4) +# end +# +# # good +# specify do +# expect { result }.to change { obj.foo }.from(1).to(2) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:35 +class RuboCop::Cop::RSpec::DiscardedMatcher < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::InsideExample + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:50 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:46 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:96 + def all_matcher_methods; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:56 + def check_discarded_matcher(send_node, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:101 + def custom_matcher_methods; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:67 + def example_with_matcher_expectation?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:76 + def expectation_with_matcher?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:105 + def find_outermost_chain(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:92 + def matcher_call?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:83 + def void_value?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:41 +RuboCop::Cop::RSpec::DiscardedMatcher::MATCHER_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/discarded_matcher.rb:38 +RuboCop::Cop::RSpec::DiscardedMatcher::MSG = T.let(T.unsafe(nil), String) + +# Avoid duplicated metadata. +# +# @example +# # bad +# describe 'Something', :a, :a +# +# # good +# describe 'Something', :a +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/duplicated_metadata.rb:14 +class RuboCop::Cop::RSpec::DuplicatedMetadata < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::Metadata + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/duplicated_metadata.rb:22 + def on_metadata(symbols, _hash); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/duplicated_metadata.rb:38 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/duplicated_metadata.rb:50 + def duplicated?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/duplicated_metadata.rb:30 + def on_metadata_symbol(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/duplicated_metadata.rb:20 +RuboCop::Cop::RSpec::DuplicatedMetadata::MSG = T.let(T.unsafe(nil), String) + +# Checks if an example group does not include any tests. +# +# @example usage +# # bad +# describe Bacon do +# let(:bacon) { Bacon.new(chunkiness) } +# let(:chunkiness) { false } +# +# context 'extra chunky' do # flagged by rubocop +# let(:chunkiness) { true } +# end +# +# it 'is chunky' do +# expect(bacon.chunky?).to be_truthy +# end +# end +# +# # good +# describe Bacon do +# let(:bacon) { Bacon.new(chunkiness) } +# let(:chunkiness) { false } +# +# it 'is chunky' do +# expect(bacon.chunky?).to be_truthy +# end +# end +# +# # good +# describe Bacon do +# pending 'will add tests later' +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:38 +class RuboCop::Cop::RSpec::EmptyExampleGroup < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::InsideExample + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:56 + def example_group_body(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:74 + def example_or_group_or_include?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:131 + def examples?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:112 + def examples_directly_or_in_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:98 + def examples_inside_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:140 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:166 + def conditionals_with_examples?(body); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:174 + def examples_in_branches?(condition_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:155 + def offensive?(body); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:181 + def removed_range(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_example_group.rb:44 +RuboCop::Cop::RSpec::EmptyExampleGroup::MSG = T.let(T.unsafe(nil), String) + +# Checks for empty before and after hooks. +# +# @example +# # bad +# before {} +# after do; end +# before(:all) do +# end +# after(:all) { } +# +# # good +# before { create_users } +# after do +# cleanup_users +# end +# before(:all) do +# create_feed +# end +# after(:all) { cleanup_feed } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_hook.rb:26 +class RuboCop::Cop::RSpec::EmptyHook < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_hook.rb:33 + def empty_hook?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_hook.rb:37 + def on_block(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_hook.rb:30 +RuboCop::Cop::RSpec::EmptyHook::MSG = T.let(T.unsafe(nil), String) + +# Checks if there is an empty line after example blocks. +# +# @example +# # bad +# RSpec.describe Foo do +# it 'does this' do +# end +# it 'does that' do +# end +# end +# +# # good +# RSpec.describe Foo do +# it 'does this' do +# end +# +# it 'does that' do +# end +# end +# +# # fair - it's ok to have non-separated one-liners +# RSpec.describe Foo do +# it { one } +# it { two } +# end +# +# @example with AllowConsecutiveOneLiners configuration +# # rubocop.yml +# # RSpec/EmptyLineAfterExample: +# # AllowConsecutiveOneLiners: false +# +# # bad +# RSpec.describe Foo do +# it { one } +# it { two } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:43 +class RuboCop::Cop::RSpec::EmptyLineAfterExample < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::EmptyLineSeparation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:49 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:64 + def allow_consecutive_one_liners?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:60 + def allowed_one_liner?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:68 + def consecutive_one_liner?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:72 + def next_one_line_example?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example.rb:47 +RuboCop::Cop::RSpec::EmptyLineAfterExample::MSG = T.let(T.unsafe(nil), String) + +# Checks if there is an empty line after example group blocks. +# +# @example +# # bad +# RSpec.describe Foo do +# describe '#bar' do +# end +# describe '#baz' do +# end +# end +# +# # good +# RSpec.describe Foo do +# describe '#bar' do +# end +# +# describe '#baz' do +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example_group.rb:26 +class RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::EmptyLineSeparation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example_group.rb:32 + def on_block(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_example_group.rb:30 +RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup::MSG = T.let(T.unsafe(nil), String) + +# Checks if there is an empty line after the last let block. +# +# @example +# # bad +# let(:foo) { bar } +# let(:something) { other } +# it { does_something } +# +# # good +# let(:foo) { bar } +# let(:something) { other } +# +# it { does_something } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_final_let.rb:20 +class RuboCop::Cop::RSpec::EmptyLineAfterFinalLet < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::EmptyLineSeparation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_final_let.rb:27 + def example_group_or_include?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_final_let.rb:31 + def on_block(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_final_let.rb:24 +RuboCop::Cop::RSpec::EmptyLineAfterFinalLet::MSG = T.let(T.unsafe(nil), String) + +# Checks if there is an empty line after hook blocks. +# +# `AllowConsecutiveOneLiners` configures whether adjacent +# one-line definitions are considered an offense. +# +# @example +# # bad +# before { do_something } +# it { does_something } +# +# # bad +# after { do_something } +# it { does_something } +# +# # bad +# around { |test| test.run } +# it { does_something } +# +# # good +# after { do_something } +# +# it { does_something } +# +# # fair - it's ok to have non-separated one-liners hooks +# around { |test| test.run } +# after { do_something } +# +# it { does_something } +# +# @example with AllowConsecutiveOneLiners configuration +# # rubocop.yml +# # RSpec/EmptyLineAfterHook: +# # AllowConsecutiveOneLiners: false +# +# # bad +# around { |test| test.run } +# after { do_something } +# +# it { does_something } +# +# # good +# around { |test| test.run } +# +# after { do_something } +# +# it { does_something } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_hook.rb:53 +class RuboCop::Cop::RSpec::EmptyLineAfterHook < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::EmptyLineSeparation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_hook.rb:60 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_hook.rb:71 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_hook.rb:70 + def on_numblock(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_hook.rb:75 + def chained_single_line_hooks?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_hook.rb:58 +RuboCop::Cop::RSpec::EmptyLineAfterHook::MSG = T.let(T.unsafe(nil), String) + +# Checks if there is an empty line after subject block. +# +# @example +# # bad +# subject(:obj) { described_class } +# let(:foo) { bar } +# +# # good +# subject(:obj) { described_class } +# +# let(:foo) { bar } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_subject.rb:18 +class RuboCop::Cop::RSpec::EmptyLineAfterSubject < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::EmptyLineSeparation + include ::RuboCop::Cop::RSpec::InsideExampleGroup + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_subject.rb:25 + def on_block(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_line_after_subject.rb:23 +RuboCop::Cop::RSpec::EmptyLineAfterSubject::MSG = T.let(T.unsafe(nil), String) + +# Helps determine the offending location if there is not an empty line +# following the node. Allows comments to follow directly after +# in the following cases. +# - followed by empty line(s) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:11 +module RuboCop::Cop::RSpec::EmptyLineSeparation + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:51 + def last_child?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:26 + def missing_separating_line(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:15 + def missing_separating_line_offense(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:41 + def offending_loc(last_line); end +end + +# Avoid empty metadata hash. +# +# @example EnforcedStyle: symbol (default) +# # bad +# describe 'Something', {} +# +# # good +# describe 'Something' +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_metadata.rb:14 +class RuboCop::Cop::RSpec::EmptyMetadata < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::Metadata + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_metadata.rb:22 + def on_metadata(_symbols, hash); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_metadata.rb:33 + def remove_empty_metadata(corrector, node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_metadata.rb:20 +RuboCop::Cop::RSpec::EmptyMetadata::MSG = T.let(T.unsafe(nil), String) + +# Check that the `output` matcher is not called with an empty string. +# +# @example +# # bad +# expect { foo }.to output('').to_stdout +# expect { bar }.not_to output('').to_stderr +# +# # good +# expect { foo }.not_to output.to_stdout +# expect { bar }.to output.to_stderr +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_output.rb:17 +class RuboCop::Cop::RSpec::EmptyOutput < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_output.rb:24 + def matching_empty_output(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_output.rb:34 + def on_send(send_node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_output.rb:20 +RuboCop::Cop::RSpec::EmptyOutput::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/empty_output.rb:21 +RuboCop::Cop::RSpec::EmptyOutput::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Use `eq` instead of `be ==` to compare objects. +# +# @example +# # bad +# expect(foo).to be == 42 +# +# # good +# expect(foo).to eq 42 +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/eq.rb:15 +class RuboCop::Cop::RSpec::Eq < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/eq.rb:23 + def be_equals(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/eq.rb:27 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/eq.rb:38 + def offense_range(matcher); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/eq.rb:19 +RuboCop::Cop::RSpec::Eq::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/eq.rb:20 +RuboCop::Cop::RSpec::Eq::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for long examples. +# +# A long example is usually more difficult to understand. Consider +# extracting out some behavior, e.g. with a `let` block, or a helper +# method. +# +# @example +# # bad +# it do +# service = described_class.new +# more_setup +# more_setup +# result = service.call +# expect(result).to be(true) +# end +# +# # good +# it do +# service = described_class.new +# result = service.call +# expect(result).to be(true) +# end +# +# You can set constructs you want to fold with `CountAsOne`. +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of +# its actual size. +# +# @example CountAsOne: ['array', 'heredoc', 'method_call'] +# +# it do +# array = [ # +1 +# 1, +# 2 +# ] +# +# hash = { # +3 +# key: 'value' +# } +# +# msg = <<~HEREDOC # +1 +# Heredoc +# content. +# HEREDOC +# +# foo( # +1 +# 1, +# 2 +# ) +# end # 6 points +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_length.rb:57 +class RuboCop::Cop::RSpec::ExampleLength < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::CodeLength + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_length.rb:62 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_length.rb:70 + def cop_label; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_length.rb:60 +RuboCop::Cop::RSpec::ExampleLength::LABEL = T.let(T.unsafe(nil), String) + +# Checks for examples without a description. +# +# RSpec allows for auto-generated example descriptions when there is no +# description provided or the description is an empty one. +# It is acceptable to use `specify` without a description +# +# This cop removes empty descriptions. +# It also defines whether auto-generated description is allowed, based +# on the configured style. +# +# This cop can be configured using the `EnforcedStyle` option +# +# @example +# # always good +# specify do +# result = service.call +# expect(result).to be(true) +# end +# +# @example `EnforcedStyle: always_allow` (default) +# # bad +# it('') { is_expected.to be_good } +# specify '' do +# result = service.call +# expect(result).to be(true) +# end +# +# # good +# it { is_expected.to be_good } +# specify do +# result = service.call +# expect(result).to be(true) +# end +# +# @example `EnforcedStyle: single_line_only` +# # bad +# it('') { is_expected.to be_good } +# it do +# result = service.call +# expect(result).to be(true) +# end +# +# # good +# it { is_expected.to be_good } +# +# @example `EnforcedStyle: disallow` +# # bad +# it { is_expected.to be_good } +# it do +# result = service.call +# expect(result).to be(true) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:59 +class RuboCop::Cop::RSpec::ExampleWithoutDescription < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:67 + def example_description(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:69 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:83 + def check_example_without_description(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:91 + def disallow_empty_description?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:64 +RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_ADD_DESCRIPTION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_without_description.rb:62 +RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_DEFAULT_ARGUMENT = T.let(T.unsafe(nil), String) + +# Checks for common mistakes in example descriptions. +# +# This cop will correct docstrings that begin with 'should' and 'it'. +# This cop will also look for insufficient examples and call them out. +# +# @see http://betterspecs.org/#should +# +# @safety +# The autocorrect is experimental - use with care! It can be configured +# with CustomTransform (e.g. have => has) and IgnoredWords (e.g. only). +# +# While the autocorrect will not break your code (it only modifies test +# description strings, not the actual test logic), it may produce +# grammatically incorrect English in some cases. Always review the diff +# when using autocorrect to ensure the descriptions remain natural and +# accurate. +# +# This is not classified as an unsafe autocorrect because it does not +# affect code behavior, but manual review of changes is strongly +# recommended. +# +# Use the DisallowedExamples setting to prevent unclear or insufficient +# descriptions. Please note that this config will not be treated as +# case sensitive. +# +# @example +# # bad +# it 'should find nothing' do +# end +# +# it 'will find nothing' do +# end +# +# # good +# it 'finds nothing' do +# end +# +# @example +# # bad +# it 'it does things' do +# end +# +# # good +# it 'does things' do +# end +# +# @example `DisallowedExamples: ['works']` (default) +# # bad +# it 'works' do +# end +# +# # good +# it 'marks the task as done' do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:60 +class RuboCop::Cop::RSpec::ExampleWording < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:74 + def it_description(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:81 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:98 + def add_wording_offense(node, message); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:145 + def custom_transform; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:108 + def docstring(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:149 + def ignored_words; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:153 + def insufficient_docstring?(description_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:157 + def insufficient_examples; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:162 + def preprocess(message); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:118 + def replacement_text(node); end + + # Recursive processing is required to process nested dstr nodes + # that is the case for \-separated multiline strings with interpolation. + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:134 + def text(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:71 +RuboCop::Cop::RSpec::ExampleWording::IT_PREFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:66 +RuboCop::Cop::RSpec::ExampleWording::MSG_INSUFFICIENT_DESCRIPTION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:65 +RuboCop::Cop::RSpec::ExampleWording::MSG_IT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:63 +RuboCop::Cop::RSpec::ExampleWording::MSG_SHOULD = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:64 +RuboCop::Cop::RSpec::ExampleWording::MSG_WILL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:69 +RuboCop::Cop::RSpec::ExampleWording::SHOULD_PREFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/example_wording.rb:70 +RuboCop::Cop::RSpec::ExampleWording::WILL_PREFIX = T.let(T.unsafe(nil), Regexp) + +# Checks for excessive whitespace in example descriptions. +# +# @example +# # bad +# it ' has excessive spacing ' do +# end +# +# # good +# it 'has excessive spacing' do +# end +# +# @example +# # bad +# context ' when a condition is met ' do +# end +# +# # good +# context 'when a condition is met' do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:26 +class RuboCop::Cop::RSpec::ExcessiveDocstringSpacing < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:32 + def example_description(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:39 + def on_send(node); end + + private + + # @param node [RuboCop::AST::Node] + # @param text [String] + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:76 + def add_whitespace_offense(node, text); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:85 + def docstring(node); end + + # @param text [String] + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:54 + def excessive_whitespace?(text); end + + # @param text [String] + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:68 + def strip_excessive_whitespace(text); end + + # Recursive processing is required to process nested dstr nodes + # that is the case for \-separated multiline strings with interpolation. + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:97 + def text(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:29 +RuboCop::Cop::RSpec::ExcessiveDocstringSpacing::MSG = T.let(T.unsafe(nil), String) + +# Checks for `expect(...)` calls containing literal values. +# +# Autocorrection is performed when the expected is not a literal. +# +# @example +# # bad +# expect(5).to eq(price) +# expect(/foo/).to eq(pattern) +# expect("John").to eq(name) +# +# # good +# expect(price).to eq(5) +# expect(pattern).to eq(/foo/) +# expect(name).to eq("John") +# +# # bad (not supported autocorrection) +# expect(42).to be_even +# expect(false).to eq(true) +# expect("user").to be_present +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:26 +class RuboCop::Cop::RSpec::ExpectActual < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:60 + def expect_literal(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:72 + def expect_literal_no_arg(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:80 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:118 + def complex_literal?(node); end + + # This is not implemented using a NodePattern because it seems + # to not be able to match against an explicit (nil) sexp + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:110 + def literal?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:91 + def register_offense(actual, send_node, matcher, expected); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:114 + def simple_literal?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:47 +RuboCop::Cop::RSpec::ExpectActual::COMPLEX_LITERALS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:57 +RuboCop::Cop::RSpec::ExpectActual::CORRECTABLE_MATCHERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:29 +RuboCop::Cop::RSpec::ExpectActual::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:30 +RuboCop::Cop::RSpec::ExpectActual::MSG_NO_ARG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:32 +RuboCop::Cop::RSpec::ExpectActual::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:34 +RuboCop::Cop::RSpec::ExpectActual::SIMPLE_LITERALS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_actual.rb:56 +RuboCop::Cop::RSpec::ExpectActual::SKIPPED_MATCHERS = T.let(T.unsafe(nil), Array) + +# Checks for consistent style of change matcher. +# +# Enforces either passing a receiver and message as method arguments, +# or a block. +# +# This cop can be configured using the `EnforcedStyle` option. +# +# When using compound expectations with `change` and a negated matcher +# (e.g., `not_change`), you can configure the `NegatedMatcher` option +# to ensure consistent style enforcement across both matchers. +# +# @safety +# Autocorrection is unsafe because `method_call` style calls the +# receiver *once* and sends the message to it before and after +# calling the `expect` block, whereas `block` style calls the +# expression *twice*, including the receiver. +# +# If your receiver is dynamic (e.g., the result of a method call) and +# you expect it to be called before and after the `expect` block, +# changing from `block` to `method_call` style may break your test. +# +# [source,ruby] +# ---- +# expect { run }.to change { my_method.message } +# # `my_method` is called before and after `run` +# +# expect { run }.to change(my_method, :message) +# # `my_method` is called once, but `message` is called on it twice +# ---- +# +# @example `EnforcedStyle: method_call` (default) +# # bad +# expect { run }.to change { Foo.bar } +# expect { run }.to change { foo.baz } +# +# # good +# expect { run }.to change(Foo, :bar) +# expect { run }.to change(foo, :baz) +# # also good when there are arguments or chained method calls +# expect { run }.to change { Foo.bar(:count) } +# expect { run }.to change { user.reload.name } +# +# @example `EnforcedStyle: block` +# # bad +# expect { run }.to change(Foo, :bar) +# +# # good +# expect { run }.to change { Foo.bar } +# +# @example `NegatedMatcher: not_change` (with compound expectations) +# # bad +# expect { run }.to change(Foo, :bar).and not_change { Foo.baz } +# +# # good +# expect { run }.to change(Foo, :bar).and not_change(Foo, :baz) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:62 +class RuboCop::Cop::RSpec::ExpectChange < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:70 + def expect_matcher_with_arguments(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:75 + def expect_matcher_with_block(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:104 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:89 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:125 + def matcher_method?(method_name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:121 + def matcher_method_names; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:129 + def negated_matcher; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:66 +RuboCop::Cop::RSpec::ExpectChange::MSG_BLOCK = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_change.rb:67 +RuboCop::Cop::RSpec::ExpectChange::MSG_CALL = T.let(T.unsafe(nil), String) + +# Do not use `expect` in hooks such as `before`. +# +# @example +# # bad +# before do +# expect(something).to eq 'foo' +# end +# +# # bad +# after do +# expect_any_instance_of(Something).to receive(:foo) +# end +# +# # good +# it do +# expect(something).to eq 'foo' +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:24 +class RuboCop::Cop::RSpec::ExpectInHook < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:28 + def expectation(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:30 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:41 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:40 + def on_numblock(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:45 + def message(expect, hook); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_hook.rb:25 +RuboCop::Cop::RSpec::ExpectInHook::MSG = T.let(T.unsafe(nil), String) + +# Do not use `expect` in let. +# +# @example +# # bad +# let(:foo) do +# expect(something).to eq 'foo' +# end +# +# # good +# it do +# expect(something).to eq 'foo' +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_let.rb:19 +class RuboCop::Cop::RSpec::ExpectInLet < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_let.rb:23 + def expectation(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_let.rb:25 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_let.rb:36 + def message(expect); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_in_let.rb:20 +RuboCop::Cop::RSpec::ExpectInLet::MSG = T.let(T.unsafe(nil), String) + +# Checks for opportunities to use `expect { ... }.to output`. +# +# @example +# # bad +# $stdout = StringIO.new +# my_app.print_report +# $stdout = STDOUT +# expect($stdout.string).to eq('Hello World') +# +# # good +# expect { my_app.print_report }.to output('Hello World').to_stdout +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_output.rb:18 +class RuboCop::Cop::RSpec::ExpectOutput < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_output.rb:22 + def on_gvasgn(node); end + + private + + # Detect if we are inside the scope of a single example + # + # We want to encourage using `expect { ... }.to output` so + # we only care about situations where you would replace with + # an expectation. Therefore, assignments to stderr or stdout + # within a `before(:all)` or otherwise outside of an example + # don't matter. + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_output.rb:40 + def inside_example_scope?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/expect_output.rb:19 +RuboCop::Cop::RSpec::ExpectOutput::MSG = T.let(T.unsafe(nil), String) + +# A helper for `explicit` style +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:129 +module RuboCop::Cop::RSpec::ExplicitHelper + include ::RuboCop::RSpec::Language + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:188 + def predicate_matcher?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:201 + def predicate_matcher_block?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:143 + def allowed_explicit_matchers; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:147 + def check_explicit(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:225 + def corrector_explicit(corrector, to_node, actual, matcher, block_child); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:183 + def heredoc_argument?(matcher); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:219 + def message_explicit(matcher); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:232 + def move_predicate(corrector, actual, matcher, block_child); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:210 + def predicate_matcher_name?(name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:170 + def replaceable_matcher?(matcher); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:259 + def replacement_matcher(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:242 + def to_predicate_method(matcher); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:179 + def uncorrectable_matcher?(node, matcher); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:135 +RuboCop::Cop::RSpec::ExplicitHelper::BUILT_IN_MATCHERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:133 +RuboCop::Cop::RSpec::ExplicitHelper::MSG_EXPLICIT = T.let(T.unsafe(nil), String) + +# Help methods for file. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/file_help.rb:7 +module RuboCop::Cop::RSpec::FileHelp + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/file_help.rb:8 + def expanded_file_path; end +end + +# Helps find the true end location of nodes which might contain heredocs. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/final_end_location.rb:7 +module RuboCop::Cop::RSpec::FinalEndLocation + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/final_end_location.rb:8 + def final_end_location(start_node); end +end + +# Checks if examples are focused. +# +# This cop does not support autocorrection in some cases. +# +# @example +# # bad +# describe MyClass, focus: true do +# end +# +# describe MyClass, :focus do +# end +# +# fdescribe MyClass do +# end +# +# # good +# describe MyClass do +# end +# +# # bad +# fdescribe 'test' do; end +# +# # good +# describe 'test' do; end +# +# # bad +# shared_examples 'test', focus: true do; end +# +# # good +# shared_examples 'test' do; end +# +# # bad +# shared_context 'test', focus: true do; end +# +# # good +# shared_context 'test' do; end +# +# # bad (does not support autocorrection) +# focus 'test' do; end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:46 +class RuboCop::Cop::RSpec::Focus < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:53 + def focusable_selector?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:71 + def focused_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:65 + def metadata(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:75 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:108 + def correct_send(corrector, focus); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:89 + def on_focused_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:95 + def on_metadata(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:101 + def with_surrounding(focus); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/focus.rb:50 +RuboCop::Cop::RSpec::Focus::MSG = T.let(T.unsafe(nil), String) + +# Checks the arguments passed to `before`, `around`, and `after`. +# +# This cop checks for consistent style when specifying RSpec +# hooks which run for each example. There are three supported +# styles: "implicit", "each", and "example." All styles have +# the same behavior. +# +# @example `EnforcedStyle: implicit` (default) +# # bad +# before(:each) do +# # ... +# end +# +# # bad +# before(:example) do +# # ... +# end +# +# # good +# before do +# # ... +# end +# +# @example `EnforcedStyle: each` +# # bad +# before(:example) do +# # ... +# end +# +# # bad +# before do +# # ... +# end +# +# # good +# before(:each) do +# # ... +# end +# +# @example `EnforcedStyle: example` +# # bad +# before(:each) do +# # ... +# end +# +# # bad +# before do +# # ... +# end +# +# # good +# before(:example) do +# # ... +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:61 +class RuboCop::Cop::RSpec::HookArgument < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:78 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:92 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:91 + def on_numblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:69 + def scoped_hook(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:74 + def unscoped_hook(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:96 + def autocorrect(corrector, _node, method_send); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:103 + def check_implicit(method_send); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:117 + def explicit_message(scope); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:129 + def hook(node, &block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:125 + def implicit_style?; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:66 +RuboCop::Cop::RSpec::HookArgument::EXPLICIT_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hook_argument.rb:65 +RuboCop::Cop::RSpec::HookArgument::IMPLICIT_MSG = T.let(T.unsafe(nil), String) + +# Checks for before/around/after hooks that come after an example. +# +# @example +# # bad +# it 'checks what foo does' do +# expect(foo).to be +# end +# +# before { prepare } +# after { clean_up } +# +# # good +# before { prepare } +# after { clean_up } +# +# it 'checks what foo does' do +# expect(foo).to be +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:25 +class RuboCop::Cop::RSpec::HooksBeforeExamples < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:31 + def example_or_group?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:41 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:48 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:47 + def on_numblock(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:74 + def autocorrect(corrector, node, first_example); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:56 + def check_hooks(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:70 + def find_first_example(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:52 + def multiline_block?(block); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/hooks_before_examples.rb:28 +RuboCop::Cop::RSpec::HooksBeforeExamples::MSG = T.let(T.unsafe(nil), String) + +# Checks for equality assertions with identical expressions on both sides. +# +# @example +# # bad +# expect(foo.bar).to eq(foo.bar) +# expect(foo.bar).to eql(foo.bar) +# +# # good +# expect(foo.bar).to eq(2) +# expect(foo.bar).to eql(2) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/identical_equality_assertion.rb:17 +class RuboCop::Cop::RSpec::IdenticalEqualityAssertion < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/identical_equality_assertion.rb:23 + def equality_check?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/identical_equality_assertion.rb:29 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/identical_equality_assertion.rb:18 +RuboCop::Cop::RSpec::IdenticalEqualityAssertion::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/identical_equality_assertion.rb:20 +RuboCop::Cop::RSpec::IdenticalEqualityAssertion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check that implicit block expectation syntax is not used. +# +# Prefer using explicit block expectations. +# +# @example +# # bad +# subject { -> { do_something } } +# it { is_expected.to change(something).to(new_value) } +# +# # good +# it 'changes something to a new value' do +# expect { do_something }.to change(something).to(new_value) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:20 +class RuboCop::Cop::RSpec::ImplicitBlockExpectation < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:36 + def implicit_expect(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:25 + def lambda?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:33 + def lambda_subject?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:40 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:62 + def find_subject(block_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:58 + def multi_statement_example_group?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:49 + def nearest_subject(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:21 +RuboCop::Cop::RSpec::ImplicitBlockExpectation::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_block_expectation.rb:22 +RuboCop::Cop::RSpec::ImplicitBlockExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check that a consistent implicit expectation style is used. +# +# This cop can be configured using the `EnforcedStyle` option +# and supports the `--auto-gen-config` flag. +# +# @example `EnforcedStyle: is_expected` (default) +# # bad +# it { should be_truthy } +# +# # good +# it { is_expected.to be_truthy } +# +# @example `EnforcedStyle: should` +# # bad +# it { is_expected.to be_truthy } +# +# # good +# it { should be_truthy } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:25 +class RuboCop::Cop::RSpec::ImplicitExpect < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:34 + def implicit_expect(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:49 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:69 + def offending_expect(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:86 + def offense_message(offending_source); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:78 + def range_for_is_expected(source_map); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:94 + def replacement_source(offending_source); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:47 +RuboCop::Cop::RSpec::ImplicitExpect::ENFORCED_REPLACEMENTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:29 +RuboCop::Cop::RSpec::ImplicitExpect::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_expect.rb:31 +RuboCop::Cop::RSpec::ImplicitExpect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for usage of implicit subject (`is_expected` / `should`). +# +# This cop can be configured using the `EnforcedStyle` option +# +# @example `EnforcedStyle: single_line_only` (default) +# # bad +# it do +# is_expected.to be_truthy +# end +# +# # good +# it { is_expected.to be_truthy } +# it do +# expect(subject).to be_truthy +# end +# +# @example `EnforcedStyle: single_statement_only` +# # bad +# it do +# foo = 1 +# is_expected.to be_truthy +# end +# +# # good +# it do +# foo = 1 +# expect(subject).to be_truthy +# end +# it do +# is_expected.to be_truthy +# end +# +# @example `EnforcedStyle: disallow` +# # bad +# it { is_expected.to be_truthy } +# +# # good +# it { expect(subject).to be_truthy } +# +# @example `EnforcedStyle: require_implicit` +# # bad +# it { expect(subject).to be_truthy } +# +# # good +# it { is_expected.to be_truthy } +# +# # bad +# it do +# expect(subject).to be_truthy +# end +# +# # good +# it do +# is_expected.to be_truthy +# end +# +# # good +# it { expect(named_subject).to be_truthy } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:65 +class RuboCop::Cop::RSpec::ImplicitSubject < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:81 + def explicit_unnamed_subject?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:86 + def implicit_subject?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:90 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:100 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:167 + def example_of(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:143 + def implicit_subject_in_non_its?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:147 + def implicit_subject_in_non_its_and_non_single_line?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:151 + def implicit_subject_in_non_its_and_non_single_statement?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:126 + def invalid?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:155 + def its?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:117 + def message(_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:159 + def single_line?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:163 + def single_statement?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:69 +RuboCop::Cop::RSpec::ImplicitSubject::MSG_REQUIRE_EXPLICIT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:71 +RuboCop::Cop::RSpec::ImplicitSubject::MSG_REQUIRE_IMPLICIT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/implicit_subject.rb:73 +RuboCop::Cop::RSpec::ImplicitSubject::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for usage of `include_examples`. +# +# `include_examples`, unlike `it_behaves_like`, does not create its +# own context. As such, using `subject`, `let`, `before`/`after`, etc. +# within shared examples included with `include_examples` can have +# unexpected behavior and side effects. +# +# Prefer using `it_behaves_like` instead. +# +# @safety +# `include_examples` and `it_behaves_like` have different scoping +# behaviors. +# Changing `include_examples` to `it_behaves_like` creates a new +# context, altering setup dependencies, which can lead to unexpected +# test failures. +# Specifically, the scope of hooks (`before`, `after`, `around`) +# changes, which may prevent expected setup from being inherited +# correctly. +# +# Additionally, `let` and `subject` are affected by scoping rules. +# When `include_examples` is used, `let` and `subject` defined within +# `shared_examples` are evaluated in the caller's context, allowing +# access to their values. +# In contrast, `it_behaves_like` creates a new context, preventing +# access to `let` or `subject` values from the caller's context. +# +# [source,ruby] +# ---- +# shared_examples "mock behavior" do +# before do +# allow(service).to receive(:call).and_return("mocked response") +# end +# +# it "returns mocked response" do +# expect(service.call).to eq "mocked response" +# end +# end +# +# context "working example with include_examples" do +# let(:service) { double(:service) } +# +# include_examples "mock behavior" +# +# it "uses the mocked service" do +# expect(service.call).to eq "mocked response" # Passes +# end +# end +# +# context "broken example with it_behaves_like" do +# let(:service) { double(:service) } +# +# it_behaves_like "mock behavior" +# +# it "unexpectedly does not use the mocked service" do +# # Fails because `it_behaves_like` does not apply the mock setup +# expect(service.call).to eq "mocked response" +# end +# end +# ---- +# +# @example +# # bad +# include_examples 'examples' +# +# # good +# it_behaves_like 'examples' +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/include_examples.rb:73 +class RuboCop::Cop::RSpec::IncludeExamples < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/include_examples.rb:80 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/include_examples.rb:76 +RuboCop::Cop::RSpec::IncludeExamples::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/include_examples.rb:78 +RuboCop::Cop::RSpec::IncludeExamples::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Do not set up test data using indexes (e.g., `item_1`, `item_2`). +# +# It makes reading the test harder because it's not clear what exactly +# is tested by this particular example. +# +# The configurable options `AllowedIdentifiers` and `AllowedPatterns` +# will also read those set in `Naming/VariableNumber`. +# +# @example `Max: 1 (default)` +# # bad +# let(:item_1) { create(:item) } +# let(:item_2) { create(:item) } +# +# let(:item1) { create(:item) } +# let(:item2) { create(:item) } +# +# # good +# +# let(:visible_item) { create(:item, visible: true) } +# let(:invisible_item) { create(:item, visible: false) } +# +# @example `Max: 2` +# # bad +# let(:item_1) { create(:item) } +# let(:item_2) { create(:item) } +# let(:item_3) { create(:item) } +# +# # good +# let(:item_1) { create(:item) } +# let(:item_2) { create(:item) } +# +# @example `AllowedIdentifiers: ['item_1', 'item_2']` +# # good +# let(:item_1) { create(:item) } +# let(:item_2) { create(:item) } +# +# @example `AllowedPatterns: ['item']` +# # good +# let(:item_1) { create(:item) } +# let(:item_2) { create(:item) } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:47 +class RuboCop::Cop::RSpec::IndexedLet < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::AllowedIdentifiers + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:55 + def let_name(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:62 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:107 + def allowed_identifiers; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:101 + def cop_config_patterns_values; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:81 + def filter_indexed_lets(candidates); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:90 + def indexed_let?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:97 + def let_name_stripped_index(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:78 +RuboCop::Cop::RSpec::IndexedLet::INDEX_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:51 +RuboCop::Cop::RSpec::IndexedLet::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/indexed_let.rb:76 +RuboCop::Cop::RSpec::IndexedLet::SUFFIX_INDEX_REGEX = T.let(T.unsafe(nil), Regexp) + +# A helper for `inflected` style +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:7 +module RuboCop::Cop::RSpec::InflectedHelper + include ::RuboCop::RSpec::Language + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:45 + def be_bool?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:50 + def be_boolthy?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:31 + def predicate_in_actual?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:54 + def boolean_matcher?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:40 + def cannot_replace_predicate?(send_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:16 + def check_inflected(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:66 + def message_inflected(predicate); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:62 + def predicate?(sym); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:89 + def remove_predicate(corrector, predicate); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:100 + def rewrite_matcher(corrector, predicate, matcher); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:72 + def to_predicate_matcher(name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:111 + def true?(to_symbol, matcher); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:11 +RuboCop::Cop::RSpec::InflectedHelper::MSG_INFLECTED = T.let(T.unsafe(nil), String) + +# Helps check if a given node is within an example block. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/inside_example.rb:7 +module RuboCop::Cop::RSpec::InsideExample + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/inside_example.rb:10 + def inside_example?(node); end +end + +# Helps you identify whether a given node +# is within an example group or not. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/inside_example_group.rb:8 +module RuboCop::Cop::RSpec::InsideExampleGroup + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/inside_example_group.rb:19 + def example_group_root?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/inside_example_group.rb:23 + def example_group_root_with_siblings?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/inside_example_group.rb:11 + def inside_example_group?(node); end +end + +# Checks for `instance_double` used with `have_received`. +# +# @example +# # bad +# it do +# foo = instance_double(Foo).as_null_object +# expect(foo).to have_received(:bar) +# end +# +# # good +# it do +# foo = instance_spy(Foo) +# expect(foo).to have_received(:bar) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_spy.rb:21 +class RuboCop::Cop::RSpec::InstanceSpy < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_spy.rb:36 + def have_received_usage(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_spy.rb:28 + def null_double(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_spy.rb:45 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_spy.rb:61 + def autocorrect(corrector, node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_spy.rb:24 +RuboCop::Cop::RSpec::InstanceSpy::MSG = T.let(T.unsafe(nil), String) + +# Checks for instance variable usage in specs. +# +# This cop can be configured with the option `AssignmentOnly` which +# will configure the cop to only register offenses on instance +# variable usage if the instance variable is also assigned within +# the spec +# +# @example +# # bad +# describe MyClass do +# before { @foo = [] } +# it { expect(@foo).to be_empty } +# end +# +# # good +# describe MyClass do +# let(:foo) { [] } +# it { expect(foo).to be_empty } +# end +# +# @example with AssignmentOnly configuration +# # rubocop.yml +# # RSpec/InstanceVariable: +# # AssignmentOnly: true +# +# # bad +# describe MyClass do +# before { @foo = [] } +# it { expect(@foo).to be_empty } +# end +# +# # allowed +# describe MyClass do +# it { expect(@foo).to be_empty } +# end +# +# # good +# describe MyClass do +# let(:foo) { [] } +# it { expect(foo).to be_empty } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:48 +class RuboCop::Cop::RSpec::InstanceVariable < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:60 + def custom_matcher?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:55 + def dynamic_class?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:71 + def ivar_assigned?(param0, param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:68 + def ivar_usage(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:73 + def on_top_level_group(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:90 + def assignment_only?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:84 + def valid_usage?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/instance_variable.rb:51 +RuboCop::Cop::RSpec::InstanceVariable::MSG = T.let(T.unsafe(nil), String) + +# Check for `specify` with `is_expected` and one-liner expectations. +# +# @example +# # bad +# specify { is_expected.to be_truthy } +# +# # good +# it { is_expected.to be_truthy } +# +# # good +# specify do +# # ... +# end +# specify { expect(sqrt(4)).to eq(2) } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/is_expected_specify.rb:21 +class RuboCop::Cop::RSpec::IsExpectedSpecify < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/is_expected_specify.rb:29 + def offense?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/is_expected_specify.rb:33 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/is_expected_specify.rb:25 +RuboCop::Cop::RSpec::IsExpectedSpecify::IS_EXPECTED_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/is_expected_specify.rb:26 +RuboCop::Cop::RSpec::IsExpectedSpecify::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/is_expected_specify.rb:24 +RuboCop::Cop::RSpec::IsExpectedSpecify::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that only one `it_behaves_like` style is used. +# +# @example `EnforcedStyle: it_behaves_like` (default) +# # bad +# it_should_behave_like 'a foo' +# +# # good +# it_behaves_like 'a foo' +# +# @example `EnforcedStyle: it_should_behave_like` +# # bad +# it_behaves_like 'a foo' +# +# # good +# it_should_behave_like 'a foo' +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/it_behaves_like.rb:22 +class RuboCop::Cop::RSpec::ItBehavesLike < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/it_behaves_like.rb:31 + def example_inclusion_offense(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/it_behaves_like.rb:33 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/it_behaves_like.rb:43 + def message(_node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/it_behaves_like.rb:26 +RuboCop::Cop::RSpec::ItBehavesLike::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/it_behaves_like.rb:28 +RuboCop::Cop::RSpec::ItBehavesLike::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check that `all` matcher is used instead of iterating over an array. +# +# @example +# # bad +# it 'validates users' do +# [user1, user2, user3].each { |user| expect(user).to be_valid } +# end +# +# # good +# it 'validates users' do +# expect([user1, user2, user3]).to all(be_valid) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:19 +class RuboCop::Cop::RSpec::IteratedExpectation < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:26 + def each?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:42 + def each_itblock?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:35 + def each_numblock?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:49 + def expectation?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:53 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:65 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:59 + def on_numblock(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:73 + def check_offense(node, argument); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:101 + def only_expectations?(body, arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:97 + def single_expectation?(body, arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:86 + def single_expectation_replacement(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:93 + def uses_argument_in_matcher?(node, argument); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/iterated_expectation.rb:22 +RuboCop::Cop::RSpec::IteratedExpectation::MSG = T.let(T.unsafe(nil), String) + +# Enforce that subject is the first definition in the test. +# +# @example +# # bad +# let(:params) { blah } +# subject { described_class.new(params) } +# +# before { do_something } +# subject { described_class.new(params) } +# +# it { expect_something } +# subject { described_class.new(params) } +# it { expect_something_else } +# +# +# # good +# subject { described_class.new(params) } +# let(:params) { blah } +# +# # good +# subject { described_class.new(params) } +# before { do_something } +# +# # good +# subject { described_class.new(params) } +# it { expect_something } +# it { expect_something_else } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:34 +class RuboCop::Cop::RSpec::LeadingSubject < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::InsideExampleGroup + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:40 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:70 + def autocorrect(corrector, node, sibling); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:49 + def check_previous_nodes(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:76 + def offending?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:58 + def offending_node(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:66 + def parent(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leading_subject.rb:38 +RuboCop::Cop::RSpec::LeadingSubject::MSG = T.let(T.unsafe(nil), String) + +# Checks that no class, module, or constant is declared. +# +# Constants, including classes and modules, when declared in a block +# scope, are defined in global namespace, and leak between examples. +# +# If several examples may define a `DummyClass`, instead of being a +# blank slate class as it will be in the first example, subsequent +# examples will be reopening it and modifying its behavior in +# unpredictable ways. +# Even worse when a class that exists in the codebase is reopened. +# +# Anonymous classes are fine, since they don't result in global +# namespace name clashes. +# +# @see https://rspec.info/features/3-12/rspec-mocks/mutating-constants +# +# @example Constants leak between examples +# # bad +# describe SomeClass do +# OtherClass = Struct.new +# CONSTANT_HERE = 'I leak into global namespace' +# end +# +# # good +# describe SomeClass do +# before do +# stub_const('OtherClass', Struct.new) +# stub_const('CONSTANT_HERE', 'I only exist during this example') +# end +# end +# +# @example +# # bad +# describe SomeClass do +# class FooClass < described_class +# def double_that +# some_base_method * 2 +# end +# end +# +# it { expect(FooClass.new.double_that).to eq(4) } +# end +# +# # good - anonymous class, no constant needs to be defined +# describe SomeClass do +# let(:foo_class) do +# Class.new(described_class) do +# def double_that +# some_base_method * 2 +# end +# end +# end +# +# it { expect(foo_class.new.double_that).to eq(4) } +# end +# +# # good - constant is stubbed +# describe SomeClass do +# before do +# foo_class = Class.new(described_class) do +# def do_something +# end +# end +# stub_const('FooClass', foo_class) +# end +# +# it { expect(FooClass.new.double_that).to eq(4) } +# end +# +# @example +# # bad +# describe SomeClass do +# module SomeModule +# class SomeClass +# def do_something +# end +# end +# end +# end +# +# # good +# describe SomeClass do +# before do +# foo_class = Class.new(described_class) do +# def do_something +# end +# end +# stub_const('SomeModule::SomeClass', foo_class) +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:96 +class RuboCop::Cop::RSpec::LeakyConstantDeclaration < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:101 + def on_casgn(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:108 + def on_class(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:115 + def on_module(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:128 + def explicit_namespace?(namespace); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:124 + def inside_describe_block?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:98 +RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_CLASS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:97 +RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_CONST = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_constant_declaration.rb:99 +RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_MODULE = T.let(T.unsafe(nil), String) + +# Checks for local variables from outer scopes used inside examples. +# +# Local variables assigned outside an example but used within it act +# as shared state, which can make tests non-deterministic. +# +# @example +# # bad - outside variable used in a hook +# user = create(:user) +# +# before { user.update(admin: true) } +# +# # good +# let(:user) { create(:user) } +# +# before { user.update(admin: true) } +# +# # bad - outside variable used in an example +# user = create(:user) +# +# it 'is persisted' do +# expect(user).to be_persisted +# end +# +# # good +# let(:user) { create(:user) } +# +# it 'is persisted' do +# expect(user).to be_persisted +# end +# +# # also good - assigning the variable within the example +# it 'is persisted' do +# user = create(:user) +# +# expect(user).to be_persisted +# end +# +# # bad - outside variable passed to included examples +# attrs = ['foo', 'bar'] +# +# it_behaves_like 'some examples', attrs +# +# # good +# it_behaves_like 'some examples' do +# let(:attrs) { ['foo', 'bar'] } +# end +# +# # good - when variable is used only as example description +# attribute = 'foo' +# +# it "#{attribute} is persisted" do +# expectations +# end +# +# # good - when variable is used only in example metadata +# skip_message = 'not yet implemented' +# +# it 'does something', skip: skip_message do +# expectations +# end +# +# # good - when variable is used only to include other examples +# examples = foo ? 'some examples' : 'other examples' +# +# it_behaves_like examples, another_argument +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:72 +class RuboCop::Cop::RSpec::LeakyLocalVariable < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:90 + def after_leaving_scope(scope, _variable_table); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:77 + def example_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:82 + def includes_method?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:132 + def allowed_includes_arguments?(node, argument); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:110 + def allowed_reference?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:96 + def check_references(variable); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:145 + def example_scope?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:123 + def in_example_arguments?(ancestor, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:150 + def inside_describe_block?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:141 + def part_of_example_scope?(node); end + + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:86 + def joining_forces; end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/leaky_local_variable.rb:73 +RuboCop::Cop::RSpec::LeakyLocalVariable::MSG = T.let(T.unsafe(nil), String) + +# Checks for `let` definitions that come after an example. +# +# @example +# # bad +# let(:foo) { bar } +# +# it 'checks what foo does' do +# expect(foo).to be +# end +# +# let(:some) { other } +# +# it 'checks what some does' do +# expect(some).to be +# end +# +# # good +# let(:foo) { bar } +# let(:some) { other } +# +# it 'checks what foo does' do +# expect(foo).to be +# end +# +# it 'checks what some does' do +# expect(some).to be +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:33 +class RuboCop::Cop::RSpec::LetBeforeExamples < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:39 + def example_or_group?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:47 + def include_examples?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:58 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:93 + def autocorrect(corrector, node, first_example); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:74 + def check_let_declarations(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:66 + def example_group_with_include_examples?(body); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:89 + def find_first_example(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:70 + def multiline_block?(block); end + + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:54 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_before_examples.rb:36 +RuboCop::Cop::RSpec::LetBeforeExamples::MSG = T.let(T.unsafe(nil), String) + +# Checks unreferenced `let!` calls being used for test setup. +# +# @example +# # bad +# let!(:my_widget) { create(:widget) } +# +# it 'counts widgets' do +# expect(Widget.count).to eq(1) +# end +# +# # good +# it 'counts widgets' do +# create(:widget) +# expect(Widget.count).to eq(1) +# end +# +# # good +# before { create(:widget) } +# +# it 'counts widgets' do +# expect(Widget.count).to eq(1) +# end +# +# # good +# describe 'a widget' do +# let!(:my_widget) { create(:widget) } +# context 'when visiting its page' do +# let!(:my_widget) { create(:widget, name: 'Special') } +# it 'counts widgets' do +# expect(Widget.count).to eq(1) +# end +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:40 +class RuboCop::Cop::RSpec::LetSetup < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:44 + def example_or_shared_group_or_including?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:52 + def let_bang(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:60 + def method_called?(param0, param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:62 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:80 + def child_let_bang(node, &block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:94 + def outer_let_bang?(ancestor_node, method_name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:86 + def overrides_outer_let_bang?(node, method_name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:72 + def unused_let_bang(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/let_setup.rb:41 +RuboCop::Cop::RSpec::LetSetup::MSG = T.let(T.unsafe(nil), String) + +# Helper methods to location. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/location_help.rb:7 +module RuboCop::Cop::RSpec::LocationHelp + private + + # @param node [RuboCop::AST::SendNode] + # @return [Parser::Source::Range] + # @example + # foo 1, 2 + # ^^^^^ + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/location_help.rb:15 + def arguments_with_whitespace(node); end + + # @param node [RuboCop::AST::SendNode] + # @return [Parser::Source::Range] + # @example + # foo { bar } + # ^^^^^^^^ + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/location_help.rb:26 + def block_with_whitespace(node); end + + class << self + # @param node [RuboCop::AST::SendNode] + # @return [Parser::Source::Range] + # @example + # foo 1, 2 + # ^^^^^ + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/location_help.rb:15 + def arguments_with_whitespace(node); end + + # @param node [RuboCop::AST::SendNode] + # @return [Parser::Source::Range] + # @example + # foo { bar } + # ^^^^^^^^ + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/location_help.rb:26 + def block_with_whitespace(node); end + end +end + +# Checks where `match_array` is used. +# +# This cop checks for the following: +# +# - Prefer `contain_exactly` when matching an array with values. +# - Prefer `eq` when using `match_array` with an empty array literal. +# +# @example +# # bad +# it { is_expected.to match_array([content1, content2]) } +# +# # good +# it { is_expected.to contain_exactly(content1, content2) } +# +# # good +# it { is_expected.to match_array([content] + array) } +# +# # good +# it { is_expected.to match_array(%w(tremble in fear foolish mortals)) } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_array.rb:26 +class RuboCop::Cop::RSpec::MatchArray < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_array.rb:33 + def match_array_with_empty_array?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_array.rb:37 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_array.rb:46 + def check_populated_array(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_array.rb:29 +RuboCop::Cop::RSpec::MatchArray::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_array.rb:30 +RuboCop::Cop::RSpec::MatchArray::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Enforces the use of `include` matcher instead of `match` when the +# matcher is a simple string literal without regex-specific features. +# +# When `match` is used with a regex that contains only literal characters +# (no anchors, character classes, quantifiers, alternations, or +# metacharacters), it's clearer to use the `include` matcher instead. +# +# @example +# # bad +# expect('foobar').to match(/foo/) +# expect(response.body).to match(/http:\/\/example\.com/) +# +# # good +# expect('foobar').to include('foo') +# expect(response.body).to include('http://example.com') +# +# # good - regex features needed +# expect('foobar').to match(/^foo/) # anchor +# expect('foobar').to match(/foo\d+/) # quantifier +# expect('foobar').to match(/foo[ob]/) # character class +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:29 +class RuboCop::Cop::RSpec::MatchWithSimpleRegex < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:37 + def match_with_regexp?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:41 + def on_send(node); end + + private + + # Reconstruct the literal string that the regex matches + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:73 + def regexp_to_string(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:64 + def simple_expression?(expr); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:56 + def simple_regexp?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:82 + def to_string_literal(string); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:32 +RuboCop::Cop::RSpec::MatchWithSimpleRegex::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/match_with_simple_regex.rb:34 +RuboCop::Cop::RSpec::MatchWithSimpleRegex::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check that chains of messages are not being stubbed. +# +# @example +# # bad +# allow(foo).to receive_message_chain(:bar, :baz).and_return(42) +# +# # good +# thing = Thing.new(baz: 42) +# allow(foo).to receive(:bar).and_return(thing) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_chain.rb:16 +class RuboCop::Cop::RSpec::MessageChain < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_chain.rb:20 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_chain.rb:17 +RuboCop::Cop::RSpec::MessageChain::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_chain.rb:18 +RuboCop::Cop::RSpec::MessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for consistent message expectation style. +# +# This cop can be configured in your configuration using the +# `EnforcedStyle` option and supports `--auto-gen-config`. +# +# @example `EnforcedStyle: allow` (default) +# +# # bad +# expect(foo).to receive(:bar) +# +# # good +# allow(foo).to receive(:bar) +# +# @example `EnforcedStyle: expect` +# +# # bad +# allow(foo).to receive(:bar) +# +# # good +# expect(foo).to receive(:bar) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:27 +class RuboCop::Cop::RSpec::MessageExpectation < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:35 + def message_expectation(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:42 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:40 + def receive_message?(param0); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:55 + def preferred_style?(expectation); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:30 +RuboCop::Cop::RSpec::MessageExpectation::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_expectation.rb:32 +RuboCop::Cop::RSpec::MessageExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that message expectations are set using spies. +# +# This cop can be configured in your configuration using the +# `EnforcedStyle` option and supports `--auto-gen-config`. +# +# @example `EnforcedStyle: have_received` (default) +# +# # bad +# expect(foo).to receive(:bar) +# do_something +# +# # good +# allow(foo).to receive(:bar) # or use instance_spy +# do_something +# expect(foo).to have_received(:bar) +# +# @example `EnforcedStyle: receive` +# +# # bad +# allow(foo).to receive(:bar) +# do_something +# expect(foo).to have_received(:bar) +# +# # good +# expect(foo).to receive(:bar) +# do_something +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:33 +class RuboCop::Cop::RSpec::MessageSpies < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:45 + def message_expectation(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:54 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:50 + def receive_message(param0); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:77 + def error_message(receiver); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:73 + def preferred_style?(expectation); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:67 + def receive_message_matcher(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:38 +RuboCop::Cop::RSpec::MessageSpies::MSG_HAVE_RECEIVED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:36 +RuboCop::Cop::RSpec::MessageSpies::MSG_RECEIVE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/message_spies.rb:42 +RuboCop::Cop::RSpec::MessageSpies::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Helper methods to find RSpec metadata. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:7 +module RuboCop::Cop::RSpec::Metadata + include ::RuboCop::RSpec::Language + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:26 + def metadata_in_block(param0, param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:30 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:42 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:44 + def on_metadata(_symbols, _hash); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:41 + def on_numblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:21 + def rspec_configure(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:13 + def rspec_metadata(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/metadata.rb:50 + def on_metadata_arguments(metadata_arguments); end +end + +# Use consistent metadata style. +# +# This cop does not support autocorrection in the case of +# `EnforcedStyle: hash` where the trailing metadata type is ambiguous. +# (e.g. `describe 'Something', :a, b`) +# +# @example EnforcedStyle: symbol (default) +# # bad +# describe 'Something', a: true +# +# # good +# describe 'Something', :a +# +# @example EnforcedStyle: hash +# # bad +# describe 'Something', :a +# +# # good +# describe 'Something', a: true +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:25 +class RuboCop::Cop::RSpec::MetadataStyle < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RSpec::Metadata + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:33 + def extract_metadata_hash(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:43 + def match_ambiguous_trailing_metadata?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:38 + def match_boolean_metadata_pair?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:47 + def on_metadata(symbols, hash); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:61 + def autocorrect_pair(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:66 + def autocorrect_symbol(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:73 + def bad_metadata_pair?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:77 + def bad_metadata_symbol?(_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:81 + def format_symbol_to_pair_source(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:85 + def insert_pair(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:96 + def insert_pair_as_last_argument(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:105 + def insert_pair_to_empty_hash_metadata(corrector, node, hash_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:112 + def insert_pair_to_non_empty_hash_metadata(corrector, node, hash_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:119 + def insert_symbol(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:126 + def message_for_style; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:133 + def on_metadata_pair(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:141 + def on_metadata_symbol(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:149 + def remove_pair(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:159 + def remove_pair_following(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:171 + def remove_pair_preceding(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/metadata_style.rb:183 + def remove_symbol(corrector, node); end +end + +# Checks that the first argument to an example group is not empty. +# +# @example +# # bad +# describe do +# end +# +# RSpec.describe do +# end +# +# # good +# describe TestedClass do +# end +# +# describe "A feature example" do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_example_group_argument.rb:23 +class RuboCop::Cop::RSpec::MissingExampleGroupArgument < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_example_group_argument.rb:26 + def on_block(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_example_group_argument.rb:24 +RuboCop::Cop::RSpec::MissingExampleGroupArgument::MSG = T.let(T.unsafe(nil), String) + +# Checks if `.to`, `not_to` or `to_not` are used. +# +# The RSpec::Expectations::ExpectationTarget must use `to`, `not_to` or +# `to_not` to run. Therefore, this cop checks if other methods are used. +# +# @example +# # bad +# expect(something).kind_of? Foo +# is_expected == 42 +# expect{something}.eq? BarError +# +# # good +# expect(something).to be_a Foo +# is_expected.to eq 42 +# expect{something}.to raise_error BarError +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:22 +class RuboCop::Cop::RSpec::MissingExpectationTargetMethod < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:27 + def expect?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:35 + def expect_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:40 + def expectation_without_runner?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:44 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:23 +RuboCop::Cop::RSpec::MissingExpectationTargetMethod::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/missing_expectation_target_method.rb:24 +RuboCop::Cop::RSpec::MissingExpectationTargetMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for multiple top-level example groups. +# +# Multiple descriptions for the same class or module should either +# be nested or separated into different test files. +# +# @example +# # bad +# describe MyClass, '.do_something' do +# end +# describe MyClass, '.do_something_else' do +# end +# +# # good +# describe MyClass do +# describe '.do_something' do +# end +# describe '.do_something_else' do +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_describes.rb:26 +class RuboCop::Cop::RSpec::MultipleDescribes < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_describes.rb:31 + def on_top_level_group(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_describes.rb:29 +RuboCop::Cop::RSpec::MultipleDescribes::MSG = T.let(T.unsafe(nil), String) + +# Checks if examples contain too many `expect` calls. +# +# @see http://betterspecs.org/#single Single expectation test +# +# This cop is configurable using the `Max` option +# and works with `--auto-gen-config`. +# +# @example +# # bad +# describe UserCreator do +# it 'builds a user' do +# expect(user.name).to eq("John") +# expect(user.age).to eq(22) +# end +# end +# +# # good +# describe UserCreator do +# it 'sets the users name' do +# expect(user.name).to eq("John") +# end +# +# it 'sets the users age' do +# expect(user.age).to eq(22) +# end +# end +# +# @example `aggregate_failures: true` (default) +# # good - the cop ignores when RSpec aggregates failures +# describe UserCreator do +# it 'builds a user', :aggregate_failures do +# expect(user.name).to eq("John") +# expect(user.age).to eq(22) +# end +# end +# +# @example `aggregate_failures: false` +# # Detected as an offense +# describe UserCreator do +# it 'builds a user', aggregate_failures: false do +# expect(user.name).to eq("John") +# expect(user.age).to eq(22) +# end +# end +# +# @example `Max: 1` (default) +# # bad +# describe UserCreator do +# it 'builds a user' do +# expect(user.name).to eq("John") +# expect(user.age).to eq(22) +# end +# end +# +# @example `Max: 2` +# # good +# describe UserCreator do +# it 'builds a user' do +# expect(user.name).to eq("John") +# expect(user.age).to eq(22) +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:69 +class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:78 + def aggregate_failures?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:89 + def aggregate_failures_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:86 + def expect?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:75 + def max=(value); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:93 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:109 + def example_with_aggregate_failures?(example_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:116 + def find_aggregate_failures(example_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:121 + def find_expectation(node, &block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:132 + def flag_example(node, expectation_count:); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:143 + def max_expectations; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:72 +RuboCop::Cop::RSpec::MultipleExpectations::ANYTHING = T.let(T.unsafe(nil), Proc) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:70 +RuboCop::Cop::RSpec::MultipleExpectations::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_expectations.rb:73 +RuboCop::Cop::RSpec::MultipleExpectations::TRUE_NODE = T.let(T.unsafe(nil), Proc) + +# Checks if example groups contain too many `let` and `subject` calls. +# +# This cop is configurable using the `Max` option and the `AllowSubject` +# which will configure the cop to only register offenses on calls to +# `let` and not calls to `subject`. +# +# @example +# # bad +# describe MyClass do +# let(:foo) { [] } +# let(:bar) { [] } +# let!(:baz) { [] } +# let(:qux) { [] } +# let(:quux) { [] } +# let(:quuz) { {} } +# end +# +# describe MyClass do +# let(:foo) { [] } +# let(:bar) { [] } +# let!(:baz) { [] } +# +# context 'when stuff' do +# let(:qux) { [] } +# let(:quux) { [] } +# let(:quuz) { {} } +# end +# end +# +# # good +# describe MyClass do +# let(:bar) { [] } +# let!(:baz) { [] } +# let(:qux) { [] } +# let(:quux) { [] } +# let(:quuz) { {} } +# end +# +# describe MyClass do +# context 'when stuff' do +# let(:foo) { [] } +# let(:bar) { [] } +# let!(:booger) { [] } +# end +# +# context 'when other stuff' do +# let(:qux) { [] } +# let(:quux) { [] } +# let(:quuz) { {} } +# end +# end +# +# @example when disabling AllowSubject configuration +# # rubocop.yml +# # RSpec/MultipleMemoizedHelpers: +# # AllowSubject: false +# +# # bad - `subject` counts towards memoized helpers +# describe MyClass do +# subject { {} } +# let(:foo) { [] } +# let(:bar) { [] } +# let!(:baz) { [] } +# let(:qux) { [] } +# let(:quux) { [] } +# end +# +# @example with Max configuration +# # rubocop.yml +# # RSpec/MultipleMemoizedHelpers: +# # Max: 1 +# +# # bad +# describe MyClass do +# let(:foo) { [] } +# let(:bar) { [] } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:84 +class RuboCop::Cop::RSpec::MultipleMemoizedHelpers < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::Variable + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:89 + def max=(value); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:91 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:102 + def on_new_investigation; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:111 + def all_helpers(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:141 + def allow_subject?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:109 + def example_group_memoized_helpers; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:116 + def helpers(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:137 + def max; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:127 + def variable_nodes(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:87 +RuboCop::Cop::RSpec::MultipleMemoizedHelpers::MSG = T.let(T.unsafe(nil), String) + +# Checks if an example group defines `subject` multiple times. +# +# @example +# # bad +# describe Foo do +# subject(:user) { User.new } +# subject(:post) { Post.new } +# end +# +# # good +# describe Foo do +# let(:user) { User.new } +# subject(:post) { Post.new } +# end +# +# # bad (does not support autocorrection) +# describe Foo do +# subject!(:user) { User.new } +# subject!(:post) { Post.new } +# end +# +# # good +# describe Foo do +# before do +# User.new +# Post.new +# end +# end +# +# This cop does not support autocorrection in some cases. +# The autocorrect behavior for this cop depends on the type of +# duplication: +# +# - If multiple named subjects are defined then this probably indicates +# that the overwritten subjects (all subjects except the last +# definition) are effectively being used to define helpers. In this +# case they are replaced with `let`. +# +# - If multiple unnamed subjects are defined though then this can *only* +# be dead code and we remove the overwritten subject definitions. +# +# - If subjects are defined with `subject!` then we don't autocorrect. +# This is enough of an edge case that people can just move this to +# a `before` hook on their own +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:51 +class RuboCop::Cop::RSpec::MultipleSubjects < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:57 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:71 + def autocorrect(corrector, subject); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:81 + def named_subject?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:89 + def remove_autocorrect(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:85 + def rename_autocorrect(corrector, node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/multiple_subjects.rb:55 +RuboCop::Cop::RSpec::MultipleSubjects::MSG = T.let(T.unsafe(nil), String) + +# Checks for explicitly referenced test subjects. +# +# RSpec lets you declare an "implicit subject" using `subject { ... }` +# which allows for tests like `it { is_expected.to be_valid }`. +# If you need to reference your test subject you should explicitly +# name it using `subject(:your_subject_name) { ... }`. Your test subjects +# should be the most important object in your tests so they deserve +# a descriptive name. +# +# This cop can be configured in your configuration using `EnforcedStyle`, +# and `IgnoreSharedExamples` which will not report offenses for implicit +# subjects in shared example groups. +# +# @example `EnforcedStyle: always` (default) +# # bad +# RSpec.describe User do +# subject { described_class.new } +# +# it 'is valid' do +# expect(subject.valid?).to be(true) +# end +# end +# +# # good +# RSpec.describe User do +# subject(:user) { described_class.new } +# +# it 'is valid' do +# expect(user.valid?).to be(true) +# end +# end +# +# # also good +# RSpec.describe User do +# subject(:user) { described_class.new } +# +# it { is_expected.to be_valid } +# end +# +# @example `EnforcedStyle: named_only` +# # bad +# RSpec.describe User do +# subject(:user) { described_class.new } +# +# it 'is valid' do +# expect(subject.valid?).to be(true) +# end +# end +# +# # good +# RSpec.describe User do +# subject(:user) { described_class.new } +# +# it 'is valid' do +# expect(user.valid?).to be(true) +# end +# end +# +# # also good +# RSpec.describe User do +# subject { described_class.new } +# +# it { is_expected.to be_valid } +# end +# +# # acceptable +# RSpec.describe User do +# subject { described_class.new } +# +# it 'is valid' do +# expect(subject.valid?).to be(true) +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:79 +class RuboCop::Cop::RSpec::NamedSubject < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:85 + def example_or_hook_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:97 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:90 + def shared_example?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:95 + def subject_usage(param0); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:123 + def allow_explicit_subject?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:127 + def always?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:117 + def check_explicit_subject(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:150 + def find_subject(block_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:109 + def ignored_shared_example?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:131 + def named_only?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:142 + def nearest_subject(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:136 + def subject_definition_is_named?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/named_subject.rb:82 +RuboCop::Cop::RSpec::NamedSubject::MSG = T.let(T.unsafe(nil), String) + +# Helps to find namespace of the node. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/namespace.rb:7 +module RuboCop::Cop::RSpec::Namespace + private + + # @param node [RuboCop::AST::Node] + # @return [Array] + # @example + # namespace(node) # => ['A', 'B', 'C'] + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/namespace.rb:14 + def namespace(node); end +end + +# Checks for nested example groups. +# +# This cop is configurable using the `Max` option +# and supports `--auto-gen-config`. +# +# @example +# # bad +# context 'when using some feature' do +# let(:some) { :various } +# let(:feature) { :setup } +# +# context 'when user is signed in' do # flagged by rubocop +# let(:user) do +# UserCreate.call(user_attributes) +# end +# +# let(:user_attributes) do +# { +# name: 'John', +# age: 22, +# role: role +# } +# end +# +# context 'when user is an admin' do # flagged by rubocop +# let(:role) { 'admin' } +# +# it 'blah blah' +# it 'yada yada' +# end +# end +# end +# +# # good +# context 'using some feature as an admin' do +# let(:some) { :various } +# let(:feature) { :setup } +# +# let(:user) do +# UserCreate.call( +# name: 'John', +# age: 22, +# role: 'admin' +# ) +# end +# +# it 'blah blah' +# it 'yada yada' +# end +# +# @example `Max: 3` (default) +# # bad +# describe Foo do +# context 'foo' do +# context 'bar' do +# context 'baz' do # flagged by rubocop +# end +# end +# end +# end +# +# @example `Max: 2` +# # bad +# describe Foo do +# context 'foo' do +# context 'bar' do # flagged by rubocop +# context 'baz' do # flagged by rubocop +# end +# end +# end +# end +# +# @example `AllowedGroups: [] (default)` +# describe Foo do # <-- nested groups 1 +# context 'foo' do # <-- nested groups 2 +# context 'bar' do # <-- nested groups 3 +# end +# end +# end +# +# @example `AllowedGroups: [path]` +# describe Foo do # <-- nested groups 1 +# path '/foo' do # <-- nested groups 1 (not counted) +# context 'bar' do # <-- nested groups 2 +# end +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:94 +class RuboCop::Cop::RSpec::NestedGroups < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:105 + def max=(value); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:107 + def on_top_level_group(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:157 + def allowed_groups; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:134 + def count_up_nesting?(node, example_group); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:119 + def find_nested_example_groups(node, nesting: T.unsafe(nil), &block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:144 + def max_nesting; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:148 + def max_nesting_config; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:140 + def message(nesting); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:99 +RuboCop::Cop::RSpec::NestedGroups::DEPRECATED_MAX_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:101 +RuboCop::Cop::RSpec::NestedGroups::DEPRECATION_WARNING = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/nested_groups.rb:97 +RuboCop::Cop::RSpec::NestedGroups::MSG = T.let(T.unsafe(nil), String) + +# Checks if an example contains any expectation. +# +# All RSpec's example and expectation methods are covered by default. +# If you are using your own custom methods, +# add the following configuration: +# +# RSpec: +# Language: +# Examples: +# Regular: +# - custom_it +# Expectations: +# - custom_expect +# +# @example +# # bad +# it do +# a? +# end +# +# # good +# it do +# expect(a?).to be(true) +# end +# +# This cop can be customized with an allowed expectation methods pattern +# with an `AllowedPatterns` option. ^expect_ and ^assert_ are allowed +# by default. +# +# @example `AllowedPatterns` configuration +# +# # .rubocop.yml +# # RSpec/NoExpectationExample: +# # AllowedPatterns: +# # - ^expect_ +# # - ^assert_ +# +# @example +# # bad +# it do +# not_expect_something +# end +# +# # good +# it do +# expect_something +# end +# +# it do +# assert_something +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:58 +class RuboCop::Cop::RSpec::NoExpectationExample < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::RSpec::SkipOrPending + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:74 + def includes_expectation?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:84 + def includes_skip_example?(param0); end + + # @param [RuboCop::AST::BlockNode] node + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:89 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:99 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:98 + def on_numblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:67 + def regular_or_focused_example?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/no_expectation_example.rb:62 +RuboCop::Cop::RSpec::NoExpectationExample::MSG = T.let(T.unsafe(nil), String) + +# Checks for consistent method usage for negating expectations. +# +# @example `EnforcedStyle: not_to` (default) +# # bad +# it '...' do +# expect(false).to_not be_true +# end +# +# # good +# it '...' do +# expect(false).not_to be_true +# end +# +# @example `EnforcedStyle: to_not` +# # bad +# it '...' do +# expect(false).not_to be_true +# end +# +# # good +# it '...' do +# expect(false).to_not be_true +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/not_to_not.rb:30 +class RuboCop::Cop::RSpec::NotToNot < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/not_to_not.rb:38 + def not_to_not_offense(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/not_to_not.rb:40 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/not_to_not.rb:50 + def message(_node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/not_to_not.rb:34 +RuboCop::Cop::RSpec::NotToNot::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/not_to_not.rb:35 +RuboCop::Cop::RSpec::NotToNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of output calls like puts and print in specs. +# +# @safety +# This autocorrection is marked as unsafe because, in rare cases, print +# statements can be used on purpose for integration testing and deleting +# them will cause tests to fail. +# +# @example +# # bad +# puts 'A debug message' +# pp 'A debug message' +# print 'A debug message' +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:19 +class RuboCop::Cop::RSpec::Output < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:50 + def io_output?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:60 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:45 + def output?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:72 + def match_gvar?(sym); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:34 +RuboCop::Cop::RSpec::Output::IO_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:24 +RuboCop::Cop::RSpec::Output::KERNEL_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:22 +RuboCop::Cop::RSpec::Output::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/output.rb:42 +RuboCop::Cop::RSpec::Output::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks if there is a let/subject that overwrites an existing one. +# +# @example +# # bad +# let(:foo) { bar } +# let(:foo) { baz } +# +# subject(:foo) { bar } +# let(:foo) { baz } +# +# let(:foo) { bar } +# let!(:foo) { baz } +# +# # good +# subject(:test) { something } +# let(:foo) { bar } +# let(:baz) { baz } +# let!(:other) { other } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:25 +class RuboCop::Cop::RSpec::OverwritingSetup < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:34 + def first_argument_name(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:36 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:29 + def setup?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:64 + def common_setup?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:49 + def find_duplicates(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/overwriting_setup.rb:26 +RuboCop::Cop::RSpec::OverwritingSetup::MSG = T.let(T.unsafe(nil), String) + +# Checks for any pending or skipped examples. +# +# @example +# # bad +# describe MyClass do +# it "should be true" +# end +# +# describe MyClass do +# it "should be true", skip: true do +# expect(1).to eq(2) +# end +# end +# +# describe MyClass do +# it "should be true" do +# pending +# end +# end +# +# describe MyClass do +# xit "should be true" do +# end +# end +# +# # good +# describe MyClass do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:35 +class RuboCop::Cop::RSpec::Pending < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::SkipOrPending + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:61 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:54 + def pending_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:41 + def skippable?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:49 + def skippable_example?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:69 + def skipped?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:74 + def skipped_regular_example_without_body?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending.rb:38 +RuboCop::Cop::RSpec::Pending::MSG = T.let(T.unsafe(nil), String) + +# Checks for pending or skipped examples without reason. +# +# @example +# # bad +# pending 'does something' do +# end +# +# # bad +# it 'does something', :pending do +# end +# +# # bad +# it 'does something' do +# pending +# end +# +# # bad +# xdescribe 'something' do +# end +# +# # bad +# skip 'does something' do +# end +# +# # bad +# it 'does something', :skip do +# end +# +# # bad +# it 'does something' do +# skip +# end +# +# # bad +# it 'does something' +# +# # good +# it 'does something' do +# pending 'reason' +# end +# +# # good +# it 'does something' do +# skip 'reason' +# end +# +# # good +# it 'does something', pending: 'reason' do +# end +# +# # good +# it 'does something', skip: 'reason' do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:59 +class RuboCop::Cop::RSpec::PendingWithoutReason < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:81 + def metadata_without_reason?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:96 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:92 + def skipped_by_example_group_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:71 + def skipped_by_example_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:76 + def skipped_by_example_method_with_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:63 + def skipped_in_example?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:117 + def block_node_example_group?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:129 + def on_pending_by_metadata(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:145 + def on_skipped_by_example_group_method(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:135 + def on_skipped_by_example_method(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:123 + def on_skipped_by_in_example_method(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:110 + def parent_node(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/pending_without_reason.rb:60 +RuboCop::Cop::RSpec::PendingWithoutReason::MSG = T.let(T.unsafe(nil), String) + +# Prefer using predicate matcher over using predicate method directly. +# +# RSpec defines magic matchers for predicate methods. +# This cop recommends to use the predicate matcher instead of using +# predicate method directly. +# +# @example Strict: true, EnforcedStyle: inflected (default) +# # bad +# expect(foo.something?).to be_truthy +# +# # good +# expect(foo).to be_something +# +# # also good - It checks "true" strictly. +# expect(foo.something?).to be(true) +# +# @example Strict: false, EnforcedStyle: inflected +# # bad +# expect(foo.something?).to be_truthy +# expect(foo.something?).to be(true) +# +# # good +# expect(foo).to be_something +# +# @example Strict: true, EnforcedStyle: explicit +# # bad +# expect(foo).to be_something +# +# # good - the above code is rewritten to it by this cop +# expect(foo.something?).to be(true) +# +# # bad - no autocorrect +# expect(foo) +# .to be_something(<<~TEXT) +# bar +# TEXT +# +# # good +# expect(foo.something?(<<~TEXT)).to be(true) +# bar +# TEXT +# +# @example Strict: false, EnforcedStyle: explicit +# # bad +# expect(foo).to be_something +# +# # good - the above code is rewritten to it by this cop +# expect(foo.something?).to be_truthy +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:322 +class RuboCop::Cop::RSpec::PredicateMatcher < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RSpec::InflectedHelper + include ::RuboCop::Cop::RSpec::ExplicitHelper + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:343 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:330 + def on_send(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/predicate_matcher.rb:328 +RuboCop::Cop::RSpec::PredicateMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check for `once` and `twice` receive counts matchers usage. +# +# @example +# # bad +# expect(foo).to receive(:bar).exactly(1).times +# expect(foo).to receive(:bar).exactly(2).times +# expect(foo).to receive(:bar).at_least(1).times +# expect(foo).to receive(:bar).at_least(2).times +# expect(foo).to receive(:bar).at_most(1).times +# expect(foo).to receive(:bar).at_most(2).times +# +# # good +# expect(foo).to receive(:bar).once +# expect(foo).to receive(:bar).twice +# expect(foo).to receive(:bar).at_least(:once) +# expect(foo).to receive(:bar).at_least(:twice) +# expect(foo).to receive(:bar).at_most(:once) +# expect(foo).to receive(:bar).at_most(:twice).times +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:25 +class RuboCop::Cop::RSpec::ReceiveCounts < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:40 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:33 + def receive_counts(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:38 + def stub?(param0); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:55 + def autocorrect(corrector, node, range); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:72 + def matcher_for(method, count); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:64 + def message_for(node, source); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:81 + def range(node, offending_node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:28 +RuboCop::Cop::RSpec::ReceiveCounts::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_counts.rb:30 +RuboCop::Cop::RSpec::ReceiveCounts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Prefer `receive_messages` over multiple `receive`s on the same object. +# +# @safety +# The autocorrection is marked as unsafe, because it may change the +# order of stubs. This in turn may cause e.g. variables to be called +# before they are defined. +# +# @example +# # bad +# before do +# allow(Service).to receive(:foo).and_return(bar) +# allow(Service).to receive(:baz).and_return(qux) +# end +# +# # good +# before do +# allow(Service).to receive_messages(foo: bar, baz: qux) +# end +# +# # good - ignore same message +# before do +# allow(Service).to receive(:foo).and_return(bar) +# allow(Service).to receive(:foo).and_return(qux) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:31 +class RuboCop::Cop::RSpec::ReceiveMessages < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:44 + def allow_argument(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:39 + def allow_receive_message?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:63 + def on_begin(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:59 + def receive_and_return_argument(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:54 + def receive_arg(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:49 + def receive_node(param0); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:83 + def add_repeated_lines_and_arguments(items); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:100 + def arguments(items); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:150 + def heredoc_or_splat?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:146 + def item_range_by_whole_lines(item); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:135 + def message(repeated_lines); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:109 + def normalize_receive_arg(receive_arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:117 + def normalize_return_arg(return_arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:125 + def register_offense(item, repeated_lines, args); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:73 + def repeated_receive_message(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:139 + def replace_to_receive_messages(corrector, item, args); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:154 + def requires_quotes?(value); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:91 + def uniq_items(items); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_messages.rb:35 +RuboCop::Cop::RSpec::ReceiveMessages::MSG = T.let(T.unsafe(nil), String) + +# Prefer `not_to receive(...)` over `receive(...).never`. +# +# This cop only flags usage with `expect`. It ignores `allow` because +# `allow(...).to receive(...).never` is a valid way to ensure a method +# is not called, while `allow(...).not_to receive(...)` would have +# different semantics. +# +# @example +# # bad +# expect(foo).to receive(:bar).never +# +# # good +# expect(foo).not_to receive(:bar) +# +# # not flagged by this cop +# allow(foo).to receive(:bar).never +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:23 +class RuboCop::Cop::RSpec::ReceiveNever < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:32 + def expect_to_receive?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:29 + def method_on_stub?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:42 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:59 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:53 + def used_with_expect?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:25 +RuboCop::Cop::RSpec::ReceiveNever::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/receive_never.rb:26 +RuboCop::Cop::RSpec::ReceiveNever::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Remove redundant `around` hook. +# +# @example +# # bad +# around do |example| +# example.run +# end +# +# # good +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:16 +class RuboCop::Cop::RSpec::RedundantAround < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:44 + def match_redundant_around_hook_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:49 + def match_redundant_around_hook_send?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:23 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:31 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:30 + def on_numblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:33 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:60 + def autocorrect(corrector, node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:19 +RuboCop::Cop::RSpec::RedundantAround::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_around.rb:21 +RuboCop::Cop::RSpec::RedundantAround::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for redundant predicate matcher. +# +# @example +# # bad +# expect(foo).to be_exist(bar) +# expect(foo).not_to be_include(bar) +# expect(foo).to be_all(bar) +# +# # good +# expect(foo).to exist(bar) +# expect(foo).not_to include(bar) +# expect(foo).to all be(bar) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:19 +class RuboCop::Cop::RSpec::RedundantPredicateMatcher < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:28 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:44 + def message(bad_method, good_method); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:48 + def replaceable_arguments?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:56 + def replaced_method_name(method_name); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:22 +RuboCop::Cop::RSpec::RedundantPredicateMatcher::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/redundant_predicate_matcher.rb:23 +RuboCop::Cop::RSpec::RedundantPredicateMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that `remove_const` is not used in specs. +# +# @example +# # bad +# it 'does something' do +# Object.send(:remove_const, :SomeConstant) +# end +# +# before do +# SomeClass.send(:remove_const, :SomeConstant) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/remove_const.rb:18 +class RuboCop::Cop::RSpec::RemoveConst < ::RuboCop::Cop::RSpec::Base + # Check for offenses + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/remove_const.rb:31 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/remove_const.rb:26 + def remove_const(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/remove_const.rb:21 +RuboCop::Cop::RSpec::RemoveConst::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/remove_const.rb:23 +RuboCop::Cop::RSpec::RemoveConst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check for repeated description strings in example groups. +# +# @example +# # bad +# RSpec.describe User do +# it 'is valid' do +# # ... +# end +# +# it 'is valid' do +# # ... +# end +# end +# +# # good +# RSpec.describe User do +# it 'is valid when first and last name are present' do +# # ... +# end +# +# it 'is valid when last name only is present' do +# # ... +# end +# end +# +# # good +# RSpec.describe User do +# it 'is valid' do +# # ... +# end +# +# it 'is valid', :flag do +# # ... +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:42 +class RuboCop::Cop::RSpec::RepeatedDescription < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:45 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:88 + def example_signature(example); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:92 + def its_signature(example); end + + # Select examples in the current scope with repeated description strings + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:60 + def repeated_descriptions(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:74 + def repeated_its(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_description.rb:43 +RuboCop::Cop::RSpec::RepeatedDescription::MSG = T.let(T.unsafe(nil), String) + +# Check for repeated examples within example groups. +# +# @example +# +# it 'is valid' do +# expect(user).to be_valid +# end +# +# it 'validates the user' do +# expect(user).to be_valid +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:18 +class RuboCop::Cop::RSpec::RepeatedExample < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::RepeatedItems + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:24 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:51 + def add_offenses_for_repeated_group(repeated_examples); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:43 + def build_example_signature(example); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:58 + def extract_other_lines(examples_group, current_example); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:34 + def find_repeated_examples(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:68 + def message(other_lines); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example.rb:21 +RuboCop::Cop::RSpec::RepeatedExample::MSG = T.let(T.unsafe(nil), String) + +# Check for repeated describe and context block body. +# +# @example +# # bad +# describe 'cool feature x' do +# it { cool_predicate } +# end +# +# describe 'cool feature y' do +# it { cool_predicate } +# end +# +# # good +# describe 'cool feature' do +# it { cool_predicate } +# end +# +# describe 'another cool feature' do +# it { another_predicate } +# end +# +# # good +# context 'when case x', :tag do +# it { cool_predicate } +# end +# +# context 'when case y' do +# it { cool_predicate } +# end +# +# # good +# context Array do +# it { is_expected.to respond_to :each } +# end +# +# context Hash do +# it { is_expected.to respond_to :each } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:45 +class RuboCop::Cop::RSpec::RepeatedExampleGroupBody < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::SkipOrPending + include ::RuboCop::Cop::RSpec::RepeatedItems + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:60 + def body(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:63 + def const_arg(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:57 + def metadata(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:65 + def on_begin(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:52 + def several_example_groups?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:90 + def message(group, repeats); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:75 + def repeated_group_bodies(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:86 + def signature_keys(group); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_body.rb:49 +RuboCop::Cop::RSpec::RepeatedExampleGroupBody::MSG = T.let(T.unsafe(nil), String) + +# Check for repeated example group descriptions. +# +# @example +# # bad +# describe 'cool feature' do +# # example group +# end +# +# describe 'cool feature' do +# # example group +# end +# +# # bad +# context 'when case x' do +# # example group +# end +# +# describe 'when case x' do +# # example group +# end +# +# # good +# describe 'cool feature' do +# # example group +# end +# +# describe 'another cool feature' do +# # example group +# end +# +# # good +# context 'when case x' do +# # example group +# end +# +# context 'when another case' do +# # example group +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:45 +class RuboCop::Cop::RSpec::RepeatedExampleGroupDescription < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::SkipOrPending + include ::RuboCop::Cop::RSpec::RepeatedItems + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:57 + def doc_string_and_metadata(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:62 + def empty_description?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:64 + def on_begin(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:52 + def several_example_groups?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:86 + def message(group, repeats); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:74 + def repeated_group_descriptions(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_example_group_description.rb:49 +RuboCop::Cop::RSpec::RepeatedExampleGroupDescription::MSG = T.let(T.unsafe(nil), String) + +# Check for repeated include of shared examples. +# +# @example +# # bad +# describe 'foo' do +# include_examples 'cool stuff' +# include_examples 'cool stuff' +# end +# +# # bad +# describe 'foo' do +# it_behaves_like 'a cool', 'thing' +# it_behaves_like 'a cool', 'thing' +# end +# +# # bad +# context 'foo' do +# it_should_behave_like 'a duck' +# it_should_behave_like 'a duck' +# end +# +# # good +# describe 'foo' do +# include_examples 'cool stuff' +# end +# +# describe 'bar' do +# include_examples 'cool stuff' +# end +# +# # good +# describe 'foo' do +# it_behaves_like 'a cool', 'thing' +# it_behaves_like 'a cool', 'person' +# end +# +# # good +# context 'foo' do +# it_should_behave_like 'a duck' +# it_should_behave_like 'a goose' +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:48 +class RuboCop::Cop::RSpec::RepeatedIncludeExample < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::RepeatedItems + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:60 + def include_examples?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:67 + def on_begin(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:55 + def several_include_examples?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:64 + def shared_examples_name(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:87 + def literal_include_examples?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:96 + def message(item, repeats); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:77 + def repeated_include_examples(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:92 + def signature_keys(item); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_include_example.rb:51 +RuboCop::Cop::RSpec::RepeatedIncludeExample::MSG = T.let(T.unsafe(nil), String) + +# Helps find repeated items in a collection +# +# Provides a generic method to find repeated items by grouping them +# by a key and returning pairs of [item, repeated_lines] for items +# that appear more than once. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/repeated_items.rb:11 +module RuboCop::Cop::RSpec::RepeatedItems + # Maps a group of items to pairs of [item, repeated_lines] + # + # @param items [Array] array of items that share the same key + # @return [Array] array of [item, repeated_lines] pairs + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/repeated_items.rb:29 + def add_repeated_lines(items); end + + # Groups items by key and returns only groups with more than one item + # + # @param items [Enumerable] the filtered collection to group + # @param key_proc [Proc] block returning the grouping key for each item + # @return [Array] array of groups containing more than one item + # that share the same key and there are multiple items in the group + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/repeated_items.rb:18 + def find_repeated_groups(items, key_proc:); end +end + +# Checks for repeated calls to subject missing that it is memoized. +# +# @example +# # bad +# it do +# subject +# expect { subject }.to not_change { A.count } +# end +# +# it do +# expect { subject }.to change { A.count } +# expect { subject }.to not_change { A.count } +# end +# +# # good +# it do +# expect { my_method }.to change { A.count } +# expect { my_method }.to not_change { A.count } +# end +# +# # also good +# it do +# expect { subject.a }.to change { A.count } +# expect { subject.b }.to not_change { A.count } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:32 +class RuboCop::Cop::RSpec::RepeatedSubjectCall < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:65 + def on_top_level_group(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:53 + def subject?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:61 + def subject_calls(param0, param1); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:73 + def detect_offense(subject_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:85 + def detect_offenses_in_block(node, subject_names = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:97 + def detect_offenses_in_example(node, subject_names); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:111 + def detect_subjects_in_scope(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:81 + def expect_block(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/repeated_subject_call.rb:35 +RuboCop::Cop::RSpec::RepeatedSubjectCall::MSG = T.let(T.unsafe(nil), String) + +# Checks for consistent style of stub's return setting. +# +# Enforces either `and_return` or block-style return in the cases +# where the returned value is constant. Ignores dynamic returned values +# are the result would be different +# +# This cop can be configured using the `EnforcedStyle` option +# +# @example `EnforcedStyle: and_return` (default) +# # bad +# allow(Foo).to receive(:bar) { "baz" } +# expect(Foo).to receive(:bar) { "baz" } +# +# # good +# allow(Foo).to receive(:bar).and_return("baz") +# expect(Foo).to receive(:bar).and_return("baz") +# # also good as the returned value is dynamic +# allow(Foo).to receive(:bar) { bar.baz } +# +# @example `EnforcedStyle: block` +# # bad +# allow(Foo).to receive(:bar).and_return("baz") +# expect(Foo).to receive(:bar).and_return("baz") +# +# # good +# allow(Foo).to receive(:bar) { "baz" } +# expect(Foo).to receive(:bar) { "baz" } +# # also good as the returned value is dynamic +# allow(Foo).to receive(:bar).and_return(bar.baz) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:36 +class RuboCop::Cop::RSpec::ReturnFromStub < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:51 + def and_return_value(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:45 + def contains_stub?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:62 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:55 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:48 + def stub_with_block?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:71 + def check_and_return_call(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:81 + def check_block_body(block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:90 + def dynamic?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:95 +class RuboCop::Cop::RSpec::ReturnFromStub::AndReturnCallCorrector + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:96 + def initialize(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:102 + def call(corrector); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:111 + def arg; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:133 + def hash_without_braces?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:113 + def heredoc?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:111 + def node; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:117 + def range; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:111 + def receiver; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:125 + def replacement; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:139 +class RuboCop::Cop::RSpec::ReturnFromStub::BlockBodyCorrector + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:140 + def initialize(block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:146 + def call(corrector); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:158 + def block; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:158 + def body; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:160 + def heredoc?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:158 + def node; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:164 +RuboCop::Cop::RSpec::ReturnFromStub::BlockBodyCorrector::NULL_BLOCK_BODY = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:40 +RuboCop::Cop::RSpec::ReturnFromStub::MSG_AND_RETURN = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:41 +RuboCop::Cop::RSpec::ReturnFromStub::MSG_BLOCK = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/return_from_stub.rb:42 +RuboCop::Cop::RSpec::ReturnFromStub::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for let scattered across the example group. +# +# Group lets together +# +# @example +# # bad +# describe Foo do +# let(:foo) { 1 } +# subject { Foo } +# let(:bar) { 2 } +# before { prepare } +# let!(:baz) { 3 } +# end +# +# # good +# describe Foo do +# let(:foo) { 1 } +# let(:bar) { 2 } +# let!(:baz) { 3 } +# subject { Foo } +# before { prepare } +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_let.rb:29 +class RuboCop::Cop::RSpec::ScatteredLet < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_let.rb:34 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_let.rb:42 + def check_let_declarations(body); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_let.rb:32 +RuboCop::Cop::RSpec::ScatteredLet::MSG = T.let(T.unsafe(nil), String) + +# Checks for setup scattered across multiple hooks in an example group. +# +# Unify `before` and `after` hooks when possible. +# However, `around` hooks are allowed to be defined multiple times, +# as unifying them would typically make the code harder to read. +# Hooks defined in class methods are also ignored. +# +# @example +# # bad +# describe Foo do +# before { setup1 } +# before { setup2 } +# end +# +# # good +# describe Foo do +# before do +# setup1 +# setup2 +# end +# end +# +# # good +# describe Foo do +# around { |example| before1; example.call; after1 } +# around { |example| before2; example.call; after2 } +# end +# +# # good +# describe Foo do +# before { setup1 } +# def self.setup +# before { setup2 } +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:42 +class RuboCop::Cop::RSpec::ScatteredSetup < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::RepeatedItems + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:51 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:92 + def autocorrect(corrector, first_occurrence, occurrence); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:77 + def lines_msg(numbers); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:85 + def message(occurrences, occurrence); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:66 + def repeated_hooks(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/scattered_setup.rb:48 +RuboCop::Cop::RSpec::ScatteredSetup::MSG = T.let(T.unsafe(nil), String) + +# Checks for proper shared_context and shared_examples usage. +# +# If there are no examples defined, use shared_context. +# If there is no setup defined, use shared_examples. +# +# With `Strict: true`, `shared_context` is flagged whenever it contains +# any examples, even if it also contains setup code. +# +# @example +# # bad +# RSpec.shared_context 'only examples here' do +# it 'does x' do +# end +# +# it 'does y' do +# end +# end +# +# # good +# RSpec.shared_examples 'only examples here' do +# it 'does x' do +# end +# +# it 'does y' do +# end +# end +# +# @example +# # bad +# RSpec.shared_examples 'only setup here' do +# subject(:foo) { :bar } +# +# let(:baz) { :bazz } +# +# before do +# something +# end +# end +# +# # good +# RSpec.shared_context 'only setup here' do +# subject(:foo) { :bar } +# +# let(:baz) { :bazz } +# +# before do +# something +# end +# end +# +# @example Strict: true +# # bad - shared_context with examples is flagged +# RSpec.shared_context 'setup and examples' do +# let(:foo) { :bar } +# +# it 'does x' do +# end +# end +# +# # good - split into separate shared_context and shared_examples +# RSpec.shared_context 'setup' do +# let(:foo) { :bar } +# end +# +# RSpec.shared_examples 'examples' do +# it 'does x' do +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:75 +class RuboCop::Cop::RSpec::SharedContext < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:88 + def context?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:83 + def examples?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:104 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:95 + def shared_context(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:100 + def shared_example(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:131 + def can_correct?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:141 + def examples_with_only_context(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:127 + def message; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:135 + def offending_node(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:123 + def strict?; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:80 +RuboCop::Cop::RSpec::SharedContext::MSG_CONTEXT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:78 +RuboCop::Cop::RSpec::SharedContext::MSG_EXAMPLES = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_context.rb:79 +RuboCop::Cop::RSpec::SharedContext::MSG_EXAMPLES_STRICT = T.let(T.unsafe(nil), String) + +# Checks for consistent style for shared example names. +# +# Enforces either `string` or `symbol` for shared example names. +# +# This cop can be configured using the `EnforcedStyle` option +# +# @example `EnforcedStyle: string` (default) +# # bad +# it_behaves_like :foo_bar_baz +# it_should_behave_like :foo_bar_baz +# shared_examples :foo_bar_baz +# shared_examples_for :foo_bar_baz +# include_examples :foo_bar_baz +# +# # good +# it_behaves_like 'foo bar baz' +# it_should_behave_like 'foo bar baz' +# shared_examples 'foo bar baz' +# shared_examples_for 'foo bar baz' +# include_examples 'foo bar baz' +# +# @example `EnforcedStyle: symbol` +# # bad +# it_behaves_like 'foo bar baz' +# it_should_behave_like 'foo bar baz' +# shared_examples 'foo bar baz' +# shared_examples_for 'foo bar baz' +# include_examples 'foo bar baz' +# +# # good +# it_behaves_like :foo_bar_baz +# it_should_behave_like :foo_bar_baz +# shared_examples :foo_bar_baz +# shared_examples_for :foo_bar_baz +# include_examples :foo_bar_baz +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:42 +class RuboCop::Cop::RSpec::SharedExamples < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:54 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:47 + def shared_examples(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:75 + def new_checker(ast_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:67 + def offense?(ast_node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:104 +class RuboCop::Cop::RSpec::SharedExamples::StringChecker + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:110 + def initialize(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:114 + def message; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:108 + def node; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:118 + def preferred_style; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:105 +RuboCop::Cop::RSpec::SharedExamples::StringChecker::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:84 +class RuboCop::Cop::RSpec::SharedExamples::SymbolChecker + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:90 + def initialize(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:94 + def message; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:88 + def node; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:98 + def preferred_style; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/shared_examples.rb:85 +RuboCop::Cop::RSpec::SharedExamples::SymbolChecker::MSG = T.let(T.unsafe(nil), String) + +# Checks that chains of messages contain more than one element. +# +# @example +# # bad +# allow(foo).to receive_message_chain(:bar).and_return(42) +# +# # good +# allow(foo).to receive(:bar).and_return(42) +# +# # also good +# allow(foo).to receive(:bar, :baz) +# allow(foo).to receive("bar.baz") +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:19 +class RuboCop::Cop::RSpec::SingleArgumentMessageChain < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:27 + def message_chain(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:34 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:32 + def single_key_hash?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:49 + def autocorrect(corrector, node, method, arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:76 + def autocorrect_array_arg(corrector, arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:69 + def autocorrect_hash_arg(corrector, arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:82 + def key_to_arg(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:86 + def replacement(method); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:65 + def single_element_array?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:55 + def valid_usage?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:22 +RuboCop::Cop::RSpec::SingleArgumentMessageChain::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/single_argument_message_chain.rb:24 +RuboCop::Cop::RSpec::SingleArgumentMessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for passing a block to `skip` within examples. +# +# @example +# # bad +# it 'does something' do +# skip 'not yet implemented' do +# do_something +# end +# end +# +# # good +# it 'does something' do +# skip 'not yet implemented' +# do_something +# end +# +# # good - when outside example +# skip 'not yet implemented' do +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/skip_block_inside_example.rb:26 +class RuboCop::Cop::RSpec::SkipBlockInsideExample < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::InsideExample + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/skip_block_inside_example.rb:31 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/skip_block_inside_example.rb:39 + def on_itblock(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/skip_block_inside_example.rb:38 + def on_numblock(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/skip_block_inside_example.rb:29 +RuboCop::Cop::RSpec::SkipBlockInsideExample::MSG = T.let(T.unsafe(nil), String) + +# Helps check offenses with variable definitions +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/skip_or_pending.rb:7 +module RuboCop::Cop::RSpec::SkipOrPending + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/skip_or_pending.rb:33 + def skip_or_pending_inside_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/skip_or_pending.rb:11 + def skipped_in_metadata?(param0 = T.unsafe(nil)); end +end + +# Sort RSpec metadata alphabetically. +# +# Only the trailing metadata is sorted. +# +# @example +# # bad +# describe 'Something', :b, :a +# context 'Something', foo: 'bar', baz: true +# it 'works', :b, :a, foo: 'bar', baz: true +# +# # good +# describe 'Something', :a, :b +# context 'Something', baz: true, foo: 'bar' +# it 'works', :a, :b, baz: true, foo: 'bar' +# +# # good, trailing metadata is sorted +# describe 'Something', 'description', :a, :b, :z +# context 'Something', :z, variable, :a, :b +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:24 +class RuboCop::Cop::RSpec::SortMetadata < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::Metadata + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:32 + def match_ambiguous_trailing_metadata?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:36 + def on_metadata(args, hash); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:58 + def crime_scene(symbols, pairs); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:54 + def last_arg_could_be_a_hash?(args); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:67 + def replacement(symbols, pairs); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:75 + def sort_pairs(pairs); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:79 + def sort_symbols(symbols); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:71 + def sorted?(symbols, pairs); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:49 + def trailing_symbols(args); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/sort_metadata.rb:29 +RuboCop::Cop::RSpec::SortMetadata::MSG = T.let(T.unsafe(nil), String) + +# Checks that spec file paths are consistent and well-formed. +# +# @example +# # bad +# whatever_spec.rb # describe MyClass +# my_class_spec.rb # describe MyClass, '#method' +# +# # good +# my_class_spec.rb # describe MyClass +# my_class_method_spec.rb # describe MyClass, '#method' +# my_class/method_spec.rb # describe MyClass, '#method' +# +# @example `CustomTransform: {RuboCop=>rubocop, RSpec=>rspec}` (default) +# # good +# rubocop_spec.rb # describe RuboCop +# rspec_spec.rb # describe RSpec +# +# @example `IgnoreMethods: false` (default) +# # bad +# my_class_spec.rb # describe MyClass, '#method' +# +# @example `IgnoreMethods: true` +# # good +# my_class_spec.rb # describe MyClass, '#method' +# +# @example `IgnoreMetadata: {type=>routing}` (default) +# # good +# whatever_spec.rb # describe MyClass, type: :routing do; end +# +# @example `EnforcedInflector: active_support` +# # Enable to use ActiveSupport's inflector for custom acronyms +# # like HTTP, etc. Set to "default" by default. +# # Configure `InflectorPath` with the path to the inflector file. +# # The default is ./config/initializers/inflections.rb. +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:41 +class RuboCop::Cop::RSpec::SpecFilePathFormat < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + include ::RuboCop::Cop::RSpec::Namespace + include ::RuboCop::Cop::RSpec::FileHelp + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:50 + def example_group_arguments(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:55 + def metadata_key_value(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:57 + def on_top_level_example_group(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:169 + def camel_to_snake_case(string); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:139 + def correct_path_pattern(class_name, arguments); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:173 + def custom_transform; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:116 + def ensure_correct_file_path(send_node, class_name, arguments); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:158 + def expected_path(constant); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:185 + def filename_ends_with?(pattern); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:181 + def ignore_metadata; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:131 + def ignore_metadata?(arguments); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:154 + def ignore_method_name?(method_name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:177 + def ignore_methods?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:102 + def inflector; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:148 + def method_name_pattern(method_name); end +end + +# Inflector module that uses ActiveSupport for advanced inflection rules +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:70 +module RuboCop::Cop::RSpec::SpecFilePathFormat::ActiveSupportInflector + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:71 + def call(string); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:75 + def prepare_availability(config); end + end +end + +# Inflector module that uses basic regex-based conversion +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:93 +module RuboCop::Cop::RSpec::SpecFilePathFormat::DefaultInflector + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:94 + def call(string); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:46 +RuboCop::Cop::RSpec::SpecFilePathFormat::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_format.rb:47 +RuboCop::Cop::RSpec::SpecFilePathFormat::PATH_NAME_BOUNDARY = T.let(T.unsafe(nil), String) + +# Checks that spec file paths suffix are consistent and well-formed. +# +# @example +# # bad +# my_class/foo_specorb.rb # describe MyClass +# spec/models/user.rb # describe User +# spec/models/user_specxrb # describe User +# +# # good +# my_class_spec.rb # describe MyClass +# +# # good - shared examples are allowed +# spec/models/user.rb # shared_examples_for 'foo' +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_suffix.rb:20 +class RuboCop::Cop::RSpec::SpecFilePathSuffix < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + include ::RuboCop::Cop::RSpec::FileHelp + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_suffix.rb:26 + def on_top_level_example_group(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_suffix.rb:34 + def correct_path?; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/spec_file_path_suffix.rb:24 +RuboCop::Cop::RSpec::SpecFilePathSuffix::MSG = T.let(T.unsafe(nil), String) + +# Checks that message expectations do not have a configured response. +# +# @example +# # bad +# expect(foo).to receive(:bar).with(42).and_return("hello world") +# +# # good (without spies) +# allow(foo).to receive(:bar).with(42).and_return("hello world") +# expect(foo).to receive(:bar).with(42) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:16 +class RuboCop::Cop::RSpec::StubbedMock < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:43 + def configured_response?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:62 + def expectation(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:130 + def matcher_with_blockpass(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:82 + def matcher_with_configured_response(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:109 + def matcher_with_hash(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:94 + def matcher_with_return_block(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:35 + def message_expectation?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:137 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:156 + def msg(method_name); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:145 + def on_expectation(expectation, method_name, matcher); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:164 + def replacement(method_name); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:17 +RuboCop::Cop::RSpec::StubbedMock::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/stubbed_mock.rb:19 +RuboCop::Cop::RSpec::StubbedMock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Ensure that subject is defined using subject helper. +# +# @example +# # bad +# let(:subject) { foo } +# let!(:subject) { foo } +# subject(:subject) { foo } +# subject!(:subject) { foo } +# +# # bad +# block = -> {} +# let(:subject, &block) +# +# # good +# subject(:test_subject) { foo } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:22 +class RuboCop::Cop::RSpec::SubjectDeclaration < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:29 + def offensive_subject_declaration?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:33 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:50 + def first_argument_range(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:46 + def message_for(offense); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:25 +RuboCop::Cop::RSpec::SubjectDeclaration::MSG_LET = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_declaration.rb:26 +RuboCop::Cop::RSpec::SubjectDeclaration::MSG_REDUNDANT = T.let(T.unsafe(nil), String) + +# Checks for stubbed test subjects. +# +# Checks nested subject stubs for innermost subject definition +# when subject is also defined in parent example groups. +# +# @see https://robots.thoughtbot.com/don-t-stub-the-system-under-test +# @see https://penelope.zone/2015/12/27/introducing-rspec-smells-and-where-to-find-them.html#smell-1-stubjec +# +# @example +# # bad +# describe Article do +# subject(:article) { Article.new } +# +# it 'indicates that the author is unknown' do +# allow(article).to receive(:author).and_return(nil) +# expect(article.description).to include('by an unknown author') +# end +# end +# +# # bad +# describe Article do +# subject(:foo) { Article.new } +# +# context 'nested subject' do +# subject(:article) { Article.new } +# +# it 'indicates that the author is unknown' do +# allow(article).to receive(:author).and_return(nil) +# expect(article.description).to include('by an unknown author') +# end +# end +# end +# +# # good +# describe Article do +# subject(:article) { Article.new(author: nil) } +# +# it 'indicates that the author is unknown' do +# expect(article.description).to include('by an unknown author') +# end +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:50 +class RuboCop::Cop::RSpec::SubjectStub < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::TopLevelGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:80 + def let?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:97 + def message_expectation?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:109 + def message_expectation_matcher?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:115 + def on_top_level_group(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:71 + def subject?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:126 + def find_all_explicit(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:140 + def find_subject_expectations(node, subject_names = T.unsafe(nil), &block); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/subject_stub.rb:53 +RuboCop::Cop::RSpec::SubjectStub::MSG = T.let(T.unsafe(nil), String) + +# Helper methods for top level example group cops +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:7 +module RuboCop::Cop::RSpec::TopLevelGroup + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:14 + def on_new_investigation; end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:23 + def top_level_groups; end + + private + + # Dummy methods to be overridden in the consumer + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:31 + def on_top_level_example_group(_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:33 + def on_top_level_group(_node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:55 + def root_node; end + + # @private + # @deprecated All callers of this method have been removed. + # + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:37 + def top_level_group?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:42 + def top_level_nodes(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/top_level_group.rb:10 +RuboCop::Cop::RSpec::TopLevelGroup::DEPRECATED_MODULE_METHOD_WARNING = T.let(T.unsafe(nil), String) + +# Description should be descriptive. +# +# If example group or example contains only `execute string`, numbers +# and regular expressions, the description is not clear. +# +# @example +# # bad +# describe `time` do +# # ... +# end +# +# # bad +# context /when foo/ do +# # ... +# end +# +# # bad +# it 10000 do +# # ... +# end +# +# # good +# describe Foo do +# # ... +# end +# +# # good +# describe '#foo' do +# # ... +# end +# +# # good +# context "when #{foo} is bar" do +# # ... +# end +# +# # good +# it 'does something' do +# # ... +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/undescriptive_literals_description.rb:47 +class RuboCop::Cop::RSpec::UndescriptiveLiteralsDescription < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/undescriptive_literals_description.rb:51 + def example_groups_or_example?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/undescriptive_literals_description.rb:55 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/undescriptive_literals_description.rb:63 + def offense?(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/undescriptive_literals_description.rb:48 +RuboCop::Cop::RSpec::UndescriptiveLiteralsDescription::MSG = T.let(T.unsafe(nil), String) + +# Checks for a specified error in checking raised errors. +# +# Enforces one of an Exception type, a string, or a regular +# expression to match against the exception message as a parameter +# to `raise_error` +# +# @example +# # bad +# expect { +# raise StandardError.new('error') +# }.to raise_error +# +# # good +# expect { +# raise StandardError.new('error') +# }.to raise_error(StandardError) +# +# expect { +# raise StandardError.new('error') +# }.to raise_error('error') +# +# expect { +# raise StandardError.new('error') +# }.to raise_error(/err/) +# +# expect { do_something }.not_to raise_error +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:33 +class RuboCop::Cop::RSpec::UnspecifiedException < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:42 + def expect_to?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:46 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:54 + def empty_exception_matcher?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:64 + def find_expect_to(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:34 +RuboCop::Cop::RSpec::UnspecifiedException::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/unspecified_exception.rb:36 +RuboCop::Cop::RSpec::UnspecifiedException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Helps check offenses with variable definitions +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/variable.rb:7 +module RuboCop::Cop::RSpec::Variable + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/variable.rb:14 + def variable_definition?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/variable.rb:11 +RuboCop::Cop::RSpec::Variable::Helpers = RuboCop::RSpec::Language::Helpers + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/mixin/variable.rb:10 +RuboCop::Cop::RSpec::Variable::Subjects = RuboCop::RSpec::Language::Subjects + +# Checks that memoized helpers names are symbols or strings. +# +# @example EnforcedStyle: symbols (default) +# # bad +# subject('user') { create_user } +# let('user_name') { 'Adam' } +# +# # good +# subject(:user) { create_user } +# let(:user_name) { 'Adam' } +# +# @example EnforcedStyle: strings +# # bad +# subject(:user) { create_user } +# let(:user_name) { 'Adam' } +# +# # good +# subject('user') { create_user } +# let('user_name') { 'Adam' } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_definition.rb:26 +class RuboCop::Cop::RSpec::VariableDefinition < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RSpec::Variable + include ::RuboCop::Cop::RSpec::InsideExampleGroup + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_definition.rb:34 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_definition.rb:51 + def correct_variable(variable); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_definition.rb:62 + def style_offense?(variable); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_definition.rb:32 +RuboCop::Cop::RSpec::VariableDefinition::MSG = T.let(T.unsafe(nil), String) + +# Checks that memoized helper names use the configured style. +# +# Variables can be excluded from checking using the `AllowedPatterns` +# option. +# +# @example EnforcedStyle: snake_case (default) +# # bad +# subject(:userName1) { 'Adam' } +# let(:userName2) { 'Adam' } +# +# # good +# subject(:user_name_1) { 'Adam' } +# let(:user_name_2) { 'Adam' } +# +# @example EnforcedStyle: camelCase +# # bad +# subject(:user_name_1) { 'Adam' } +# let(:user_name_2) { 'Adam' } +# +# # good +# subject(:userName1) { 'Adam' } +# let(:userName2) { 'Adam' } +# +# @example AllowedPatterns configuration +# # rubocop.yml +# # RSpec/VariableName: +# # EnforcedStyle: snake_case +# # AllowedPatterns: +# # - ^userFood +# +# @example +# # okay because it matches the `^userFood` regex in `AllowedPatterns` +# subject(:userFood_1) { 'spaghetti' } +# let(:userFood_2) { 'fettuccine' } +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_name.rb:41 +class RuboCop::Cop::RSpec::VariableName < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting + include ::RuboCop::Cop::ConfigurableNaming + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::RSpec::Variable + include ::RuboCop::Cop::RSpec::InsideExampleGroup + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_name.rb:49 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_name.rb:62 + def message(style); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/variable_name.rb:47 +RuboCop::Cop::RSpec::VariableName::MSG = T.let(T.unsafe(nil), String) + +# Checks for consistent verified double reference style. +# +# @see https://rspec.info/features/3-12/rspec-mocks/verifying-doubles +# +# @safety +# This cop is unsafe because the correction requires loading the class. +# Loading before stubbing causes RSpec to only allow instance methods +# to be stubbed. +# +# @example +# # bad +# let(:foo) do +# instance_double('ClassName', method_name: 'returned_value') +# end +# +# # good +# let(:foo) do +# instance_double(ClassName, method_name: 'returned_value') +# end +# +# @example Reference is any dynamic variable. No enforcement +# +# # good +# let(:foo) do +# instance_double(@klass, method_name: 'returned_value') +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_double_reference.rb:32 +class RuboCop::Cop::RSpec::VerifiedDoubleReference < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_double_reference.rb:66 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_double_reference.rb:58 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_double_reference.rb:50 + def verified_double(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_double_reference.rb:35 +RuboCop::Cop::RSpec::VerifiedDoubleReference::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_double_reference.rb:38 +RuboCop::Cop::RSpec::VerifiedDoubleReference::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Prefer using verifying doubles over normal doubles. +# +# @see https://rspec.info/features/3-12/rspec-mocks/verifying-doubles +# +# @example +# # bad +# let(:foo) do +# double("ClassName", method_name: 'returned value') +# end +# +# # bad +# let(:foo) do +# spy("ClassName", method_name: 'returned value') +# end +# +# # good +# let(:foo) do +# instance_double("ClassName", method_name: 'returned value') +# end +# +# # good +# let(:foo) do +# class_double("ClassName", method_name: 'returned value') +# end +# +# # good +# let(:foo) do +# object_double("some object", method_name: 'returned value') +# end +# +# @example `IgnoreNameless: true (default)` +# # good +# let(:foo) do +# double(method_name: 'returned value') +# end +# +# # good +# let(:foo) do +# double +# end +# +# @example `IgnoreNameless: false` +# # bad +# let(:foo) do +# double(method_name: 'returned value') +# end +# +# # bad +# let(:foo) do +# double +# end +# +# @example `IgnoreSymbolicNames: false (default)` +# # bad +# let(:foo) do +# double(:foo) +# end +# +# @example `IgnoreSymbolicNames: true` +# # good +# let(:foo) do +# double(:foo) +# end +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:70 +class RuboCop::Cop::RSpec::VerifiedDoubles < ::RuboCop::Cop::RSpec::Base + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:79 + def on_send(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:75 + def unverified_double(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:94 + def hash?(arg); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:90 + def symbol?(name); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:71 +RuboCop::Cop::RSpec::VerifiedDoubles::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/verified_doubles.rb:72 +RuboCop::Cop::RSpec::VerifiedDoubles::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks void `expect()`. +# +# @example +# # bad +# expect(something) +# +# # good +# expect(something).to be(1) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:15 +class RuboCop::Cop::RSpec::VoidExpect < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RSpec::InsideExample + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:23 + def expect?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:28 + def expect_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:39 + def on_block(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:32 + def on_send(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:48 + def check_expect(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:54 + def void?(expect); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:18 +RuboCop::Cop::RSpec::VoidExpect::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/void_expect.rb:20 +RuboCop::Cop::RSpec::VoidExpect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for calling a block within a stub. +# +# @example +# # bad +# allow(foo).to receive(:bar) { |&block| block.call(1) } +# +# # good +# expect(foo).to receive(:bar).and_yield(1) +# +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:15 +class RuboCop::Cop::RSpec::Yield < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:25 + def block_arg(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:28 + def block_call?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:22 + def method_on_stub?(param0); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:30 + def on_block(node); end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:46 + def autocorrect(corrector, node, range); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:61 + def block_range(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:53 + def calling_block?(node, block); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:73 + def convert_block_to_yield(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:65 + def generate_replacement(node); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/cop/rspec/yield.rb:19 +RuboCop::Cop::RSpec::Yield::MSG = T.let(T.unsafe(nil), String) + +# RuboCop RSpec project namespace +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec.rb:5 +module RuboCop::RSpec; end + +# Shared behavior for aligning braces for single line lets +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:6 +class RuboCop::RSpec::AlignLetBrace + include ::RuboCop::RSpec::Language + include ::RuboCop::PathUtil + include ::RuboCop::Cop::Util + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:10 + def initialize(root, token); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:21 + def indent_for(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:15 + def offending_tokens; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:43 + def adjacent_let_chunks; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:35 + def let_group_for(let); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:27 + def let_token(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:60 + def root; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:53 + def single_line_lets; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:31 + def target_column_for(let); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/align_let_brace.rb:60 + def token; end +end + +# Wrapper for RSpec DSL methods +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:6 +class RuboCop::RSpec::Concept + include ::RuboCop::RSpec::Language + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:10 + def initialize(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:18 + def ==(other); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:14 + def eql?(other); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:20 + def hash; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:24 + def to_node; end + + protected + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/concept.rb:30 + def node; end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:5 +module RuboCop::RSpec::Corrector; end + +# Helper methods to move a node +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:7 +class RuboCop::RSpec::Corrector::MoveNode + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RSpec::FinalEndLocation + include ::RuboCop::Cop::RSpec::CommentsHelp + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:14 + def initialize(node, corrector, processed_source); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:12 + def corrector; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:27 + def move_after(other); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:20 + def move_before(other); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:12 + def original; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:12 + def processed_source; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:40 + def node_range(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:44 + def node_range_with_surrounding_space(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/corrector/move_node.rb:36 + def source(node); end +end + +# Wrapper for RSpec examples +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:6 +class RuboCop::RSpec::Example < ::RuboCop::RSpec::Concept + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:28 + def definition; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:16 + def doc_string; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:8 + def extract_doc_string(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:14 + def extract_implementation(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:11 + def extract_metadata(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:24 + def implementation; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example.rb:20 + def metadata; end +end + +# Wrapper for RSpec example groups +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:6 +class RuboCop::RSpec::ExampleGroup < ::RuboCop::RSpec::Concept + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:28 + def examples; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:34 + def hooks; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:20 + def lets; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:13 + def scope_change?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:24 + def subjects; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:56 + def find_all(node, predicate); end + + # Recursively search for predicate within the current scope + # + # Searches node and halts when a scope change is detected + # + # @param node [RuboCop::AST::Node] node to recursively search + # @param predicate [Symbol] method to call with node as argument + # + # @return [Array] discovered nodes + # + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/example_group.rb:50 + def find_all_in_scope(node, predicate); end +end + +# Wrapper for RSpec hook +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:6 +class RuboCop::RSpec::Hook < ::RuboCop::RSpec::Concept + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:24 + def example?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:8 + def extract_metadata(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:28 + def inside_class_method?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:18 + def knowable_scope?; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:45 + def metadata; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:14 + def name; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:35 + def scope; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:87 + def inside_class_self?(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:83 + def scope_argument; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:79 + def scope_name; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:58 + def transform_metadata(meta); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:73 + def transform_true(node); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/hook.rb:54 + def valid_scope?(node); end +end + +# Contains node matchers for common RSpec DSL. +# +# RSpec allows for configuring aliases for commonly used DSL elements, e.g. +# example groups and hooks. It is possible to configure RuboCop RSpec to +# be able to properly detect these elements in the `RSpec/Language` section +# of the RuboCop YAML configuration file. +# +# In addition to providing useful matchers, this class is responsible for +# using the configured aliases. +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:14 +module RuboCop::RSpec::Language + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:49 + def example?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:28 + def example_group?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:44 + def example_group_with_body?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:25 + def explicit_rspec?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:52 + def hook?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:65 + def include?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:57 + def let?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:22 + def rspec?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:33 + def shared_group?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:37 + def spec_group?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:73 + def subject?(param0 = T.unsafe(nil)); end + + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:18 + def config; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:18 + def config=(_arg0); end + end +end + +# This is used in Dialect and DescribeClass cops to detect RSpec blocks. +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:207 +module RuboCop::RSpec::Language::ALL + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:208 + def all(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:75 +module RuboCop::RSpec::Language::ErrorMatchers + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:76 + def all(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:81 +module RuboCop::RSpec::Language::ExampleGroups + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:83 + def all(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:93 + def focused(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:89 + def regular(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:97 + def skipped(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:103 +module RuboCop::RSpec::Language::Examples + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:105 + def all(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:116 + def focused(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:124 + def pending(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:112 + def regular(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:120 + def skipped(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:130 +module RuboCop::RSpec::Language::Expectations + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:131 + def all(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:136 +module RuboCop::RSpec::Language::Helpers + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:137 + def all(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:148 +module RuboCop::RSpec::Language::HookScopes + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:150 + def all(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:149 +RuboCop::RSpec::Language::HookScopes::ALL = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:142 +module RuboCop::RSpec::Language::Hooks + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:143 + def all(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:155 +module RuboCop::RSpec::Language::Includes + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:157 + def all(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:166 + def context(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:162 + def examples(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:172 +module RuboCop::RSpec::Language::Runners + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:175 + def all(element = T.unsafe(nil)); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:173 +RuboCop::RSpec::Language::Runners::ALL = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:183 +module RuboCop::RSpec::Language::SharedGroups + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:185 + def all(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:194 + def context(element); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:190 + def examples(element); end + end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:200 +module RuboCop::RSpec::Language::Subjects + class << self + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/language.rb:201 + def all(element); end + end +end + +# RuboCop RSpec specific extensions of RuboCop::AST::Node +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/node.rb:6 +module RuboCop::RSpec::Node + # In various cops we want to regard const as literal although it's not + # strictly literal. + # + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/node.rb:9 + def recursive_literal_or_const?; end +end + +# A plugin that integrates RuboCop RSpec with RuboCop's plugin system. +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/plugin.rb:8 +class RuboCop::RSpec::Plugin < ::LintRoller::Plugin + # :nocov: + # + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/plugin.rb:10 + def about; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/plugin.rb:24 + def rules(_context); end + + # :nocov: + # + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/plugin.rb:20 + def supported?(context); end +end + +# Version information for the RSpec RuboCop plugin. +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/version.rb:6 +module RuboCop::RSpec::Version; end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/version.rb:7 +RuboCop::RSpec::Version::STRING = T.let(T.unsafe(nil), String) + +# RSpec example wording rewriter +# +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:6 +class RuboCop::RSpec::Wording + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:14 + def initialize(text, ignore:, replace:); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:20 + def rewrite; end + + private + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:78 + def append_suffix(word, suffix); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:63 + def ignored_word?(word); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:37 + def ignores; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:49 + def remove_should_and_pluralize; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:39 + def replace_prefix(pattern, replacement); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:37 + def replacements; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:67 + def substitute(word); end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:37 + def text; end + + # pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:45 + def uppercase?(word); end +end + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:11 +RuboCop::RSpec::Wording::ES_SUFFIX_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:12 +RuboCop::RSpec::Wording::IES_SUFFIX_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:8 +RuboCop::RSpec::Wording::SHOULDNT_BE_PREFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:7 +RuboCop::RSpec::Wording::SHOULDNT_PREFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:9 +RuboCop::RSpec::Wording::WILL_NOT_PREFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rspec#lib/rubocop/rspec/wording.rb:10 +RuboCop::RSpec::Wording::WONT_PREFIX = T.let(T.unsafe(nil), Regexp) diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.16.0.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.16.0.rbi new file mode 100644 index 0000000..9dac839 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-sorbet@0.16.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-sorbet` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-sorbet`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rubocop@1.88.2.rbi b/sorbet/rbi/gems/rubocop@1.88.2.rbi new file mode 100644 index 0000000..eba4f86 --- /dev/null +++ b/sorbet/rbi/gems/rubocop@1.88.2.rbi @@ -0,0 +1,63035 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop` gem. +# Please instead update this file by running `bin/tapioca gem rubocop`. + + +class Parser::Source::Comment + include ::RuboCop::Ext::Comment +end + +class Parser::Source::Range + include ::RuboCop::Ext::Range +end + +class Regexp::Expression::Base + include ::RuboCop::Ext::RegexpParser::Expression::Base +end + +class Regexp::Expression::CharacterSet < ::Regexp::Expression::Subexpression + include ::RuboCop::Ext::RegexpParser::Expression::CharacterSet +end + +class Regexp::Expression::Quantifier + include ::RuboCop::Ext::RegexpParser::Expression::Base +end + +# These aliases are for compatibility. +# FIXME: Moving Rails department code to RuboCop Rails will remove +# The Lint/RedundantCopDisableDirective cop needs to be disabled so as +# to be able to provide a (bad) example of a redundant disable. +# Lint/RedundantCopDisableDirective needs to be disabled so as +# +# This code is based on https://github.com/mikian/rubocop-junit-formatter. +# +# Copyright (c) 2015 Mikko Kokkonen +# +# MIT License +# +# https://github.com/mikian/rubocop-junit-formatter/blob/master/LICENSE.txt +# +# +# This code is based on https://github.com/standardrb/standard. +# +# Copyright (c) 2023 Test Double, Inc. +# +# The MIT License (MIT) +# +# https://github.com/standardrb/standard/blob/main/LICENSE.txt +# +# +# This code is based on https://github.com/fohte/rubocop-daemon. +# +# Copyright (c) 2018 Hayato Kawai +# +# The MIT License (MIT) +# +# https://github.com/fohte/rubocop-daemon/blob/master/LICENSE.txt +# +# pkg:gem/rubocop#lib/rubocop/version.rb:3 +module RuboCop; end + +# pkg:gem/rubocop#lib/rubocop/ast_aliases.rb:6 +class RuboCop::AST::ProcessedSource + include ::RuboCop::Ext::ProcessedSource +end + +class RuboCop::AST::RegexpNode < ::RuboCop::AST::Node + include ::RuboCop::Ext::RegexpNode +end + +# This is a class that reads optional command line arguments to rubocop from environment variable. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/arguments_env.rb:6 +class RuboCop::ArgumentsEnv + class << self + # pkg:gem/rubocop#lib/rubocop/arguments_env.rb:7 + def read_as_arguments; end + end +end + +# This is a class that reads optional command line arguments to rubocop from .rubocop file. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/arguments_file.rb:6 +class RuboCop::ArgumentsFile + class << self + # pkg:gem/rubocop#lib/rubocop/arguments_file.rb:7 + def read_as_arguments; end + end +end + +# The CLI is a class responsible of handling all the command line interface +# logic. +# +# pkg:gem/rubocop#lib/rubocop/cli.rb:8 +class RuboCop::CLI + # pkg:gem/rubocop#lib/rubocop/cli.rb:24 + def initialize; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:22 + def config_store; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:22 + def options; end + + # @api public + # + # Entry point for the application logic. Here we + # do the command line arguments processing and inspect + # the target files. + # + # @param args [Array] command line arguments + # @return [Integer] UNIX exit code + # + # pkg:gem/rubocop#lib/rubocop/cli.rb:39 + def run(args = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cli.rb:164 + def act_on_options; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:215 + def apply_default_formatter; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:133 + def execute_runners; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:201 + def handle_editor_mode; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:205 + def handle_exiting_options; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:152 + def parallel_by_default!; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:88 + def profile_if_needed; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:229 + def report_pending_cops; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:121 + def require_gem(name); end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:129 + def run_command(name); end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:186 + def set_options_to_config_loader; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:196 + def set_options_to_pending_cops_reporter; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:141 + def suggest_extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:145 + def validate_options_vs_config; end + + # pkg:gem/rubocop#lib/rubocop/cli.rb:233 + def warn_if_cache_root_changed(early, desired); end +end + +# Home of subcommands in the CLI. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command.rb:7 +module RuboCop::CLI::Command + class << self + # Find the command with a given name and run it in an environment. + # + # pkg:gem/rubocop#lib/rubocop/cli/command.rb:10 + def run(env, name); end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command.rb:16 + def class_for(name); end + end +end + +# Generate a configuration file acting as a TODO list. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:8 +class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:25 + def run; end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:139 + def add_formatter; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:147 + def add_inheritance_from_auto_generated_file(config_file); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:56 + def auto_gen_tmp_dir; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:143 + def execute_runner; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:168 + def existing_configuration(config_file); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:97 + def line_length_cop(config); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:85 + def line_length_enabled?(config); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:93 + def max_line_length(config); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:66 + def maybe_run_line_length_cop; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:105 + def only_exclude?; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:101 + def options_has_only_flag?; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:185 + def relative_path_to_todo_from_options_config; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:51 + def reset_auto_gen_tmp_dir; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:132 + def reset_config_and_auto_gen_file; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:123 + def run_all_cops(line_length_contents); end + + # Do an initial run with only Layout/LineLength so that cops that + # depend on Layout/LineLength:Max get the correct value for that + # parameter. + # + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:112 + def run_line_length_cop; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:89 + def same_max_line_length?(config1, config2); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:80 + def skip_line_length_cop(reason); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:44 + def use_temporary_cache; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:174 + def write_config_file(file_name, file_string, rubocop_yml_contents); end +end + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:11 +RuboCop::CLI::Command::AutoGenerateConfig::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:15 +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1 = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:19 +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_DISABLED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:18 +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_OVERRIDDEN = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:20 +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_SKIPPED_ONLY_COPS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:22 +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_SKIPPED_ONLY_EXCLUDE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:16 +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_2 = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:13 +RuboCop::CLI::Command::AutoGenerateConfig::PLACEHOLDER = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cli/command/auto_generate_config.rb:12 +RuboCop::CLI::Command::AutoGenerateConfig::YAML_OPTIONAL_DOC_START = T.let(T.unsafe(nil), Regexp) + +# A subcommand in the CLI. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:8 +class RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:26 + def initialize(env); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:9 + def env; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:21 + def by_command_name(name); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:14 + def command_name; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:14 + def command_name=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/base.rb:16 + def inherited(subclass); end + end +end + +# Run all the selected cops and report the result. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:8 +class RuboCop::CLI::Command::ExecuteRunner < ::RuboCop::CLI::Command::Base + include ::RuboCop::Formatter::TextUtil + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:16 + def run; end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:85 + def bug_tracker_uri; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:69 + def display_error_summary(errors); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:56 + def display_summary(runner); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:61 + def display_warning_summary(warnings); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:22 + def execute_runner(paths); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:91 + def maybe_print_corrected_source; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:42 + def with_redirect; end +end + +# Combination of short and long formatter names. +# +# pkg:gem/rubocop#lib/rubocop/cli/command/execute_runner.rb:12 +RuboCop::CLI::Command::ExecuteRunner::INTEGRATION_FORMATTERS = T.let(T.unsafe(nil), Array) + +# Generate a .rubocop.yml file in the current directory. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/init_dotfile.rb:8 +class RuboCop::CLI::Command::InitDotfile < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/init_dotfile.rb:13 + def run; end +end + +# pkg:gem/rubocop#lib/rubocop/cli/command/init_dotfile.rb:9 +RuboCop::CLI::Command::InitDotfile::DOTFILE = T.let(T.unsafe(nil), String) + +# Start Language Server Protocol of RuboCop. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/lsp.rb:8 +class RuboCop::CLI::Command::LSP < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/lsp.rb:11 + def run; end +end + +# Lists the cops that will inspect the given file or directory. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/list_enabled_cops_for.rb:8 +class RuboCop::CLI::Command::ListEnabledCopsFor < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/list_enabled_cops_for.rb:11 + def initialize(env); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/list_enabled_cops_for.rb:18 + def run; end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command/list_enabled_cops_for.rb:32 + def cops_of_department(registry, department); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/list_enabled_cops_for.rb:24 + def print_available_cops; end +end + +# Start Model Context Protocol of RuboCop. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/mcp.rb:8 +class RuboCop::CLI::Command::MCP < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/mcp.rb:11 + def run; end +end + +# Shows the given cops, or all cops by default, and their configurations +# for the current directory. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:9 +class RuboCop::CLI::Command::ShowCops < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:24 + def initialize(env); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:39 + def run; end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:89 + def config_lines(cop); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:85 + def cops_of_department(cops, department); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:45 + def print_available_cops; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:68 + def print_cop_details(cops); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:56 + def print_cops_of_department(registry, department, show_all); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:77 + def selected_cops_of_department(cops, department); end +end + +# pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 +class RuboCop::CLI::Command::ShowCops::ExactMatcher < ::Struct + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:13 + def match?(name); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def pattern; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def pattern=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:12 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 +class RuboCop::CLI::Command::ShowCops::WildcardMatcher < ::Struct + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:19 + def match?(name); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def pattern; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def pattern=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_cops.rb:18 + def new(*_arg0); end + end +end + +# Prints out url to documentation of provided cops +# or documentation base url by default. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/show_docs_url.rb:9 +class RuboCop::CLI::Command::ShowDocsUrl < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/show_docs_url.rb:12 + def initialize(env); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_docs_url.rb:18 + def run; end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_docs_url.rb:38 + def cops_array; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/show_docs_url.rb:24 + def print_documentation_url; end +end + +# Suggest RuboCop extensions to install based on Gemfile dependencies. +# Only primary dependencies are evaluated, so if a dependency depends on a +# gem with an extension, it is not suggested. However, if an extension is +# a transitive dependency, it will not be suggested. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:11 +class RuboCop::CLI::Command::SuggestExtensions < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:17 + def run; end + + private + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:73 + def all_extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:69 + def current_formatter; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:117 + def dependent_gems; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:87 + def extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:109 + def installed_and_not_loaded_extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:91 + def installed_extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:121 + def installed_gems; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:99 + def loaded_extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:113 + def lockfile; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:95 + def not_installed_extensions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:41 + def print_install_suggestions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:51 + def print_load_suggestions; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:60 + def print_opt_out_instruction; end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:125 + def puts(*args); end + + # pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:30 + def skip?; end +end + +# Combination of short and long formatter names. +# +# pkg:gem/rubocop#lib/rubocop/cli/command/suggest_extensions.rb:13 +RuboCop::CLI::Command::SuggestExtensions::INCLUDED_FORMATTERS = T.let(T.unsafe(nil), Array) + +# Display version. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/command/version.rb:8 +class RuboCop::CLI::Command::Version < ::RuboCop::CLI::Command::Base + # pkg:gem/rubocop#lib/rubocop/cli/command/version.rb:11 + def run; end +end + +# pkg:gem/rubocop#lib/rubocop/cli.rb:13 +RuboCop::CLI::DEFAULT_PARALLEL_OPTIONS = T.let(T.unsafe(nil), Array) + +# Execution environment for a CLI command. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cli/environment.rb:7 +class RuboCop::CLI::Environment + # pkg:gem/rubocop#lib/rubocop/cli/environment.rb:10 + def initialize(options, config_store, paths); end + + # pkg:gem/rubocop#lib/rubocop/cli/environment.rb:8 + def config_store; end + + # pkg:gem/rubocop#lib/rubocop/cli/environment.rb:8 + def options; end + + # pkg:gem/rubocop#lib/rubocop/cli/environment.rb:8 + def paths; end + + # Run a command in this environment. + # + # pkg:gem/rubocop#lib/rubocop/cli/environment.rb:17 + def run(name); end +end + +# pkg:gem/rubocop#lib/rubocop/cli.rb:20 +class RuboCop::CLI::Finished < ::StandardError; end + +# pkg:gem/rubocop#lib/rubocop/cli.rb:11 +RuboCop::CLI::STATUS_ERROR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop#lib/rubocop/cli.rb:12 +RuboCop::CLI::STATUS_INTERRUPTED = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop#lib/rubocop/cli.rb:10 +RuboCop::CLI::STATUS_OFFENSES = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop#lib/rubocop/cli.rb:9 +RuboCop::CLI::STATUS_SUCCESS = T.let(T.unsafe(nil), Integer) + +# This class represents the cache config of the caching RuboCop runs. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cache_config.rb:6 +class RuboCop::CacheConfig + class << self + # pkg:gem/rubocop#lib/rubocop/cache_config.rb:7 + def root_dir; end + + # Lightweight cache root computation that reads CacheRootDirectory from + # the toplevel config file and environment variables without going through + # the full ConfigStore/ConfigLoader. This method can be used, for example, + # before loading configuration files. Please note that this method doesn't + # take into account any `inherit_from` dependencies. + # + # pkg:gem/rubocop#lib/rubocop/cache_config.rb:34 + def root_dir_from_toplevel_config(cache_root_override = T.unsafe(nil)); end + end +end + +# Converts RuboCop objects to and from the serialization format JSON. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cached_data.rb:8 +class RuboCop::CachedData + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:9 + def initialize(filename); end + + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:13 + def from_json(text); end + + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:17 + def to_json(offenses); end + + private + + # Restore an offense object loaded from a JSON file. + # + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:47 + def deserialize_offenses(offenses); end + + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:54 + def location_from_source_buffer(offense); end + + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:40 + def message(offense); end + + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:23 + def serialize_offense(offense); end + + # Delay creation until needed. Some type of offenses will have no buffer associated with them + # and be global only. For these, trying to create the buffer will likely fail, for example + # because of unknown encoding comments. + # + # pkg:gem/rubocop#lib/rubocop/cached_data.rb:67 + def source_buffer; end +end + +# and provides a way to check if each cop is enabled at arbitrary line. +# +# pkg:gem/rubocop#lib/rubocop/comment_config.rb:6 +class RuboCop::CommentConfig + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:34 + def initialize(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:64 + def comment_only_line?(line_number); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:32 + def config(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:52 + def cop_disabled_line_ranges; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:40 + def cop_enabled_at_line?(cop, line_number); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:48 + def cop_opted_in?(cop); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:56 + def extra_enabled_comments; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:30 + def processed_source; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:32 + def registry(*, **, &); end + + private + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:99 + def analyze; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:174 + def analyze_cop(analysis, directive); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:192 + def analyze_disabled(analysis, directive); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:199 + def analyze_rest(analysis, directive); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:185 + def analyze_single_line(analysis, directive); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:145 + def apply_cop_op(analyses, operation, cop, line); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:139 + def apply_push(analyses, resolved_cops, line); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:206 + def cop_line_ranges(analysis); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:212 + def each_directive; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:133 + def expand_cop_name(name); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:70 + def extra_enabled_comments_with_names(extras:, names:); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:232 + def handle_enable_all(directive, names, extras); end + + # Collect cops that have been disabled or enabled by name in a directive comment + # so that `Lint/RedundantCopEnableDirective` can register offenses correctly. + # + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:246 + def handle_switch(directive, names, extras); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:165 + def inject_disabled_cops_directives(analyses); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:225 + def non_comment_token_line_numbers; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:85 + def opt_in_cops; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:155 + def pop_state(analyses, line); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:221 + def qualified_cop_name(cop_name); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:127 + def resolve_push_cops(directive); end +end + +# pkg:gem/rubocop#lib/rubocop/comment_config.rb:9 +RuboCop::CommentConfig::CONFIG_DISABLED_LINE_RANGE_MIN = T.let(T.unsafe(nil), Float) + +# This class provides an API compatible with RuboCop::DirectiveComment +# to be used for cops that are disabled in the config file +# +# pkg:gem/rubocop#lib/rubocop/comment_config.rb:13 +class RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment + include ::RuboCop::Ext::Comment + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:21 + def initialize(cop_name); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:16 + def line_number; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:16 + def loc; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:16 + def text; end +end + +# pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 +class RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment::Expression < ::Struct + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def line; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def line=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def members; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:19 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 +class RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment::Loc < ::Struct + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def expression; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def expression=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def members; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:18 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 +class RuboCop::CommentConfig::CopAnalysis < ::Struct + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def line_ranges; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def line_ranges=(_); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def start_line_number; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def start_line_number=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def members; end + + # pkg:gem/rubocop#lib/rubocop/comment_config.rb:28 + def new(*_arg0); end + end +end + +# This class represents the configuration of the RuboCop application +# and all its cops. A Config is associated with a YAML configuration +# file from which it was read. Several different Configs can be used +# during a run of the rubocop program, if files in several +# directories are inspected. +# +# pkg:gem/rubocop#lib/rubocop/config.rb:12 +class RuboCop::Config + include ::RuboCop::PathUtil + include ::RuboCop::FileFinder + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop#lib/rubocop/config.rb:31 + def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def [](*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def []=(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:212 + def active_support_extensions_enabled?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:127 + def add_excludes_from_higher_level(highest_config); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:240 + def allowed_camel_case_file?(file); end + + # Paths specified in configuration files starting with .rubocop are + # relative to the directory where that file is. Paths in other config files + # are relative to the current directory. This is so that paths in + # config/default.yml, for example, are not relative to RuboCop's config + # directory since that wouldn't work. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:281 + def base_dir_for_path_parameters; end + + # @return [String, nil] + # + # pkg:gem/rubocop#lib/rubocop/config.rb:311 + def bundler_lock_file_path; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:85 + def check; end + + # @return [Boolean] whether config for this badge has 'Include' or 'Exclude' keys + # @api private + # + # pkg:gem/rubocop#lib/rubocop/config.rb:180 + def clusivity_config_for_badge?(badge); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:200 + def cop_enabled?(name); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def delete(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:139 + def deprecation_check; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def dig(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:204 + def disabled_new_cops?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def each(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def each_key(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:208 + def enabled_new_cops?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def fetch(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:259 + def file_to_exclude?(file); end + + # Returns true if the file matches any include pattern. If a block is given, the block is called + # to determine if the pattern is relevant (true returned by the block) or should be skipped + # (false returned). + # + # pkg:gem/rubocop#lib/rubocop/config.rb:223 + def file_to_include?(file); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:196 + def for_all_cops; end + + # @return [Config] for the given cop merged with that of its department (if any) + # Note: the 'Enabled' attribute is same as that returned by `for_cop` + # + # pkg:gem/rubocop#lib/rubocop/config.rb:166 + def for_badge(badge); end + + # @return [Config] for the given cop / cop name. + # Note: the 'Enabled' attribute is calculated according to the department's + # and 'AllCops' configuration; other attributes are not inherited. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:153 + def for_cop(cop); end + + # @return [Config] for the given department name. + # Note: the 'Enabled' attribute will be present only if specified + # at the department's level + # + # pkg:gem/rubocop#lib/rubocop/config.rb:191 + def for_department(department_name); end + + # @return [Config, Hash] for the given cop / cop name. + # If the given cop is enabled, returns its configuration hash. + # Otherwise, returns an empty hash. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:160 + def for_enabled_cop(cop); end + + # Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked) + # @returns [Hash{String => Gem::Version}] The locked gem versions, keyed by the gems' names. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:336 + def gem_versions_in_target; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:340 + def inspect; end + + # True if this is a config file that is shipped with RuboCop + # + # pkg:gem/rubocop#lib/rubocop/config.rb:110 + def internal?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def key?(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def keys(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:81 + def loaded_features; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:21 + def loaded_path; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:77 + def loaded_plugins; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:115 + def make_excludes_absolute; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def map(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def merge(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:291 + def parser_engine; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:272 + def path_relative_to_config(path); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:268 + def patterns_to_exclude; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:264 + def patterns_to_include; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:322 + def pending_cops; end + + # Returns true if there's a chance that an Include pattern matches hidden + # files, false if that's definitely not possible. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:251 + def possibly_include_hidden?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def replace(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:105 + def signature; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:306 + def smart_loaded_path; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:216 + def string_literals_frozen_by_default?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:295 + def target_rails_version; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:99 + def target_ruby_version(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def to_h(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def to_hash(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:101 + def to_s; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def transform_values(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:99 + def validate(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:92 + def validate_after_resolution; end + + private + + # pkg:gem/rubocop#lib/rubocop/config.rb:396 + def department_of(qualified_cop_name); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:384 + def enable_cop?(qualified_cop_name, cop_options); end + + # @param [Gem::Version] gem_version an object like `Gem::Version.new("7.1.2.3")` + # @return [Float] The major and minor version, like `7.1` + # + # pkg:gem/rubocop#lib/rubocop/config.rb:371 + def gem_version_to_major_minor_float(gem_version); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:346 + def match_relative_or_absolute_path?(pattern, relative_file_path, absolute_file_path); end + + # @returns [Hash{String => Gem::Version}] The locked gem versions, keyed by the gems' names. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:377 + def read_gem_versions_from_target_lockfile; end + + # @return [Float, nil] The Rails version as a `major.minor` Float. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:358 + def read_rails_version_from_bundler_lock_file; end + + # @return [Float, nil] The Rails version as a `major.minor` Float. + # + # pkg:gem/rubocop#lib/rubocop/config.rb:353 + def target_rails_version_from_bundler_lock_file; end + + class << self + # pkg:gem/rubocop#lib/rubocop/config.rb:23 + def create(hash, path, check: T.unsafe(nil)); end + end +end + +# pkg:gem/rubocop#lib/rubocop/config.rb:17 +class RuboCop::Config::CopConfig < ::Struct + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def metadata; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def metadata=(_); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def name; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def name=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def members; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:17 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/config.rb:20 +RuboCop::Config::DEFAULT_RAILS_VERSION = T.let(T.unsafe(nil), Float) + +# pkg:gem/rubocop#lib/rubocop/config.rb:19 +RuboCop::Config::EMPTY_CONFIG = T.let(T.unsafe(nil), Hash) + +# This class has methods related to finding configuration path. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_finder.rb:8 +class RuboCop::ConfigFinder + extend ::RuboCop::FileFinder + + class << self + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:19 + def find_config_path(target_dir); end + + # Returns the path RuboCop inferred as the root of the project. No file + # searches will go past this directory. + # + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:26 + def project_root; end + + # Returns the path RuboCop inferred as the root of the project. No file + # searches will go past this directory. + # + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:17 + def project_root=(_arg0); end + + private + + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:69 + def expand_path(path); end + + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:40 + def find_project_dotfile(target_dir); end + + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:32 + def find_project_root; end + + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:44 + def find_project_root_dot_config; end + + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:54 + def find_user_dotfile; end + + # pkg:gem/rubocop#lib/rubocop/config_finder.rb:62 + def find_user_xdg_config; end + end +end + +# pkg:gem/rubocop#lib/rubocop/config_finder.rb:12 +RuboCop::ConfigFinder::DEFAULT_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/config_finder.rb:9 +RuboCop::ConfigFinder::DOTFILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/config_finder.rb:11 +RuboCop::ConfigFinder::RUBOCOP_HOME = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/config_finder.rb:10 +RuboCop::ConfigFinder::XDG_CONFIG = T.let(T.unsafe(nil), String) + +# This class represents the configuration of the RuboCop application +# and all its cops. A Config is associated with a YAML configuration +# file from which it was read. Several different Configs can be used +# during a run of the rubocop program, if files in several +# directories are inspected. +# +# pkg:gem/rubocop#lib/rubocop/config_loader.rb:18 +class RuboCop::ConfigLoader + extend ::RuboCop::FileFinder + + class << self + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:140 + def add_excludes_from_files(config, config_file); end + + # @api private + # Used to add features that were required inside a config or from + # the CLI using `--require`. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:218 + def add_loaded_features(loaded_features); end + + # @api private + # Used to add plugins that were required inside a config or from + # the CLI using `--plugin`. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:211 + def add_loaded_plugins(loaded_plugins); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:93 + def add_missing_namespaces(path, hash); end + + # Applies CLI overrides for `AllCops/EnabledByDefault` and + # `AllCops/DisabledByDefault` to the given configuration. Used when the + # configuration would otherwise be returned without going through + # `merge_with_default` (e.g. there is no user-supplied `.rubocop.yml`). + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:199 + def apply_default_overrides(config); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:34 + def cache_root(cache_root_override = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:28 + def cache_root=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:38 + def clear_options; end + + # Returns the path of .rubocop.yml searching upwards in the + # directory structure starting at the given directory where the + # inspected file is. If no .rubocop.yml is found there, the + # user's home directory is checked. If there's no .rubocop.yml + # there either, the path to the default file is returned. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:121 + def configuration_file_for(target_dir); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:125 + def configuration_from_file(config_file, check: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def debug; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def debug=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:31 + def debug?; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:150 + def default_configuration; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:28 + def default_configuration=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def disable_pending_cops; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def disable_pending_cops=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def disabled_by_default; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def disabled_by_default=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def enable_pending_cops; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def enable_pending_cops=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def enabled_by_default; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def enabled_by_default=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def ignore_parent_exclusion; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def ignore_parent_exclusion=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:32 + def ignore_parent_exclusion?; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def ignore_unrecognized_cops; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:26 + def ignore_unrecognized_cops=(_arg0); end + + # This API is primarily intended for testing and documenting plugins. + # When testing a plugin using `rubocop/rspec/support`, the plugin is loaded automatically, + # so this API is usually not needed. It is intended to be used only when implementing tests + # that do not use `rubocop/rspec/support`. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:161 + def inject_defaults!(config_yml_path); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:53 + def load_file(file, check: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:78 + def load_yaml_configuration(absolute_path); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:29 + def loaded_features; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:29 + def loaded_plugins; end + + # Return a recursive merge of two hashes. That is, a normal hash merge, + # with the addition that any value that is a hash, and occurs in both + # arguments, will also be merged. And so on. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:112 + def merge(base_hash, derived_hash); end + + # Merges the given configuration with the default one. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:191 + def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end + + # Returns the path RuboCop inferred as the root of the project. No file + # searches will go past this directory. + # @deprecated Use `RuboCop::ConfigFinder.project_root` instead. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:181 + def project_root; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:232 + def check_duplication(yaml_code, absolute_path); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:224 + def file_path(file); end + + # Read the specified file, or exit with a friendly, concise message on + # stderr. Care is taken to use the standard OS exit code for a "file not + # found" error. + # + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:252 + def read_file(absolute_path); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:228 + def resolver; end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:258 + def yaml_tree_to_hash(yaml_tree); end + + # pkg:gem/rubocop#lib/rubocop/config_loader.rb:268 + def yaml_tree_to_hash!(yaml_tree); end + end +end + +# pkg:gem/rubocop#lib/rubocop/config_loader.rb:21 +RuboCop::ConfigLoader::DEFAULT_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/config_loader.rb:19 +RuboCop::ConfigLoader::DOTFILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/config_loader.rb:20 +RuboCop::ConfigLoader::RUBOCOP_HOME = T.let(T.unsafe(nil), String) + +# A help class for ConfigLoader that handles configuration resolution. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:10 +class RuboCop::ConfigLoaderResolver + # When one .rubocop.yml file inherits from another .rubocop.yml file, the Include paths in the + # base configuration are relative to the directory where the base configuration file is. For the + # derived configuration, we need to make those paths relative to where the derived configuration + # file is. + # + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:65 + def fix_include_paths(base_config_path, hash, path, key, value); end + + # Return a recursive merge of two hashes. That is, a normal hash merge, + # with the addition that any value that is a hash, and occurs in both + # arguments, will also be merged. And so on. + # + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:119 + def merge(base_hash, derived_hash, **opts); end + + # Merges the given configuration with the default one. If + # AllCops:DisabledByDefault is true, it changes the Enabled params so that + # only cops from user configuration are enabled. If + # AllCops:EnabledByDefault is true, it changes the Enabled params so that + # only cops explicitly disabled in user configuration are disabled. + # When the `--disable-all-cops` or `--enable-all-cops` CLI option is given, + # it takes precedence over the configuration values. + # + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:97 + def merge_with_default(config, config_file, unset_nil:); end + + # An `Enabled: true` setting in user configuration for a cop overrides an + # `Enabled: false` setting for its department. + # + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:139 + def override_department_setting_for_cops(base_hash, derived_hash); end + + # If a cop was previously explicitly enabled, but then superseded by the + # department being disabled, disable it. + # + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:156 + def override_enabled_for_disabled_departments(base_hash, derived_hash); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:38 + def resolve_inheritance(path, hash, file, debug); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:75 + def resolve_inheritance_from_gems(hash); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:11 + def resolve_plugins(rubocop_config, plugins); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:18 + def resolve_requires(path, hash); end + + private + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:243 + def base_configs(path, inherit_from, file); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:211 + def determine_inherit_mode(hash, key); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:180 + def disabled?(hash, department); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:184 + def duplicate_setting?(base_hash, derived_hash, key, inherited_file); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:205 + def duplicate_setting_warning(opts, key); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:302 + def gem_config_path(gem_name, relative_config_path); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:280 + def handle_disabled_by_default(config, new_default_configuration); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:255 + def inherited_file(path, inherit_from, file); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:239 + def merge_hashes?(base_hash, derived_hash, key); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:276 + def remote_config?(file); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:172 + def resolve_default_overrides(config); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:231 + def should_merge?(mode, key); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:235 + def should_override?(mode, key); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:217 + def should_union?(derived_hash, base_hash, root_mode, key); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:298 + def transform(config, &block); end + + # pkg:gem/rubocop#lib/rubocop/config_loader_resolver.rb:193 + def warn_on_duplicate_setting(base_hash, derived_hash, key, **opts); end +end + +# Raised when a RuboCop configuration file is not found. +# +# pkg:gem/rubocop#lib/rubocop/config_loader.rb:10 +class RuboCop::ConfigNotFoundError < ::RuboCop::Error; end + +# This class handles obsolete configuration. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:4 +class RuboCop::ConfigObsoletion + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:66 + def initialize(config); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:84 + def deprecated_cop_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:79 + def legacy_cop_names; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:72 + def reject_obsolete!; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:21 + def rules; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:21 + def warnings; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:151 + def cop_rules; end + + # Cop rules are keyed by the name of the original cop + # + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:112 + def load_cop_rules(rules); end + + # Parameter rules may apply to multiple cops and multiple parameters + # and are given as an array. Each combination is turned into a separate + # rule object. + # + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:125 + def load_parameter_rules(rules); end + + # Default rules for obsoletions are in config/obsoletion.yml + # Additional rules files can be added with `RuboCop::ConfigObsoletion.files << filename` + # + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:92 + def load_rules; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:138 + def obsoletions; end + + class << self + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:45 + def deprecated_cop_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:49 + def deprecated_names_for(cop); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:24 + def files; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:24 + def files=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:26 + def global; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:40 + def legacy_cop_names; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:30 + def reset!; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:36 + def rules_cache_key; end + end +end + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:8 +RuboCop::ConfigObsoletion::COP_RULE_CLASSES = T.let(T.unsafe(nil), Hash) + +# Encapsulation of a ConfigObsoletion rule for changing a parameter +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_enforced_styles.rb:7 +class RuboCop::ConfigObsoletion::ChangedEnforcedStyles < ::RuboCop::ConfigObsoletion::ParameterRule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_enforced_styles.rb:14 + def message; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_enforced_styles.rb:10 + def violated?; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_enforced_styles.rb:28 + def value; end +end + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_enforced_styles.rb:8 +RuboCop::ConfigObsoletion::ChangedEnforcedStyles::BASE_MESSAGE = T.let(T.unsafe(nil), String) + +# Encapsulation of a ConfigObsoletion rule for changing a parameter +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_parameter.rb:7 +class RuboCop::ConfigObsoletion::ChangedParameter < ::RuboCop::ConfigObsoletion::ParameterRule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_parameter.rb:10 + def message; end +end + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/changed_parameter.rb:8 +RuboCop::ConfigObsoletion::ChangedParameter::BASE_MESSAGE = T.let(T.unsafe(nil), String) + +# Base class for ConfigObsoletion rules relating to cops +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:7 +class RuboCop::ConfigObsoletion::CopRule < ::RuboCop::ConfigObsoletion::Rule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:10 + def initialize(config, old_name); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:15 + def cop_rule?; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:19 + def message; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:8 + def old_name; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:28 + def violated?; end + + # Cop rules currently can only be failures, not warnings + # + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/cop_rule.rb:24 + def warning?; end +end + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:7 +RuboCop::ConfigObsoletion::DEFAULT_RULES_FILE = T.let(T.unsafe(nil), String) + +# Encapsulation of a ConfigObsoletion rule for splitting a cop's +# functionality into multiple new cops. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:8 +class RuboCop::ConfigObsoletion::ExtractedCop < ::RuboCop::ConfigObsoletion::CopRule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:11 + def initialize(config, old_name, gem); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:9 + def department; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:9 + def gem; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:23 + def rule_message; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:17 + def violated?; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:32 + def affected_cops; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/extracted_cop.rb:41 + def plugin_loaded?; end +end + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:18 +RuboCop::ConfigObsoletion::LOAD_RULES_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion.rb:14 +RuboCop::ConfigObsoletion::PARAMETER_RULE_CLASSES = T.let(T.unsafe(nil), Hash) + +# Base class for ConfigObsoletion rules relating to parameters +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:7 +class RuboCop::ConfigObsoletion::ParameterRule < ::RuboCop::ConfigObsoletion::Rule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:10 + def initialize(config, cop, parameter, metadata); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:8 + def cop; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:8 + def metadata; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:8 + def parameter; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:17 + def parameter_rule?; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:21 + def violated?; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:25 + def warning?; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:39 + def alternative; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:43 + def alternatives; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:31 + def applies_to_current_ruby_version?; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:47 + def reason; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/parameter_rule.rb:51 + def severity; end +end + +# Encapsulation of a ConfigObsoletion rule for removing +# a previously defined cop. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:8 +class RuboCop::ConfigObsoletion::RemovedCop < ::RuboCop::ConfigObsoletion::CopRule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:13 + def initialize(config, old_name, metadata); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:9 + def metadata; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:9 + def old_name; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:18 + def rule_message; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:36 + def alternatives; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:32 + def reason; end +end + +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/removed_cop.rb:11 +RuboCop::ConfigObsoletion::RemovedCop::BASE_MESSAGE = T.let(T.unsafe(nil), String) + +# Encapsulation of a ConfigObsoletion rule for renaming +# a cop or moving it to a new department. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:8 +class RuboCop::ConfigObsoletion::RenamedCop < ::RuboCop::ConfigObsoletion::CopRule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:11 + def initialize(config, old_name, name_or_hash); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:9 + def metadata; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:9 + def new_name; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:23 + def rule_message; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:27 + def warning?; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:33 + def moved?; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:44 + def severity; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/renamed_cop.rb:40 + def verb; end +end + +# Abstract base class for ConfigObsoletion rules +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:7 +class RuboCop::ConfigObsoletion::Rule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:8 + def initialize(config); end + + # Does this rule relate to cops? + # + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:13 + def cop_rule?; end + + # Does this rule relate to parameters? + # + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:18 + def parameter_rule?; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:22 + def violated?; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:28 + def config; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:36 + def smart_loaded_path; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/rule.rb:30 + def to_sentence(collection, connector: T.unsafe(nil)); end +end + +# Encapsulation of a ConfigObsoletion rule for splitting a cop's +# functionality into multiple new cops. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_obsoletion/split_cop.rb:8 +class RuboCop::ConfigObsoletion::SplitCop < ::RuboCop::ConfigObsoletion::CopRule + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/split_cop.rb:11 + def initialize(config, old_name, metadata); end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/split_cop.rb:9 + def metadata; end + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/split_cop.rb:16 + def rule_message; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_obsoletion/split_cop.rb:22 + def alternatives; end +end + +# This class handles collecting the options for regenerating a TODO file. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:6 +class RuboCop::ConfigRegeneration + # Get options from the comment in the TODO file, and parse them as options + # + # pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:12 + def options; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:29 + def generation_command; end + + # pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:25 + def todo_exists?; end +end + +# pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:7 +RuboCop::ConfigRegeneration::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:8 +RuboCop::ConfigRegeneration::COMMAND_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/config_regeneration.rb:9 +RuboCop::ConfigRegeneration::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Handles caching of configurations and association of inspected +# ruby files to configurations. +# +# pkg:gem/rubocop#lib/rubocop/config_store.rb:6 +class RuboCop::ConfigStore + # pkg:gem/rubocop#lib/rubocop/config_store.rb:10 + def initialize; end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:28 + def apply_options!(options); end + + # If type (file/dir) is known beforehand, + # prefer using #for_file or #for_dir for improved performance + # + # pkg:gem/rubocop#lib/rubocop/config_store.rb:57 + def for(file_or_dir); end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:66 + def for_dir(dir); end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:47 + def for_file(file); end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:51 + def for_pwd; end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:38 + def force_default_config!; end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:33 + def options_config=(options_config); end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:42 + def unvalidated; end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:7 + def validated; end + + # pkg:gem/rubocop#lib/rubocop/config_store.rb:8 + def validated?; end +end + +# Handles validation of configuration, for example cop names, parameter +# names, and Ruby versions. +# +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:7 +class RuboCop::ConfigValidator + extend ::RuboCop::SimpleForwardable + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:28 + def initialize(config); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:26 + def for_all_cops(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:26 + def smart_loaded_path(*, **, &); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:65 + def target_ruby_version; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:34 + def validate; end + + # Validations that should only be run after all config resolving has + # taken place: + # * The target ruby version is only checked once the entire inheritance + # chain has been loaded so that only the final value is validated, and + # any obsolete but overridden values are ignored. + # + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:61 + def validate_after_resolution; end + + private + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:100 + def alert_about_unrecognized_cops(invalid_cop_names); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:263 + def check_cop_config_value(hash, parent = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:73 + def check_obsoletions; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:80 + def check_target_ruby; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:205 + def each_invalid_parameter(cop_name); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:116 + def list_unknown_cops(invalid_cop_names); end + + # FIXME: Handling colors in exception messages like this is ugly. + # + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:284 + def param_error_message(parent, key, value, supposed_values); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:252 + def reject_conflicting_safe_settings; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:243 + def reject_mutually_exclusive_defaults; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:139 + def suggestion(name); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:71 + def target_ruby; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:217 + def validate_enforced_styles(valid_cop_names); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:166 + def validate_new_cops_parameter; end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:191 + def validate_parameter_names(valid_cop_names); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:177 + def validate_parameter_shape(valid_cop_names); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:237 + def validate_support_and_has_list(name, formats, valid); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:155 + def validate_syntax_cop; end +end + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:11 +RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:23 +RuboCop::ConfigValidator::CONFIG_CHECK_AUTOCORRECTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:22 +RuboCop::ConfigValidator::CONFIG_CHECK_DEPARTMENTS = T.let(T.unsafe(nil), Array) + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:21 +RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set) + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:14 +RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/config_validator.rb:18 +RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/util.rb:4 +module RuboCop::Cop; end + +# This module checks for nodes that should be aligned to the left or right. +# This amount is determined by the instance variable @column_delta. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:7 +module RuboCop::Cop::Alignment + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:26 + def check_alignment(items, base_column = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:12 + def column_delta; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:14 + def configured_indentation_width; end + + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:58 + def display_column(range); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:45 + def each_bad_alignment(items, base_column); end + + # @deprecated Use processed_source.line_with_comment?(line) + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:69 + def end_of_line_comment(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:18 + def indentation(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:22 + def offset(node); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:78 + def register_offense(offense_node, message_node); end + + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:64 + def within?(inner, outer); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/alignment.rb:8 +RuboCop::Cop::Alignment::SPACE = T.let(T.unsafe(nil), String) + +# This class does autocorrection of nodes that should just be moved to +# the left or to the right, amount being determined by the instance +# variable column_delta. +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:8 +class RuboCop::Cop::AlignmentCorrector + extend ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::Alignment + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:32 + def align_end(corrector, processed_source, node, align_to); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:15 + def correct(corrector, processed_source, node, column_delta); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:13 + def processed_source; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:118 + def alignment_column(align_to); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:47 + def autocorrect_line(corrector, line_begin_pos, expr, column_delta, taboo_ranges); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:86 + def block_comment_within?(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:92 + def calculate_range(expr, line_begin_pos, column_delta); end + + # Some special kinds of string literals are not composed of literal + # characters between two delimiters: + # - The source map of `?a` responds to :begin and :end but its end is + # nil. + # - The source map of `__FILE__` responds to neither :begin nor :end. + # + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:82 + def delimited_string_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:104 + def each_line(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:128 + def indentation_string(column); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:67 + def inside_string_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:61 + def inside_string_ranges(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:136 + def using_tabs?; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/alignment_corrector.rb:112 + def whitespace_range(node); end + end +end + +# This module encapsulates the ability to allow certain identifiers in a cop. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_identifiers.rb:6 +module RuboCop::Cop::AllowedIdentifiers + # if a variable starts with a sigil it will be removed + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_identifiers.rb:9 + def allowed_identifier?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_identifiers.rb:13 + def allowed_identifiers; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_identifiers.rb:7 +RuboCop::Cop::AllowedIdentifiers::SIGILS = T.let(T.unsafe(nil), String) + +# This module encapsulates the ability to allow certain methods when +# parsing. Even if the code is in offense, if it contains methods +# that are allowed. This module is equivalent to the IgnoredMethods module, +# which will be deprecated in RuboCop 2.0. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:9 +module RuboCop::Cop::AllowedMethods + private + + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:13 + def allowed_method?(name); end + + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:27 + def allowed_methods; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:35 + def cop_config_allowed_methods; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:39 + def cop_config_deprecated_values; end + + # @deprecated Use allowed_method? instead + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:18 + def ignored_method?; end +end + +# This module encapsulates the ability to ignore certain lines when +# parsing. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:7 +module RuboCop::Cop::AllowedPattern + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:10 + def allowed_line?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:52 + def allowed_pattern_regexps; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:42 + def allowed_patterns; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:62 + def cop_config_deprecated_methods_values; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:56 + def cop_config_patterns_values; end + + # @deprecated Use allowed_line? instead + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:21 + def ignored_line?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:29 + def matches_allowed_pattern?(line); end + + # @deprecated Use matches_allowed_pattern? instead + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:34 + def matches_ignored_pattern?(line); end +end + +# This module encapsulates the ability to allow certain receivers in a cop. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_receivers.rb:6 +module RuboCop::Cop::AllowedReceivers + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_receivers.rb:7 + def allowed_receiver?(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_receivers.rb:29 + def allowed_receivers; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_receivers.rb:13 + def receiver_name(receiver); end +end + +# Error raised when an unqualified cop name is used that could +# refer to two or more cops under different departments +# +# pkg:gem/rubocop#lib/rubocop/cop/registry.rb:7 +class RuboCop::Cop::AmbiguousCopName < ::RuboCop::Error + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:11 + def initialize(name, origin, badges); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/registry.rb:8 +RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String) + +# Representation of an annotation comment in source code (eg. `# TODO: blah blah blah`). +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:6 +class RuboCop::Cop::AnnotationComment + # @param [Parser::Source::Comment] comment + # @param [Array] keywords + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:11 + def initialize(comment, keywords); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:17 + def annotation?; end + + # Returns the range bounds for just the annotation + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:29 + def bounds; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:7 + def colon; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:7 + def comment; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:21 + def correct?(colon:); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:7 + def keyword; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:7 + def margin; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:7 + def note; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:7 + def space; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:65 + def just_keyword_of_sentence?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:61 + def keyword_appearance?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:37 + def keywords; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:51 + def regex; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:39 + def split_comment(comment); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/annotation_comment.rb:48 +RuboCop::Cop::AnnotationComment::KEYWORDS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) + +# Handles the `MinSize` configuration option for array-based cops +# `Style/SymbolArray` and `Style/WordArray`, which check for use of the +# relevant percent literal syntax such as `%i[...]` and `%w[...]` +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/array_min_size.rb:8 +module RuboCop::Cop::ArrayMinSize + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/array_min_size.rb:19 + def array_style_detected(style, ary_size); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/array_min_size.rb:11 + def below_array_length?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/array_min_size.rb:38 + def largest_brackets_size(style, ary_size); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/array_min_size.rb:15 + def min_size_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/array_min_size.rb:48 + def smallest_percent_size(style, ary_size); end +end + +# Common code for ordinary arrays with [] that can be written with % +# syntax. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/array_syntax.rb:7 +module RuboCop::Cop::ArraySyntax + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/array_syntax.rb:10 + def bracketed_array_of?(element_type, node); end +end + +# extend this module to signal autocorrection support +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/auto_corrector.rb:6 +module RuboCop::Cop::AutoCorrector + # pkg:gem/rubocop#lib/rubocop/cop/mixin/auto_corrector.rb:7 + def support_autocorrect?; end +end + +# This module encapsulates the logic for autocorrect behavior for a cop. +# +# pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:6 +module RuboCop::Cop::AutocorrectLogic + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:7 + def autocorrect?; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:31 + def autocorrect_enabled?; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:15 + def autocorrect_requested?; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:11 + def autocorrect_with_disable_uncorrectable?; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:19 + def correctable?; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:23 + def disable_uncorrectable?; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:27 + def safe_autocorrect?; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:51 + def disable_offense(offense_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:144 + def disable_offense_at_end_of_line(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:152 + def disable_offense_before_and_after(range_by_lines); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:78 + def disable_offense_with_eol_or_surround_comment(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:148 + def eol_comment; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:86 + def eol_comment_would_be_inside_literal?(offense_range, literal_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:103 + def heredoc_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:93 + def line_with_eol_comment_too_long?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:138 + def max_line_length; end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:64 + def multiline_ranges(offense_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:115 + def multiline_string?(node); end + + # Expand the given range to include all of any lines it covers. Does not + # include newline at end of the last line. + # + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:128 + def range_by_lines(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:119 + def range_of_first_line(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:111 + def string_continuation?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:99 + def surrounding_heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/autocorrect_logic.rb:107 + def surrounding_percent_array?(node); end +end + +# Identifier of all cops containing a department and cop name. +# +# All cops are identified by their badge. For example, the badge for +# `RuboCop::Cop::Layout::IndentationStyle` is `Layout/IndentationStyle`. +# Badges can be parsed as either `Department/CopName` or just `CopName` to +# allow for badge references in source files that omit the department for +# RuboCop to infer. +# +# pkg:gem/rubocop#lib/rubocop/cop/badge.rb:12 +class RuboCop::Cop::Badge + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:34 + def initialize(class_name_parts); end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:41 + def ==(other); end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:13 + def cop_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:13 + def department; end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:13 + def department_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:44 + def eql?(other); end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:46 + def hash; end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:51 + def match?(other); end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:59 + def qualified?; end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:55 + def to_s; end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:63 + def with_department(department); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:27 + def camel_case(name_part); end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:15 + def for(class_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/badge.rb:23 + def parse(identifier); end + end +end + +# A scaffold for concrete cops. +# +# The Cop::Base class is meant to be extended. +# +# Cops track offenses and can autocorrect them on the fly. +# +# A commissioner object is responsible for traversing the AST and invoking +# the specific callbacks on each cop. +# +# First the callback `on_new_investigation` is called; +# if a cop needs to do its own processing of the AST or depends on +# something else. +# +# Then callbacks like `on_def`, `on_send` (see AST::Traversal) are called +# with their respective nodes. +# +# Finally the callback `on_investigation_end` is called. +# +# Within these callbacks, cops are meant to call `add_offense` or +# `add_global_offense`. Use the `processed_source` method to +# get the currently processed source being investigated. +# +# In case of invalid syntax / unparsable content, +# the callback `on_other_file` is called instead of all the other +# `on_...` callbacks. +# +# Private methods are not meant for custom cops consumption, +# nor are any instance variables. +# +# pkg:gem/rubocop#lib/rubocop/cop/base.rb:34 +class RuboCop::Cop::Base + include ::RuboCop::AST::Sexp + include ::RuboCop::PathUtil + include ::RuboCop::Cop::Util + include ::RuboCop::Cop::IgnoredNode + include ::RuboCop::Cop::AutocorrectLogic + extend ::RuboCop::AST::Sexp + extend ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::ExcludeLimit + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:157 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:279 + def active_support_extensions_enabled?; end + + # Adds an offense that has no particular location. + # No correction can be applied to global offenses + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:190 + def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end + + # Adds an offense on the specified range (or node with an expression) + # Unless that offense is disabled for this range, a corrector will be yielded + # to provide the cop the opportunity to autocorrect the offense. + # If message is not specified, the method `message` will be called. + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:202 + def add_offense(node_or_range, message: T.unsafe(nil), severity: T.unsafe(nil), &block); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:359 + def always_autocorrect?; end + + # Called before any investigation + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:345 + def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:327 + def callbacks_needed; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:43 + def config; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:253 + def config_to_allow_offenses; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:257 + def config_to_allow_offenses=(hash); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:365 + def contextual_autocorrect?; end + + # Configuration Helpers + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:247 + def cop_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:239 + def cop_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:296 + def excluded_file?(file); end + + # This method should be overridden when a cop's behavior depends + # on state that lives outside of these locations: + # + # (1) the file under inspection + # (2) the cop's source code + # (3) the config (eg a .rubocop.yml file) + # + # For example, some cops may want to look at other parts of + # the codebase being inspected to find violations. A cop may + # use the presence or absence of file `foo.rb` to determine + # whether a certain violation exists in `bar.rb`. + # + # Overriding this method allows the cop to indicate to RuboCop's + # ResultCache system when those external dependencies change, + # ie when the ResultCache should be invalidated. + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:235 + def external_dependency_checksum; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:369 + def inspect; end + + # Gets called if no message is specified when calling `add_offense` or + # `add_global_offense` + # Cops are discouraged to override this; instead pass your message directly + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:184 + def message(_range = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:243 + def name; end + + # @deprecated Make potential errors with previous API more obvious + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:318 + def offenses; end + + # Called after all on_... have been called + # When refining this method, always call `super` + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:171 + def on_investigation_end; end + + # Called before all on_... have been called + # When refining this method, always call `super` + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:165 + def on_new_investigation; end + + # Called instead of all on_... callbacks for unrecognized files / syntax errors + # When refining this method, always call `super` + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:177 + def on_other_file; end + + # There should be very limited reasons for a Cop to do it's own parsing + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:301 + def parse(source, path = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:271 + def parser_engine; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:43 + def processed_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:44 + def project_index; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:44 + def project_index=(_arg0); end + + # @api private + # Called between investigations + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:307 + def ready; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:287 + def relevant_file?(file); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:283 + def string_literals_frozen_by_default?; end + + # Returns a gems locked versions (i.e. from Gemfile.lock or gems.locked) + # @returns [Gem::Version | nil] The locked gem version, or nil if the gem is not present. + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:267 + def target_gem_version(gem_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:275 + def target_rails_version; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:261 + def target_ruby_version; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:490 + def annotate(message); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:381 + def apply_correction(corrector); end + + # @return [Symbol] offense status + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:454 + def attempt_correction(range, corrector); end + + # Reserved for Cop::Cop + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:377 + def callback_argument(range); end + + # Called to complete an investigation + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:410 + def complete_investigation; end + + # @return [Symbol, Corrector] offense status + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:428 + def correct(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:395 + def current_corrector; end + + # Reserved for Commissioner: + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:387 + def current_offense_locations; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:399 + def current_offenses; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:391 + def currently_disabled_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:533 + def custom_severity; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:529 + def default_severity; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:468 + def disable_uncorrectable(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:519 + def enabled_line?(line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:496 + def file_name_matches_any?(file, parameter, default_result); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:486 + def find_message(range, message); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:525 + def find_severity(_range, severity); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:511 + def matches_absolute_include_pattern?(patterns, file); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:546 + def range_for_original(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:475 + def range_from_node_or_range(node_or_range); end + + # Actually private methods + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:420 + def reset_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:557 + def target_satisfies_all_gem_version_requirements?; end + + # @return [Symbol] offense status + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:443 + def use_corrector(range, corrector); end + + class << self + # List of cops that should not try to autocorrect at the same + # time as this cop + # + # @return [Array] + # + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:60 + def autocorrect_incompatible_with; end + + # Naming + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:94 + def badge; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:332 + def callbacks_needed; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:98 + def cop_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:102 + def department; end + + # Returns a url to view this cops documentation online. + # Requires 'DocumentationBaseURL' to be set for your department. + # Will follow the convention of RuboCops own documentation structure, + # overwrite this method to accommodate your custom layout. + # @return [String, nil] + # + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:71 + def documentation_url(config = T.unsafe(nil)); end + + # Call for abstract Cop classes + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:82 + def exclude_from_registry; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:139 + def gem_requirements; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:75 + def inherited(subclass); end + + # Override and return the Force class(es) you need to join + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:119 + def joining_forces; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:106 + def lint?; end + + # Returns true if the cop name or the cop namespace matches any of the + # given names. + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:112 + def match?(given_names); end + + # Register a version requirement for the given gem name. + # This cop will be skipped unless the target satisfies *all* requirements. + # @param [String] gem_name + # @param [Array] version_requirements The version requirements, + # using the same syntax as a Gemfile, e.g. ">= 1.2.3" + # + # If omitted, any version of the gem will be accepted. + # + # https://guides.rubygems.org/patterns/#declaring-dependencies + # + # @api public + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:152 + def requires_gem(gem_name, *version_requirements); end + + # Returns if class supports autocorrect. + # It is recommended to extend AutoCorrector instead of overriding + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:88 + def support_autocorrect?; end + + # Override if your cop should be called repeatedly for multiple investigations + # Between calls to `on_new_investigation` and `on_investigation_end`, + # the result of `processed_source` will remain constant. + # You should invalidate any caches that depend on the current `processed_source` + # in the `on_new_investigation` callback. + # If your cop does autocorrections, be aware that your instance may be called + # multiple times with the same `processed_source.path` but different content. + # + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:130 + def support_multiple_source?; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:403 + def restrict_on_send; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/base.rb:407 +RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array) + +# Reports of an investigation. +# Immutable +# Consider creation API private +# +# pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 +class RuboCop::Cop::Base::InvestigationReport < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def cop; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def cop=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def corrector; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def corrector=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def offenses; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def offenses=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def processed_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def processed_source=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/base.rb:49 + def new(*_arg0); end + end +end + +# List of methods names to restrict calls for `on_send` / `on_csend` +# +# pkg:gem/rubocop#lib/rubocop/cop/base.rb:52 +RuboCop::Cop::Base::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:5 +module RuboCop::Cop::Bundler; end + +# A Gem's requirements should be listed only once in a Gemfile. +# +# @example +# # bad +# gem 'rubocop' +# gem 'rubocop' +# +# # bad +# group :development do +# gem 'rubocop' +# end +# +# group :test do +# gem 'rubocop' +# end +# +# # good +# group :development, :test do +# gem 'rubocop' +# end +# +# # good +# gem 'rubocop', groups: [:development, :test] +# +# # good - conditional declaration +# if Dir.exist?(local) +# gem 'rubocop', path: local +# elsif ENV['RUBOCOP_VERSION'] == 'master' +# gem 'rubocop', git: 'https://github.com/rubocop/rubocop.git' +# else +# gem 'rubocop', '~> 0.90.0' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:39 +class RuboCop::Cop::Bundler::DuplicatedGem < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:58 + def gem_declarations(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:45 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:67 + def conditional_declaration?(nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:60 + def duplicated_gem_nodes; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:81 + def register_offense(node, gem_name, line_of_first_occurrence); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:75 + def within_conditional?(node, conditional_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_gem.rb:42 +RuboCop::Cop::Bundler::DuplicatedGem::MSG = T.let(T.unsafe(nil), String) + +# A Gem group, or a set of groups, should be listed only once in a Gemfile. +# +# For example, if the values of `source`, `git`, `platforms`, or `path` +# surrounding `group` are different, no offense will be registered: +# +# [source,ruby] +# ----- +# platforms :ruby do +# group :default do +# gem 'openssl' +# end +# end +# +# platforms :jruby do +# group :default do +# gem 'jruby-openssl' +# end +# end +# ----- +# +# @example +# # bad +# group :development do +# gem 'rubocop' +# end +# +# group :development do +# gem 'rubocop-rails' +# end +# +# # bad (same set of groups declared twice) +# group :development, :test do +# gem 'rubocop' +# end +# +# group :test, :development do +# gem 'rspec' +# end +# +# # good +# group :development do +# gem 'rubocop' +# end +# +# group :development, :test do +# gem 'rspec' +# end +# +# # good +# gem 'rubocop', groups: [:development, :test] +# gem 'rspec', groups: [:development, :test] +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:58 +class RuboCop::Cop::Bundler::DuplicatedGroup < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:66 + def group_declarations(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:68 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:82 + def duplicated_group_nodes; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:105 + def find_source_key(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:115 + def group_attributes(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:94 + def register_offense(node, group_name, line_of_first_occurrence); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:61 +RuboCop::Cop::Bundler::DuplicatedGroup::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/duplicated_group.rb:63 +RuboCop::Cop::Bundler::DuplicatedGroup::SOURCE_BLOCK_NAMES = T.let(T.unsafe(nil), Array) + +# Each gem in the Gemfile should have a comment explaining +# its purpose in the project, or the reason for its version +# or source. +# +# The optional "OnlyFor" configuration array +# can be used to only register offenses when the gems +# use certain options or have version specifiers. +# +# When "version_specifiers" is included, a comment +# will be enforced if the gem has any version specifier. +# +# When "restrictive_version_specifiers" is included, a comment +# will be enforced if the gem has a version specifier that +# holds back the version of the gem. +# +# For any other value in the array, a comment will be enforced for +# a gem if an option by the same name is present. +# A useful use case is to enforce a comment when using +# options that change the source of a gem: +# +# - `bitbucket` +# - `gist` +# - `git` +# - `github` +# - `source` +# +# For a full list of options supported by bundler, +# see https://bundler.io/man/gemfile.5.html +# . +# +# @example OnlyFor: [] (default) +# # bad +# +# gem 'foo' +# +# # good +# +# # Helpers for the foo things. +# gem 'foo' +# +# @example OnlyFor: ['version_specifiers'] +# # bad +# +# gem 'foo', '< 2.1' +# +# # good +# +# # Version 2.1 introduces breaking change baz +# gem 'foo', '< 2.1' +# +# @example OnlyFor: ['restrictive_version_specifiers'] +# # bad +# +# gem 'foo', '< 2.1' +# +# # good +# +# gem 'foo', '>= 1.0' +# +# # Version 2.1 introduces breaking change baz +# gem 'foo', '< 2.1' +# +# @example OnlyFor: ['version_specifiers', 'github'] +# # bad +# +# gem 'foo', github: 'some_account/some_fork_of_foo' +# +# gem 'bar', '< 2.1' +# +# # good +# +# # Using this fork because baz +# gem 'foo', github: 'some_account/some_fork_of_foo' +# +# # Version 2.1 introduces breaking change baz +# gem 'bar', '< 2.1' +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:83 +class RuboCop::Cop::Bundler::GemComment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::VisibilityHelp + include ::RuboCop::Cop::DefNode + include ::RuboCop::Cop::GemDeclaration + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:94 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:135 + def checked_options_present?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:109 + def commented?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:105 + def commented_any_descendant?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:159 + def contains_checked_options?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:163 + def gem_options(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:130 + def ignored_gem?(node); end + + # The args node1 & node2 may represent a RuboCop::AST::Node + # or a Parser::Source::Comment. Both respond to #loc. + # + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:116 + def precede?(node1, node2); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:126 + def preceding_comment?(node1, node2); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:120 + def preceding_lines(node); end + + # Version specifications that restrict all updates going forward. This excludes versions + # like ">= 1.0" or "!= 2.0.3". + # + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:152 + def restrictive_version_specified_gem?(node); end + + # Besides the gem name, all other *positional* arguments to `gem` are version specifiers, + # as long as it has one we know there's at least one version specifier. + # + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:145 + def version_specified_gem?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:88 +RuboCop::Cop::Bundler::GemComment::CHECKED_OPTIONS_CONFIG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:87 +RuboCop::Cop::Bundler::GemComment::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:91 +RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:90 +RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:92 +RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_comment.rb:89 +RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) + +# Verifies that a project contains Gemfile or gems.rb file and correct +# associated lock file based on the configuration. +# +# @example EnforcedStyle: Gemfile (default) +# # bad +# Project contains gems.rb and gems.locked files +# +# # bad +# Project contains Gemfile and gems.locked file +# +# # good +# Project contains Gemfile and Gemfile.lock +# +# @example EnforcedStyle: gems.rb +# # bad +# Project contains Gemfile and Gemfile.lock files +# +# # bad +# Project contains gems.rb and Gemfile.lock file +# +# # good +# Project contains gems.rb and gems.locked files +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:28 +class RuboCop::Cop::Bundler::GemFilename < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:42 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:87 + def expected_gemfile?(basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:79 + def gemfile_offense?(basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:92 + def gemfile_required?; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:83 + def gems_rb_offense?(basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:96 + def gems_rb_required?; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:57 + def register_gemfile_offense(file_path, basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:68 + def register_gems_rb_offense(file_path, basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:52 + def register_offense(file_path, basename); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:39 +RuboCop::Cop::Bundler::GemFilename::GEMFILE_FILES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:40 +RuboCop::Cop::Bundler::GemFilename::GEMS_RB_FILES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:35 +RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_MISMATCHED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:31 +RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_REQUIRED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:37 +RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_MISMATCHED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_filename.rb:33 +RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_REQUIRED = T.let(T.unsafe(nil), String) + +# Enforce that Gem version specifications or a commit reference (branch, +# ref, or tag) are either required or forbidden. +# +# @example EnforcedStyle: required (default) +# # bad +# gem 'rubocop' +# +# # good +# gem 'rubocop', '~> 1.12' +# +# # good +# gem 'rubocop', '>= 1.10.0' +# +# # good +# gem 'rubocop', '>= 1.5.0', '< 1.10.0' +# +# # good +# gem 'rubocop', branch: 'feature-branch' +# +# # good +# gem 'rubocop', ref: '74b5bfbb2c4b6fd6cdbbc7254bd7084b36e0c85b' +# +# # good +# gem 'rubocop', tag: 'v1.17.0' +# +# @example EnforcedStyle: forbidden +# # good +# gem 'rubocop' +# +# # bad +# gem 'rubocop', '~> 1.12' +# +# # bad +# gem 'rubocop', '>= 1.10.0' +# +# # bad +# gem 'rubocop', '>= 1.5.0', '< 1.10.0' +# +# # bad +# gem 'rubocop', branch: 'feature-branch' +# +# # bad +# gem 'rubocop', ref: '74b5bfbb2c4b6fd6cdbbc7254bd7084b36e0c85b' +# +# # bad +# gem 'rubocop', tag: 'v1.17.0' +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:53 +class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::GemDeclaration + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:68 + def includes_commit_reference?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:63 + def includes_version_specification?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:72 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:86 + def allowed_gem?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:90 + def allowed_gems; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:112 + def forbidden_offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:118 + def forbidden_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:94 + def message(_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:102 + def offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:106 + def required_offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:122 + def required_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:126 + def version_specification?(expression); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:58 +RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:57 +RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:59 +RuboCop::Cop::Bundler::GemVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/gem_version.rb:60 +RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) + +# Passing symbol arguments to `source` (e.g. `source :rubygems`) is +# deprecated because they default to using HTTP requests. Instead, specify +# `'https://rubygems.org'` if possible, or `'http://rubygems.org'` if not. +# +# When autocorrecting, this cop will replace symbol arguments with +# `'https://rubygems.org'`. +# +# This cop will not replace existing sources that use `http://`. This may +# be necessary where HTTPS is not available. For example, where using an +# internal gem server via an intranet, or where HTTPS is prohibited. +# However, you should strongly prefer `https://` where possible, as it is +# more secure. +# +# If you don't allow `http://`, please set `false` to `AllowHttpProtocol`. +# This option is `true` by default for safe autocorrection. +# +# @example +# # bad +# source :gemcutter +# source :rubygems +# source :rubyforge +# +# # good +# source 'https://rubygems.org' # strongly recommended +# +# @example AllowHttpProtocol: true (default) +# +# # good +# source 'http://rubygems.org' # use only if HTTPS is unavailable +# +# @example AllowHttpProtocol: false +# +# # bad +# source 'http://rubygems.org' +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:41 +class RuboCop::Cop::Bundler::InsecureProtocolSource < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:53 + def insecure_protocol_source?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:58 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:79 + def allow_http_protocol?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:44 +RuboCop::Cop::Bundler::InsecureProtocolSource::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:48 +RuboCop::Cop::Bundler::InsecureProtocolSource::MSG_HTTP_PROTOCOL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/insecure_protocol_source.rb:50 +RuboCop::Cop::Bundler::InsecureProtocolSource::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Gems should be alphabetically sorted within groups. +# +# @example +# # bad +# gem 'rubocop' +# gem 'rspec' +# +# # good +# gem 'rspec' +# gem 'rubocop' +# +# # good +# gem 'rubocop' +# +# gem 'rspec' +# +# @example TreatCommentsAsGroupSeparators: true (default) +# # good +# # For code quality +# gem 'rubocop' +# # For tests +# gem 'rspec' +# +# @example TreatCommentsAsGroupSeparators: false +# # bad +# # For code quality +# gem 'rubocop' +# # For tests +# gem 'rspec' +# +# pkg:gem/rubocop#lib/rubocop/cop/bundler/ordered_gems.rb:35 +class RuboCop::Cop::Bundler::OrderedGems < ::RuboCop::Cop::Base + include ::RuboCop::Cop::OrderedGemNode + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/ordered_gems.rb:63 + def gem_declarations(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/ordered_gems.rb:43 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/bundler/ordered_gems.rb:56 + def previous_declaration(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/bundler/ordered_gems.rb:39 +RuboCop::Cop::Bundler::OrderedGems::MSG = T.let(T.unsafe(nil), String) + +# Common functionality for checking assignment nodes. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:6 +module RuboCop::Cop::CheckAssignment + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:17 + def on_and_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:13 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:11 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:12 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:10 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:7 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:14 + def on_masgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:15 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:16 + def on_or_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:19 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:27 + def extract_rhs(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_assignment.rb:27 + def extract_rhs(node); end + end +end + +# This mixin detects collections that are safe to "break" +# by inserting new lines. This is useful for breaking +# up long lines. +# +# Let's look at hashes as an example: +# +# We know hash keys are safe to break across lines. We can add +# linebreaks into hashes on lines longer than the specified maximum. +# Then in further passes cops can clean up the multi-line hash. +# For example, say the maximum line length is as indicated below: +# +# | +# v +# {foo: "0000000000", bar: "0000000000", baz: "0000000000"} +# +# In a LineLength autocorrection pass, a line is added before +# the first key that exceeds the column limit: +# +# {foo: "0000000000", bar: "0000000000", +# baz: "0000000000"} +# +# In a MultilineHashKeyLineBreaks pass, lines are inserted +# before all keys: +# +# {foo: "0000000000", +# bar: "0000000000", +# baz: "0000000000"} +# +# Then in future passes FirstHashElementLineBreak, +# MultilineHashBraceLayout, and TrailingCommaInHashLiteral will +# manipulate as well until we get: +# +# { +# foo: "0000000000", +# bar: "0000000000", +# baz: "0000000000", +# } +# +# (Note: Passes may not happen exactly in this sequence.) +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:44 +module RuboCop::Cop::CheckLineBreakable + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:45 + def extract_breakable_node(node, max); end + + private + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:202 + def all_on_same_line?(nodes); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:222 + def already_on_multiple_lines?(node); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:135 + def breakable_collection?(node, elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:228 + def chained_to_heredoc?(node); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:189 + def children_could_be_broken_up?(children); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:152 + def contained_by_breakable_collection_on_same_line?(node); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:172 + def contained_by_multiline_collection_that_could_be_broken_up?(node); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:62 + def extract_breakable_node_from_elements(node, elements, max); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:74 + def extract_first_element_over_column_limit(node, elements, max); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:94 + def first_argument_is_heredoc?(node); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:209 + def process_args(args); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:119 + def safe_to_ignore?(node); end + + # @api private + # If a `send` or `csend` node contains a heredoc argument, splitting cannot happen + # after the heredoc or else it will cause a syntax error. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:103 + def shift_elements_for_heredoc_arg(node, elements, index); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_line_breakable.rb:114 + def within_column_limit?(element, max, line); end +end + +# Checks for code on multiple lines that could be rewritten on a single line +# without changing semantics or exceeding the `Max` parameter of `Layout/LineLength`. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/check_single_line_suitability.rb:7 +module RuboCop::Cop::CheckSingleLineSuitability + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_single_line_suitability.rb:8 + def suitable_as_single_line?(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_single_line_suitability.rb:32 + def comment_within?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_single_line_suitability.rb:40 + def safe_to_split?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_single_line_suitability.rb:23 + def to_single_line(source); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/check_single_line_suitability.rb:16 + def too_long?(node); end +end + +# Common functionality for checking length of code segments. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:6 +module RuboCop::Cop::CodeLength + extend ::RuboCop::ExcludeLimit + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:11 + def max=(value); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:49 + def build_code_length_calculator(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:31 + def check_code_length(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:27 + def count_as_one; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:23 + def count_comments?; end + + # Returns true for lines that shall not be included in the count. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:45 + def irrelevant_line(source_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:58 + def location(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:19 + def max_length; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:15 + def message(length, max_length); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/code_length.rb:9 +RuboCop::Cop::CodeLength::MSG = T.let(T.unsafe(nil), String) + +# Help methods for working with nodes containing comments. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:6 +module RuboCop::Cop::CommentsHelp + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:27 + def comments_contain_disables?(node, cop_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:18 + def comments_in_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:14 + def contains_comments?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:7 + def source_range_with_comment(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:46 + def begin_pos_with_comment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:60 + def buffer; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:41 + def end_position_for(node); end + + # Returns the end line of a node, which might be a comment and not part of the AST + # End line is considered either the line at which another node starts, or + # the line at which the parent node ends. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:68 + def find_end_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/comments_help.rb:56 + def start_line_position(node); end +end + +# Commissioner class is responsible for processing the AST and delegating +# work to the specified cops. +# +# pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:7 +class RuboCop::Cop::Commissioner + include ::RuboCop::AST::Traversal + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:44 + def initialize(cops, forces = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:42 + def errors; end + + # @return [InvestigationReport] + # + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:81 + def investigate(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on___ENCODING__(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on___FILE__(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on___LINE__(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_alias(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_and_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_arg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_arg_expr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_args(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_array_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_array_pattern_with_tail(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_back_ref(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_block_pass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_blockarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_blocknilarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_break(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_case_match(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_cbase(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_complex(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_const(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_const_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_cvar(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_defined?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_dstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_dsym(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_eflipflop(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_empty_else(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_erange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_false(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_find_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_float(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_for(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_forward_arg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_forward_args(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_forwarded_args(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_forwarded_kwrestarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_forwarded_restarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_gvar(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_hash_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_if_guard(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_iflipflop(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_in_match(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_in_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_index(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_indexasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_int(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_irange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_ivar(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwargs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwbegin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwnilarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwoptarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwrestarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_kwsplat(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_lambda(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_lvar(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_masgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_alt(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_as(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_current_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_nil_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_pattern_p(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_rest(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_var(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_with_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_match_with_trailing_comma(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_mlhs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_next(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_nil(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_not(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_nth_ref(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_optarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_or_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_pair(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_pin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_postexe(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_preexe(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_procarg0(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_rational(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_redo(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_regexp(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_regopt(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_resbody(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_rescue(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_restarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_retry(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_return(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_sclass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_self(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_shadowarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_splat(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_str(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_super(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_sym(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_true(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_undef(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_unless_guard(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_until_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_when(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_while(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_while_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_xstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_yield(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:69 + def on_zsuper(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:100 + def begin_investigation(processed_source, offset:, original:); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:123 + def build_callbacks(cops); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:118 + def initialize_callbacks; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:161 + def invoke(callback, cops); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:165 + def invoke_with_argument(callback, cops, arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:114 + def reset; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:133 + def restrict_callbacks(callbacks); end + + # NOTE: mutates `callbacks` in place + # + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:151 + def restricted_map(callbacks); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:106 + def trigger_responding_cops(callback, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:141 + def trigger_restricted_cops(event, node); end + + # Allow blind rescues here, since we're absorbing and packaging or + # re-raising exceptions that can be raised from within the individual + # cops' `#investigate` methods. + # + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:172 + def with_cop_error_handling(cop, node = T.unsafe(nil)); end +end + +# How a Commissioner returns the results of the investigation +# as a list of Cop::InvestigationReport and any errors caught +# during the investigation. +# Immutable +# Consider creation API private +# +# pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 +class RuboCop::Cop::Commissioner::InvestigationReport < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def cop_reports; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def cop_reports=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:19 + def cops; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:27 + def correctors; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def errors; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def errors=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:35 + def merge(investigation); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:31 + def offenses; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:23 + def offenses_per_cop; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def processed_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def processed_source=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:18 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/commissioner.rb:10 +RuboCop::Cop::Commissioner::RESTRICTED_CALLBACKS = T.let(T.unsafe(nil), Array) + +# This class does condition autocorrection +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/condition_corrector.rb:6 +class RuboCop::Cop::ConditionCorrector + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/condition_corrector.rb:8 + def correct_negative_condition(corrector, node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/condition_corrector.rb:17 + def negated_condition(node); end + end +end + +# Handles `EnforcedStyle` configuration parameters. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:6 +module RuboCop::Cop::ConfigurableEnforcedStyle + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:88 + def alternative_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:96 + def alternative_styles; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:19 + def ambiguous_style_detected(*possibilities); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:72 + def conflicting_styles_detected; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:11 + def correct_style_detected; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:64 + def detected_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:68 + def detected_style=(style); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:60 + def no_acceptable_style!; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:56 + def no_acceptable_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:7 + def opposite_style_detected; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:79 + def style; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:75 + def style_configured?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:29 + def style_detected(detected); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:107 + def style_parameter_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:100 + def supported_styles; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:15 + def unexpected_style_detected(unexpected); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:73 + def unrecognized_style_detected; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_enforced_style.rb:23 +RuboCop::Cop::ConfigurableEnforcedStyle::SYMBOL_TO_STRING_CACHE = T.let(T.unsafe(nil), Hash) + +# Shared functionality between mixins that enforce naming conventions +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_formatting.rb:6 +module RuboCop::Cop::ConfigurableFormatting + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_formatting.rb:9 + def check_name(node, name, name_range); end + + # A class emitter method is a singleton method in a class/module, where + # the method has the same name as a class defined in the class/module. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_formatting.rb:30 + def class_emitter_method?(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_formatting.rb:17 + def report_opposing_styles(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_formatting.rb:24 + def valid_name?(node, name, given_style = T.unsafe(nil)); end +end + +# Handles `Max` configuration parameters, especially setting them to an +# appropriate value with --auto-gen-config. +# @deprecated Use `exclude_limit ` instead. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_max.rb:8 +module RuboCop::Cop::ConfigurableMax + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_max.rb:11 + def max=(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_max.rb:24 + def max_parameter_name; end +end + +# This module provides functionality for checking if names match the +# configured EnforcedStyle. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_naming.rb:7 +module RuboCop::Cop::ConfigurableNaming + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_naming.rb:10 +RuboCop::Cop::ConfigurableNaming::FORMATS = T.let(T.unsafe(nil), Hash) + +# This module provides functionality for checking if numbering match the +# configured EnforcedStyle. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_numbering.rb:7 +module RuboCop::Cop::ConfigurableNumbering + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/configurable_numbering.rb:11 +RuboCop::Cop::ConfigurableNumbering::FORMATS = T.let(T.unsafe(nil), Hash) + +# @deprecated Use Cop::Base instead +# Legacy scaffold for Cops. +# See https://docs.rubocop.org/rubocop/v1_upgrade_notes.html +# Monkey-patch Cop for tests to provide easy access to messages and +# highlights. +# +# pkg:gem/rubocop#lib/rubocop/cop/cop.rb:11 +class RuboCop::Cop::Cop < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:73 + def add_offense(node_or_range, location: T.unsafe(nil), message: T.unsafe(nil), severity: T.unsafe(nil), &block); end + + # Called before any investigation + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:129 + def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end + + # @deprecated + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:105 + def corrections; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:90 + def find_location(node, loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:12 + def offenses; end + + # Called after all on_... have been called + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:122 + def on_investigation_end; end + + # Called before all on_... have been called + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:116 + def on_new_investigation; end + + # @deprecated Use class method + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:96 + def support_autocorrect?; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:147 + def apply_correction(corrector); end + + # Override Base + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:143 + def callback_argument(_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:164 + def correction_lambda; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:170 + def dedupe_on_node(node); end + + # Just for legacy + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:152 + def emulate_v0_callsequence(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:183 + def range_for_original(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:177 + def suppress_clobbering; end + + class << self + # @deprecated Use Registry.all + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:56 + def all; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:25 + def inherited(_subclass); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:37 + def joining_forces; end + + # @deprecated Use Registry.qualified_cop_name + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:65 + def qualified_cop_name(name, origin); end + + # @deprecated Use Registry.global + # + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:47 + def registry; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:33 + def support_autocorrect?; end + end +end + +# @deprecated +# +# pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 +class RuboCop::Cop::Cop::Correction < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:18 + def call(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def cop; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def cop=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def lambda; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def lambda=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def node; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def node=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/cop.rb:17 + def new(*_arg0); end + end +end + +# This class takes a source buffer and rewrite its source +# based on the different correction rules supplied. +# +# Important! +# The nodes modified by the corrections should be part of the +# AST of the source_buffer. +# +# pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:11 +class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter + # @param source [Parser::Source::Buffer, or anything + # leading to one via `(processed_source.)buffer`] + # + # corrector = Corrector.new(cop) + # + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:32 + def initialize(source); end + + # Removes `size` characters from the beginning of the given range. + # If `size` is greater than the size of `range`, the removed region can + # overrun the end of `range`. + # + # @param [Parser::Source::Range, RuboCop::AST::Node] range or node + # @param [Integer] size + # + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:63 + def remove_leading(node_or_range, size); end + + # Removes `size` characters prior to the source range. + # + # @param [Parser::Source::Range, RuboCop::AST::Node] range or node + # @param [Integer] size + # + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:51 + def remove_preceding(node_or_range, size); end + + # Removes `size` characters from the end of the given range. + # If `size` is greater than the size of `range`, the removed region can + # overrun the beginning of `range`. + # + # @param [Parser::Source::Range, RuboCop::AST::Node] range or node + # @param [Integer] size + # + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:75 + def remove_trailing(node_or_range, size); end + + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:45 + def rewrite; end + + # Swaps sources at the given ranges. + # + # @param [Parser::Source::Range, RuboCop::AST::Node] node_or_range1 + # @param [Parser::Source::Range, RuboCop::AST::Node] node_or_range2 + # + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:85 + def swap(node_or_range1, node_or_range2); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:119 + def check_range_validity(node_or_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:104 + def to_range(node_or_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:123 + def validate_buffer(buffer); end + + class << self + # Duck typing for get to a ::Parser::Source::Buffer + # + # pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:15 + def source_buffer(source); end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/corrector.rb:12 +RuboCop::Cop::Corrector::NOOP_CONSUMER = T.let(T.unsafe(nil), Proc) + +# Common functionality for checking def nodes. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/def_node.rb:6 +module RuboCop::Cop::DefNode + include ::RuboCop::Cop::VisibilityHelp + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/def_node.rb:21 + def non_public_modifier?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/def_node.rb:12 + def non_public?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/def_node.rb:16 + def preceding_non_public_modifier?(node); end +end + +# Help methods for working with `Enumerable#dig` in cops. +# Used by `Style::DigChain` and `Style::SingleArgumentDig` +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/dig_help.rb:7 +module RuboCop::Cop::DigHelp + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/dig_help.rb:11 + def dig?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/dig_help.rb:16 + def single_argument_dig?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/dig_help.rb:22 + def dig_chain_enabled?; end +end + +# Helpers for builtin documentation +# +# pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:6 +module RuboCop::Cop::Documentation + private + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:25 + def base_url_for(cop_class, config); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:57 + def builtin?(cop_class); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:47 + def default_base_url; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:52 + def default_extension; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:10 + def department_to_basename(department); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:36 + def extension_for(cop_class, config); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:15 + def url_for(cop_class, config = T.unsafe(nil)); end + + class << self + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:25 + def base_url_for(cop_class, config); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:57 + def builtin?(cop_class); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:47 + def default_base_url; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:52 + def default_extension; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:10 + def department_to_basename(department); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:36 + def extension_for(cop_class, config); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/documentation.rb:15 + def url_for(cop_class, config = T.unsafe(nil)); end + end +end + +# Common functionality for checking documentation. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:6 +module RuboCop::Cop::DocumentationComment + extend ::RuboCop::AST::NodePattern::Macros + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:47 + def annotation_keywords; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:11 + def documentation_comment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:39 + def interpreter_directive_comment?(comment); end + + # The args node1 & node2 may represent a RuboCop::AST::Node + # or a Parser::Source::Comment. Both respond to #loc. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:31 + def precede?(node1, node2); end + + # The args node1 & node2 may represent a RuboCop::AST::Node + # or a Parser::Source::Comment. Both respond to #loc. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:25 + def preceding_comment?(node1, node2); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:35 + def preceding_lines(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/documentation_comment.rb:43 + def rubocop_directive_comment?(comment); end +end + +# Common functionality for dealing with duplication. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/duplication.rb:6 +module RuboCop::Cop::Duplication + private + + # Returns the consecutive duplicates, leaving out the first instance of + # the duplicated elements. + # + # @param [Array] collection an array to return consecutive duplicates for + # @return [Array] the consecutive duplicates + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/duplication.rb:31 + def consecutive_duplicates(collection); end + + # Returns all duplicates, including the first instance of the duplicated + # elements. + # + # @param [Array] collection an array to return duplicates for + # @return [Array] all the duplicates + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/duplication.rb:22 + def duplicates(collection); end + + # Whether the `collection` contains any duplicates. + # + # @param [Array] collection an array to check for duplicates + # @return [Boolean] whether the array contains any duplicates + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/duplication.rb:13 + def duplicates?(collection); end + + # Returns a hash of grouped duplicates. The key will be the first + # instance of the element, and the value an `array` of the initial + # element and all duplicate instances. + # + # @param [Array] collection an array to group duplicates for + # @return [Array] the grouped duplicates + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/duplication.rb:41 + def grouped_duplicates(collection); end +end + +# This class autocorrects `#each` enumeration to `for` iteration. +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:6 +class RuboCop::Cop::EachToForCorrector + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:12 + def initialize(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:18 + def call(corrector); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:24 + def argument_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:24 + def block_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:24 + def collection_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:26 + def correction; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:36 + def offending_range; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:10 +RuboCop::Cop::EachToForCorrector::CORRECTION_WITHOUT_ARGUMENTS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/correctors/each_to_for_corrector.rb:9 +RuboCop::Cop::EachToForCorrector::CORRECTION_WITH_ARGUMENTS = T.let(T.unsafe(nil), String) + +# This class does empty line autocorrection +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/empty_line_corrector.rb:6 +class RuboCop::Cop::EmptyLineCorrector + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/empty_line_corrector.rb:8 + def correct(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/empty_line_corrector.rb:19 + def insert_before(corrector, node); end + end +end + +# Common code for empty parameter cops. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_parameter.rb:6 +module RuboCop::Cop::EmptyParameter + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_parameter.rb:12 + def empty_arguments?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_parameter.rb:16 + def check(node); end +end + +# Functions for checking the alignment of the `end` keyword. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:6 +module RuboCop::Cop::EndKeywordAlignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:49 + def add_offense_for_misalignment(node, align_with); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:19 + def check_end_kw_alignment(node, align_ranges); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:15 + def check_end_kw_in_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:69 + def line_break_before_keyword?(whole_expression, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:34 + def matching_ranges(end_loc, align_ranges); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:40 + def start_line_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:59 + def style_parameter_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:63 + def variable_alignment?(whole_expression, rhs, end_alignment_style); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/end_keyword_alignment.rb:10 +RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String) + +# Common functionality for rewriting endless methods to normal method definitions +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/endless_method_rewriter.rb:6 +module RuboCop::Cop::EndlessMethodRewriter + # pkg:gem/rubocop#lib/rubocop/cop/mixin/endless_method_rewriter.rb:7 + def correct_to_multiline(corrector, node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/endless_method_rewriter.rb:19 + def arguments(node, missing = T.unsafe(nil)); end +end + +# Common functionality for enforcing a specific superclass. +# +# IMPORTANT: RuboCop core depended on this module when it supported Rails department. +# Rails department has been extracted to RuboCop Rails gem. +# +# @deprecated This module is deprecated and will be removed by RuboCop 2.0. +# It will not be updated to `RuboCop::Cop::Base` v1 API to maintain compatibility +# with existing RuboCop Rails 2.8 or lower. +# +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/enforce_superclass.rb:15 +module RuboCop::Cop::EnforceSuperclass + # pkg:gem/rubocop#lib/rubocop/cop/mixin/enforce_superclass.rb:35 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/enforce_superclass.rb:39 + def on_send(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/mixin/enforce_superclass.rb:16 + def included(base); end + end +end + +# Common functionality for checking for a line break before the first +# element in a multi-line collection. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/first_element_line_break.rb:7 +module RuboCop::Cop::FirstElementLineBreak + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/first_element_line_break.rb:23 + def check_children_line_break(node, children, start = T.unsafe(nil), ignore_last: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/first_element_line_break.rb:10 + def check_method_line_break(node, children, ignore_last: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/first_element_line_break.rb:37 + def first_by_line(nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/first_element_line_break.rb:41 + def last_line(nodes, ignore_last:); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/first_element_line_break.rb:18 + def method_uses_parens?(node, limit); end +end + +# This class autocorrects `for` iteration to `#each` enumeration. +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:6 +class RuboCop::Cop::ForToEachCorrector + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:11 + def initialize(for_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:17 + def call(corrector); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:62 + def collection_end; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:25 + def collection_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:36 + def collection_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:27 + def correction; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:50 + def end_range; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:25 + def for_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:58 + def keyword_begin; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:44 + def requires_parentheses?; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:25 + def variable_node; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/correctors/for_to_each_corrector.rb:9 +RuboCop::Cop::ForToEachCorrector::CORRECTION = T.let(T.unsafe(nil), String) + +# This module encapsulates the ability to forbid certain identifiers in a cop. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_identifiers.rb:6 +module RuboCop::Cop::ForbiddenIdentifiers + # if a variable starts with a sigil it will be removed + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_identifiers.rb:9 + def forbidden_identifier?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_identifiers.rb:15 + def forbidden_identifiers; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_identifiers.rb:7 +RuboCop::Cop::ForbiddenIdentifiers::SIGILS = T.let(T.unsafe(nil), String) + +# This module encapsulates the ability to forbid certain patterns in a cop. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_pattern.rb:6 +module RuboCop::Cop::ForbiddenPattern + # pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_pattern.rb:7 + def forbidden_pattern?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_pattern.rb:15 + def forbidden_pattern_regexps; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/forbidden_pattern.rb:11 + def forbidden_patterns; end +end + +# A scaffold for concrete forces. +# +# pkg:gem/rubocop#lib/rubocop/cop/force.rb:6 +class RuboCop::Cop::Force + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:32 + def initialize(cops); end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:17 + def cops; end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:50 + def investigate(_processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:36 + def name; end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:40 + def run_hook(method_name, *args); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:19 + def all; end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:28 + def force_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:23 + def inherited(subclass); end + end +end + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cop/force.rb:8 +class RuboCop::Cop::Force::HookError < ::StandardError + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:11 + def initialize(joining_cop); end + + # pkg:gem/rubocop#lib/rubocop/cop/force.rb:9 + def joining_cop; end +end + +# Common functionality for dealing with frozen string literals. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:6 +module RuboCop::Cop::FrozenStringLiteral + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:41 + def frozen_heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:20 + def frozen_string_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:14 + def frozen_string_literal_comment_exists?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:77 + def frozen_string_literal_specified?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:71 + def frozen_string_literals_disabled?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:43 + def frozen_string_literals_enabled?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:87 + def leading_comment_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:83 + def leading_magic_comments; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:36 + def uninterpolated_heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:30 + def uninterpolated_string?(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:14 + def frozen_string_literal_comment_exists?; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:9 +RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/frozen_string_literal.rb:10 +RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES_RUBY27 = T.let(T.unsafe(nil), Array) + +# Common functionality for checking gem declarations. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/gem_declaration.rb:6 +module RuboCop::Cop::GemDeclaration + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/gem_declaration.rb:10 + def gem_declaration?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/add_runtime_dependency.rb:5 +module RuboCop::Cop::Gemspec; end + +# Prefer `add_dependency` over `add_runtime_dependency` as the latter is +# considered soft-deprecated. +# +# @example +# +# # bad +# Gem::Specification.new do |spec| +# spec.add_runtime_dependency('rubocop') +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_dependency('rubocop') +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/add_runtime_dependency.rb:21 +class RuboCop::Cop::Gemspec::AddRuntimeDependency < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/add_runtime_dependency.rb:28 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/add_runtime_dependency.rb:24 +RuboCop::Cop::Gemspec::AddRuntimeDependency::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/add_runtime_dependency.rb:26 +RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Use consistent style for Gemspec attributes assignment. +# +# @example +# +# # bad +# # This example uses two styles for assignment of metadata attribute. +# Gem::Specification.new do |spec| +# spec.metadata = { 'key' => 'value' } +# spec.metadata['another-key'] = 'another-value' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata['key'] = 'value' +# spec.metadata['another-key'] = 'another-value' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata = { 'key' => 'value', 'another-key' => 'another-value' } +# end +# +# # bad +# # This example uses two styles for assignment of authors attribute. +# Gem::Specification.new do |spec| +# spec.authors = %w[author-0 author-1] +# spec.authors[2] = 'author-2' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.authors = %w[author-0 author-1 author-2] +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.authors[0] = 'author-0' +# spec.authors[1] = 'author-1' +# spec.authors[2] = 'author-2' +# end +# +# # good +# # This example uses consistent assignment per attribute, +# # even though two different styles are used overall. +# Gem::Specification.new do |spec| +# spec.metadata = { 'key' => 'value' } +# spec.authors[0] = 'author-0' +# spec.authors[1] = 'author-1' +# spec.authors[2] = 'author-2' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/attribute_assignment.rb:57 +class RuboCop::Cop::Gemspec::AttributeAssignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::GemspecHelp + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/attribute_assignment.rb:62 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/attribute_assignment.rb:77 + def source_assignments(ast); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/attribute_assignment.rb:84 + def source_indexed_assignments(ast); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/attribute_assignment.rb:60 +RuboCop::Cop::Gemspec::AttributeAssignment::MSG = T.let(T.unsafe(nil), String) + +# Enforce that gem dependency version specifications or a commit reference (branch, +# ref, or tag) are either required or forbidden. +# +# @example EnforcedStyle: required (default) +# +# # bad +# Gem::Specification.new do |spec| +# spec.add_dependency 'parser' +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.add_development_dependency 'parser' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0' +# end +# +# @example EnforcedStyle: forbidden +# +# # bad +# Gem::Specification.new do |spec| +# spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0' +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_dependency 'parser' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_development_dependency 'parser' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:53 +class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::GemspecHelp + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:67 + def add_dependency_method_declaration?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:78 + def includes_commit_reference?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:73 + def includes_version_specification?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:82 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:118 + def add_dependency_method?(method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:96 + def allowed_gem?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:100 + def allowed_gems; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:132 + def forbidden_offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:138 + def forbidden_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:112 + def match_block_variable_name?(receiver_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:104 + def message(_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:122 + def offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:126 + def required_offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:142 + def required_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:146 + def version_specification?(expression); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:61 +RuboCop::Cop::Gemspec::DependencyVersion::ADD_DEPENDENCY_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:58 +RuboCop::Cop::Gemspec::DependencyVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:57 +RuboCop::Cop::Gemspec::DependencyVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:64 +RuboCop::Cop::Gemspec::DependencyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/dependency_version.rb:59 +RuboCop::Cop::Gemspec::DependencyVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) + +# Checks that deprecated attributes are not set in a gemspec file. +# Removing deprecated attributes allows the user to receive smaller packed gems. +# +# @example +# +# # bad +# Gem::Specification.new do |spec| +# spec.name = 'your_cool_gem_name' +# spec.test_files = Dir.glob('test/**/*') +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.name = 'your_cool_gem_name' +# spec.test_files += Dir.glob('test/**/*') +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.name = 'your_cool_gem_name' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:28 +class RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:35 + def gem_specification(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:43 + def on_block(block_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:85 + def format_message_from; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:63 + def node_and_method_name(node, attribute); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:71 + def use_deprecated_attributes?(node, block_parameter); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb:32 +RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment::MSG = T.let(T.unsafe(nil), String) + +# Enforce that development dependencies for a gem are specified in +# `Gemfile`, rather than in the `gemspec` using +# `add_development_dependency`. Alternatively, using `EnforcedStyle: +# gemspec`, enforce that all dependencies are specified in `gemspec`, +# rather than in `Gemfile`. +# +# @example EnforcedStyle: Gemfile (default) +# # Specify runtime dependencies in your gemspec, +# # but all other dependencies in your Gemfile. +# +# # bad +# # example.gemspec +# s.add_development_dependency "foo" +# +# # good +# # Gemfile +# gem "foo" +# +# # good +# # gems.rb +# gem "foo" +# +# # good (with AllowedGems: ["bar"]) +# # example.gemspec +# s.add_development_dependency "bar" +# +# @example EnforcedStyle: gems.rb +# # Specify runtime dependencies in your gemspec, +# # but all other dependencies in your Gemfile. +# # +# # Identical to `EnforcedStyle: Gemfile`, but with a different error message. +# # Rely on Bundler/GemFilename to enforce the use of `Gemfile` vs `gems.rb`. +# +# # bad +# # example.gemspec +# s.add_development_dependency "foo" +# +# # good +# # Gemfile +# gem "foo" +# +# # good +# # gems.rb +# gem "foo" +# +# # good (with AllowedGems: ["bar"]) +# # example.gemspec +# s.add_development_dependency "bar" +# +# @example EnforcedStyle: gemspec +# # Specify all dependencies in your gemspec. +# +# # bad +# # Gemfile +# gem "foo" +# +# # good +# # example.gemspec +# s.add_development_dependency "foo" +# +# # good (with AllowedGems: ["bar"]) +# # Gemfile +# gem "bar" +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:70 +class RuboCop::Cop::Gemspec::DevelopmentDependencies < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:77 + def add_development_dependency?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:82 + def gem?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:86 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:97 + def forbidden_gem?(gem_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:101 + def message(_range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:73 +RuboCop::Cop::Gemspec::DevelopmentDependencies::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/development_dependencies.rb:74 +RuboCop::Cop::Gemspec::DevelopmentDependencies::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# An attribute assignment method call should be listed only once +# in a gemspec. +# +# Assigning to an attribute with the same name using `spec.foo =` or +# `spec.attribute#[]=` will be an unintended usage. On the other hand, +# duplication of methods such as `spec.requirements`, +# `spec.add_runtime_dependency`, and others are permitted because it is +# the intended use of appending values. +# +# @example +# # bad +# Gem::Specification.new do |spec| +# spec.name = 'rubocop' +# spec.name = 'rubocop2' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.name = 'rubocop' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.requirements << 'libmagick, v6.0' +# spec.requirements << 'A good graphics card' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_dependency('parallel', '~> 1.10') +# spec.add_dependency('parser', '>= 2.3.3.1', '< 3.0') +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.metadata["key"] = "value" +# spec.metadata["key"] = "value" +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata["key"] = "value" +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:50 +class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::GemspecHelp + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:57 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:83 + def duplicated_assignment_method_nodes; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:91 + def duplicated_indexed_assignment_method_nodes; end + + # Assignments in separate `Gem::Specification.new` blocks are not duplicates of + # one another, so the enclosing specification is part of the grouping key. + # + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:104 + def enclosing_specification(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:98 + def indexed_assignment_key(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:66 + def process_assignment_method_nodes; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:74 + def process_indexed_assignment_method_nodes; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:108 + def register_offense(node, assignment, line_of_first_occurrence); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/duplicated_assignment.rb:54 +RuboCop::Cop::Gemspec::DuplicatedAssignment::MSG = T.let(T.unsafe(nil), String) + +# Dependencies in the gemspec should be alphabetically sorted. +# +# @example +# # bad +# spec.add_dependency 'rubocop' +# spec.add_dependency 'rspec' +# +# # good +# spec.add_dependency 'rspec' +# spec.add_dependency 'rubocop' +# +# # good +# spec.add_dependency 'rubocop' +# +# spec.add_dependency 'rspec' +# +# # bad +# spec.add_development_dependency 'rubocop' +# spec.add_development_dependency 'rspec' +# +# # good +# spec.add_development_dependency 'rspec' +# spec.add_development_dependency 'rubocop' +# +# # good +# spec.add_development_dependency 'rubocop' +# +# spec.add_development_dependency 'rspec' +# +# # bad +# spec.add_runtime_dependency 'rubocop' +# spec.add_runtime_dependency 'rspec' +# +# # good +# spec.add_runtime_dependency 'rspec' +# spec.add_runtime_dependency 'rubocop' +# +# # good +# spec.add_runtime_dependency 'rubocop' +# +# spec.add_runtime_dependency 'rspec' +# +# @example TreatCommentsAsGroupSeparators: true (default) +# # good +# # For code quality +# spec.add_dependency 'rubocop' +# # For tests +# spec.add_dependency 'rspec' +# +# @example TreatCommentsAsGroupSeparators: false +# # bad +# # For code quality +# spec.add_dependency 'rubocop' +# # For tests +# spec.add_dependency 'rspec' +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/ordered_dependencies.rb:61 +class RuboCop::Cop::Gemspec::OrderedDependencies < ::RuboCop::Cop::Base + include ::RuboCop::Cop::OrderedGemNode + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ordered_dependencies.rb:94 + def dependency_declarations(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ordered_dependencies.rb:69 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ordered_dependencies.rb:89 + def get_dependency_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ordered_dependencies.rb:83 + def previous_declaration(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/ordered_dependencies.rb:65 +RuboCop::Cop::Gemspec::OrderedDependencies::MSG = T.let(T.unsafe(nil), String) + +# Requires a gemspec to have `rubygems_mfa_required` metadata set. +# +# This setting tells RubyGems that MFA (Multi-Factor Authentication) is +# required for accounts to be able to perform privileged operations, such as +# (see RubyGems' documentation for the full list of privileged +# operations): +# +# * `gem push` +# * `gem yank` +# * `gem owner --add/remove` +# * adding or removing owners using gem ownership page +# +# This helps make your gem more secure, as users can be more +# confident that gem updates were pushed by maintainers. +# +# @example +# # bad +# Gem::Specification.new do |spec| +# # no `rubygems_mfa_required` metadata specified +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata = { +# 'rubygems_mfa_required' => 'true' +# } +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata['rubygems_mfa_required'] = 'true' +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.metadata = { +# 'rubygems_mfa_required' => 'false' +# } +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata = { +# 'rubygems_mfa_required' => 'true' +# } +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.metadata['rubygems_mfa_required'] = 'false' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.metadata['rubygems_mfa_required'] = 'true' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:63 +class RuboCop::Cop::Gemspec::RequireMFA < ::RuboCop::Cop::Base + include ::RuboCop::Cop::GemspecHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:70 + def metadata(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:78 + def metadata_assignment(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:95 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:86 + def rubygems_mfa_required(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:91 + def true_string?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:123 + def autocorrect(corrector, node, block_var, metadata); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:156 + def change_value(corrector, value); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:133 + def correct_metadata(corrector, metadata); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:141 + def insert_mfa_required(corrector, node, block_var); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:116 + def mfa_value(metadata_value); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/require_mfa.rb:67 +RuboCop::Cop::Gemspec::RequireMFA::MSG = T.let(T.unsafe(nil), String) + +# Checks that `required_ruby_version` in a gemspec file is set to a valid +# value (non-blank) and matches `TargetRubyVersion` as set in RuboCop's +# configuration for the gem. +# +# This ensures that RuboCop is using the same Ruby version as the gem. +# +# @example +# # When `TargetRubyVersion` of .rubocop.yml is `2.5`. +# +# # bad +# Gem::Specification.new do |spec| +# # no `required_ruby_version` specified +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.required_ruby_version = '>= 2.4.0' +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.required_ruby_version = '>= 2.6.0' +# end +# +# # bad +# Gem::Specification.new do |spec| +# spec.required_ruby_version = '' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.required_ruby_version = '>= 2.5.0' +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.required_ruby_version = '>= 2.5' +# end +# +# # accepted but not recommended +# Gem::Specification.new do |spec| +# spec.required_ruby_version = ['>= 2.5.0', '< 2.7.0'] +# end +# +# # accepted but not recommended, since +# # Ruby does not really follow semantic versioning +# Gem::Specification.new do |spec| +# spec.required_ruby_version = '~> 2.5' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:55 +class RuboCop::Cop::Gemspec::RequiredRubyVersion < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:68 + def defined_ruby_version(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:76 + def on_new_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:82 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:63 + def required_ruby_version?(param0); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:94 + def dynamic_version?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:100 + def extract_ruby_version(required_ruby_version); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:118 + def not_equal_message(required_ruby_version, target_ruby_version); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:60 +RuboCop::Cop::Gemspec::RequiredRubyVersion::MISSING_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:57 +RuboCop::Cop::Gemspec::RequiredRubyVersion::NOT_EQUAL_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/required_ruby_version.rb:56 +RuboCop::Cop::Gemspec::RequiredRubyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that `RUBY_VERSION` and `Ruby::VERSION` constants are not used in gemspec. +# Using `RUBY_VERSION` and `Ruby::VERSION` is dangerous because the value of the +# constant is determined by `rake release`. +# It's possible to have a dependency based on the Ruby version used +# to execute `rake release` and not the user's Ruby version. +# +# @example +# +# # bad +# Gem::Specification.new do |spec| +# if RUBY_VERSION >= '3.0' +# spec.add_dependency 'gem_a' +# else +# spec.add_dependency 'gem_b' +# end +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_dependency 'gem_a' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb:28 +class RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage < ::RuboCop::Cop::Base + include ::RuboCop::Cop::GemspecHelp + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb:41 + def on_const(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb:34 + def ruby_version?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb:49 + def gem_spec_with_ruby_version?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb:31 +RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage::MSG = T.let(T.unsafe(nil), String) + +# Common functionality for checking gem declarations. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/gemspec_help.rb:6 +module RuboCop::Cop::GemspecHelp + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/gemspec_help.rb:30 + def assignment_method_declarations(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/gemspec_help.rb:20 + def gem_specification(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/gemspec_help.rb:10 + def gem_specification?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/gemspec_help.rb:36 + def indexed_assignment_method_declarations(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/gemspec_help.rb:45 + def match_block_variable_name?(receiver_name); end +end + +# Source and spec generator for new cops +# +# This generator will take a cop name and generate a source file +# and spec file when given a valid qualified cop name. +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cop/generator.rb:10 +class RuboCop::Cop::Generator + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:119 + def initialize(name, output: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:139 + def inject_config(config_file_path: T.unsafe(nil), version_added: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:135 + def inject_require(root_file_path: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:152 + def todo; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:127 + def write_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:131 + def write_spec; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:166 + def badge; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:189 + def generate(template); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:181 + def generated_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:185 + def generated_spec; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:166 + def output; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:214 + def snake_case(camel_case_string); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:204 + def source_path; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:194 + def spec_path; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator.rb:168 + def write_unless_file_exists(path, contents); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/generator.rb:115 +RuboCop::Cop::Generator::CONFIGURATION_ADDED_MESSAGE = T.let(T.unsafe(nil), String) + +# A class that injects a require directive into the root RuboCop file. +# It looks for other directives that require files in the same (cop) +# namespace and injects the provided one in alpha +# +# pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:9 +class RuboCop::Cop::Generator::ConfigurationInjector + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:17 + def initialize(configuration_file_path:, badge:, version_added: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:24 + def inject; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:39 + def badge; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:41 + def configuration_entries; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:39 + def configuration_file_path; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:59 + def cop_name_line?(yaml); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:49 + def find_target_line; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:45 + def new_configuration_entry; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:39 + def output; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:39 + def version_added; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/generator/configuration_injector.rb:10 +RuboCop::Cop::Generator::ConfigurationInjector::TEMPLATE = T.let(T.unsafe(nil), String) + +# A class that injects a require directive into the root RuboCop file. +# It looks for other directives that require files in the same (cop) +# namespace and injects the provided one in alpha +# +# pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:9 +class RuboCop::Cop::Generator::RequireFileInjector + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:12 + def initialize(source_path:, root_file_path:, output: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:19 + def inject; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:64 + def injectable_require_directive; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:29 + def output; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:29 + def require_entries; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:31 + def require_exists?; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:68 + def require_path; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:58 + def require_path_fragments(require_directive); end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:29 + def root_file_path; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:29 + def source_path; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:39 + def target_line; end + + # pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:35 + def updated_directives; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/generator/require_file_injector.rb:10 +RuboCop::Cop::Generator::RequireFileInjector::REQUIRE_PATH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/generator.rb:11 +RuboCop::Cop::Generator::SOURCE_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/generator.rb:91 +RuboCop::Cop::Generator::SPEC_TEMPLATE = T.let(T.unsafe(nil), String) + +# Common functionality for checking hash alignment. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:6 +module RuboCop::Cop::HashAlignmentStyles; end + +# Handles calculation of deltas when the enforced style is 'key'. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:8 +class RuboCop::Cop::HashAlignmentStyles::KeyAlignment + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:9 + def checkable_layout?(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:20 + def deltas(first_pair, current_pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:13 + def deltas_for_first_pair(first_pair); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:34 + def separator_delta(pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:45 + def value_delta(pair); end +end + +# Handles calculation of deltas for `kwsplat` nodes. +# This is a special case that just ensures the kwsplat is aligned with the rest of the hash +# since a `kwsplat` does not have a key, separator or value. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:146 +class RuboCop::Cop::HashAlignmentStyles::KeywordSplatAlignment + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:147 + def deltas(first_pair, current_pair); end +end + +# Handles calculation of deltas when the enforced style is 'separator'. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:121 +class RuboCop::Cop::HashAlignmentStyles::SeparatorAlignment + include ::RuboCop::Cop::HashAlignmentStyles::ValueAlignment + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:124 + def deltas_for_first_pair(_first_pair); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:134 + def hash_rocket_delta(first_pair, current_pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:130 + def key_delta(first_pair, current_pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:138 + def value_delta(first_pair, current_pair); end +end + +# Handles calculation of deltas when the enforced style is 'table'. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:81 +class RuboCop::Cop::HashAlignmentStyles::TableAlignment + include ::RuboCop::Cop::HashAlignmentStyles::ValueAlignment + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:84 + def deltas_for_first_pair(first_pair); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:98 + def hash_rocket_delta(first_pair, current_pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:94 + def key_delta(first_pair, current_pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:115 + def max_delimiter_width(hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:111 + def max_key_width(hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:103 + def value_delta(first_pair, current_pair); end +end + +# Common functionality for checking alignment of hash values. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:56 +module RuboCop::Cop::HashAlignmentStyles::ValueAlignment + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:57 + def checkable_layout?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:61 + def deltas(first_pair, current_pair); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_alignment_styles.rb:71 + def separator_delta(first_pair, current_pair, key_delta); end +end + +# This module checks for Ruby 3.1's hash value omission syntax. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:7 +module RuboCop::Cop::HashShorthandSyntax + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:32 + def on_hash_for_mixed_shorthand(hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:44 + def on_pair(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:144 + def brackets?(method_dispatch_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:174 + def breakdown_value_types_of_hash(hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:121 + def def_node_that_require_parentheses(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:203 + def each_omittable_value_pair(hash_value_type_breakdown, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:199 + def each_omitted_value_pair(hash_value_type_breakdown, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:99 + def enforced_shorthand_syntax; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:136 + def find_ancestor_method_dispatch_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:186 + def hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:190 + def hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:194 + def ignore_explicit_omissible_hash_shorthand_syntax?(hash_value_type_breakdown); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:93 + def ignore_hash_shorthand_syntax?(pair_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:87 + def ignore_mixed_hash_shorthand_syntax?(hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:159 + def last_expression?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:207 + def mixed_shorthand_syntax_check(hash_value_type_breakdown); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:223 + def no_mixed_shorthand_syntax_check(hash_value_type_breakdown); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:67 + def register_offense(node, message, replacement); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:103 + def require_hash_value?(hash_key_source, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:112 + def require_hash_value_for_around_hash_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:167 + def requires_parentheses_context?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:148 + def use_element_of_hash_literal_as_receiver?(ancestor, parent); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:153 + def use_modifier_form_without_parenthesized_method_call?(ancestor); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:12 +RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_EXPLICIT_VALUE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:10 +RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_MSG_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:11 +RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_OMIT_VALUE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 +class RuboCop::Cop::HashShorthandSyntax::DefNode < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:23 + def first_argument; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:27 + def last_argument; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def node; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def node=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:15 + def selector; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:14 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:9 +RuboCop::Cop::HashShorthandSyntax::EXPLICIT_HASH_VALUE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_shorthand_syntax.rb:8 +RuboCop::Cop::HashShorthandSyntax::OMIT_HASH_VALUE_MSG = T.let(T.unsafe(nil), String) + +# Common functionality for Style/HashExcept and Style/HashSlice cops. +# It registers an offense on methods with blocks that are equivalent +# to Hash#except or Hash#slice. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:9 +module RuboCop::Cop::HashSubset + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:21 + def block_with_first_arg_check?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:47 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:36 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:181 + def decorate_source(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:197 + def except_key(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:168 + def except_key_source(key); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:160 + def extract_body_if_negated(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:59 + def extract_offense(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:69 + def extracts_hash_subset?(block); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:138 + def included?(body, negated); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:146 + def not_included?(body, negated); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:205 + def offense_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:55 + def preferred_method_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:95 + def range_include?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:150 + def safe_to_register_offense?(block, except_key); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:123 + def semantically_except_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:134 + def semantically_slice_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:51 + def semantically_subset_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:88 + def slices_key?(send_node, method, key_arg, value_arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:115 + def supported_subset_method?(method); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:193 + def to_single_quoted(string); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:107 + def using_value_variable?(send_node, value_arg); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:16 +RuboCop::Cop::HashSubset::ACTIVE_SUPPORT_SUBSET_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:18 +RuboCop::Cop::HashSubset::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:13 +RuboCop::Cop::HashSubset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_subset.rb:15 +RuboCop::Cop::HashSubset::SUBSET_METHODS = T.let(T.unsafe(nil), Array) + +# Common functionality for Style/HashTransformKeys and +# Style/HashTransformValues +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:5 +module RuboCop::Cop::HashTransformMethod + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:33 + def hash_receiver?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:41 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:58 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:51 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:136 + def execute_correction(corrector, node, correction); end + + # @abstract + # + # @return [Captures] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:111 + def extract_captures(_match); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:84 + def handle_possible_offense(node, match, match_desc); end + + # @abstract + # + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:118 + def new_method_name; end + + # @abstract Implemented with `def_node_matcher` + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:65 + def on_bad_each_with_object(_node); end + + # @abstract Implemented with `def_node_matcher` + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:70 + def on_bad_hash_brackets_map(_node); end + + # @abstract Implemented with `def_node_matcher` + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:75 + def on_bad_map_to_h(_node); end + + # @abstract Implemented with `def_node_matcher` + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:80 + def on_bad_to_h(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:122 + def prepare_correction(node); end +end + +# Internal helper class to hold autocorrect data +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 +class RuboCop::Cop::HashTransformMethod::Autocorrection < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def block_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def block_node=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def leading; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def leading=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def match; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def match=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:48 + def set_new_arg_name(transformed_argname, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:52 + def set_new_body_expression(transforming_body_expr, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:38 + def set_new_method_name(new_method_name, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:32 + def strip_prefix_and_suffix(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def trailing; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def trailing=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:8 + def from_each_with_object(node, match); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:12 + def from_hash_brackets_map(node, match); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:16 + def from_map_to_h(node, match); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:28 + def from_to_h(node, match); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method/autocorrection.rb:7 + def new(*_arg0); end + end +end + +# Internal helper class to hold match data +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 +class RuboCop::Cop::HashTransformMethod::Captures < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:16 + def noop_transformation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:21 + def transformation_uses_both_args?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def transformed_argname; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def transformed_argname=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def transforming_body_expr; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def transforming_body_expr=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def unchanged_body_expr; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def unchanged_body_expr=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:25 + def use_transformed_argname?; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:15 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/hash_transform_method.rb:12 +RuboCop::Cop::HashTransformMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Common functionality for working with heredoc strings. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:6 +module RuboCop::Cop::Heredoc + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:14 + def on_dstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:17 + def on_heredoc(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:9 + def on_str(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:15 + def on_xstr(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:28 + def delimiter_string(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:34 + def heredoc_type(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:23 + def indent_level(str); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/heredoc.rb:7 +RuboCop::Cop::Heredoc::OPENING_DELIMITER = T.let(T.unsafe(nil), Regexp) + +# This class autocorrects `if...then` structures to a multiline `if` statement +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:6 +class RuboCop::Cop::IfThenCorrector + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:9 + def initialize(if_node, indentation: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:14 + def call(corrector); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:50 + def branch_body_indentation; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:20 + def if_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:20 + def indentation; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:22 + def replacement(node = T.unsafe(nil), indentation = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:36 + def rewrite_else_branch(else_branch, indentation); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/correctors/if_then_corrector.rb:7 +RuboCop::Cop::IfThenCorrector::DEFAULT_INDENTATION_WIDTH = T.let(T.unsafe(nil), Integer) + +# @deprecated IgnoredMethods class has been replaced with AllowedMethods. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_methods.rb:46 +RuboCop::Cop::IgnoredMethods = RuboCop::Cop::AllowedMethods + +# Handles adding and checking ignored nodes. +# +# pkg:gem/rubocop#lib/rubocop/cop/ignored_node.rb:6 +module RuboCop::Cop::IgnoredNode + # pkg:gem/rubocop#lib/rubocop/cop/ignored_node.rb:7 + def ignore_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/ignored_node.rb:24 + def ignored_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/ignored_node.rb:11 + def part_of_ignored_node?(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/ignored_node.rb:31 + def ignored_nodes; end +end + +# @deprecated IgnoredPattern class has been replaced with AllowedPattern. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/allowed_pattern.rb:70 +RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern + +# Common functionality for checking integer nodes. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/integer_node.rb:6 +module RuboCop::Cop::IntegerNode + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/integer_node.rb:9 + def integer_part(node); end +end + +# Common functionality for working with string interpolations. +# +# @abstract Subclasses are expected to implement {#on_interpolation}. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/interpolation.rb:8 +module RuboCop::Cop::Interpolation + # pkg:gem/rubocop#lib/rubocop/cop/mixin/interpolation.rb:9 + def on_dstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/interpolation.rb:14 + def on_dsym(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/interpolation.rb:17 + def on_node_with_interpolations(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/interpolation.rb:15 + def on_regexp(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/interpolation.rb:13 + def on_xstr(node); end +end + +# This class autocorrects lambda literal to method notation. +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:6 +class RuboCop::Cop::LambdaLiteralToMethodCorrector + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:7 + def initialize(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:13 + def call(corrector); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:124 + def arg_to_unparenthesized_call?; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:34 + def arguments; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:108 + def arguments_begin_pos; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:104 + def arguments_end_pos; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:116 + def block_begin; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:112 + def block_end; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:34 + def block_node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:59 + def insert_arguments(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:43 + def insert_separating_space(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:88 + def lambda_arg_string; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:34 + def method; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:98 + def needs_separating_space?; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:53 + def remove_arguments(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:66 + def remove_leading_whitespace(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:74 + def remove_trailing_whitespace(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:36 + def remove_unparenthesized_whitespace(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:79 + def replace_delimiters(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:49 + def replace_selector(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:120 + def selector_end; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb:140 + def separating_space?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:5 +module RuboCop::Cop::Layout; end + +# Bare access modifiers (those not applying to specific methods) should be +# indented as deep as method definitions, or as deep as the `class`/`module` +# keyword, depending on configuration. +# +# @example EnforcedStyle: indent (default) +# # bad +# class Plumbus +# private +# def smooth; end +# end +# +# # good +# class Plumbus +# private +# def smooth; end +# end +# +# @example EnforcedStyle: outdent +# # bad +# class Plumbus +# private +# def smooth; end +# end +# +# # good +# class Plumbus +# private +# def smooth; end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:35 +class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:50 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:43 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:49 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:48 + def on_sclass(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:54 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:58 + def check_body(body, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:69 + def check_modifier(send_node, end_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:92 + def expected_indent_offset; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:88 + def message(range); end + + # An offset that is not expected, but correct if the configuration is + # changed. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:98 + def unexpected_indent_offset; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/access_modifier_indentation.rb:41 +RuboCop::Cop::Layout::AccessModifierIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks that the arguments on a multi-line method call are aligned. +# +# @example EnforcedStyle: with_first_argument (default) +# # good +# +# foo :bar, +# :baz, +# key: value +# +# foo( +# :bar, +# :baz, +# key: value +# ) +# +# # bad +# +# foo :bar, +# :baz, +# key: value +# +# foo( +# :bar, +# :baz, +# key: value +# ) +# +# @example EnforcedStyle: with_fixed_indentation +# # good +# +# foo :bar, +# :baz, +# key: value +# +# # bad +# +# foo :bar, +# :baz, +# key: value +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:45 +class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:63 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:54 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:91 + def arguments_or_first_arg_pairs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:79 + def arguments_with_last_arg_pairs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:107 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:67 + def autocorrect_incompatible_with_other_cops?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:123 + def base_column(node, first_argument); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:143 + def enforce_hash_argument_with_separator?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:115 + def fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:71 + def flattened_arguments(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:111 + def message(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:100 + def multiple_arguments?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:134 + def target_method_lineno(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:119 + def with_first_argument_style?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:49 +RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/argument_alignment.rb:51 +RuboCop::Cop::Layout::ArgumentAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) + +# Checks that the elements of a multi-line array literal are +# aligned. +# +# @example EnforcedStyle: with_first_element (default) +# # good +# +# array = [1, 2, 3, +# 4, 5, 6] +# array = ['run', +# 'forrest', +# 'run'] +# +# # bad +# +# array = [1, 2, 3, +# 4, 5, 6] +# array = ['run', +# 'forrest', +# 'run'] +# +# @example EnforcedStyle: with_fixed_indentation +# # good +# +# array = [1, 2, 3, +# 4, 5, 6] +# +# # bad +# +# array = [1, 2, 3, +# 4, 5, 6] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:36 +class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:46 + def on_array(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:55 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:67 + def base_column(node, args); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:63 + def fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:59 + def message(_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:78 + def target_method_lineno(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:40 +RuboCop::Cop::Layout::ArrayAlignment::ALIGN_ELEMENTS_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/array_alignment.rb:43 +RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of the first line of the +# right-hand-side of a multi-line assignment. +# +# The indentation of the remaining lines can be corrected with +# other cops such as `Layout/IndentationConsistency` and `Layout/EndAlignment`. +# +# @example +# # bad +# value = +# if foo +# 'bar' +# end +# +# # good +# value = +# if foo +# 'bar' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/assignment_indentation.rb:25 +class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CheckAssignment + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/assignment_indentation.rb:43 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/assignment_indentation.rb:34 + def check_assignment(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/assignment_indentation.rb:47 + def leftmost_multiple_assignment(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/assignment_indentation.rb:30 +RuboCop::Cop::Layout::AssignmentIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks whether the end keyword of `begin` is aligned properly. +# +# Two modes are supported through the `EnforcedStyleAlignWith` configuration +# parameter. If it's set to `start_of_line` (which is the default), the +# `end` shall be aligned with the start of the line where the `begin` +# keyword is. If it's set to `begin`, the `end` shall be aligned with the +# `begin` keyword. +# +# `Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`) +# by default. On the other hand, `||= begin` that this cop targets tends to +# align with the start of the line, it defaults to `EnforcedStyleAlignWith: start_of_line`. +# These styles can be configured by each cop. +# +# @example EnforcedStyleAlignWith: start_of_line (default) +# # bad +# foo ||= begin +# do_something +# end +# +# # good +# foo ||= begin +# do_something +# end +# +# @example EnforcedStyleAlignWith: begin +# # bad +# foo ||= begin +# do_something +# end +# +# # good +# foo ||= begin +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/begin_end_alignment.rb:41 +class RuboCop::Cop::Layout::BeginEndAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::EndKeywordAlignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/begin_end_alignment.rb:47 + def on_kwbegin(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/begin_end_alignment.rb:62 + def alignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/begin_end_alignment.rb:58 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/begin_end_alignment.rb:53 + def check_begin_alignment(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/begin_end_alignment.rb:45 +RuboCop::Cop::Layout::BeginEndAlignment::MSG = T.let(T.unsafe(nil), String) + +# Checks whether the end keywords are aligned properly for do +# end blocks. +# +# Three modes are supported through the `EnforcedStyleAlignWith` +# configuration parameter: +# +# `start_of_block` : the `end` shall be aligned with the +# start of the line where the `do` appeared. +# +# `start_of_line` : the `end` shall be aligned with the +# start of the line where the expression started. +# +# `either` (which is the default) : the `end` is allowed to be in either +# location. The autocorrect will default to `start_of_line`. +# +# When the `do` or `{` appears on a continuation line of multiline +# method arguments, the start of the line where the method is called +# is used as the alignment target instead of that continuation line. +# +# @example EnforcedStyleAlignWith: either (default) +# # bad +# +# foo.bar +# .each do +# baz +# end +# +# # good +# +# foo.bar +# .each do +# baz +# end +# +# @example EnforcedStyleAlignWith: start_of_block +# # bad +# +# foo.bar +# .each do +# baz +# end +# +# # good +# +# foo.bar +# .each do +# baz +# end +# +# @example EnforcedStyleAlignWith: start_of_line +# # bad +# +# foo.bar +# .each do +# baz +# end +# +# # good +# +# foo.bar +# .each do +# baz +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:70 +class RuboCop::Cop::Layout::BlockAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:78 + def block_end_align_target?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:88 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:93 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:92 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:95 + def style_parameter_name; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:263 + def add_space_before(corrector, loc, delta); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:240 + def alt_start_msg(start_loc, source_line_column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:151 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:101 + def block_end_align_target(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:119 + def check_block_alignment(start_node, block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:202 + def compute_do_source_line_column(node, end_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:255 + def compute_start_col(ancestor_node, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:115 + def disqualified_parent?(parent, node); end + + # When the `do` or `{` is on a continuation line of multiline method + # arguments, the indentation of that line is not a meaningful + # alignment target; anchor on the method dispatch position instead. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:276 + def do_line_anchor_loc(node, do_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:285 + def do_line_begins_inside_argument?(node, do_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:111 + def end_align_target?(node, parent); end + + # In offense message, we want to show the assignment LHS rather than + # the entire assignment. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:197 + def find_lhs_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:168 + def format_message(start_loc, end_loc, do_source_line_column, error_source_line_column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:250 + def format_source_line_column(source_line_column); end + + # The continuation line indentation is only an unmeaningful alignment target when + # it is dictated by an opening delimiter, i.e. the line begins inside `(` or `[`. + # For a bare argument list without parentheses the indentation is the author's + # deliberate alignment, so the anchor must not move to the method dispatch line. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:301 + def inside_parentheses?(node, pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:232 + def loc_to_source_line_column(loc); end + + # `end` aligned with an argument continuation line that holds the `do` + # was accepted before the anchor moved to the method dispatch line; + # keep accepting it so that such code does not become an offense. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:226 + def permitted_do_line_columns(do_loc, indentation_of_do_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:133 + def register_offense(block_node, start_loc, end_loc, do_source_line_column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:267 + def remove_space_before(corrector, end_pos, delta); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:178 + def start_for_block_node(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:185 + def start_for_line_node(block_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/block_alignment.rb:75 +RuboCop::Cop::Layout::BlockAlignment::MSG = T.let(T.unsafe(nil), String) + +# Checks whether the end statement of a do..end block +# is on its own line. +# +# @example +# # bad +# blah do |i| +# foo(i) end +# +# # good +# blah do |i| +# foo(i) +# end +# +# # bad +# blah { |i| +# foo(i) } +# +# # good +# blah { |i| +# foo(i) +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:27 +class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:33 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:46 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:45 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:67 + def last_heredoc_argument(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:63 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:77 + def offense_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:50 + def register_offense(node, offense_range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/block_end_newline.rb:31 +RuboCop::Cop::Layout::BlockEndNewline::MSG = T.let(T.unsafe(nil), String) + +# Checks how the `when` and ``in``s of a `case` expression +# are indented in relation to its `case` or `end` keyword. +# +# It will register a separate offense for each misaligned `when` and `in`. +# +# @example +# # If Layout/EndAlignment is set to keyword style (default) +# # *case* and *end* should always be aligned to same depth, +# # and therefore *when* should always be aligned to both - +# # regardless of configuration. +# +# # bad for all styles +# case n +# when 0 +# x * 2 +# else +# y / 3 +# end +# +# case n +# in pattern +# x * 2 +# else +# y / 3 +# end +# +# # good for all styles +# case n +# when 0 +# x * 2 +# else +# y / 3 +# end +# +# case n +# in pattern +# x * 2 +# else +# y / 3 +# end +# +# @example EnforcedStyle: case (default) +# # if EndAlignment is set to other style such as +# # start_of_line (as shown below), then *when* alignment +# # configuration does have an effect. +# +# # bad +# a = case n +# when 0 +# x * 2 +# else +# y / 3 +# end +# +# a = case n +# in pattern +# x * 2 +# else +# y / 3 +# end +# +# # good +# a = case n +# when 0 +# x * 2 +# else +# y / 3 +# end +# +# a = case n +# in pattern +# x * 2 +# else +# y / 3 +# end +# +# @example EnforcedStyle: end +# # bad +# a = case n +# when 0 +# x * 2 +# else +# y / 3 +# end +# +# a = case n +# in pattern +# x * 2 +# else +# y / 3 +# end +# +# # good +# a = case n +# when 0 +# x * 2 +# else +# y / 3 +# end +# +# a = case n +# in pattern +# x * 2 +# else +# y / 3 +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:112 +class RuboCop::Cop::Layout::CaseIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:120 + def on_case(case_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:127 + def on_case_match(case_match_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:195 + def base_column(case_node, base); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:152 + def check_when(when_node, branch_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:184 + def detect_incorrect_style(when_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:138 + def end_and_last_conditional_same_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:148 + def enforced_style_end?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:171 + def incorrect_style(when_node, branch_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:163 + def indent_one_step?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:167 + def indentation_width; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:209 + def replacement(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:202 + def whitespace_range(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/case_indentation.rb:118 +RuboCop::Cop::Layout::CaseIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks if the code style follows the `ExpectedOrder` configuration: +# +# `Categories` allows us to map macro names into a category. +# +# Consider an example of code style that covers the following order: +# +# * Module inclusion (`include`, `prepend`, `extend`) +# * Constants +# * Associations (`has_one`, `has_many`) +# * Public attribute macros (`attr_accessor`, `attr_writer`, `attr_reader`) +# * Other macros (`validates`, `validate`) +# * Public class methods +# * Initializer +# * Public instance methods +# * Protected attribute macros (`attr_accessor`, `attr_writer`, `attr_reader`) +# * Protected instance methods +# * Private attribute macros (`attr_accessor`, `attr_writer`, `attr_reader`) +# * Private instance methods +# +# NOTE: Simply enabling the cop with `Enabled: true` will not use +# the example order shown below. +# To enforce the order of macros like `attr_reader`, +# you must define both `ExpectedOrder` *and* `Categories`. +# +# You can configure the following order: +# +# [source,yaml] +# ---- +# Layout/ClassStructure: +# ExpectedOrder: +# - module_inclusion +# - constants +# - association +# - public_attribute_macros +# - public_delegate +# - macros +# - public_class_methods +# - initializer +# - public_methods +# - protected_attribute_macros +# - protected_methods +# - private_attribute_macros +# - private_delegate +# - private_methods +# ---- +# +# Instead of putting all literals in the expected order, it is also +# possible to group categories of macros. Visibility levels are handled +# automatically. +# +# [source,yaml] +# ---- +# Layout/ClassStructure: +# Categories: +# association: +# - has_many +# - has_one +# attribute_macros: +# - attr_accessor +# - attr_reader +# - attr_writer +# macros: +# - validates +# - validate +# module_inclusion: +# - include +# - prepend +# - extend +# ---- +# +# If you only set `ExpectedOrder` +# without defining `Categories`, +# macros such as `attr_reader` or `has_many` +# will not be recognized as part of a category, and their order will not be validated. +# For example, the following will NOT raise any offenses, even if the order is incorrect: +# +# [source,yaml] +# ---- +# Layout/ClassStructure: +# Enabled: true +# ExpectedOrder: +# - public_attribute_macros +# - initializer +# ---- +# +# To make it work as expected, you must also specify `Categories` like this: +# +# [source,yaml] +# ---- +# Layout/ClassStructure: +# ExpectedOrder: +# - public_attribute_macros +# - initializer +# Categories: +# attribute_macros: +# - attr_reader +# - attr_writer +# - attr_accessor +# ---- +# +# @safety +# Autocorrection is unsafe because class methods and module inclusion +# can behave differently, based on which methods or constants have +# already been defined. +# +# Constants will only be moved when they are assigned with literals. +# +# @example +# # bad +# # Expect extend be before constant +# class Person < ApplicationRecord +# has_many :orders +# ANSWER = 42 +# +# extend SomeModule +# include AnotherModule +# end +# +# # good +# class Person +# # extend and include go first +# extend SomeModule +# include AnotherModule +# +# # inner classes +# CustomError = Class.new(StandardError) +# +# # constants are next +# SOME_CONSTANT = 20 +# +# # afterwards we have public attribute macros +# attr_reader :name +# +# # followed by other macros (if any) +# validates :name +# +# # then we have public delegate macros +# delegate :to_s, to: :name +# +# # public class methods are next in line +# def self.some_method +# end +# +# # initialization goes between class methods and instance methods +# def initialize +# end +# +# # followed by other public instance methods +# def some_method +# end +# +# # protected attribute macros and methods go next +# protected +# +# attr_reader :protected_name +# +# def some_protected_method +# end +# +# # private attribute macros, delegate macros and methods +# # are grouped near the end +# private +# +# attr_reader :private_name +# +# delegate :some_private_delegate, to: :name +# +# def some_private_method +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:177 +class RuboCop::Cop::Layout::ClassStructure < ::RuboCop::Cop::Base + include ::RuboCop::Cop::VisibilityHelp + include ::RuboCop::Cop::CommentsHelp + extend ::RuboCop::Cop::AutoCorrector + + # Validates code style on class declaration. + # Add offense when find a node out of expected order. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:193 + def on_class(class_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:204 + def on_sclass(class_node); end + + private + + # Autocorrect by swapping between two nodes autocorrecting them + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:209 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:351 + def begin_pos_with_comment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:374 + def buffer; end + + # Setting categories hash allow you to group methods in group to match + # in the {expected_order}. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:386 + def categories; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:276 + def class_elements(class_node); end + + # Classifies a node to match with something in the {expected_order} + # @param node to be analysed + # @return String when the node type is a `:block` then + # {classify} recursively with the first children + # @return String when the node type is a `:send` then {find_send_node_category} + # by method name + # @return String otherwise trying to {humanize_node} of the current node + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:229 + def classify(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:317 + def dynamic_constant?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:341 + def end_position_for(node); end + + # Load expected order from `ExpectedOrder` config. + # Define new terms in the expected order by adding new {categories}. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:380 + def expected_order; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:261 + def find_category(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:370 + def find_heredoc(node); end + + # Categorize a node according to the {expected_order} + # Try to match {categories} values against the node's method_name given + # also its visibility. + # @param node to be analysed. + # @return [String] with the key category or the `method_name` as string + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:248 + def find_send_node_category(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:308 + def humanize_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:292 + def ignore?(node, classification); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:299 + def ignore_for_autocorrect?(node, sibling); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:335 + def marked_as_private_constant?(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:325 + def private_constant?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:366 + def start_line_position(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:267 + def walk_over_nested_class_definition(class_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:362 + def whole_line_comment_at_line?(line); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:182 +RuboCop::Cop::Layout::ClassStructure::HUMANIZED_NODE_TYPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/class_structure.rb:189 +RuboCop::Cop::Layout::ClassStructure::MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of here document closings. +# +# @example +# +# # bad +# class Foo +# def bar +# <<~SQL +# 'Hi' +# SQL +# end +# end +# +# # good +# class Foo +# def bar +# <<~SQL +# 'Hi' +# SQL +# end +# end +# +# # bad +# +# # heredoc contents is before closing heredoc. +# foo arg, +# <<~EOS +# Hi +# EOS +# +# # good +# foo arg, +# <<~EOS +# Hi +# EOS +# +# # good +# foo arg, +# <<~EOS +# Hi +# EOS +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:48 +class RuboCop::Cop::Layout::ClosingHeredocIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Heredoc + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:57 + def on_heredoc(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:74 + def argument_indentation_correct?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:82 + def closing_indentation(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:101 + def find_node_used_heredoc_argument(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:90 + def heredoc_closing(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:86 + def heredoc_opening(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:117 + def indent_level(source_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:94 + def indented_end(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:109 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:70 + def opening_indentation(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:53 +RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:54 +RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG_ARG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_heredoc_indentation.rb:52 +RuboCop::Cop::Layout::ClosingHeredocIndentation::SIMPLE_HEREDOC = T.let(T.unsafe(nil), String) + +# Checks the indentation of hanging closing parentheses in +# method calls, method definitions, and grouped expressions. A hanging +# closing parenthesis means `)` preceded by a line break. +# +# @example +# +# # bad +# some_method( +# a, +# b +# ) +# +# some_method( +# a, b +# ) +# +# some_method(a, b, c +# ) +# +# some_method(a, +# b, +# c +# ) +# +# some_method(a, +# x: 1, +# y: 2 +# ) +# +# # Scenario 1: When First Parameter Is On Its Own Line +# +# # good: when first param is on a new line, right paren is *always* +# # outdented by IndentationWidth +# some_method( +# a, +# b +# ) +# +# # good +# some_method( +# a, b +# ) +# +# # Scenario 2: When First Parameter Is On The Same Line +# +# # good: when all other params are also on the same line, outdent +# # right paren by IndentationWidth +# some_method(a, b, c +# ) +# +# # good: when all other params are on multiple lines, but are lined +# # up, align right paren with left paren +# some_method(a, +# b, +# c +# ) +# +# # good: when other params are not lined up on multiple lines, outdent +# # right paren by IndentationWidth +# some_method(a, +# x: 1, +# y: 2 +# ) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:71 +class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:84 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:82 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:88 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:91 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:79 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:157 + def all_elements_aligned?(elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:95 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:99 + def check(node, elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:107 + def check_for_elements(node, elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:125 + def check_for_no_elements(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:171 + def correct_column_candidates(node, left_paren); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:144 + def expected_column(left_paren, elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:167 + def first_argument_line(elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:187 + def line_break_after_left_paren?(left_paren, elements); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:179 + def message(correct_column, left_paren, right_paren); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:77 +RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/closing_parenthesis_indentation.rb:75 +RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) + +# Checks the indentation of comments. +# +# @example +# # bad +# # comment here +# def method_name +# end +# +# # comment here +# a = 'hello' +# +# # yet another comment +# if true +# true +# end +# +# # good +# # comment here +# def method_name +# end +# +# # comment here +# a = 'hello' +# +# # yet another comment +# if true +# true +# end +# +# @example AllowForAlignment: false (default) +# # bad +# a = 1 # A really long comment +# # spanning two lines. +# +# # good +# # A really long comment spanning one line. +# a = 1 +# +# @example AllowForAlignment: true +# # good +# a = 1 # A really long comment +# # spanning two lines. +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:48 +class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:55 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:61 + def autocorrect(corrector, comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:88 + def autocorrect_one(corrector, comment); end + + # Corrects all comment lines that occur immediately before the given + # comment and have the same indentation. This is to avoid a long chain + # of correcting, saving the file, parsing and inspecting again, and + # then correcting one more line, and so on. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:71 + def autocorrect_preceding_comments(corrector, comment); end + + # Only a bare access modifier (the keyword alone on its line) is outdented by + # `Layout/AccessModifierIndentation`. An inline modifier such as `private def foo` + # keeps the regular method indentation, so a comment above it must not be pushed + # one level deeper. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:165 + def bare_access_modifier?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:92 + def check(comment, comment_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:145 + def correct_indentation(next_line); end + + # Returns true if: + # a) the cop is configured to allow extra indentation for alignment, and + # b) the currently inspected comment is aligned with the nearest preceding end-of-line + # comment. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:121 + def correctly_aligned_with_preceding_comment?(comment_index, column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:156 + def less_indented?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:140 + def line_after_comment(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:131 + def message(column, correct_comment_indentation); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:135 + def own_line_comment?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:82 + def should_correct?(preceding_comment, reference_comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:169 + def two_alternatives?(line); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/comment_indentation.rb:52 +RuboCop::Cop::Layout::CommentIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks for conditions that are not on the same line as +# if/while/until. +# +# @example +# +# # bad +# if +# some_condition +# do_something +# end +# +# # good +# if some_condition +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:21 +class RuboCop::Cop::Layout::ConditionPosition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:27 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:36 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:33 + def on_while(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:40 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:52 + def message(condition); end + + # When a body statement shares the condition's line (e.g. `while\n cond; body\nend`), + # removing the whole line would delete the body too. In that case only remove the + # condition and its trailing separator, preserving the body statement. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:59 + def removal_range(node, condition); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/condition_position.rb:25 +RuboCop::Cop::Layout::ConditionPosition::MSG = T.let(T.unsafe(nil), String) + +# Checks whether the end keywords of method definitions are +# aligned properly. +# +# Two modes are supported through the EnforcedStyleAlignWith configuration +# parameter. If it's set to `start_of_line` (which is the default), the +# `end` shall be aligned with the start of the line where the `def` +# keyword is. If it's set to `def`, the `end` shall be aligned with the +# `def` keyword. +# +# @example EnforcedStyleAlignWith: start_of_line (default) +# # bad +# +# private def foo +# end +# +# # good +# +# private def foo +# end +# +# @example EnforcedStyleAlignWith: def +# # bad +# +# private def foo +# end +# +# # good +# +# private def foo +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/def_end_alignment.rb:36 +class RuboCop::Cop::Layout::DefEndAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::EndKeywordAlignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/def_end_alignment.rb:43 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/def_end_alignment.rb:46 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/def_end_alignment.rb:48 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/def_end_alignment.rb:63 + def autocorrect(corrector, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/def_end_alignment.rb:41 +RuboCop::Cop::Layout::DefEndAlignment::MSG = T.let(T.unsafe(nil), String) + +# Checks the . position in multi-line method calls. +# +# @example EnforcedStyle: leading (default) +# # bad +# something. +# method +# +# # good +# something +# .method +# +# @example EnforcedStyle: trailing +# # bad +# something +# .method +# +# # good +# something. +# method +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:25 +class RuboCop::Cop::Layout::DotPosition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:45 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:34 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:49 + def autocorrect(corrector, dot, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:99 + def correct_dot_position_style?(dot_line, selector_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:126 + def end_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:122 + def heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:114 + def last_heredoc_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:95 + def line_between?(first_line, second_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:64 + def message(dot); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:74 + def proper_dot_position?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:106 + def receiver_end_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:130 + def selector_range(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/dot_position.rb:30 + def autocorrect_incompatible_with; end + end +end + +# Checks the alignment of else keywords. Normally they should +# be aligned with an if/unless/while/until/begin/def/rescue keyword, but there +# are special cases when they should follow the same rules as the +# alignment of end. +# +# @example +# # bad +# if something +# code +# else +# code +# end +# +# # bad +# if something +# code +# elsif something +# code +# end +# +# # good +# if something +# code +# else +# code +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:32 +class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::EndKeywordAlignment + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::CheckAssignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:57 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:63 + def on_case_match(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:40 + def on_if(node, base = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:51 + def on_rescue(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:71 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:100 + def base_for_method_definition(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:80 + def base_range_of_if(node, base); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:89 + def base_range_of_rescue(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:125 + def check_alignment(base_range, else_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:109 + def check_assignment(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:75 + def check_nested(node, base); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/else_alignment.rb:38 +RuboCop::Cop::Layout::ElseAlignment::MSG = T.let(T.unsafe(nil), String) + +# Checks empty comment. +# +# @example +# # bad +# +# # +# class Foo +# end +# +# # good +# +# # +# # Description of `Foo` class. +# # +# class Foo +# end +# +# @example AllowBorderComment: true (default) +# # good +# +# def foo +# end +# +# ################# +# +# def bar +# end +# +# @example AllowBorderComment: false +# # bad +# +# def foo +# end +# +# ################# +# +# def bar +# end +# +# @example AllowMarginComment: true (default) +# # good +# +# # +# # Description of `Foo` class. +# # +# class Foo +# end +# +# @example AllowMarginComment: false +# # bad +# +# # +# # Description of `Foo` class. +# # +# class Foo +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:63 +class RuboCop::Cop::Layout::EmptyComment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:69 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:132 + def allow_border_comment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:136 + def allow_margin_comment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:97 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:128 + def comment_text(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:107 + def concat_consecutive_comments(comments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:118 + def empty_comment_only?(comment_text); end + + # A comment is inline when code precedes it on the same line. Detecting this + # from the source (rather than the token stream) is required because, for a + # comment trailing a heredoc opener, the preceding token is the heredoc end on + # a later line, which would wrongly trigger whole-line removal of the opener. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:144 + def inline_comment?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:85 + def investigate(comments); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_comment.rb:67 +RuboCop::Cop::Layout::EmptyComment::MSG = T.let(T.unsafe(nil), String) + +# Enforces empty line after guard clause. +# +# This cop allows a SimpleCov directive comment after guard clause because +# SimpleCov excludes code from the coverage report by wrapping it in such directives. +# Both the legacy `# :nocov:` comment and the newer `# simplecov:disable` / +# `# simplecov:enable` comments are recognized: +# +# [source,ruby] +# ---- +# def foo +# # :nocov: +# return if condition +# # :nocov: +# bar +# end +# +# def foo +# # simplecov:disable +# return if condition +# # simplecov:enable +# bar +# end +# ---- +# +# Refer to SimpleCov's documentation for more details: +# https://github.com/simplecov-ruby/simplecov#ignoringskipping-code +# +# @example +# +# # bad +# def foo +# return if need_return? +# bar +# end +# +# # good +# def foo +# return if need_return? +# +# bar +# end +# +# # good +# def foo +# return if something? +# return if something_different? +# +# bar +# end +# +# # also good +# def foo +# if something? +# do_something +# return if need_return? +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:63 +class RuboCop::Cop::Layout::EmptyLineAfterGuardClause < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::PathUtil + extend ::RuboCop::Cop::Util + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:73 + def guard_clause_branch?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:77 + def on_if(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:98 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:120 + def contains_guard_clause?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:113 + def correct_style?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:200 + def heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:193 + def heredoc_line(node, heredoc_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:165 + def last_heredoc_argument(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:181 + def last_heredoc_argument_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:218 + def multiple_statements_on_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:137 + def next_line_allowed_directive_comment?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:133 + def next_line_empty?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:126 + def next_line_empty_or_allowed_directive_comment?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:143 + def next_line_rescue_or_ensure?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:157 + def next_sibling_empty_or_guard_clause?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:148 + def next_sibling_parent_empty_or_else?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:210 + def offense_location(node); end + + # SimpleCov excludes code from the coverage report by wrapping it in directive comments: + # https://github.com/simplecov-ruby/simplecov#ignoringskipping-code + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:227 + def simplecov_directive_comment?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:204 + def use_heredoc_in_condition?(condition); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:69 +RuboCop::Cop::Layout::EmptyLineAfterGuardClause::END_OF_HEREDOC_LINE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:68 +RuboCop::Cop::Layout::EmptyLineAfterGuardClause::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_guard_clause.rb:70 +RuboCop::Cop::Layout::EmptyLineAfterGuardClause::SIMPLECOV_COMMENT_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Checks for a newline after the final magic comment. +# +# @example +# # good +# +# # Some documentation for Person +# class Person +# # Some code +# end +# +# # bad +# # Some documentation for Person +# class Person +# # Some code +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_magic_comment.rb:23 +class RuboCop::Cop::Layout::EmptyLineAfterMagicComment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_magic_comment.rb:29 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_magic_comment.rb:61 + def comments_before_code(source); end + + # Find the last magic comment in the source file. + # + # Take all comments that precede the first line of code (or just take + # them all in the case when there is no code), select the + # magic comments, and return the last magic comment in the file. + # + # @return [Parser::Source::Comment] if magic comments exist before code + # @return [nil] otherwise + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_magic_comment.rb:55 + def last_magic_comment(source); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_magic_comment.rb:43 + def offending_range(last_magic_comment); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_magic_comment.rb:27 +RuboCop::Cop::Layout::EmptyLineAfterMagicComment::MSG = T.let(T.unsafe(nil), String) + +# Enforces empty line after multiline condition. +# +# @example +# # bad +# if multiline && +# condition +# do_something +# end +# +# # good +# if multiline && +# condition +# +# do_something +# end +# +# # bad +# case x +# when foo, +# bar +# do_something +# end +# +# # good +# case x +# when foo, +# bar +# +# do_something +# end +# +# # bad +# begin +# do_something +# rescue FooError, +# BarError +# handle_error +# end +# +# # good +# begin +# do_something +# rescue FooError, +# BarError +# +# handle_error +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:54 +class RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:82 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:60 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:93 + def on_rescue(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:73 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:80 + def on_until_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:70 + def on_while(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:75 + def on_while_post(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:127 + def autocorrect(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:105 + def check_condition(condition); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:120 + def multiline_rescue_exceptions?(exception_nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:116 + def multiline_when_condition?(when_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:112 + def next_line_empty?(line); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb:58 +RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition::MSG = T.let(T.unsafe(nil), String) + +# Checks whether class/module/method definitions are +# separated by one or more empty lines. +# +# `NumberOfEmptyLines` can be an integer (default is 1) or +# an array (e.g. [1, 2]) to specify a minimum and maximum +# number of empty lines permitted. +# +# `AllowAdjacentOneLineDefs` configures whether adjacent +# one-line definitions are considered an offense. +# +# @example EmptyLineBetweenMethodDefs: true (default) +# # checks for empty lines between method definitions. +# +# # bad +# def a +# end +# def b +# end +# +# # good +# def a +# end +# +# def b +# end +# +# @example EmptyLineBetweenClassDefs: true (default) +# # checks for empty lines between class definitions. +# +# # bad +# class A +# end +# class B +# end +# def b +# end +# +# # good +# class A +# end +# +# class B +# end +# +# def b +# end +# +# @example EmptyLineBetweenModuleDefs: true (default) +# # checks for empty lines between module definitions. +# +# # bad +# module A +# end +# module B +# end +# def b +# end +# +# # good +# module A +# end +# +# module B +# end +# +# def b +# end +# +# @example AllowAdjacentOneLineDefs: true (default) +# +# # good +# class ErrorA < BaseError; end +# class ErrorB < BaseError; end +# +# # good +# class ErrorA < BaseError; end +# +# class ErrorB < BaseError; end +# +# # good - DefLikeMacros: [memoize] +# memoize :attribute_a +# memoize :attribute_b +# +# # good +# memoize :attribute_a +# +# memoize :attribute_b +# +# @example AllowAdjacentOneLineDefs: false +# +# # bad +# class ErrorA < BaseError; end +# class ErrorB < BaseError; end +# +# # good +# class ErrorA < BaseError; end +# +# class ErrorB < BaseError; end +# +# # bad - DefLikeMacros: [memoize] +# memoize :attribute_a +# memoize :attribute_b +# +# # good +# memoize :attribute_a +# +# memoize :attribute_b +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:114 +class RuboCop::Cop::Layout::EmptyLineBetweenDefs < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:151 + def autocorrect(corrector, prev_def, node, count); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:136 + def check_defs(nodes); end + + # We operate on `begin` nodes, instead of using `OnMethodDef`, + # so that we can walk over pairs of consecutive nodes and + # efficiently access a node's predecessor; #prev_node ends up + # doing a linear scan over siblings, so we don't want to call + # it on each def. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:129 + def on_begin(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:318 + def allowance_range?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:300 + def autocorrect_insert_lines(corrector, newline_pos, count); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:293 + def autocorrect_remove_lines(corrector, newline_pos, count); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:242 + def blank_lines_count_between(first_def_node, second_def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:180 + def candidate?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:206 + def class_candidate?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:272 + def def_end(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:170 + def def_location(correction_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:262 + def def_start(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:187 + def empty_line_between_macros; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:276 + def end_loc(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:220 + def expected_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:238 + def line_count_allowed?(count); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:254 + def lines_between_defs(first_def_node, second_def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:191 + def macro_candidate?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:250 + def maximum_empty_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:214 + def message(node, count: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:202 + def method_candidate?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:246 + def minimum_empty_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:210 + def module_candidate?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:229 + def multiple_blank_lines_groups?(first_def_node, second_def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:307 + def node_type(node); end + + # For an endless method whose body is a heredoc (e.g. `def a = <<~TEXT`), the + # node's source range ends at the heredoc opening line, before the heredoc body. + # Use the heredoc's closing delimiter so the def's real end is located after the + # heredoc and blank-line insertion does not land inside the heredoc body. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:285 + def trailing_heredoc_end(node, end_location); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:120 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_line_between_defs.rb:118 +RuboCop::Cop::Layout::EmptyLineBetweenDefs::MSG = T.let(T.unsafe(nil), String) + +# Checks for two or more consecutive blank lines. +# +# @example +# +# # bad - It has two empty lines. +# some_method +# # one empty line +# # two empty lines +# some_method +# +# # good +# some_method +# # one empty line +# some_method +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:21 +class RuboCop::Cop::Layout::EmptyLines < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:28 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:45 + def each_extra_empty_line(lines); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:63 + def exceeds_line_offset?(line_diff); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:67 + def previous_and_current_lines_empty?(line); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:26 +RuboCop::Cop::Layout::EmptyLines::LINE_OFFSET = T.let(T.unsafe(nil), Integer) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines.rb:25 +RuboCop::Cop::Layout::EmptyLines::MSG = T.let(T.unsafe(nil), String) + +# Checks for an empty line after a module inclusion method (`extend`, +# `include` and `prepend`), or a group of them. +# +# @example +# # bad +# class Foo +# include Bar +# attr_reader :baz +# end +# +# # good +# class Foo +# include Bar +# +# attr_reader :baz +# end +# +# # also good - multiple module inclusions grouped together +# class Foo +# extend Bar +# include Baz +# prepend Qux +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:30 +class RuboCop::Cop::Layout::EmptyLinesAfterModuleInclusion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:40 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:85 + def allowed_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:54 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:69 + def enable_directive_comment?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:75 + def line_empty?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:65 + def next_line_empty_or_enable_directive_comment?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:93 + def next_line_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:79 + def require_empty_line?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:36 +RuboCop::Cop::Layout::EmptyLinesAfterModuleInclusion::MODULE_INCLUSION_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:34 +RuboCop::Cop::Layout::EmptyLinesAfterModuleInclusion::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb:38 +RuboCop::Cop::Layout::EmptyLinesAfterModuleInclusion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Access modifiers should be surrounded by blank lines. +# +# @example EnforcedStyle: around (default) +# +# # bad +# class Foo +# def bar; end +# private +# def baz; end +# end +# +# # good +# class Foo +# def bar; end +# +# private +# +# def baz; end +# end +# +# @example EnforcedStyle: only_before +# +# # bad +# class Foo +# def bar; end +# private +# def baz; end +# end +# +# # good +# class Foo +# def bar; end +# +# private +# def baz; end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:43 +class RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:56 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:81 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:62 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:86 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:71 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:85 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:76 + def on_sclass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:88 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:116 + def allowed_only_before_style?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:171 + def block_start?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:177 + def body_end?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:165 + def class_def?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:125 + def correct_next_line_if_denied_style(corrector, node, line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:161 + def empty_lines_around?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:105 + def expected_empty_lines?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:230 + def inside_block?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:187 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:196 + def message_for_around_style(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:206 + def message_for_only_before_style(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:183 + def next_empty_line_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:151 + def next_line_empty?(last_send_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:157 + def next_line_empty_and_exists?(last_send_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:234 + def no_empty_lines_around_block_body?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:144 + def previous_line_empty?(send_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:140 + def previous_line_ignoring_comments(processed_source, send_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:224 + def should_insert_line_after?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:216 + def should_insert_line_before?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:48 +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:52 +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:49 +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_AND_AFTER = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:51 +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb:54 +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks if empty lines exist around the arguments +# of a method invocation. +# +# @example +# # bad +# do_something( +# foo +# +# ) +# +# process(bar, +# +# baz: qux, +# thud: fred) +# +# some_method( +# +# [1,2,3], +# x: y +# ) +# +# # good +# do_something( +# foo +# ) +# +# process(bar, +# baz: qux, +# thud: fred) +# +# some_method( +# [1,2,3], +# x: y +# ) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:41 +class RuboCop::Cop::Layout::EmptyLinesAroundArguments < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:57 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:47 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:73 + def empty_range_for_starting_point(start); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:65 + def extra_lines(node, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:61 + def receiver_and_method_call_on_different_lines?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_arguments.rb:45 +RuboCop::Cop::Layout::EmptyLinesAroundArguments::MSG = T.let(T.unsafe(nil), String) + +# Checks for a newline after an attribute accessor or a group of them. +# `alias` syntax and `alias_method`, `public`, `protected`, and `private` methods are allowed +# by default. These are customizable with `AllowAliasSyntax` and `AllowedMethods` options. +# +# @example +# # bad +# attr_accessor :foo +# def do_something +# end +# +# # good +# attr_accessor :foo +# +# def do_something +# end +# +# # good +# attr_accessor :foo +# attr_reader :bar +# attr_writer :baz +# attr :qux +# +# def do_something +# end +# +# @example AllowAliasSyntax: true (default) +# # good +# attr_accessor :foo +# alias :foo? :foo +# +# def do_something +# end +# +# @example AllowAliasSyntax: false +# # bad +# attr_accessor :foo +# alias :foo? :foo +# +# def do_something +# end +# +# # good +# attr_accessor :foo +# +# alias :foo? :foo +# +# def do_something +# end +# +# @example AllowedMethods: ['private'] +# # good +# attr_accessor :foo +# private :foo +# +# def do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:63 +class RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::AllowedMethods + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:71 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:124 + def allow_alias?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:134 + def allow_alias_syntax?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:128 + def attribute_or_allowed_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:84 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:108 + def next_line_empty?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:95 + def next_line_empty_or_enable_directive_comment?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:102 + def next_line_enable_directive_comment?(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:118 + def next_line_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:112 + def require_empty_line?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:68 +RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb:69 +RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks if empty lines exist around the bodies of begin-end +# blocks. +# +# @example +# +# # bad +# begin +# +# # ... +# +# end +# +# # good +# begin +# # ... +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_begin_body.rb:23 +class RuboCop::Cop::Layout::EmptyLinesAroundBeginBody < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Layout::EmptyLinesAroundBody + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_begin_body.rb:29 + def on_kwbegin(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_begin_body.rb:35 + def style; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_begin_body.rb:27 +RuboCop::Cop::Layout::EmptyLinesAroundBeginBody::KIND = T.let(T.unsafe(nil), String) + +# Checks if empty lines around the bodies of blocks match +# the configuration. +# +# @example EnforcedStyle: no_empty_lines (default) +# # bad +# foo do |bar| +# +# # ... +# +# end +# +# # good +# foo do |bar| +# # ... +# end +# +# @example EnforcedStyle: empty_lines +# # bad +# foo do |bar| +# # ... +# end +# +# # good +# foo do |bar| +# +# # ... +# +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_block_body.rb:34 +class RuboCop::Cop::Layout::EmptyLinesAroundBlockBody < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Layout::EmptyLinesAroundBody + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_block_body.rb:40 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_block_body.rb:47 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_block_body.rb:46 + def on_numblock(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_block_body.rb:38 +RuboCop::Cop::Layout::EmptyLinesAroundBlockBody::KIND = T.let(T.unsafe(nil), String) + +# Common functionality for checking if presence/absence of empty lines +# around some kind of body matches the configuration. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:8 +module RuboCop::Cop::Layout::EmptyLinesAroundBody + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:20 + def constant_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:23 + def empty_line_required?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:26 + def check(node, body, adjusted_first_line: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:81 + def check_beginning(style, first_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:67 + def check_both(style, first_line, last_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:108 + def check_deferred_empty_line(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:43 + def check_empty_lines_except_namespace(body, first_line, last_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:51 + def check_empty_lines_special(body, first_line, last_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:85 + def check_ending(style, last_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:98 + def check_line(style, line, msg); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:89 + def check_source(style, line_no, desc); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:159 + def deferred_message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:132 + def first_child_requires_empty_line?(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:140 + def first_empty_line_required_child(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:155 + def message(type, desc); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:122 + def namespace?(body, with_one_child: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:148 + def previous_line_ignoring_comments(send_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:163 + def valid_body_style?(body); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:15 +RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_DEFERRED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:13 +RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_EXTRA = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/empty_lines_around_body.rb:14 +RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_MISSING = T.let(T.unsafe(nil), String) + +# Checks if empty lines around the bodies of classes match +# the configuration. +# +# @example EnforcedStyle: no_empty_lines (default) +# # bad +# class Foo +# +# def bar +# # ... +# end +# +# end +# +# # good +# class Foo +# def bar +# # ... +# end +# end +# +# @example EnforcedStyle: empty_lines +# # bad +# class Foo +# def bar +# # ... +# end +# end +# +# # good +# class Foo +# +# def bar +# # ... +# end +# +# end +# +# @example EnforcedStyle: empty_lines_except_namespace +# # good +# +# class Foo +# class Bar +# +# # ... +# +# end +# end +# +# @example EnforcedStyle: empty_lines_special +# # good +# class Foo +# +# def bar; end +# +# end +# +# @example EnforcedStyle: beginning_only +# # good +# +# class Foo +# +# def bar +# # ... +# end +# end +# +# @example EnforcedStyle: ending_only +# # good +# +# class Foo +# def bar +# # ... +# end +# +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_class_body.rb:81 +class RuboCop::Cop::Layout::EmptyLinesAroundClassBody < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Layout::EmptyLinesAroundBody + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_class_body.rb:87 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_class_body.rb:93 + def on_sclass(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_class_body.rb:85 +RuboCop::Cop::Layout::EmptyLinesAroundClassBody::KIND = T.let(T.unsafe(nil), String) + +# Checks if empty lines exist around the bodies of `begin` +# sections. This cop doesn't check empty lines at `begin` body +# beginning/end and around method definition body. +# `Layout/EmptyLinesAroundBeginBody` or `Layout/EmptyLinesAroundMethodBody` +# can be used for this purpose. +# +# @example +# +# # good +# +# begin +# do_something +# rescue +# do_something2 +# else +# do_something3 +# ensure +# do_something4 +# end +# +# # good +# +# def foo +# do_something +# rescue +# do_something2 +# end +# +# # bad +# +# begin +# do_something +# +# rescue +# +# do_something2 +# +# else +# +# do_something3 +# +# ensure +# +# do_something4 +# end +# +# # bad +# +# def foo +# do_something +# +# rescue +# +# do_something2 +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:61 +class RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Layout::EmptyLinesAroundBody + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:71 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:67 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:70 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:74 + def on_kwbegin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:72 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:80 + def check_body(body, line_of_def_or_kwbegin); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:112 + def keyword_locations(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:129 + def keyword_locations_in_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:125 + def keyword_locations_in_rescue(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:95 + def last_body_and_end_on_same_line?(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:104 + def message(location, keyword); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:108 + def style; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb:65 +RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords::MSG = T.let(T.unsafe(nil), String) + +# Checks if empty lines exist around the bodies of methods. +# +# @example +# +# # good +# +# def foo +# # ... +# end +# +# # bad +# +# def bar +# +# # ... +# +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:23 +class RuboCop::Cop::Layout::EmptyLinesAroundMethodBody < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Layout::EmptyLinesAroundBody + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:29 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:39 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:47 + def offending_endless_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:52 + def register_offense_for_endless_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:43 + def style; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_method_body.rb:27 +RuboCop::Cop::Layout::EmptyLinesAroundMethodBody::KIND = T.let(T.unsafe(nil), String) + +# Checks if empty lines around the bodies of modules match +# the configuration. +# +# @example EnforcedStyle: no_empty_lines (default) +# # bad +# module Foo +# +# def bar +# # ... +# end +# +# end +# +# # good +# module Foo +# def bar +# # ... +# end +# end +# +# @example EnforcedStyle: empty_lines +# # bad +# module Foo +# def bar +# # ... +# end +# end +# +# # good +# module Foo +# +# def bar +# # ... +# end +# +# end +# +# @example EnforcedStyle: empty_lines_except_namespace +# # good +# +# module Foo +# module Bar +# +# # ... +# +# end +# end +# +# @example EnforcedStyle: empty_lines_special +# # good +# module Foo +# +# def bar; end +# +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_module_body.rb:61 +class RuboCop::Cop::Layout::EmptyLinesAroundModuleBody < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Layout::EmptyLinesAroundBody + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_module_body.rb:67 + def on_module(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/empty_lines_around_module_body.rb:65 +RuboCop::Cop::Layout::EmptyLinesAroundModuleBody::KIND = T.let(T.unsafe(nil), String) + +# Checks whether the end keywords are aligned properly. +# +# Three modes are supported through the `EnforcedStyleAlignWith` +# configuration parameter: +# +# If it's set to `keyword` (which is the default), the `end` +# shall be aligned with the start of the keyword (if, class, etc.). +# +# If it's set to `variable` the `end` shall be aligned with the +# left-hand-side of the variable assignment, if there is one. +# +# If it's set to `start_of_line`, the `end` shall be aligned with the +# start of the line where the matching keyword appears. +# +# This `Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`) +# by default. On the other hand, `Layout/BeginEndAlignment` cop aligns with +# `EnforcedStyleAlignWith: start_of_line` by default because `||= begin` tends +# to align with the start of the line. `Layout/DefEndAlignment` cop also aligns with +# `EnforcedStyleAlignWith: start_of_line` by default. +# These styles can be configured by each cop. +# +# @example EnforcedStyleAlignWith: keyword (default) +# # bad +# +# variable = if true +# end +# +# # good +# +# variable = if true +# end +# +# variable = +# if true +# end +# +# @example EnforcedStyleAlignWith: variable +# # bad +# +# variable = if true +# end +# +# # good +# +# variable = if true +# end +# +# variable = +# if true +# end +# +# @example EnforcedStyleAlignWith: start_of_line +# # bad +# +# variable = if true +# end +# +# puts(if true +# end) +# +# # good +# +# variable = if true +# end +# +# puts(if true +# end) +# +# variable = +# if true +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:77 +class RuboCop::Cop::Layout::EndAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CheckAssignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::EndKeywordAlignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:111 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:118 + def on_case_match(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:83 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:99 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:95 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:87 + def on_sclass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:107 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:103 + def on_while(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:174 + def alignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:191 + def alignment_node_for_variable_style(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:155 + def asgn_variable_align_with(outer_node, inner_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:209 + def assignment_or_operator_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:122 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:144 + def check_asgn_alignment(outer_node, inner_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:127 + def check_assignment(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_alignment.rb:165 + def check_other_alignment(node); end +end + +# Checks for Windows-style line endings in the source code. +# +# @example EnforcedStyle: native (default) +# # The `native` style means that CR+LF (Carriage Return + Line Feed) is +# # enforced on Windows, and LF is enforced on other platforms. +# +# # bad +# puts 'Hello' # Return character is LF on Windows. +# puts 'Hello' # Return character is CR+LF on other than Windows. +# +# # good +# puts 'Hello' # Return character is CR+LF on Windows. +# puts 'Hello' # Return character is LF on other than Windows. +# +# @example EnforcedStyle: lf +# # The `lf` style means that LF (Line Feed) is enforced on +# # all platforms. +# +# # bad +# puts 'Hello' # Return character is CR+LF on all platforms. +# +# # good +# puts 'Hello' # Return character is LF on all platforms. +# +# @example EnforcedStyle: crlf +# # The `crlf` style means that CR+LF (Carriage Return + Line Feed) is +# # enforced on all platforms. +# +# # bad +# puts 'Hello' # Return character is LF on all platforms. +# +# # good +# puts 'Hello' # Return character is CR+LF on all platforms. +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:40 +class RuboCop::Cop::Layout::EndOfLine < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:71 + def offense_message(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:47 + def on_new_investigation; end + + # If there is no LF on the last line, we don't care if there's no CR. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:67 + def unimportant_missing_cr?(index, last_line, line); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:85 + def last_line(processed_source); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:44 +RuboCop::Cop::Layout::EndOfLine::MSG_DETECTED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/end_of_line.rb:45 +RuboCop::Cop::Layout::EndOfLine::MSG_MISSING = T.let(T.unsafe(nil), String) + +# Checks for extra/unnecessary whitespace. +# +# @example +# +# # good if AllowForAlignment is true +# name = "RuboCop" +# # Some comment and an empty line +# +# website += "/rubocop/rubocop" unless cond +# puts "rubocop" if debug +# +# # bad for any configuration +# set_app("RuboCop") +# website = "https://github.com/rubocop/rubocop" +# +# # good only if AllowBeforeTrailingComments is true +# object.method(arg) # this is a comment +# +# # good even if AllowBeforeTrailingComments is false or not set +# object.method(arg) # this is a comment +# +# # good with either AllowBeforeTrailingComments or AllowForAlignment +# object.method(arg) # this is a comment +# another_object.method(arg) # this is another comment +# some_object.method(arg) # this is some comment +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:31 +class RuboCop::Cop::Layout::ExtraSpacing < ::RuboCop::Cop::Base + include ::RuboCop::Cop::PrecedingFollowingAlignment + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:39 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:170 + def align_column(asgn_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:147 + def align_equal_sign(corrector, token, align_to); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:137 + def align_equal_signs(range, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:52 + def aligned_locations(locs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:103 + def aligned_tok?(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:159 + def all_relevant_assignment_lines(line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:179 + def allow_for_trailing_comments?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:72 + def check_assignment(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:81 + def check_other(token1, token2, ast); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:62 + def check_tokens(ast, token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:91 + def extra_space_range(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:133 + def force_equal_sign_alignment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:111 + def ignored_range?(ast, start_pos); end + + # Returns an array of ranges that should not be reported. It's the + # extra spaces between the keys and values in a multiline hash, + # since those are handled by the Layout/HashAlignment cop. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:118 + def ignored_ranges(ast); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:37 +RuboCop::Cop::Layout::ExtraSpacing::MSG_UNALIGNED_ASGN = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/extra_spacing.rb:36 +RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) + +# Checks the indentation of the first argument in a method call. +# Arguments after the first one are checked by `Layout/ArgumentAlignment`, +# not by this cop. +# +# For indenting the first parameter of method _definitions_, check out +# `Layout/FirstParameterIndentation`. +# +# This cop will respect `Layout/ArgumentAlignment` and will not work when +# `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArgumentAlignment`. +# +# @example +# +# # bad +# some_method( +# first_param, +# second_param) +# +# foo = some_method( +# first_param, +# second_param) +# +# foo = some_method(nested_call( +# nested_first_param), +# second_param) +# +# foo = some_method( +# nested_call( +# nested_first_param), +# second_param) +# +# some_method nested_call( +# nested_first_param), +# second_param +# +# @example EnforcedStyle: special_for_inner_method_call_in_parentheses (default) +# # Same as `special_for_inner_method_call` except that the special rule +# # only applies if the outer method call encloses its arguments in +# # parentheses. +# +# # good +# some_method( +# first_param, +# second_param) +# +# foo = some_method( +# first_param, +# second_param) +# +# foo = some_method(nested_call( +# nested_first_param), +# second_param) +# +# foo = some_method( +# nested_call( +# nested_first_param), +# second_param) +# +# some_method nested_call( +# nested_first_param), +# second_param +# +# @example EnforcedStyle: consistent +# # The first argument should always be indented one step more than the +# # preceding line. +# +# # good +# some_method( +# first_param, +# second_param) +# +# foo = some_method( +# first_param, +# second_param) +# +# foo = some_method(nested_call( +# nested_first_param), +# second_param) +# +# foo = some_method( +# nested_call( +# nested_first_param), +# second_param) +# +# some_method nested_call( +# nested_first_param), +# second_param +# +# @example EnforcedStyle: consistent_relative_to_receiver +# # The first argument should always be indented one level relative to +# # the parent that is receiving the argument +# +# # good +# some_method( +# first_param, +# second_param) +# +# foo = some_method( +# first_param, +# second_param) +# +# foo = some_method(nested_call( +# nested_first_param), +# second_param) +# +# foo = some_method( +# nested_call( +# nested_first_param), +# second_param) +# +# some_method nested_call( +# nested_first_param), +# second_params +# +# @example EnforcedStyle: special_for_inner_method_call +# # The first argument should normally be indented one step more than +# # the preceding line, but if it's an argument for a method call that +# # is itself an argument in a method call, then the inner argument +# # should be indented relative to the inner method. +# +# # good +# some_method( +# first_param, +# second_param) +# +# foo = some_method( +# first_param, +# second_param) +# +# foo = some_method(nested_call( +# nested_first_param), +# second_param) +# +# foo = some_method( +# nested_call( +# nested_first_param), +# second_param) +# +# some_method nested_call( +# nested_first_param), +# second_param +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:147 +class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:255 + def eligible_method_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:165 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:155 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:166 + def on_super(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:174 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:211 + def bare_operator?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:231 + def base_indentation(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:259 + def base_range(send_node, arg_node); end + + # Returns the column of the given range. For single line ranges, this + # is simple. For ranges with line breaks, we look a the last code line. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:271 + def column_of(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:292 + def comment_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:309 + def enable_layout_first_method_argument_line_break?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:304 + def enforce_first_argument_with_fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:201 + def find_top_level_send(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:195 + def inner_call?(top_level_send); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:215 + def message(arg_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:300 + def on_new_investigation; end + + # Takes the line number of a given code line and returns a string + # containing the previous line that's not a comment line or a blank + # line. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:283 + def previous_code_line(line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:170 + def should_check?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:187 + def should_correct_entire_chain?(send_node, top_level_send); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:239 + def special_inner_call_indentation?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_argument_indentation.rb:153 +RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of the first element in an array literal +# where the opening bracket and the first element are on separate lines. +# The other elements' indentations are handled by `Layout/ArrayAlignment` cop. +# +# This cop will respect `Layout/ArrayAlignment` and will not work when +# `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArrayAlignment`. +# +# By default, array literals that are arguments in a method call with +# parentheses, and where the opening square bracket of the array is on the +# same line as the opening parenthesis of the method call, shall have +# their first element indented one step (two spaces) more than the +# position inside the opening parenthesis. +# +# Other array literals shall have their first element indented one step +# more than the start of the line where the opening square bracket is. +# +# This default style is called 'special_inside_parentheses'. Alternative +# styles are 'consistent' and 'align_brackets'. Here are examples: +# +# @example EnforcedStyle: special_inside_parentheses (default) +# # The `special_inside_parentheses` style enforces that the first +# # element in an array literal where the opening bracket and first +# # element are on separate lines is indented one step (two spaces) more +# # than the position inside the opening parenthesis. +# +# # bad +# array = [ +# :value +# ] +# and_in_a_method_call([ +# :no_difference +# ]) +# +# # good +# array = [ +# :value +# ] +# but_in_a_method_call([ +# :its_like_this +# ]) +# +# @example EnforcedStyle: consistent +# # The `consistent` style enforces that the first element in an array +# # literal where the opening bracket and the first element are on +# # separate lines is indented the same as an array literal which is not +# # defined inside a method call. +# +# # bad +# array = [ +# :value +# ] +# but_in_a_method_call([ +# :its_like_this +# ]) +# +# # good +# array = [ +# :value +# ] +# and_in_a_method_call([ +# :no_difference +# ]) +# +# @example EnforcedStyle: align_brackets +# # The `align_brackets` style enforces that the opening and closing +# # brackets are indented to the same position. +# +# # bad +# and_now_for_something = [ +# :completely_different +# ] +# +# # good +# and_now_for_something = [ +# :completely_different +# ] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:82 +class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineElementIndentation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:91 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:104 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:97 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:108 + def autocorrect(corrector, node); end + + # Returns the description of what the correct indentation is based on. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:146 + def base_description(indent_base_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:112 + def brace_alignment_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:116 + def check(array_node, left_parenthesis); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:130 + def check_right_bracket(right_bracket, first_elem, left_bracket, left_parenthesis); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:182 + def enforce_first_argument_with_fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:159 + def message(base_description); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:167 + def message_for_right_bracket(indent_base_type); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_indentation.rb:88 +RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks for a line break before the first element in a +# multi-line array. +# +# @example +# +# # bad +# [ :a, +# :b] +# +# # good +# [ +# :a, +# :b] +# +# # good +# [:a, :b] +# +# @example AllowImplicitArrayLiterals: false (default) +# +# # bad +# a = b, +# c +# +# # good +# a = +# b, +# c +# +# @example AllowImplicitArrayLiterals: true +# +# # good +# a = b, +# c +# +# a = +# b, +# c +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# [ :a, { +# :b => :c +# }] +# +# # good +# [ +# :a, { +# :b => :c +# }] +# +# @example AllowMultilineFinalElement: true +# +# # good +# [:a, { +# :b => :c +# }] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_line_break.rb:64 +class RuboCop::Cop::Layout::FirstArrayElementLineBreak < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FirstElementLineBreak + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_line_break.rb:70 + def on_array(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_line_break.rb:84 + def allow_implicit_array_brackets?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_line_break.rb:79 + def assignment_on_same_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_line_break.rb:88 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_array_element_line_break.rb:68 +RuboCop::Cop::Layout::FirstArrayElementLineBreak::MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of the first key in a hash literal +# where the opening brace and the first key are on separate lines. The +# other keys' indentations are handled by the HashAlignment cop. +# +# By default, `Hash` literals that are arguments in a method call with +# parentheses, and where the opening curly brace of the hash is on the +# same line as the opening parenthesis of the method call, shall have +# their first key indented one step (two spaces) more than the position +# inside the opening parenthesis. +# +# Other hash literals shall have their first key indented one step more +# than the start of the line where the opening curly brace is. +# +# This default style is called 'special_inside_parentheses'. Alternative +# styles are 'consistent' and 'align_braces'. Here are examples: +# +# @example EnforcedStyle: special_inside_parentheses (default) +# # The `special_inside_parentheses` style enforces that the first key +# # in a hash literal where the opening brace and the first key are on +# # separate lines is indented one step (two spaces) more than the +# # position inside the opening parentheses. +# +# # bad +# hash = { +# key: :value +# } +# in_a_method_call({ +# foo: :bar +# }) +# takes_multi_pairs_hash(x: { +# a: 1, +# b: 2 +# }, +# y: { +# c: 1, +# d: 2 +# }) +# +# # good +# hash = { +# key: :value +# } +# in_a_method_call({ +# foo: :bar +# }) +# takes_multi_pairs_hash(x: { +# a: 1, +# b: 2 +# }, +# y: { +# c: 1, +# d: 2 +# }) +# +# @example EnforcedStyle: consistent +# # The `consistent` style enforces that the first key in a hash +# # literal where the opening brace and the first key are on +# # separate lines is indented the same as a hash literal which is not +# # defined inside a method call. +# +# # bad +# hash = { +# key: :value +# } +# in_a_method_call({ +# foo: :bar +# }) +# +# # good +# hash = { +# key: :value +# } +# in_a_method_call({ +# foo: :bar +# }) +# +# +# @example EnforcedStyle: align_braces +# # The `align_brackets` style enforces that the opening and closing +# # braces are indented to the same position. +# +# # bad +# and_now_for_something = { +# completely: :different +# } +# takes_multi_pairs_hash(x: { +# a: 1, +# b: 2 +# }, +# y: { +# c: 1, +# d: 2 +# }) +# +# # good +# and_now_for_something = { +# completely: :different +# } +# takes_multi_pairs_hash(x: { +# a: 1, +# b: 2 +# }, +# y: { +# c: 1, +# d: 2 +# }) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:112 +class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineElementIndentation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:132 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:121 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:125 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:136 + def autocorrect(corrector, node); end + + # Returns the description of what the correct indentation is based on. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:196 + def base_description(indent_base_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:146 + def brace_alignment_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:150 + def check(hash_node, left_parenthesis); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:189 + def check_based_on_longest_key(hash_node, left_brace, left_parenthesis); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:169 + def check_right_brace(right_brace, first_pair, left_brace, left_parenthesis); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:232 + def enforce_first_argument_with_fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:209 + def message(base_description); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:217 + def message_for_right_brace(indent_base_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:183 + def separator_style?(first_pair); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_indentation.rb:118 +RuboCop::Cop::Layout::FirstHashElementIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks for a line break before the first element in a +# multi-line hash. +# +# @example +# +# # bad +# { a: 1, +# b: 2} +# +# # good +# { +# a: 1, +# b: 2 } +# +# # good +# { +# a: 1, b: { +# c: 3 +# }} +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# { a: 1, b: { +# c: 3 +# }} +# +# @example AllowMultilineFinalElement: true +# +# # bad +# { a: 1, +# b: { +# c: 3 +# }} +# +# # good +# { a: 1, b: { +# c: 3 +# }} +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_line_break.rb:46 +class RuboCop::Cop::Layout::FirstHashElementLineBreak < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FirstElementLineBreak + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_line_break.rb:52 + def on_hash(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_line_break.rb:62 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_hash_element_line_break.rb:50 +RuboCop::Cop::Layout::FirstHashElementLineBreak::MSG = T.let(T.unsafe(nil), String) + +# Checks for a line break before the first argument in a +# multi-line method call. +# +# @example +# +# # bad +# method(foo, bar, +# baz) +# +# # good +# method( +# foo, bar, +# baz) +# +# # ignored +# method foo, bar, +# baz +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# method(foo, bar, { +# baz: "a", +# qux: "b", +# }) +# +# # good +# method( +# foo, bar, { +# baz: "a", +# qux: "b", +# }) +# +# @example AllowMultilineFinalElement: true +# +# # bad +# method(foo, +# bar, +# { +# baz: "a", +# qux: "b", +# } +# ) +# +# # good +# method(foo, bar, { +# baz: "a", +# qux: "b", +# }) +# +# # good +# method( +# foo, +# bar, +# { +# baz: "a", +# qux: "b", +# } +# ) +# +# @example AllowedMethods: ['some_method'] +# +# # good +# some_method(foo, bar, +# baz) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_argument_line_break.rb:71 +class RuboCop::Cop::Layout::FirstMethodArgumentLineBreak < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FirstElementLineBreak + include ::RuboCop::Cop::AllowedMethods + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_argument_line_break.rb:94 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_argument_line_break.rb:78 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_argument_line_break.rb:95 + def on_super(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_argument_line_break.rb:99 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_argument_line_break.rb:76 +RuboCop::Cop::Layout::FirstMethodArgumentLineBreak::MSG = T.let(T.unsafe(nil), String) + +# Checks for a line break before the first parameter in a +# multi-line method parameter definition. +# +# @example +# +# # bad +# def method(foo, bar, +# baz) +# do_something +# end +# +# # good +# def method( +# foo, bar, +# baz) +# do_something +# end +# +# # ignored +# def method foo, +# bar +# do_something +# end +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# def method(foo, bar, baz = { +# :a => "b", +# }) +# do_something +# end +# +# # good +# def method( +# foo, bar, baz = { +# :a => "b", +# }) +# do_something +# end +# +# @example AllowMultilineFinalElement: true +# +# # good +# def method(foo, bar, baz = { +# :a => "b", +# }) +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_parameter_line_break.rb:56 +class RuboCop::Cop::Layout::FirstMethodParameterLineBreak < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FirstElementLineBreak + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_parameter_line_break.rb:62 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_parameter_line_break.rb:65 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_parameter_line_break.rb:69 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_method_parameter_line_break.rb:60 +RuboCop::Cop::Layout::FirstMethodParameterLineBreak::MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of the first parameter in a method +# definition. Parameters after the first one are checked by +# `Layout/ParameterAlignment`, not by this cop. +# +# For indenting the first argument of method _calls_, check out +# `Layout/FirstArgumentIndentation`, which supports options related to +# nesting that are irrelevant for method _definitions_. +# +# @example +# +# # bad +# def some_method( +# first_param, +# second_param) +# 123 +# end +# +# @example EnforcedStyle: consistent (default) +# # The first parameter should always be indented one step more than the +# # preceding line. +# +# # good +# def some_method( +# first_param, +# second_param) +# 123 +# end +# +# @example EnforcedStyle: align_parentheses +# # The first parameter should always be indented one step more than the +# # opening parenthesis. +# +# # good +# def some_method( +# first_param, +# second_param) +# 123 +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:44 +class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineElementIndentation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:53 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:59 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:63 + def autocorrect(corrector, node); end + + # Returns the description of what the correct indentation is based on. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:83 + def base_description(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:67 + def brace_alignment_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:71 + def check(def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:91 + def message(base_description); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/first_parameter_indentation.rb:50 +RuboCop::Cop::Layout::FirstParameterIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks that the keys, separators, and values of a multi-line hash +# literal are aligned according to configuration. The configuration +# options are: +# +# * key (left align keys, one space before hash rockets and values) +# * separator (align hash rockets and colons, right align keys) +# * table (left align keys, hash rockets, and values) +# +# The treatment of hashes passed as the last argument to a method call +# can also be configured. The options are: +# +# * always_inspect +# * always_ignore +# * ignore_implicit (without curly braces) +# +# Alternatively you can specify multiple allowed styles. That's done by +# passing a list of styles to EnforcedHashRocketStyle and EnforcedColonStyle. +# +# @example EnforcedHashRocketStyle: key (default) +# # bad +# { +# :foo => bar, +# :ba => baz +# } +# { +# :foo => bar, +# :ba => baz +# } +# +# # good +# { +# :foo => bar, +# :ba => baz +# } +# +# @example EnforcedHashRocketStyle: separator +# # bad +# { +# :foo => bar, +# :ba => baz +# } +# { +# :foo => bar, +# :ba => baz +# } +# +# # good +# { +# :foo => bar, +# :ba => baz +# } +# +# @example EnforcedHashRocketStyle: table +# # bad +# { +# :foo => bar, +# :ba => baz +# } +# +# # good +# { +# :foo => bar, +# :ba => baz +# } +# +# @example EnforcedColonStyle: key (default) +# # bad +# { +# foo: bar, +# ba: baz +# } +# { +# foo: bar, +# ba: baz +# } +# +# # good +# { +# foo: bar, +# ba: baz +# } +# +# @example EnforcedColonStyle: separator +# # bad +# { +# foo: bar, +# ba: baz +# } +# +# # good +# { +# foo: bar, +# ba: baz +# } +# +# @example EnforcedColonStyle: table +# # bad +# { +# foo: bar, +# ba: baz +# } +# +# # good +# { +# foo: bar, +# ba: baz +# } +# +# @example EnforcedLastArgumentHashStyle: always_inspect (default) +# # Inspect both implicit and explicit hashes. +# +# # bad +# do_something(foo: 1, +# bar: 2) +# +# # bad +# do_something({foo: 1, +# bar: 2}) +# +# # good +# do_something(foo: 1, +# bar: 2) +# +# # good +# do_something( +# foo: 1, +# bar: 2 +# ) +# +# # good +# do_something({foo: 1, +# bar: 2}) +# +# # good +# do_something({ +# foo: 1, +# bar: 2 +# }) +# +# @example EnforcedLastArgumentHashStyle: always_ignore +# # Ignore both implicit and explicit hashes. +# +# # good +# do_something(foo: 1, +# bar: 2) +# +# # good +# do_something({foo: 1, +# bar: 2}) +# +# @example EnforcedLastArgumentHashStyle: ignore_implicit +# # Ignore only implicit hashes. +# +# # bad +# do_something({foo: 1, +# bar: 2}) +# +# # good +# do_something(foo: 1, +# bar: 2) +# +# @example EnforcedLastArgumentHashStyle: ignore_explicit +# # Ignore only explicit hashes. +# +# # bad +# do_something(foo: 1, +# bar: 2) +# +# # good +# do_something({foo: 1, +# bar: 2}) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:178 +class RuboCop::Cop::Layout::HashAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::HashAlignmentStyles + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:218 + def column_deltas; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:218 + def column_deltas=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:218 + def offenses_by; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:218 + def offenses_by=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:204 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:208 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:195 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:205 + def on_super(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:206 + def on_yield(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:264 + def add_offenses; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:370 + def adjust(corrector, delta, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:299 + def alignment_for(pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:313 + def alignment_for_colons; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:309 + def alignment_for_hash_rockets; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:234 + def argument_before_hash(hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:222 + def autocorrect_incompatible_with_other_cops?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:282 + def check_delta(delta, node:, alignment:); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:245 + def check_pairs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:336 + def correct_key_value(corrector, delta, key, value, separator); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:332 + def correct_no_value(corrector, key_delta, key); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:317 + def correct_node(corrector, node, delta); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:383 + def enforce_first_argument_with_fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:379 + def good_alignment?(column_deltas); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:290 + def ignore_hash_argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:352 + def new_alignment(key); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:272 + def register_offenses_with_format(offenses, format); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:240 + def reset!; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:388 + def same_line?(node1, node2); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:183 +RuboCop::Cop::Layout::HashAlignment::MESSAGES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/hash_alignment.rb:193 +RuboCop::Cop::Layout::HashAlignment::SEPARATOR_ALIGNMENT_STYLES = T.let(T.unsafe(nil), Array) + +# Checks for the placement of the closing parenthesis +# in a method call that passes a HEREDOC string as an argument. +# It should be placed at the end of the line containing the +# opening HEREDOC tag. +# +# @example +# # bad +# +# foo(<<-SQL +# bar +# SQL +# ) +# +# foo(<<-SQL, 123, <<-NOSQL, +# bar +# SQL +# baz +# NOSQL +# ) +# +# foo( +# bar(<<-SQL +# baz +# SQL +# ), +# 123, +# ) +# +# # good +# +# foo(<<-SQL) +# bar +# SQL +# +# foo(<<-SQL, 123, <<-NOSQL) +# bar +# SQL +# baz +# NOSQL +# +# foo( +# bar(<<-SQL), +# baz +# SQL +# 123, +# ) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:53 +class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:78 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:64 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:185 + def add_correct_closing_paren(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:272 + def add_correct_external_trailing_comma(node, corrector); end + + # Autocorrection note: + # + # Commas are a bit tricky to handle when the method call is + # embedded in another expression. Here's an example: + # + # [ + # first_array_value, + # foo(<<-SQL, 123, 456, + # SELECT * FROM db + # SQL + # ), + # third_array_value, + # ] + # + # The "internal" trailing comma is after `456`. + # The "external" trailing comma is after `)`. + # + # To autocorrect, we remove the latter, and move the former up: + # + # [ + # first_array_value, + # foo(<<-SQL, 123, 456), + # SELECT * FROM db + # SQL + # third_array_value, + # ] + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:108 + def autocorrect(corrector, node); end + + # Closing parenthesis helpers. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:163 + def end_keyword_before_closing_parenthesis?(parenthesized_send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:223 + def exist_argument_between_heredoc_end_and_closing_parentheses?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:290 + def external_trailing_comma?(node); end + + # Returns nil if no trailing external comma. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:295 + def external_trailing_comma_offset_from_loc_end(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:138 + def extract_heredoc(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:134 + def extract_heredoc_argument(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:231 + def find_most_bottom_of_heredoc_end(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:180 + def fix_closing_parenthesis(node, corrector); end + + # External trailing comma helpers. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:267 + def fix_external_trailing_comma(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:150 + def heredoc_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:198 + def incorrect_parenthesis_removal_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:214 + def incorrect_parenthesis_removal_end(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:245 + def internal_trailing_comma?(node); end + + # Returns nil if no trailing internal comma. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:250 + def internal_trailing_comma_offset_from_last_arg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:116 + def outermost_send_on_same_line(heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:189 + def remove_incorrect_closing_paren(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:278 + def remove_incorrect_external_trailing_comma(node, corrector); end + + # Internal trailing comma helpers. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:239 + def remove_internal_trailing_comma(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:208 + def safe_to_remove_line_containing_closing_paren?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:127 + def send_missing_closing_parens?(parent, child, heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:154 + def single_line_send_with_heredoc_receiver?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:306 + def space?(pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:169 + def subsequent_closing_parentheses_in_same_line?(outermost_send); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:60 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb:57 +RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis::MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of the here document bodies. The bodies +# are indented one step. +# +# NOTE: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default), +# this cop does not add any offenses for long here documents to +# avoid ``Layout/LineLength``'s offenses. +# +# @example +# # bad +# <<-RUBY +# something +# RUBY +# +# # good +# <<~RUBY +# something +# RUBY +# +# @example AllCops:ActiveSupportExtensionsEnabled: false (default) +# # good +# <<-RUBY.squish +# something +# RUBY +# +# @example AllCops:ActiveSupportExtensionsEnabled: true +# # bad +# <<-RUBY.squish +# something +# RUBY +# +# # good +# <<~RUBY.squish +# something +# RUBY +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:41 +class RuboCop::Cop::Layout::HeredocIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::Heredoc + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:58 + def on_heredoc(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:54 + def squish_method?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:136 + def adjust_heredoc_squish(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:146 + def adjust_minus(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:141 + def adjust_squiggly(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:170 + def base_indent_level(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:181 + def heredoc_body(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:185 + def heredoc_end(node); end + + # Returns '~', '-' or nil + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:177 + def heredoc_indent_type(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:189 + def heredoc_squish?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:152 + def indented_body(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:159 + def indented_end(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:115 + def line_too_long?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:128 + def longest_line(lines); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:93 + def message(heredoc_indent_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:79 + def register_offense(node, heredoc_indent_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:103 + def type_message(indentation_width, current_indent_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:132 + def unlimited_heredoc_length?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:111 + def width_message(indentation_width); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:49 +RuboCop::Cop::Layout::HeredocIndentation::TYPE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/heredoc_indentation.rb:51 +RuboCop::Cop::Layout::HeredocIndentation::WIDTH_MSG = T.let(T.unsafe(nil), String) + +# Checks for inconsistent indentation. +# +# The difference between `indented_internal_methods` and `normal` is +# that the `indented_internal_methods` style prescribes that in +# classes and modules the `protected` and `private` modifier keywords +# shall be indented the same as public methods and that protected and +# private members shall be indented one step more than the modifiers. +# Other than that, both styles mean that entities on the same logical +# depth shall have the same indentation. +# +# @example EnforcedStyle: normal (default) +# # bad +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# end +# +# # bad +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# +# protected +# +# def foo +# end +# +# private +# +# def bar +# end +# end +# +# # good +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# end +# +# # good +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# +# protected +# +# def foo +# end +# +# private +# +# def bar +# end +# end +# +# @example EnforcedStyle: indented_internal_methods +# # bad +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# end +# +# # bad +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# +# protected +# +# def foo +# end +# +# private +# +# def bar +# end +# end +# +# # good +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# end +# +# # good +# class A +# def test +# puts 'hello' +# puts 'world' +# end +# +# protected +# +# def foo +# end +# +# private +# +# def bar +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:121 +class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:128 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:132 + def on_kwbegin(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:138 + def autocorrect(corrector, node); end + + # Not all nodes define `bare_access_modifier?` (for example, + # `RuboCop::AST::DefNode` does not), so we must check `send_type?` first + # to avoid a NoMethodError. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:145 + def bare_access_modifier?(node); end + + # Returns an integer representing the correct indentation, or nil to + # indicate that the correct indentation is that of the first child that + # is not an access modifier. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:152 + def base_column_for_normal_style(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:172 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:187 + def check_indented_internal_methods_style(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:180 + def check_normal_style(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_consistency.rb:126 +RuboCop::Cop::Layout::IndentationConsistency::MSG = T.let(T.unsafe(nil), String) + +# Checks that the indentation method is consistent. +# Either tabs only or spaces only are used for indentation. +# +# @example EnforcedStyle: spaces (default) +# # bad +# # This example uses a tab to indent bar. +# def foo +# bar +# end +# +# # good +# # This example uses spaces to indent bar. +# def foo +# bar +# end +# +# @example EnforcedStyle: tabs +# # bad +# # This example uses spaces to indent bar. +# def foo +# bar +# end +# +# # good +# # This example uses a tab to indent bar. +# def foo +# bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:34 +class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:42 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:58 + def autocorrect(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:82 + def autocorrect_lambda_for_spaces(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:77 + def autocorrect_lambda_for_tabs(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:66 + def find_offense(line, lineno); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:88 + def in_string_literal?(ranges, tabs_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:109 + def message(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:92 + def string_literal_ranges(ast); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_style.rb:40 +RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) + +# Checks for indentation that doesn't use the specified number of spaces. +# The indentation width can be configured using the `Width` setting. The default width is 2. +# The block body indentation for method chain blocks can be configured using the +# `EnforcedStyleAlignWith` setting. +# +# See also the `Layout/IndentationConsistency` cop which is the companion to this one. +# +# @example Width: 2 (default) +# # bad +# class A +# def test +# puts 'hello' +# end +# end +# +# # good +# class A +# def test +# puts 'hello' +# end +# end +# +# @example +# # bad +# value = ( +# foo - bar +# ) +# +# # good +# value = ( +# foo - bar +# ) +# +# @example AllowedPatterns: ['^\s*module'] +# # bad +# module A +# class B +# def test +# puts 'hello' +# end +# end +# end +# +# # good +# module A +# class B +# def test +# puts 'hello' +# end +# end +# end +# +# @example EnforcedStyleAlignWith: start_of_line (default) +# # good +# records.uniq { |el| el[:profile_id] } +# .map do |message| +# SomeJob.perform_later(message[:id]) +# end +# +# @example EnforcedStyleAlignWith: relative_to_receiver +# # good +# records.uniq { |el| el[:profile_id] } +# .map do |message| +# SomeJob.perform_later(message[:id]) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:71 +class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::EndKeywordAlignment + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::CheckAssignment + include ::RuboCop::Cop::AllowedPattern + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:84 + def access_modifier?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:109 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:119 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:179 + def on_case(case_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:187 + def on_case_match(case_match); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:136 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:160 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:162 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:167 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:97 + def on_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:95 + def on_for(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:197 + def on_if(node, base = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:134 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:101 + def on_kwbegin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:143 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:133 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:92 + def on_resbody(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:88 + def on_rescue(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:142 + def on_sclass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:145 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:177 + def on_until(node, base = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:169 + def on_while(node, base = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:277 + def access_modifier_indentation_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:206 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:503 + def block_body_indentation_base(node, end_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:285 + def check_assignment(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:305 + def check_if(node, body, else_clause, base_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:318 + def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:219 + def check_members(base, members); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:243 + def check_members_for_indented_internal_methods_style(members); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:249 + def check_members_for_normal_style(base, members); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:412 + def check_rescue?(rescue_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:468 + def column_offset_between(base_range, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:454 + def contains_access_modifier?(body_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:515 + def dot_on_new_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:257 + def each_member(members); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:281 + def indentation_consistency_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:460 + def indentation_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:395 + def indentation_to_check?(base_loc, body_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:269 + def indented_internal_methods_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:497 + def leftmost_modifier_of(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:479 + def line_indentation(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:484 + def line_uses_tabs?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:352 + def message(configured_indentation_width, indentation, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:373 + def message_for_spaces(configured_indentation_width, indentation, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:360 + def message_for_tabs(configured_indentation_width, indentation, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:431 + def offending_range(body_node, indentation); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:328 + def offense(body_node, indentation, style); end + + # Returns a range at the first non-space column of the line the opening parenthesis is on, + # used as the base to indent the body from. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:214 + def opening_line_start(begin_loc); end + + # Returns true if the given node is within another node that has + # already been marked for autocorrection by this cop. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:385 + def other_offense_in_same_range?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:231 + def select_check_member(member); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:523 + def selector_on_new_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:416 + def skip_check?(base_loc, body_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:273 + def special_modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:445 + def starts_with_access_modifier?(body_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:464 + def using_tabs?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:488 + def visual_column(range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/indentation_width.rb:80 +RuboCop::Cop::Layout::IndentationWidth::MSG = T.let(T.unsafe(nil), String) + +# Checks for indentation of the first non-blank non-comment +# line in a file. +# +# @example +# # bad +# class A +# def foo; end +# end +# +# # good +# class A +# def foo; end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/initial_indentation.rb:20 +class RuboCop::Cop::Layout::InitialIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/initial_indentation.rb:26 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/initial_indentation.rb:36 + def first_token; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/initial_indentation.rb:40 + def space_before(token); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/initial_indentation.rb:24 +RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) + +# Checks whether comments have a leading space after the +# `#` denoting the start of the comment. The leading space is not +# required for some RDoc special syntax, like `#++`, `#--`, +# `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives, +# or rackup options. +# +# @example +# +# # bad +# #Some comment +# +# # good +# # Some comment +# +# @example AllowDoxygenCommentStyle: false (default) +# +# # bad +# +# #** +# # Some comment +# # Another line of comment +# #* +# +# @example AllowDoxygenCommentStyle: true +# +# # good +# +# #** +# # Some comment +# # Another line of comment +# #* +# +# @example AllowGemfileRubyComment: false (default) +# +# # bad +# +# #ruby=2.7.0 +# #ruby-gemset=myproject +# +# @example AllowGemfileRubyComment: true +# +# # good +# +# #ruby=2.7.0 +# #ruby-gemset=myproject +# +# @example AllowRBSInlineAnnotation: false (default) +# +# # bad +# +# include Enumerable #[Integer] +# +# attr_reader :name #: String +# attr_reader :age #: Integer? +# +# #: ( +# #| Integer, +# #| String +# #| ) -> void +# def foo; end +# +# @example AllowRBSInlineAnnotation: true +# +# # good +# +# include Enumerable #[Integer] +# +# attr_reader :name #: String +# attr_reader :age #: Integer? +# +# #: ( +# #| Integer, +# #| String +# #| ) -> void +# def foo; end +# +# @example AllowSteepAnnotation: false (default) +# +# # bad +# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] +# list << n +# end +# +# name = 'John' #: String +# +# @example AllowSteepAnnotation: true +# +# # good +# +# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] +# list << n +# end +# +# name = 'John' #: String +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:101 +class RuboCop::Cop::Layout::LeadingCommentSpace < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:107 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:161 + def allow_doxygen_comment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:169 + def allow_gemfile_ruby_comment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:185 + def allow_rbs_inline_annotation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:193 + def allow_steep_annotation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:131 + def allowed_on_first_line?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:165 + def doxygen_comment_style?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:173 + def gemfile?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:181 + def gemfile_ruby_comment?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:127 + def hash_mark(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:157 + def rackup_config_file?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:153 + def rackup_options?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:189 + def rbs_inline_annotation?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:177 + def ruby_comment_in_gemfile?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:135 + def shebang?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:139 + def shebang_continuation?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:197 + def steep_annotation?(comment); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/leading_comment_space.rb:105 +RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String) + +# Checks for unnecessary leading blank lines at the beginning +# of a file. +# +# @example +# +# # bad +# # (start of file) +# +# class Foo +# end +# +# # bad +# # (start of file) +# +# # a comment +# +# # good +# # (start of file) +# class Foo +# end +# +# # good +# # (start of file) +# # a comment +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/leading_empty_lines.rb:30 +class RuboCop::Cop::Layout::LeadingEmptyLines < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/leading_empty_lines.rb:35 + def on_new_investigation; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/leading_empty_lines.rb:33 +RuboCop::Cop::Layout::LeadingEmptyLines::MSG = T.let(T.unsafe(nil), String) + +# Checks that strings broken over multiple lines (by a backslash) contain +# trailing spaces instead of leading spaces (default) or leading spaces +# instead of trailing spaces. +# +# @example EnforcedStyle: trailing (default) +# # bad +# 'this text contains a lot of' \ +# ' spaces' +# +# # good +# 'this text contains a lot of ' \ +# 'spaces' +# +# # bad +# 'this text is too' \ +# ' long' +# +# # good +# 'this text is too ' \ +# 'long' +# +# @example EnforcedStyle: leading +# # bad +# 'this text contains a lot of ' \ +# 'spaces' +# +# # good +# 'this text contains a lot of' \ +# ' spaces' +# +# # bad +# 'this text is too ' \ +# 'long' +# +# # good +# 'this text is too' \ +# ' long' +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:43 +class RuboCop::Cop::Layout::LineContinuationLeadingSpace < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:63 + def on_dstr(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:122 + def autocorrect(corrector, offense_range, insert_pos, spaces); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:115 + def continuation?(line, line_num, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:147 + def enforced_style_leading?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:85 + def investigate(first_line, second_line, end_of_first_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:93 + def investigate_leading_style(first_line, second_line, end_of_first_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:104 + def investigate_trailing_style(first_line, second_line, end_of_first_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:127 + def leading_offense_range(end_of_first_line, matches); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:139 + def message(_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:81 + def raw_lines(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:133 + def trailing_offense_range(end_of_first_line, matches); end + + class << self + # When both cops are activated and run in the same iteration of the correction loop, + # `Style/StringLiterals` undoes the moving of spaces that + # `Layout/LineContinuationLeadingSpace` performs. This is because `Style/StringLiterals` + # takes the original string content and transforms it, rather than just modifying the + # delimiters, in order to handle escaping for quotes within the string. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:59 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:49 +RuboCop::Cop::Layout::LineContinuationLeadingSpace::LEADING_STYLE_OFFENSE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:47 +RuboCop::Cop::Layout::LineContinuationLeadingSpace::LINE_1_ENDING = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:48 +RuboCop::Cop::Layout::LineContinuationLeadingSpace::LINE_2_BEGINNING = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_leading_space.rb:50 +RuboCop::Cop::Layout::LineContinuationLeadingSpace::TRAILING_STYLE_OFFENSE = T.let(T.unsafe(nil), Regexp) + +# Checks that the backslash of a line continuation is separated from +# preceding text by exactly one space (default) or zero spaces. +# +# @example EnforcedStyle: space (default) +# # bad +# 'a'\ +# 'b' \ +# 'c' +# +# # good +# 'a' \ +# 'b' \ +# 'c' +# +# @example EnforcedStyle: no_space +# # bad +# 'a' \ +# 'b' \ +# 'c' +# +# # good +# 'a'\ +# 'b'\ +# 'c' +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:30 +class RuboCop::Cop::Layout::LineContinuationSpacing < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:34 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:81 + def autocorrect(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:111 + def comment_ranges(comments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:65 + def find_offensive_spacing(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:121 + def ignore_range?(backtick_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:91 + def ignored_literal_ranges(ast); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:130 + def ignored_parent?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:125 + def ignored_ranges; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:49 + def investigate(line, line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:115 + def last_line(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:73 + def message(_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:136 + def no_space_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_continuation_spacing.rb:140 + def space_style?; end +end + +# Checks the indentation of the next line after a line that ends with a string +# literal and a backslash. +# +# If `EnforcedStyle: aligned` is set, the concatenated string parts shall be aligned with the +# first part. There are some exceptions, such as implicit return values, where the +# concatenated string parts shall be indented regardless of `EnforcedStyle` configuration. +# +# If `EnforcedStyle: indented` is set, it's the second line that shall be indented one step +# more than the first line. Lines 3 and forward shall be aligned with line 2. +# +# @example +# # bad +# def some_method +# 'x' \ +# 'y' \ +# 'z' +# end +# +# my_hash = { +# first: 'a message' \ +# 'in two parts' +# } +# +# # good +# def some_method +# 'x' \ +# 'y' \ +# 'z' +# end +# +# @example EnforcedStyle: aligned (default) +# # bad +# puts 'x' \ +# 'y' +# +# my_hash = { +# first: 'a message' \ +# 'in two parts' +# } +# +# # good +# puts 'x' \ +# 'y' +# +# my_hash = { +# first: 'a message' \ +# 'in two parts' +# } +# +# @example EnforcedStyle: indented +# # bad +# result = 'x' \ +# 'y' +# +# my_hash = { +# first: 'a message' \ +# 'in two parts' +# } +# +# # good +# result = 'x' \ +# 'y' +# +# my_hash = { +# first: 'a message' \ +# 'in two parts' +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:74 +class RuboCop::Cop::Layout::LineEndStringConcatenationIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:97 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:83 + def on_dstr(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:137 + def add_offense_and_correction(node, message); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:109 + def always_indented?(dstr_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:128 + def base_column(child); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:113 + def check_aligned(children, start_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:122 + def check_indented(children); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:103 + def strings_concatenated_with_backslash?(dstr_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:79 +RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:80 +RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb:81 +RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_INDENTED = T.let(T.unsafe(nil), Array) + +# Checks the length of lines in the source code. +# The maximum length is configurable. +# The tab size is configured in the `IndentationWidth` +# of the `Layout/IndentationStyle` cop. +# It also ignores a shebang line by default. +# +# This cop has some autocorrection capabilities. +# It can programmatically shorten certain long lines by +# inserting line breaks into expressions that can be safely +# split across lines. These include arrays, hashes, and +# method calls with argument lists. +# +# If autocorrection is enabled, the following cops +# are recommended to further format the broken lines. +# (Many of these are enabled by default.) +# +# * `Layout/ArgumentAlignment` +# * `Layout/ArrayAlignment` +# * `Layout/BlockAlignment` +# * `Layout/BlockEndNewline` +# * `Layout/ClosingParenthesisIndentation` +# * `Layout/FirstArgumentIndentation` +# * `Layout/FirstArrayElementIndentation` +# * `Layout/FirstHashElementIndentation` +# * `Layout/FirstParameterIndentation` +# * `Layout/HashAlignment` +# * `Layout/IndentationWidth` +# * `Layout/MultilineArrayLineBreaks` +# * `Layout/MultilineBlockLayout` +# * `Layout/MultilineHashBraceLayout` +# * `Layout/MultilineHashKeyLineBreaks` +# * `Layout/MultilineMethodArgumentLineBreaks` +# * `Layout/MultilineMethodParameterLineBreaks` +# * `Layout/ParameterAlignment` +# * `Style/BlockDelimiters` +# +# Together, these cops will pretty print hashes, arrays, +# method calls, etc. For example, let's say the max columns +# is 25: +# +# @example +# +# # bad +# {foo: "0000000000", bar: "0000000000", baz: "0000000000"} +# +# # good +# {foo: "0000000000", +# bar: "0000000000", baz: "0000000000"} +# +# # good (with recommended cops enabled) +# { +# foo: "0000000000", +# bar: "0000000000", +# baz: "0000000000", +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:63 +class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CheckLineBreakable + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::LineLengthHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:70 + def max=(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:91 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:74 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:94 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:95 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:96 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:84 + def on_dstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:92 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:104 + def on_investigation_end; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:78 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:98 + def on_new_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:77 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:88 + def on_potential_breakable_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:93 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:80 + def on_str(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:316 + def allow_heredoc?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:324 + def allow_string_split?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:391 + def allowed_combination?(line, uri_range, qualified_name_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:320 + def allowed_heredoc; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:272 + def allowed_line?(line, line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:182 + def breakable_block_range(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:403 + def breakable_dstr?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:231 + def breakable_dstr_begin_position(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:112 + def breakable_range; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:112 + def breakable_range=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:190 + def breakable_range_after_semicolon(semicolon_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:236 + def breakable_range_by_line_index; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:173 + def breakable_string?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:240 + def breakable_string_delimiters; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:203 + def breakable_string_position(node); end + + # Locate where to break a string that is too long, ensuring that escape characters + # are not bisected. + # If the string contains spaces, use them to determine a place for a clean break; + # otherwise, the string will be broken at the line length limit. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:215 + def breakable_string_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:358 + def check_directive_line(line, line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:135 + def check_for_breakable_block(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:158 + def check_for_breakable_dstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:114 + def check_for_breakable_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:127 + def check_for_breakable_semicolons(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:146 + def check_for_breakable_str(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:256 + def check_line(line, line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:375 + def check_line_for_exemptions(line, line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:300 + def excess_range(uri_range, line, line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:328 + def extract_heredocs(ast); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:244 + def heredocs; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:248 + def highlight_start(line); end + + # Find the largest possible substring of a string node to retain before a break + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:419 + def largest_possible_string(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:347 + def line_in_heredoc?(line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:338 + def line_in_permitted_heredoc?(line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:311 + def max; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:314 + def max_line_length; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:385 + def range_if_applicable(line, type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:351 + def receiver_contains_heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:282 + def register_offense(loc, line, line_index, length: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:278 + def shebang?(line, line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:408 + def string_delimiter(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/line_length.rb:72 +RuboCop::Cop::Layout::LineLength::MSG = T.let(T.unsafe(nil), String) + +# Checks that the closing brace in an array literal is either +# on the same line as the last array element or on a new line. +# +# When using the `symmetrical` (default) style: +# +# If an array's opening brace is on the same line as the first element +# of the array, then the closing brace should be on the same line as +# the last element of the array. +# +# If an array's opening brace is on the line above the first element +# of the array, then the closing brace should be on the line below +# the last element of the array. +# +# When using the `new_line` style: +# +# The closing brace of a multi-line array literal must be on the line +# after the last element of the array. +# +# When using the `same_line` style: +# +# The closing brace of a multi-line array literal must be on the same +# line as the last element of the array. +# +# @example EnforcedStyle: symmetrical (default) +# # bad +# [ :a, +# :b +# ] +# +# # bad +# [ +# :a, +# :b ] +# +# # good +# [ :a, +# :b ] +# +# # good +# [ +# :a, +# :b +# ] +# +# @example EnforcedStyle: new_line +# # bad +# [ +# :a, +# :b ] +# +# # bad +# [ :a, +# :b ] +# +# # good +# [ :a, +# :b +# ] +# +# # good +# [ +# :a, +# :b +# ] +# +# @example EnforcedStyle: same_line +# # bad +# [ :a, +# :b +# ] +# +# # bad +# [ +# :a, +# :b +# ] +# +# # good +# [ +# :a, +# :b ] +# +# # good +# [ :a, +# :b ] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_brace_layout.rb:91 +class RuboCop::Cop::Layout::MultilineArrayBraceLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineLiteralBraceLayout + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_brace_layout.rb:109 + def on_array(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_brace_layout.rb:103 +RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_brace_layout.rb:106 +RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_brace_layout.rb:99 +RuboCop::Cop::Layout::MultilineArrayBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_brace_layout.rb:95 +RuboCop::Cop::Layout::MultilineArrayBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# Ensures that each item in a multi-line array +# starts on a separate line. +# +# @example +# +# # bad +# [ +# a, b, +# c +# ] +# +# # good +# [ +# a, +# b, +# c +# ] +# +# # good +# [ +# a, +# b, +# foo( +# bar +# ) +# ] +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# [a, b, foo( +# bar +# )] +# +# @example AllowMultilineFinalElement: true +# +# # good +# [a, b, foo( +# bar +# )] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_line_breaks.rb:47 +class RuboCop::Cop::Layout::MultilineArrayLineBreaks < ::RuboCop::Cop::Base + include ::RuboCop::Cop::MultilineElementLineBreaks + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_line_breaks.rb:53 + def on_array(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_line_breaks.rb:59 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_array_line_breaks.rb:51 +RuboCop::Cop::Layout::MultilineArrayLineBreaks::MSG = T.let(T.unsafe(nil), String) + +# Checks whether the multiline assignments have a newline +# after the assignment operator. +# +# @example EnforcedStyle: new_line (default) +# # bad +# foo = if expression +# 'bar' +# end +# +# # good +# foo = +# if expression +# 'bar' +# end +# +# # good +# foo = +# begin +# compute +# rescue => e +# nil +# end +# +# @example EnforcedStyle: same_line +# # good +# foo = if expression +# 'bar' +# end +# +# @example SupportedTypes: ['block', 'case', 'class', 'if', 'kwbegin', 'module'] (default) +# # good +# foo = +# if expression +# 'bar' +# end +# +# # good +# foo = +# [1].map do |i| +# i + 1 +# end +# +# @example SupportedTypes: ['block'] +# # good +# foo = if expression +# 'bar' +# end +# +# # good +# foo = +# [1].map do |i| +# 'bar' * i +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:60 +class RuboCop::Cop::Layout::MultilineAssignmentLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CheckAssignment + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:75 + def check_assignment(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:85 + def check_by_enforced_style(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:94 + def check_new_line_offense(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:102 + def check_same_line_offense(node, rhs); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:115 + def supported_types; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:72 +RuboCop::Cop::Layout::MultilineAssignmentLayout::BLOCK_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:66 +RuboCop::Cop::Layout::MultilineAssignmentLayout::NEW_LINE_OFFENSE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_assignment_layout.rb:69 +RuboCop::Cop::Layout::MultilineAssignmentLayout::SAME_LINE_OFFENSE = T.let(T.unsafe(nil), String) + +# Checks whether the multiline do end blocks have a newline +# after the start of the block. Additionally, it checks whether the block +# arguments, if any, are on the same line as the start of the +# block. Putting block arguments on separate lines, because the whole +# line would otherwise be too long, is accepted. +# +# @example +# # bad +# blah do |i| foo(i) +# bar(i) +# end +# +# # bad +# blah do +# |i| foo(i) +# bar(i) +# end +# +# # good +# blah do |i| +# foo(i) +# bar(i) +# end +# +# # bad +# blah { |i| foo(i) +# bar(i) +# } +# +# # good +# blah { |i| +# foo(i) +# bar(i) +# } +# +# # good +# blah { | +# long_list, +# of_parameters, +# that_would_not, +# fit_on_one_line +# | +# foo(i) +# bar(i) +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:51 +class RuboCop::Cop::Layout::MultilineBlockLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:59 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:72 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:71 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:101 + def add_offense_for_expression(node, expr, msg); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:76 + def args_on_beginning_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:108 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:123 + def autocorrect_arguments(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:133 + def autocorrect_body(corrector, node, block_body); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:145 + def block_arg_string(node, args); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:93 + def characters_needed_for_space_and_pipes(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:157 + def include_trailing_comma?(args); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:80 + def line_break_necessary_in_args?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:86 + def needed_length_for_args(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:56 +RuboCop::Cop::Layout::MultilineBlockLayout::ARG_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:55 +RuboCop::Cop::Layout::MultilineBlockLayout::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_block_layout.rb:57 +RuboCop::Cop::Layout::MultilineBlockLayout::PIPE_SIZE = T.let(T.unsafe(nil), Integer) + +# Checks that the closing brace in a hash literal is either +# on the same line as the last hash element, or a new line. +# +# When using the `symmetrical` (default) style: +# +# If a hash's opening brace is on the same line as the first element +# of the hash, then the closing brace should be on the same line as +# the last element of the hash. +# +# If a hash's opening brace is on the line above the first element +# of the hash, then the closing brace should be on the line below +# the last element of the hash. +# +# When using the `new_line` style: +# +# The closing brace of a multi-line hash literal must be on the line +# after the last element of the hash. +# +# When using the `same_line` style: +# +# The closing brace of a multi-line hash literal must be on the same +# line as the last element of the hash. +# +# @example EnforcedStyle: symmetrical (default) +# +# # bad +# { a: 1, +# b: 2 +# } +# # bad +# { +# a: 1, +# b: 2 } +# +# # good +# { a: 1, +# b: 2 } +# +# # good +# { +# a: 1, +# b: 2 +# } +# +# @example EnforcedStyle: new_line +# # bad +# { +# a: 1, +# b: 2 } +# +# # bad +# { a: 1, +# b: 2 } +# +# # good +# { a: 1, +# b: 2 +# } +# +# # good +# { +# a: 1, +# b: 2 +# } +# +# @example EnforcedStyle: same_line +# # bad +# { a: 1, +# b: 2 +# } +# +# # bad +# { +# a: 1, +# b: 2 +# } +# +# # good +# { +# a: 1, +# b: 2 } +# +# # good +# { a: 1, +# b: 2 } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_brace_layout.rb:91 +class RuboCop::Cop::Layout::MultilineHashBraceLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineLiteralBraceLayout + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_brace_layout.rb:109 + def on_hash(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_brace_layout.rb:103 +RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_brace_layout.rb:106 +RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_brace_layout.rb:99 +RuboCop::Cop::Layout::MultilineHashBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_brace_layout.rb:95 +RuboCop::Cop::Layout::MultilineHashBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# Ensures that each key in a multi-line hash +# starts on a separate line. +# +# @example +# +# # bad +# { +# a: 1, b: 2, +# c: 3 +# } +# +# # good +# { +# a: 1, +# b: 2, +# c: 3 +# } +# +# # good +# { +# a: 1, +# b: { +# c: 3, +# } +# } +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# { a: 1, b: { +# c: 3, +# }} +# +# @example AllowMultilineFinalElement: true +# +# # good +# { a: 1, b: { +# c: 3, +# }} +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb:46 +class RuboCop::Cop::Layout::MultilineHashKeyLineBreaks < ::RuboCop::Cop::Base + include ::RuboCop::Cop::MultilineElementLineBreaks + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb:52 + def on_hash(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb:68 + def ignore_last_element?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb:64 + def starts_with_curly_brace?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb:50 +RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), String) + +# Ensures that each argument in a multi-line method call +# starts on a separate line. +# +# NOTE: This cop does not move the first argument, if you want that to +# be on a separate line, see `Layout/FirstMethodArgumentLineBreak`. +# +# @example +# +# # bad +# foo(a, b, +# c +# ) +# +# # bad +# foo(a, b, { +# foo: "bar", +# }) +# +# # good +# foo( +# a, +# b, +# c +# ) +# +# # good +# foo(a, b, c) +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# foo(a, b, +# c +# ) +# +# # bad +# foo( +# a, b, { +# foo: "bar", +# } +# ) +# +# # good +# foo( +# a, +# b, +# { +# foo: "bar", +# } +# ) +# +# @example AllowMultilineFinalElement: true +# +# # bad +# foo(a, b, +# c +# ) +# +# # good +# foo( +# a, b, { +# foo: "bar", +# } +# ) +# +# # good +# foo( +# a, +# b, +# { +# foo: "bar", +# } +# ) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb:80 +class RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks < ::RuboCop::Cop::Base + include ::RuboCop::Cop::MultilineElementLineBreaks + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb:102 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb:86 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb:106 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb:84 +RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks::MSG = T.let(T.unsafe(nil), String) + +# Checks that the closing brace in a method call is either +# on the same line as the last method argument, or a new line. +# +# When using the `symmetrical` (default) style: +# +# If a method call's opening brace is on the same line as the first +# argument of the call, then the closing brace should be on the same +# line as the last argument of the call. +# +# If a method call's opening brace is on the line above the first +# argument of the call, then the closing brace should be on the line +# below the last argument of the call. +# +# When using the `new_line` style: +# +# The closing brace of a multi-line method call must be on the line +# after the last argument of the call. +# +# When using the `same_line` style: +# +# The closing brace of a multi-line method call must be on the same +# line as the last argument of the call. +# +# @example EnforcedStyle: symmetrical (default) +# # bad +# foo(a, +# b +# ) +# +# # bad +# foo( +# a, +# b) +# +# # good +# foo(a, +# b) +# +# # good +# foo( +# a, +# b +# ) +# +# @example EnforcedStyle: new_line +# # bad +# foo( +# a, +# b) +# +# # bad +# foo(a, +# b) +# +# # good +# foo(a, +# b +# ) +# +# # good +# foo( +# a, +# b +# ) +# +# @example EnforcedStyle: same_line +# # bad +# foo(a, +# b +# ) +# +# # bad +# foo( +# a, +# b +# ) +# +# # good +# foo( +# a, +# b) +# +# # good +# foo(a, +# b) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:91 +class RuboCop::Cop::Layout::MultilineMethodCallBraceLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineLiteralBraceLayout + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:112 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:109 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:116 + def children(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:120 + def ignored_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:124 + def single_line_ignoring_receiver?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:103 +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:106 +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:99 +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb:95 +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# Checks the indentation of the method name part in method calls +# that span more than one line. +# +# @example EnforcedStyle: aligned (default) +# # bad +# while myvariable +# .b +# # do something +# end +# +# # good +# while myvariable +# .b +# # do something +# end +# +# # good +# Thing.a +# .b +# .c +# +# @example EnforcedStyle: indented +# # good +# while myvariable +# .b +# +# # do something +# end +# +# @example EnforcedStyle: indented_relative_to_receiver +# # good +# while myvariable +# .a +# .b +# +# # do something +# end +# +# # good +# myvariable = Thing +# .a +# .b +# .c +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:50 +class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::MultilineExpressionIndentation + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:57 + def validate_config; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:196 + def after_multiline_block_base(first_call, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:285 + def align_with_base_message(rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:224 + def aligned_with_first_line_dot?(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:307 + def alignment_base(node, rhs, given_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:366 + def alignment_base_for_chained_receiver?(receiver_chain, base_receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:88 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:289 + def base_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:247 + def calculate_column_delta_offense(rhs, correct_column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:162 + def check_hash_pair_indentation(node, lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:153 + def check_hash_pair_indented_style(rhs, pair_ancestor); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:234 + def check_regular_indentation(node, lhs, rhs, given_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:103 + def correct_block(corrector, block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:97 + def correct_selector_only(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:252 + def extra_indentation(given_style, parent); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:69 + def find_base_receiver(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:411 + def find_continuation_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:212 + def find_enclosing_chain_call(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:354 + def find_hash_method_base_in_receiver_chain(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:172 + def find_hash_pair_alignment_base(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:405 + def find_multiline_block_chain_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:75 + def find_pair_ancestor(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:379 + def first_call_alignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:435 + def first_call_has_a_dot(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:180 + def first_dot_alignment_base(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:396 + def get_dot_right_above(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:425 + def handle_descendant_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:220 + def hash_arg_in_chain?(call, hash_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:145 + def hash_pair_aligned?(pair_ancestor, given_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:149 + def hash_pair_indented?(node, pair_ancestor, given_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:205 + def inside_multiline_chain_arg?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:262 + def message(node, lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:390 + def method_on_receiver_last_line?(node, base_receiver, type); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:293 + def no_base_message(lhs, rhs, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:125 + def offending_range(node, lhs, rhs, given_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:442 + def operation_rhs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:452 + def operator_rhs?(node, receiver); end + + # a + # .b + # .c + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:346 + def receiver_alignment_base(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:280 + def relative_to_receiver_message(rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:109 + def relevant_node?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:113 + def right_hand_side(send_node); end + + # a.b + # .c + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:334 + def semantic_alignment_base(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:371 + def semantic_alignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:276 + def should_align_with_base?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:272 + def should_indent_relative_to_receiver?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:421 + def single_line_block_receiver?(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:141 + def skip_for_context?(node, pair_ancestor); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:316 + def syntactic_alignment_base(lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_call_indentation.rb:84 + def unwrap_block_node(node); end +end + +# Checks that the closing brace in a method definition is either +# on the same line as the last method parameter, or a new line. +# +# When using the `symmetrical` (default) style: +# +# If a method definition's opening brace is on the same line as the +# first parameter of the definition, then the closing brace should be +# on the same line as the last parameter of the definition. +# +# If a method definition's opening brace is on the line above the first +# parameter of the definition, then the closing brace should be on the +# line below the last parameter of the definition. +# +# When using the `new_line` style: +# +# The closing brace of a multi-line method definition must be on the line +# after the last parameter of the definition. +# +# When using the `same_line` style: +# +# The closing brace of a multi-line method definition must be on the same +# line as the last parameter of the definition. +# +# @example EnforcedStyle: symmetrical (default) +# # bad +# def foo(a, +# b +# ) +# end +# +# # bad +# def foo( +# a, +# b) +# end +# +# # good +# def foo(a, +# b) +# end +# +# # good +# def foo( +# a, +# b +# ) +# end +# +# @example EnforcedStyle: new_line +# # bad +# def foo( +# a, +# b) +# end +# +# # bad +# def foo(a, +# b) +# end +# +# # good +# def foo(a, +# b +# ) +# end +# +# # good +# def foo( +# a, +# b +# ) +# end +# +# @example EnforcedStyle: same_line +# # bad +# def foo(a, +# b +# ) +# end +# +# # bad +# def foo( +# a, +# b +# ) +# end +# +# # good +# def foo( +# a, +# b) +# end +# +# # good +# def foo(a, +# b) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:103 +class RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineLiteralBraceLayout + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:121 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:124 + def on_defs(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:115 +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:118 +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:111 +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb:107 +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +# Ensures that each parameter in a multi-line method definition +# starts on a separate line. +# +# NOTE: This cop does not move the first argument, if you want that to +# be on a separate line, see `Layout/FirstMethodParameterLineBreak`. +# +# @example +# +# # bad +# def foo(a, b, +# c +# ) +# end +# +# # good +# def foo( +# a, +# b, +# c +# ) +# end +# +# # good +# def foo( +# a, +# b = { +# foo: "bar", +# } +# ) +# end +# +# # good +# def foo(a, b, c) +# end +# +# @example AllowMultilineFinalElement: false (default) +# +# # bad +# def foo(a, b = { +# foo: "bar", +# }) +# end +# +# @example AllowMultilineFinalElement: true +# +# # good +# def foo(a, b = { +# foo: "bar", +# }) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb:57 +class RuboCop::Cop::Layout::MultilineMethodParameterLineBreaks < ::RuboCop::Cop::Base + include ::RuboCop::Cop::MultilineElementLineBreaks + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb:63 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb:68 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb:72 + def ignore_last_element?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb:61 +RuboCop::Cop::Layout::MultilineMethodParameterLineBreaks::MSG = T.let(T.unsafe(nil), String) + +# Checks the indentation of the right hand side operand in binary operations that +# span more than one line. +# +# The `aligned` style checks that operators are aligned if they are part of an `if` or `while` +# condition, an explicit `return` statement, etc. In other contexts, the second operand should +# be indented regardless of enforced style. +# +# In both styles, operators should be aligned when an assignment begins on the next line. +# +# @example EnforcedStyle: aligned (default) +# # bad +# if a + +# b +# something && +# something_else +# end +# +# # good +# if a + +# b +# something && +# something_else +# end +# +# @example EnforcedStyle: indented +# # bad +# if a + +# b +# something && +# something_else +# end +# +# # good +# if a + +# b +# something && +# something_else +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:45 +class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::MultilineExpressionIndentation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:51 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:55 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:59 + def validate_config; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:70 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:80 + def check_and_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:113 + def message(node, lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:85 + def offending_range(node, lhs, rhs, given_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:74 + def relevant_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:124 + def right_hand_side(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/multiline_operation_indentation.rb:98 + def should_align?(node, rhs, given_style); end +end + +# Checks that the parameters on a multi-line method call or definition are aligned. +# +# To set the alignment of the first argument, use the +# `Layout/FirstParameterIndentation` cop. +# +# @example EnforcedStyle: with_first_parameter (default) +# # good +# +# def foo(bar, +# baz) +# 123 +# end +# +# def foo( +# bar, +# baz +# ) +# 123 +# end +# +# # bad +# +# def foo(bar, +# baz) +# 123 +# end +# +# # bad +# +# def foo( +# bar, +# baz) +# 123 +# end +# +# @example EnforcedStyle: with_fixed_indentation +# # good +# +# def foo(bar, +# baz) +# 123 +# end +# +# def foo( +# bar, +# baz +# ) +# 123 +# end +# +# # bad +# +# def foo(bar, +# baz) +# 123 +# end +# +# # bad +# +# def foo( +# bar, +# baz) +# 123 +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:70 +class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:80 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:85 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:89 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:101 + def base_column(node, args); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:97 + def fixed_indentation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:93 + def message(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:112 + def target_method_lineno(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:74 +RuboCop::Cop::Layout::ParameterAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/parameter_alignment.rb:77 +RuboCop::Cop::Layout::ParameterAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) + +# Checks whether certain expressions, e.g. method calls, that could fit +# completely on a single line, are broken up into multiple lines unnecessarily. +# +# @example +# # bad +# foo( +# a, +# b +# ) +# +# # good +# foo(a, b) +# +# # bad +# puts 'string that fits on ' \ +# 'a single line' +# +# # good +# puts 'string that fits on a single line' +# +# # bad +# things +# .select { |thing| thing.cond? } +# .join('-') +# +# # good +# things.select { |thing| thing.cond? }.join('-') +# +# @example InspectBlocks: false (default) +# # good +# foo(a) do |x| +# puts x +# end +# +# @example InspectBlocks: true +# # bad +# foo(a) do |x| +# puts x +# end +# +# # good +# foo(a) { |x| puts x } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:49 +class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CheckAssignment + include ::RuboCop::Cop::CheckSingleLineSuitability + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:70 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:56 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:60 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:78 + def check_assignment(node, _rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:108 + def configured_to_not_be_inspected?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:127 + def convertible_block?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:74 + def end_with_percent_blank_string?(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:102 + def index_access_call_chained?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:91 + def offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:115 + def other_cop_takes_precedence?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:84 + def register_offense(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:98 + def require_backslash?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:123 + def single_line_block_chain_enabled?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/redundant_line_break.rb:54 +RuboCop::Cop::Layout::RedundantLineBreak::MSG = T.let(T.unsafe(nil), String) + +# Checks whether the rescue and ensure keywords are aligned +# properly. +# +# @example +# +# # bad +# begin +# something +# rescue +# puts 'error' +# end +# +# # good +# begin +# something +# rescue +# puts 'error' +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:24 +class RuboCop::Cop::Layout::RescueEnsureAlignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::EndKeywordAlignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:39 + def on_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:43 + def on_new_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:35 + def on_resbody(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:187 + def access_modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:165 + def access_modifier_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:151 + def aligned_with_leading_dot?(do_keyword_line, send_node_loc, rescue_keyword_column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:138 + def aligned_with_line_break_method?(ancestor_node, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:196 + def alignment_location(alignment_node); end + + # We will use ancestor or wrapper with access modifier. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:118 + def alignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:95 + def alignment_source(node, starting_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:134 + def ancestor_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:157 + def assignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:72 + def autocorrect(corrector, node, alignment_location); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:212 + def begin_end_alignment_style; end + + # Check alignment of node with rescue or ensure modifiers. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:56 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:82 + def format_message(alignment_node, alignment_loc, kw_loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:174 + def modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:180 + def whitespace_range(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:33 +RuboCop::Cop::Layout::RescueEnsureAlignment::ALTERNATIVE_ACCESS_MODIFIERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:32 +RuboCop::Cop::Layout::RescueEnsureAlignment::ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/rescue_ensure_alignment.rb:29 +RuboCop::Cop::Layout::RescueEnsureAlignment::MSG = T.let(T.unsafe(nil), String) + +# Checks if method calls are chained onto single line blocks. It considers that a +# line break before the dot improves the readability of the code. +# +# @example +# # bad +# example.select { |item| item.cond? }.join('-') +# +# # good +# example.select { |item| item.cond? } +# .join('-') +# +# # good (not a concern for this cop) +# example.select do |item| +# item.cond? +# end.join('-') +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:22 +class RuboCop::Cop::Layout::SingleLineBlockChain < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:36 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:32 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:56 + def call_method_after_block?(node, dot_range, closing_block_delimiter_line_num); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:40 + def offending_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:62 + def selector_range(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:28 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/single_line_block_chain.rb:26 +RuboCop::Cop::Layout::SingleLineBlockChain::MSG = T.let(T.unsafe(nil), String) + +# Checks for colon (`:`) not followed by some kind of space. +# N.B. this cop does not handle spaces after a ternary operator, which are +# instead handled by `Layout/SpaceAroundOperators`. +# +# @example +# # bad +# def f(a:, b:2); {a:3}; end +# +# # good +# def f(a:, b: 2); {a: 3}; end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_colon.rb:16 +class RuboCop::Cop::Layout::SpaceAfterColon < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_colon.rb:29 + def on_kwoptarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_colon.rb:21 + def on_pair(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_colon.rb:43 + def followed_by_space?(colon); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_colon.rb:39 + def register_offense(colon); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_colon.rb:19 +RuboCop::Cop::Layout::SpaceAfterColon::MSG = T.let(T.unsafe(nil), String) + +# Checks for comma (`,`) not followed by some kind of space. +# +# @example +# +# # bad +# [1,2] +# { foo:bar,} +# +# # good +# [1, 2] +# { foo:bar, } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_comma.rb:17 +class RuboCop::Cop::Layout::SpaceAfterComma < ::RuboCop::Cop::Base + include ::RuboCop::Cop::SpaceAfterPunctuation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_comma.rb:26 + def kind(token, next_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_comma.rb:21 + def space_style_before_rcurly; end +end + +# Checks for space between a method name and a left parenthesis in defs. +# +# @example +# +# # bad +# def func (x) end +# def method= (y) end +# +# # good +# def func(x) end +# def method=(y) end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_method_name.rb:17 +class RuboCop::Cop::Layout::SpaceAfterMethodName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_method_name.rb:23 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_method_name.rb:35 + def on_defs(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_method_name.rb:21 +RuboCop::Cop::Layout::SpaceAfterMethodName::MSG = T.let(T.unsafe(nil), String) + +# Checks for space after `!`. +# +# @example +# # bad +# ! something +# +# # good +# !something +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_not.rb:14 +class RuboCop::Cop::Layout::SpaceAfterNot < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_not.rb:21 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_not.rb:33 + def whitespace_after_operator?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_not.rb:18 +RuboCop::Cop::Layout::SpaceAfterNot::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_not.rb:19 +RuboCop::Cop::Layout::SpaceAfterNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for semicolon (`;`) not followed by some kind of space. +# +# @example +# # bad +# x = 1;y = 2 +# +# # good +# x = 1; y = 2 +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_semicolon.rb:14 +class RuboCop::Cop::Layout::SpaceAfterSemicolon < ::RuboCop::Cop::Base + include ::RuboCop::Cop::SpaceAfterPunctuation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_semicolon.rb:23 + def kind(token, _next_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_semicolon.rb:27 + def space_missing?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_semicolon.rb:18 + def space_style_before_rcurly; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_after_semicolon.rb:33 + def semicolon_sequence?(token, next_token); end +end + +# Checks the spacing inside and after block parameters pipes. Line breaks +# inside parameter pipes are checked by `Layout/MultilineBlockLayout` and +# not by this cop. +# +# @example EnforcedStyleInsidePipes: no_space (default) +# # bad +# {}.each { | x, y |puts x } +# ->( x, y ) { puts x } +# +# # good +# {}.each { |x, y| puts x } +# ->(x, y) { puts x } +# +# @example EnforcedStyleInsidePipes: space +# # bad +# {}.each { |x, y| puts x } +# ->(x, y) { puts x } +# +# # good +# {}.each { | x, y | puts x } +# ->( x, y ) { puts x } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:27 +class RuboCop::Cop::Layout::SpaceAroundBlockParameters < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:32 + def on_block(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:65 + def check_after_closing_pipe(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:125 + def check_arg(arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:103 + def check_closing_pipe_space(arguments, closing_pipe); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:121 + def check_each_arg(args); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:56 + def check_inside_pipes(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:150 + def check_no_space(space_begin_pos, space_end_pos, msg); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:73 + def check_no_space_style_inside_pipes(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:92 + def check_opening_pipe_space(arguments, opening_pipe); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:136 + def check_space(space_begin_pos, space_end_pos, range, msg, node = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:85 + def check_space_style_inside_pipes(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:113 + def last_end_pos_inside_pipes(arguments, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:44 + def pipes(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:48 + def pipes?(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_block_parameters.rb:52 + def style_parameter_name; end +end + +# Checks that the equals signs in parameter default assignments +# have or don't have surrounding space depending on configuration. +# +# @example EnforcedStyle: space (default) +# # bad +# def some_method(arg1=:default, arg2=nil, arg3=[]) +# # do something... +# end +# +# # good +# def some_method(arg1 = :default, arg2 = nil, arg3 = []) +# # do something... +# end +# +# @example EnforcedStyle: no_space +# # bad +# def some_method(arg1 = :default, arg2 = nil, arg3 = []) +# # do something... +# end +# +# # good +# def some_method(arg1=:default, arg2=nil, arg3=[]) +# # do something... +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:30 +class RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:38 + def on_optarg(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:67 + def autocorrect(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:46 + def check_optarg(arg, equals, value); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:58 + def incorrect_style_detected(arg, value); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:83 + def message(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:79 + def no_surrounding_space?(arg, equals); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:75 + def space_on_both_sides?(arg, equals); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb:36 +RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault::MSG = T.let(T.unsafe(nil), String) + +# Checks the spacing around the keywords. +# +# @example +# +# # bad +# something 'test'do|x| +# end +# +# while(something) +# end +# +# something = 123if test +# +# return(foo + bar) +# +# # good +# something 'test' do |x| +# end +# +# while (something) +# end +# +# something = 123 if test +# +# return (foo + bar) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:32 +class RuboCop::Cop::Layout::SpaceAroundKeyword < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:46 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:50 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:56 + def on_break(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:60 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:64 + def on_case_match(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:164 + def on_defined?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:68 + def on_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:72 + def on_for(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:76 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:80 + def on_if_guard(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:84 + def on_in_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:54 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:88 + def on_kwbegin(node); end + + # Handle one-line pattern matching syntax (`in`) with `Parser::Ruby27`. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:93 + def on_match_pattern(node); end + + # Handle one-line pattern matching syntax (`in`) with `Parser::Ruby30`. + # + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:100 + def on_match_pattern_p(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:104 + def on_next(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:53 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:108 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:112 + def on_postexe(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:116 + def on_preexe(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:120 + def on_resbody(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:124 + def on_rescue(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:128 + def on_return(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:132 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:136 + def on_super(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:144 + def on_unless_guard(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:148 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:152 + def on_when(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:156 + def on_while(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:160 + def on_yield(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:140 + def on_zsuper(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:243 + def accept_left_parenthesis?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:247 + def accept_left_square_bracket?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:251 + def accept_namespace_operator?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:236 + def accepted_opening_delimiter?(range, char); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:170 + def check(node, locations, begin_keyword = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:185 + def check_begin(node, range, begin_keyword); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:191 + def check_end(node, range, begin_keyword); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:204 + def check_keyword(node, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:200 + def do?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:259 + def namespace_operator?(range, pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:263 + def preceded_by_operator?(node, _range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:255 + def safe_navigation_call?(range, pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:225 + def space_after_missing?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:218 + def space_before_missing?(range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:41 +RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_PAREN = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:42 +RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_SQUARE_BRACKET = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:43 +RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:38 +RuboCop::Cop::Layout::SpaceAroundKeyword::DO = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:36 +RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_AFTER = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:35 +RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_BEFORE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:40 +RuboCop::Cop::Layout::SpaceAroundKeyword::NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:44 +RuboCop::Cop::Layout::SpaceAroundKeyword::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_keyword.rb:39 +RuboCop::Cop::Layout::SpaceAroundKeyword::SAFE_NAVIGATION = T.let(T.unsafe(nil), String) + +# Checks method call operators to not have spaces around them. +# +# @example +# # bad +# foo. bar +# foo .bar +# foo . bar +# foo. bar .buzz +# foo +# . bar +# . buzz +# foo&. bar +# foo &.bar +# foo &. bar +# foo &. bar&. buzz +# RuboCop:: Cop +# RuboCop:: Cop:: Base +# :: RuboCop::Cop +# +# # good +# foo.bar +# foo.bar.buzz +# foo +# .bar +# .buzz +# foo&.bar +# foo&.bar&.buzz +# RuboCop::Cop +# RuboCop::Cop::Base +# ::RuboCop::Cop +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:37 +class RuboCop::Cop::Layout::SpaceAroundMethodCallOperator < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:53 + def on_const(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:51 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:45 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:87 + def check_space(begin_pos, end_pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:67 + def check_space_after_dot(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:81 + def check_space_after_double_colon(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:61 + def check_space_before_dot(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:43 +RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_method_call_operator.rb:41 +RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::SPACES_REGEXP = T.let(T.unsafe(nil), Regexp) + +# Checks that operators have space around them, except for ** which +# should or shouldn't have surrounding space depending on configuration. +# It allows vertical alignment consisting of one or more whitespace +# around operators. +# +# This cop has `AllowForAlignment` option. When `true`, allows most +# uses of extra spacing if the intent is to align with an operator on +# the previous or next line, not counting empty lines or comment lines. +# +# @example +# # bad +# total = 3*4 +# "apple"+"juice" +# my_number = 38/4 +# +# # good +# total = 3 * 4 +# "apple" + "juice" +# my_number = 38 / 4 +# +# @example AllowForAlignment: true (default) +# # good +# { +# 1 => 2, +# 11 => 3 +# } +# +# @example AllowForAlignment: false +# # bad +# { +# 1 => 2, +# 11 => 3 +# } +# +# @example EnforcedStyleForExponentOperator: no_space (default) +# # bad +# a ** b +# +# # good +# a**b +# +# @example EnforcedStyleForExponentOperator: space +# # bad +# a**b +# +# # good +# a ** b +# +# @example EnforcedStyleForRationalLiterals: no_space (default) +# # bad +# 1 / 48r +# +# # good +# 1/48r +# +# @example EnforcedStyleForRationalLiterals: space +# # bad +# 1/48r +# +# # good +# 1 / 48r +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:67 +class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base + include ::RuboCop::Cop::PrecedingFollowingAlignment + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::RationalLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:163 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:171 + def on_and_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:115 + def on_assignment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:132 + def on_binary(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:165 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:124 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:168 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:169 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:92 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:167 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:164 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:166 + def on_masgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:154 + def on_match_alt(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:158 + def on_match_as(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:148 + def on_match_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:172 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:162 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:170 + def on_or_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:84 + def on_pair(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:99 + def on_resbody(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:80 + def on_sclass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:105 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:140 + def on_setter_method(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:270 + def align_hash_cop_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:205 + def autocorrect(corrector, range, right_operand); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:186 + def check_operator(type, operator, right_operand); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:223 + def enclose_operator_with_space(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:250 + def excess_leading_space?(type, operator, with_space); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:265 + def excess_trailing_space?(right_operand, with_space); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:291 + def force_equal_sign_alignment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:274 + def hash_table_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:200 + def offense(type, operator, with_space, right_operand); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:236 + def offense_message(type, operator, with_space, right_operand); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:182 + def operator_with_regular_syntax?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:176 + def regular_operator?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:295 + def should_not_have_surrounding_space?(operator, right_operand); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:281 + def space_around_exponent_operator?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:285 + def space_around_slash_operator?(right_operand); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:76 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:74 +RuboCop::Cop::Layout::SpaceAroundOperators::EXCESSIVE_SPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_around_operators.rb:73 +RuboCop::Cop::Layout::SpaceAroundOperators::IRREGULAR_METHODS = T.let(T.unsafe(nil), Array) + +# Checks that block braces have or don't have a space before the opening +# brace depending on configuration. +# +# @example EnforcedStyle: space (default) +# # bad +# foo.map{ |a| +# a.bar.to_s +# } +# +# # good +# foo.map { |a| +# a.bar.to_s +# } +# +# @example EnforcedStyle: no_space +# # bad +# foo.map { |a| +# a.bar.to_s +# } +# +# # good +# foo.map{ |a| +# a.bar.to_s +# } +# +# @example EnforcedStyleForEmptyBraces: space (default) +# # bad +# 7.times{} +# +# # good +# 7.times {} +# +# @example EnforcedStyleForEmptyBraces: no_space +# # bad +# 7.times {} +# +# # good +# 7.times{} +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:44 +class RuboCop::Cop::Layout::SpaceBeforeBlockBraces < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:56 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:80 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:79 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:134 + def autocorrect(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:154 + def block_delimiters_style; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:84 + def check_empty(left_brace, space_plus_brace, used_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:110 + def check_non_empty(left_brace, space_plus_brace, used_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:150 + def conflict_with_block_delimiters?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:158 + def empty_braces?(loc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:102 + def handle_different_styles_for_empty_braces(used_style); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:125 + def space_detected(left_brace, space_plus_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:118 + def space_missing(left_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:141 + def style_for_empty_braces; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:52 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:50 +RuboCop::Cop::Layout::SpaceBeforeBlockBraces::DETECTED_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_block_braces.rb:49 +RuboCop::Cop::Layout::SpaceBeforeBlockBraces::MISSING_MSG = T.let(T.unsafe(nil), String) + +# Checks for space between the name of a receiver and a left +# bracket. +# +# @example +# +# # bad +# collection [index_or_key] +# +# # good +# collection[index_or_key] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_brackets.rb:17 +class RuboCop::Cop::Layout::SpaceBeforeBrackets < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_brackets.rb:24 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_brackets.rb:21 +RuboCop::Cop::Layout::SpaceBeforeBrackets::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_brackets.rb:22 +RuboCop::Cop::Layout::SpaceBeforeBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for comma (`,`) preceded by space. +# +# @example +# # bad +# [1 , 2 , 3] +# a(1 , 2) +# each { |a , b| } +# +# # good +# [1, 2, 3] +# a(1, 2) +# each { |a, b| } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_comma.rb:19 +class RuboCop::Cop::Layout::SpaceBeforeComma < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SpaceBeforePunctuation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_comma.rb:23 + def kind(token); end +end + +# Checks for missing space between a token and a comment on the +# same line. +# +# @example +# # bad +# 1 + 1# this operation does ... +# +# # good +# 1 + 1 # this operation does ... +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_comment.rb:15 +class RuboCop::Cop::Layout::SpaceBeforeComment < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_comment.rb:20 + def on_new_investigation; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_comment.rb:18 +RuboCop::Cop::Layout::SpaceBeforeComment::MSG = T.let(T.unsafe(nil), String) + +# Checks that exactly one space is used between a method name and the +# first argument for method calls without parentheses. +# +# Alternatively, extra spaces can be added to align the argument with +# something on a preceding or following line, if the AllowForAlignment +# config parameter is true. +# +# @example +# # bad +# something x +# something y, z +# something'hello' +# +# # good +# something x +# something y, z +# something 'hello' +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:24 +class RuboCop::Cop::Layout::SpaceBeforeFirstArg < ::RuboCop::Cop::Base + include ::RuboCop::Cop::PrecedingFollowingAlignment + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:47 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:35 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:55 + def expect_params_after_method_name?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:64 + def no_space_between_method_name_and_first_argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:51 + def regular_method_call_with_arguments?(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:31 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_first_arg.rb:29 +RuboCop::Cop::Layout::SpaceBeforeFirstArg::MSG = T.let(T.unsafe(nil), String) + +# Checks for semicolon (`;`) preceded by space. +# +# @example +# # bad +# x = 1 ; y = 2 +# +# # good +# x = 1; y = 2 +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_semicolon.rb:14 +class RuboCop::Cop::Layout::SpaceBeforeSemicolon < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SpaceBeforePunctuation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_before_semicolon.rb:18 + def kind(token); end +end + +# Checks for spaces between `->` and opening parameter +# parenthesis (`(`) in lambda literals. +# +# @example EnforcedStyle: require_no_space (default) +# # bad +# a = -> (x, y) { x + y } +# +# # good +# a = ->(x, y) { x + y } +# +# @example EnforcedStyle: require_space +# # bad +# a = ->(x, y) { x + y } +# +# # good +# a = -> (x, y) { x + y } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:22 +class RuboCop::Cop::Layout::SpaceInLambdaLiteral < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:31 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:51 + def arrow_lambda_with_args?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:73 + def lambda_arguments(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:66 + def range_of_offense(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:59 + def space_after_arrow(lambda_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:55 + def space_after_arrow?(lambda_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:28 +RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_NO_SPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:27 +RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_SPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_in_lambda_literal.rb:29 +RuboCop::Cop::Layout::SpaceInLambdaLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that brackets used for array literals have or don't have +# surrounding space depending on configuration. +# +# Array pattern matching is handled in the same way. +# +# @example EnforcedStyle: no_space (default) +# # The `no_space` style enforces that array literals have +# # no surrounding space. +# +# # bad +# array = [ a, b, c, d ] +# array = [ a, [ b, c ]] +# +# # good +# array = [a, b, c, d] +# array = [a, [b, c]] +# +# @example EnforcedStyle: space +# # The `space` style enforces that array literals have +# # surrounding space. +# +# # bad +# array = [a, b, c, d] +# array = [ a, [ b, c ]] +# +# # good +# array = [ a, b, c, d ] +# array = [ a, [ b, c ] ] +# +# @example EnforcedStyle: compact +# # The `compact` style normally requires a space inside +# # array brackets, with the exception that successive left +# # or right brackets are collapsed together in nested arrays. +# +# # bad +# array = [a, b, c, d] +# array = [ a, [ b, c ] ] +# array = [ +# [ a ], +# [ b, c ] +# ] +# +# # good +# array = [ a, b, c, d ] +# array = [ a, [ b, c ]] +# array = [[ a ], +# [ b, c ]] +# +# @example EnforcedStyleForEmptyBrackets: no_space (default) +# # The `no_space` EnforcedStyleForEmptyBrackets style enforces that +# # empty array brackets do not contain spaces. +# +# # bad +# foo = [ ] +# bar = [ ] +# +# # good +# foo = [] +# bar = [] +# +# @example EnforcedStyleForEmptyBrackets: space +# # The `space` EnforcedStyleForEmptyBrackets style enforces that +# # empty array brackets contain exactly one space. +# +# # bad +# foo = [] +# bar = [ ] +# +# # good +# foo = [ ] +# bar = [ ] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:78 +class RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:86 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:102 + def on_array_pattern(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:124 + def array_brackets(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:110 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:232 + def compact(corrector, bracket, side); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:218 + def compact_corrections(corrector, node, left, right); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:210 + def compact_offense(node, token, side: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:172 + def compact_offenses(node, left, right, start_ok, end_ok); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:133 + def empty_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:141 + def end_has_own_line?(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:106 + def find_node_with_brackets(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:148 + def index_for(node, token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:156 + def issue_offenses(node, left, right, start_ok, end_ok); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:152 + def line_and_column_for(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:193 + def multi_dimensional_array?(node, token, side: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:204 + def next_to_bracket?(token, side: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:168 + def next_to_comment?(node, token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:137 + def next_to_newline?(node, token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:185 + def qualifies_for_compact?(node, token, side: T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:84 +RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb:83 +RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::MSG = T.let(T.unsafe(nil), String) + +# Checks for unnecessary additional spaces inside array percent literals +# (i.e. %i/%w). +# +# Note that blank percent literals (e.g. `%i( )`) are checked by +# `Layout/SpaceInsidePercentLiteralDelimiters`. +# +# @example +# +# # bad +# %w(foo bar baz) +# # good +# %i(foo bar baz) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_percent_literal.rb:18 +class RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::MatchRange + include ::RuboCop::Cop::PercentLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_percent_literal.rb:26 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_percent_literal.rb:30 + def on_percent_literal(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_percent_literal.rb:40 + def each_unnecessary_space_match(node, &blk); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_percent_literal.rb:23 +RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_array_percent_literal.rb:24 +RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MULTIPLE_SPACES_BETWEEN_ITEMS_REGEX = T.let(T.unsafe(nil), Regexp) + +# Checks that block braces have or don't have surrounding space inside +# them on configuration. For blocks taking parameters, it checks that the +# left brace has or doesn't have trailing space depending on +# configuration. +# +# @example EnforcedStyle: space (default) +# # The `space` style enforces that block braces have +# # surrounding space. +# +# # bad +# some_array.each {puts e} +# +# # good +# some_array.each { puts e } +# +# @example EnforcedStyle: no_space +# # The `no_space` style enforces that block braces don't +# # have surrounding space. +# +# # bad +# some_array.each { puts e } +# +# # good +# some_array.each {puts e} +# +# +# @example EnforcedStyleForEmptyBraces: no_space (default) +# # The `no_space` EnforcedStyleForEmptyBraces style enforces that +# # block braces don't have a space in between when empty. +# +# # bad +# some_array.each { } +# some_array.each { } +# some_array.each { } +# +# # good +# some_array.each {} +# +# @example EnforcedStyleForEmptyBraces: space +# # The `space` EnforcedStyleForEmptyBraces style enforces that +# # block braces have at least a space in between when empty. +# +# # bad +# some_array.each {} +# +# # good +# some_array.each { } +# some_array.each { } +# some_array.each { } +# +# +# @example SpaceBeforeBlockParameters: true (default) +# # The SpaceBeforeBlockParameters style set to `true` enforces that +# # there is a space between `{` and `|`. Overrides `EnforcedStyle` +# # if there is a conflict. +# +# # bad +# [1, 2, 3].each {|n| n * 2 } +# +# # good +# [1, 2, 3].each { |n| n * 2 } +# +# @example SpaceBeforeBlockParameters: false +# # The SpaceBeforeBlockParameters style set to `false` enforces that +# # there is no space between `{` and `|`. Overrides `EnforcedStyle` +# # if there is a conflict. +# +# # bad +# [1, 2, 3].each { |n| n * 2 } +# +# # good +# [1, 2, 3].each {|n| n * 2 } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:79 +class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:89 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:106 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:105 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:127 + def adjacent_braces(left_brace, right_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:166 + def aligned_braces?(inner, right_brace, column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:135 + def braces_with_contents_inside(node, inner); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:110 + def check_inside(node, left_brace, right_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:142 + def check_left_brace(inner, left_brace, args_delimiter); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:150 + def check_right_brace(node, inner, left_brace, right_brace, single_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:170 + def inner_last_space_count(inner); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:162 + def multiline_block?(left_brace, right_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:227 + def no_space(begin_pos, end_pos, msg); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:174 + def no_space_inside_left_brace(left_brace, args_delimiter); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:243 + def offense(begin_pos, end_pos, msg, style_param = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:206 + def pipe?(args_delimiter); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:235 + def space(begin_pos, end_pos, msg); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:191 + def space_inside_left_brace(left_brace, args_delimiter); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:210 + def space_inside_right_brace(inner, right_brace, column); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:258 + def style_for_empty_braces; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_block_braces.rb:85 + def autocorrect_incompatible_with; end + end +end + +# Checks that braces used for hash literals have or don't have +# surrounding space depending on configuration. +# +# Hash pattern matching is handled in the same way. +# +# @example EnforcedStyle: space (default) +# # The `space` style enforces that hash literals have +# # surrounding space. +# +# # bad +# h = {a: 1, b: 2} +# foo = {{ a: 1 } => { b: { c: 2 }}} +# +# # good +# h = { a: 1, b: 2 } +# foo = { { a: 1 } => { b: { c: 2 } } } +# +# @example EnforcedStyle: no_space +# # The `no_space` style enforces that hash literals have +# # no surrounding space. +# +# # bad +# h = { a: 1, b: 2 } +# foo = {{ a: 1 } => { b: { c: 2 }}} +# +# # good +# h = {a: 1, b: 2} +# foo = {{a: 1} => {b: {c: 2}}} +# +# @example EnforcedStyle: compact +# # The `compact` style normally requires a space inside +# # hash braces, with the exception that successive left +# # braces or right braces are collapsed together in nested hashes. +# +# # bad +# h = { a: { b: 2 } } +# foo = { { a: 1 } => { b: { c: 2 } } } +# +# # good +# h = { a: { b: 2 }} +# foo = {{ a: 1 } => { b: { c: 2 }}} +# +# @example EnforcedStyleForEmptyBraces: no_space (default) +# # The `no_space` EnforcedStyleForEmptyBraces style enforces that +# # empty hash braces do not contain spaces. +# +# # bad +# foo = { } +# bar = { } +# baz = { +# } +# +# # good +# foo = {} +# bar = {} +# baz = {} +# +# @example EnforcedStyleForEmptyBraces: space +# # The `space` EnforcedStyleForEmptyBraces style enforces that +# # empty hash braces contain space. +# +# # bad +# foo = {} +# +# # good +# foo = { } +# foo = { } +# foo = { +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:76 +class RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:84 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:92 + def on_hash_pattern(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:144 + def ambiguous_or_unexpected_style_detected(style, is_match); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:136 + def autocorrect(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:96 + def check(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:191 + def check_whitespace_only_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:209 + def enforce_no_space_style_for_empty_braces?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:111 + def expect_space?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:124 + def incorrect_style_detected(token1, token2, expect_space, is_empty_braces); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:157 + def message(brace, is_empty_braces, expect_space); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:152 + def offense?(token1, expect_space); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:203 + def range_inside_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:183 + def range_of_space_to_the_left(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:175 + def range_of_space_to_the_right(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:167 + def space_range(token_range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb:82 +RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces::MSG = T.let(T.unsafe(nil), String) + +# Checks for spaces inside ordinary round parentheses. +# +# @example EnforcedStyle: no_space (default) +# # The `no_space` style enforces that parentheses do not have spaces. +# +# # bad +# f( 3) +# g = (a + 3 ) +# f( ) +# +# # good +# f(3) +# g = (a + 3) +# f() +# +# @example EnforcedStyle: space +# # The `space` style enforces that parentheses have a space at the +# # beginning and end. +# # Note: Empty parentheses should not have spaces. +# +# # bad +# f(3) +# g = (a + 3) +# y( ) +# +# # good +# f( 3 ) +# g = ( a + 3 ) +# y() +# +# @example EnforcedStyle: compact +# # The `compact` style enforces that parentheses have a space at the +# # beginning with the exception that successive parentheses are allowed. +# # Note: Empty parentheses should not have spaces. +# +# # bad +# f(3) +# g = (a + 3) +# y( ) +# g( f( x ) ) +# g( f( x( 3 ) ), 5 ) +# g( ( ( 3 + 5 ) * f) ** x, 5 ) +# +# # good +# f( 3 ) +# g = ( a + 3 ) +# y() +# g( f( x )) +# g( f( x( 3 )), 5 ) +# g((( 3 + 5 ) * f ) ** x, 5 ) +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:57 +class RuboCop::Cop::Layout::SpaceInsideParens < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:66 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:161 + def can_be_ignored?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:99 + def correct_extraneous_space(tokens); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:115 + def correct_extraneous_space_between_consecutive_parens(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:124 + def correct_extraneous_space_in_empty_parens(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:135 + def correct_missing_space(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:153 + def left_parens?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:149 + def parens?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:88 + def process_with_compact_style(tokens); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:81 + def process_with_space_style(tokens); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:157 + def right_parens?(token1, token2); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:63 +RuboCop::Cop::Layout::SpaceInsideParens::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_parens.rb:64 +RuboCop::Cop::Layout::SpaceInsideParens::MSG_SPACE = T.let(T.unsafe(nil), String) + +# Checks for unnecessary additional spaces inside the delimiters of +# %i/%w/%x literals. +# +# @example +# +# # bad +# %i( foo bar baz ) +# +# # good +# %i(foo bar baz) +# +# # bad +# %w( foo bar baz ) +# +# # good +# %w(foo bar baz) +# +# # bad +# %x( ls -l ) +# +# # good +# %x(ls -l) +# +# # bad +# %w( ) +# %w( +# ) +# +# # good +# %w() +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:36 +class RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::MatchRange + include ::RuboCop::Cop::PercentLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:45 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:53 + def on_percent_literal(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:49 + def on_xstr(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:60 + def add_offenses_for_blank_spaces(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:69 + def add_offenses_for_unnecessary_spaces(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:85 + def body_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:79 + def regex_matches(node, &blk); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:42 +RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::BEGIN_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:43 +RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::END_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb:41 +RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::MSG = T.let(T.unsafe(nil), String) + +# Checks for spaces inside range literals. +# +# @example +# # bad +# 1 .. 3 +# +# # good +# 1..3 +# +# # bad +# 'a' .. 'z' +# +# # good +# 'a'..'z' +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_range_literal.rb:20 +class RuboCop::Cop::Layout::SpaceInsideRangeLiteral < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_range_literal.rb:29 + def on_erange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_range_literal.rb:25 + def on_irange(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_range_literal.rb:35 + def check(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_range_literal.rb:23 +RuboCop::Cop::Layout::SpaceInsideRangeLiteral::MSG = T.let(T.unsafe(nil), String) + +# Checks that reference brackets have or don't have +# surrounding space depending on configuration. +# +# @example EnforcedStyle: no_space (default) +# # The `no_space` style enforces that reference brackets have +# # no surrounding space. +# +# # bad +# hash[ :key ] +# array[ index ] +# +# # good +# hash[:key] +# array[index] +# +# @example EnforcedStyle: space +# # The `space` style enforces that reference brackets have +# # surrounding space. +# +# # bad +# hash[:key] +# array[index] +# +# # good +# hash[ :key ] +# array[ index ] +# +# +# @example EnforcedStyleForEmptyBrackets: no_space (default) +# # The `no_space` EnforcedStyleForEmptyBrackets style enforces that +# # empty reference brackets do not contain spaces. +# +# # bad +# foo[ ] +# foo[ ] +# foo[ +# ] +# +# # good +# foo[] +# +# @example EnforcedStyleForEmptyBrackets: space +# # The `space` EnforcedStyleForEmptyBrackets style enforces that +# # empty reference brackets contain exactly one space. +# +# # bad +# foo[] +# foo[ ] +# foo[ +# ] +# +# # good +# foo[ ] +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:60 +class RuboCop::Cop::Layout::SpaceInsideReferenceBrackets < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:70 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:92 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:121 + def closing_bracket(tokens, opening_bracket); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:137 + def empty_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:110 + def left_ref_bracket(node, tokens); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:132 + def previous_token(current_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:104 + def reference_brackets(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:66 +RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:65 +RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_reference_brackets.rb:68 +RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for whitespace within string interpolations. +# +# @example EnforcedStyle: no_space (default) +# # bad +# var = "This is the #{ space } example" +# +# # good +# var = "This is the #{no_space} example" +# +# @example EnforcedStyle: space +# # bad +# var = "This is the #{no_space} example" +# +# # good +# var = "This is the #{ space } example" +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_string_interpolation.rb:21 +class RuboCop::Cop::Layout::SpaceInsideStringInterpolation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Interpolation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_string_interpolation.rb:29 + def on_interpolation(begin_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_string_interpolation.rb:45 + def autocorrect(corrector, begin_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_string_interpolation.rb:55 + def delimiters(begin_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/space_inside_string_interpolation.rb:27 +RuboCop::Cop::Layout::SpaceInsideStringInterpolation::MSG = T.let(T.unsafe(nil), String) + +# Looks for trailing blank lines and a final newline in the +# source code. +# +# @example EnforcedStyle: final_newline (default) +# # `final_newline` looks for one newline at the end of files. +# +# # bad +# class Foo; end +# +# # EOF +# +# # bad +# class Foo; end # EOF +# +# # good +# class Foo; end +# # EOF +# +# @example EnforcedStyle: final_blank_line +# # `final_blank_line` looks for one blank line followed by a new line +# # at the end of files. +# +# # bad +# class Foo; end +# # EOF +# +# # bad +# class Foo; end # EOF +# +# # good +# class Foo; end +# +# # EOF +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_empty_lines.rb:40 +class RuboCop::Cop::Layout::TrailingEmptyLines < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_empty_lines.rb:45 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_empty_lines.rb:90 + def end_with_percent_blank_string?(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_empty_lines.rb:80 + def ends_in_end?(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_empty_lines.rb:94 + def message(wanted_blank_lines, blank_lines); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_empty_lines.rb:67 + def offense_detected(buffer, wanted_blank_lines, blank_lines, whitespace_at_end); end +end + +# Looks for trailing whitespace in the source code. +# +# @example +# # The line in this example contains spaces after the 0. +# # bad +# x = 0 +# +# # The line in this example ends directly after the 0. +# # good +# x = 0 +# +# @example AllowInHeredoc: false (default) +# # The line in this example contains spaces after the 0. +# # bad +# code = <<~RUBY +# x = 0 +# RUBY +# +# # ok +# code = <<~RUBY +# x = 0 #{} +# RUBY +# +# # good +# trailing_whitespace = ' ' +# code = <<~RUBY +# x = 0#{trailing_whitespace} +# RUBY +# +# @example AllowInHeredoc: true +# # The line in this example contains spaces after the 0. +# # good +# code = <<~RUBY +# x = 0 +# RUBY +# +# pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:42 +class RuboCop::Cop::Layout::TrailingWhitespace < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Heredoc + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:57 + def on_heredoc(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:49 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:112 + def extract_heredocs(ast); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:103 + def find_heredoc(line_number); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:108 + def heredocs; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:125 + def offense_range(lineno, line); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:61 + def process_line(line, lineno); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:75 + def process_line_in_heredoc(corrector, range, heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:99 + def skip_heredoc?; end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:95 + def static?(heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:86 + def whitespace_is_indentation?(range, level); end + + # pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:90 + def whitespace_only?(range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/layout/trailing_whitespace.rb:47 +RuboCop::Cop::Layout::TrailingWhitespace::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:5 +module RuboCop::Cop::Legacy; end + +# Legacy support for Corrector#corrections +# See https://docs.rubocop.org/rubocop/v1_upgrade_notes.html +# +# pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:8 +class RuboCop::Cop::Legacy::CorrectionsProxy + # pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:9 + def initialize(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:13 + def <<(callable); end + + # pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:21 + def concat(corrections); end + + # pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:17 + def empty?; end + + protected + + # pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:31 + def corrector; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/legacy/corrections_proxy.rb:35 + def suppress_clobbering; end +end + +# This class handles autocorrection for code that needs to be moved +# to new lines. +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:7 +class RuboCop::Cop::LineBreakCorrector + extend ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::TrailingBody + extend ::RuboCop::PathUtil + extend ::RuboCop::Cop::Util + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:27 + def break_line_before(range:, node:, corrector:, configured_width:, indent_steps: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:15 + def correct_trailing_body(configured_width:, corrector:, node:, processed_source:); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:35 + def move_comment(eol_comment:, node:, corrector:); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:13 + def processed_source; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:45 + def remove_semicolon(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:51 + def semicolon(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/line_break_corrector.rb:60 + def trailing_class_definition?(token, body); end + end +end + +# Help methods for determining if a line is too long. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:6 +module RuboCop::Cop::LineLengthHelp + include ::RuboCop::Cop::Alignment + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:24 + def allow_cop_directives?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:47 + def allow_qualified_name?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:11 + def allow_rbs_inline_annotation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:43 + def allow_uri?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:51 + def allowed_position?(line, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:34 + def directive_on_source_line?(line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:104 + def extend_end_position(line, end_position); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:59 + def find_excessive_range(line, type); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:91 + def indentation_difference(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:55 + def line_length(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:146 + def line_length_without_directive(line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:83 + def match_qualified_names(string); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:75 + def match_uris(string); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:135 + def qualified_name_regexp; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:15 + def rbs_inline_annotation_on_source_line?(line_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:120 + def tab_indentation_width; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:125 + def uri_regexp; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/line_length_help.rb:139 + def valid_uri?(uri_ish_string); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/unused_argument.rb:5 +module RuboCop::Cop::Lint; end + +# Checks for mistyped shorthand assignments. +# +# @example +# # bad +# x =- y +# x =+ y +# x =* y +# x =! y +# +# # good +# x -= y # or x = -y +# x += y # or x = +y +# x *= y # or x = *y +# x != y # or x = !y +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:21 +class RuboCop::Cop::Lint::AmbiguousAssignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:30 + def on_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:40 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:40 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:40 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:40 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:40 + def on_lvasgn(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:28 +RuboCop::Cop::Lint::AmbiguousAssignment::MISTAKES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:24 +RuboCop::Cop::Lint::AmbiguousAssignment::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_assignment.rb:26 +RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +# Checks for ambiguous block association with method +# when param passed without parentheses. +# +# This cop can customize allowed methods with `AllowedMethods`. +# By default, there are no allowed methods. +# +# @example +# +# # bad +# some_method a { |val| puts val } +# +# # good +# # With parentheses, there's no ambiguity. +# some_method(a { |val| puts val }) +# # or (different meaning) +# some_method(a) { |val| puts val } +# +# # good +# # Operator methods require no disambiguation +# foo == bar { |b| b.baz } +# +# # good +# # Lambda arguments require no disambiguation +# foo = ->(bar) { bar.baz } +# +# @example AllowedMethods: [] (default) +# +# # bad +# expect { do_something }.to change { object.attribute } +# +# @example AllowedMethods: [change] +# +# # good +# expect { do_something }.to change { object.attribute } +# +# @example AllowedPatterns: [] (default) +# +# # bad +# expect { do_something }.to change { object.attribute } +# +# @example AllowedPatterns: ['change'] +# +# # good +# expect { do_something }.to change { object.attribute } +# expect { do_something }.to not_change { object.attribute } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:52 +class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:75 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:62 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:83 + def allowed_method_pattern?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:79 + def ambiguous_block_association?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:89 + def message(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:95 + def wrap_in_parentheses(corrector, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_block_association.rb:58 +RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String) + +# Checks for ambiguous operators in the first argument of a +# method invocation without parentheses. +# +# @example +# +# # bad +# +# # The `*` is interpreted as a splat operator but it could possibly be +# # a `*` method invocation (i.e. `do_something.*(some_array)`). +# do_something *some_array +# +# # good +# +# # With parentheses, there's no ambiguity. +# do_something(*some_array) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:21 +class RuboCop::Cop::Lint::AmbiguousOperator < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:43 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:62 + def find_offense_node_by(diagnostic); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:80 + def message(diagnostic); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:90 + def offense_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:86 + def offense_position?(node, diagnostic); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:99 + def unary_operator?(node, diagnostic); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:39 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:24 +RuboCop::Cop::Lint::AmbiguousOperator::AMBIGUITIES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator.rb:34 +RuboCop::Cop::Lint::AmbiguousOperator::MSG_FORMAT = T.let(T.unsafe(nil), String) + +# Looks for expressions containing multiple binary operators +# where precedence is ambiguous due to lack of parentheses. For example, +# in `1 + 2 * 3`, the multiplication will happen before the addition, but +# lexically it appears that the addition will happen first. +# +# The cop does not consider unary operators (ie. `!a` or `-b`) or comparison +# operators (ie. `a =~ b`) because those are not ambiguous. +# +# NOTE: Ranges are handled by `Lint/AmbiguousRange`. +# +# @example +# # bad +# a + b * c +# a || b && c +# a ** b + c +# +# # good (different precedence) +# a + (b * c) +# a || (b && c) +# (a ** b) + c +# +# # good (same precedence) +# a + b + c +# a * b / c % d +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:30 +class RuboCop::Cop::Lint::AmbiguousOperatorPrecedence < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:47 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:58 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:96 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:80 + def greater_precedence?(node1, node2); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:76 + def operator?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:88 + def operator_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:72 + def precedence(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:45 +RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::MSG = T.let(T.unsafe(nil), String) + +# See https://ruby-doc.org/core-3.0.2/doc/syntax/precedence_rdoc.html +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:34 +RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::PRECEDENCE = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_operator_precedence.rb:44 +RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for ambiguous ranges. +# +# Ranges have quite low precedence, which leads to unexpected behavior when +# using a range with other operators. This cop avoids that by making ranges +# explicit by requiring parenthesis around complex range boundaries (anything +# that is not a literal: numerics, strings, symbols, etc.). +# +# This cop can be configured with `RequireParenthesesForMethodChains` in order to +# specify whether method chains (including `self.foo`) should be wrapped in parens +# by this cop. +# +# NOTE: Regardless of this configuration, if a method receiver is a basic literal +# value, it will be wrapped in order to prevent the ambiguity of `1..2.to_a`. +# +# @safety +# The cop autocorrects by wrapping the entire boundary in parentheses, which +# makes the outcome more explicit but is possible to not be the intention of the +# programmer. For this reason, this cop's autocorrect is unsafe (it will not +# change the behavior of the code, but will not necessarily match the +# intent of the program). +# +# @example +# # bad +# x || 1..2 +# x - 1..2 +# (x || 1..2) +# x || 1..y || 2 +# 1..2.to_a +# +# # good, unambiguous +# 1..2 +# 'a'..'z' +# :bar..:baz +# MyClass::MIN..MyClass::MAX +# @min..@max +# a..b +# -a..b +# +# # good, ambiguity removed +# x || (1..2) +# (x - 1)..2 +# (x || 1)..2 +# (x || 1)..(y || 2) +# (1..2).to_a +# +# @example RequireParenthesesForMethodChains: false (default) +# # good +# a.foo..b.bar +# (a.foo)..(b.bar) +# +# @example RequireParenthesesForMethodChains: true +# # bad +# a.foo..b.bar +# +# # good +# (a.foo)..(b.bar) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:62 +class RuboCop::Cop::Lint::AmbiguousRange < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RationalLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:77 + def on_erange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:68 + def on_irange(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:87 + def acceptable?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:95 + def acceptable_call?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:81 + def each_boundary(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:107 + def require_parentheses_for_method_chain?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_range.rb:66 +RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String) + +# Checks for ambiguous regexp literals in the first argument of +# a method invocation without parentheses. +# +# @example +# +# # bad +# +# # This is interpreted as a method invocation with a regexp literal, +# # but it could possibly be `/` method invocations. +# # (i.e. `do_something./(pattern)./(i)`) +# do_something /pattern/i +# +# # good +# +# # With parentheses, there's no ambiguity. +# do_something(/pattern/i) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:22 +class RuboCop::Cop::Lint::AmbiguousRegexpLiteral < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:29 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:54 + def find_offense_node(node, regexp_receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:47 + def find_offense_node_by(diagnostic); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:65 + def first_argument_is_regexp?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:69 + def method_chain_to_regexp_receiver?(node, regexp_receiver); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:25 +RuboCop::Cop::Lint::AmbiguousRegexpLiteral::MSG = T.let(T.unsafe(nil), String) + +# Checks for an array literal interpolated inside a regexp. +# +# When interpolating an array literal, it is converted to a string. This means +# that when inside a regexp, it acts as a character class but with additional +# quotes, spaces and commas that are likely not intended. For example, +# `/#{%w[a b c]}/` parses as `/["a", "b", "c"]/` (or `/["a, bc]/` without +# repeated characters). +# +# The cop can autocorrect to a character class (if all items in the array are a +# single character) or alternation (if the array contains longer items). +# +# NOTE: This only considers interpolated arrays that contain only strings, symbols, +# integers, and floats. Any other type is not easily convertible to a character class +# or regexp alternation. +# +# @safety +# Autocorrection is unsafe because it will change the regexp pattern, by +# removing the additional quotes, spaces and commas from the character class. +# +# @example +# # bad +# /#{%w[a b c]}/ +# +# # good +# /[abc]/ +# +# # bad +# /#{%w[foo bar baz]}/ +# +# # good +# /(?:foo|bar|baz)/ +# +# # bad - construct a regexp rather than interpolate an array of identifiers +# /#{[foo, bar]}/ +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:41 +class RuboCop::Cop::Lint::ArrayLiteralInRegexp < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Interpolation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:53 + def on_interpolation(begin_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:106 + def alternation_for(values); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:67 + def array_of_literal_values?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:92 + def array_values(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:98 + def character_class?(values); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:102 + def character_class_for(values); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:110 + def escape_values(values); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:71 + def register_array_of_literal_values(begin_node, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:87 + def register_array_of_nonliteral_values(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:45 +RuboCop::Cop::Lint::ArrayLiteralInRegexp::LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:49 +RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_ALTERNATION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:48 +RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_CHARACTER_CLASS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/array_literal_in_regexp.rb:50 +RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_UNKNOWN = T.let(T.unsafe(nil), String) + +# Checks for assignments in the conditions of +# if/while/until. +# +# `AllowSafeAssignment` option for safe assignment. +# By safe assignment we mean putting parentheses around +# an assignment to indicate "I know I'm using an assignment +# as a condition. It's not a mistake." +# +# @safety +# This cop's autocorrection is unsafe because it assumes that +# the author meant to use an assignment result as a condition. +# +# @example +# # bad +# if some_var = value +# do_something +# end +# +# # good +# if some_var == value +# do_something +# end +# +# @example AllowSafeAssignment: true (default) +# # good +# if (some_var = value) +# do_something +# end +# +# @example AllowSafeAssignment: false +# # bad +# if (some_var = value) +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:41 +class RuboCop::Cop::Lint::AssignmentInCondition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::SafeAssignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:55 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:68 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:67 + def on_while(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:80 + def allowed_construct?(asgn_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:86 + def conditional_assignment?(asgn_node); end + + # An assignment that is a statement of a multi-statement `begin` + # (e.g. `(foo = bar; baz)`) has its value discarded, so it is not used + # as the condition. Wrapping it in parentheses would only conflict with + # `Style/RedundantParentheses`, so it is left alone. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:94 + def discarded_assignment?(asgn_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:72 + def message(_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:100 + def skip_children?(asgn_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:106 + def traverse_node(node, &block); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:53 +RuboCop::Cop::Lint::AssignmentInCondition::ASGN_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:50 +RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITHOUT_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/assignment_in_condition.rb:46 +RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITH_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) + +# `BigDecimal.new()` is deprecated since BigDecimal 1.3.3. +# This cop identifies places where `BigDecimal.new()` +# can be replaced by `BigDecimal()`. +# +# @example +# # bad +# BigDecimal.new(123.456, 3) +# +# # good +# BigDecimal(123.456, 3) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/big_decimal_new.rb:17 +class RuboCop::Cop::Lint::BigDecimalNew < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/big_decimal_new.rb:24 + def big_decimal_new(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/big_decimal_new.rb:29 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/big_decimal_new.rb:20 +RuboCop::Cop::Lint::BigDecimalNew::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/big_decimal_new.rb:21 +RuboCop::Cop::Lint::BigDecimalNew::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for places where binary operator has identical operands. +# +# It covers comparison operators: `==`, `===`, `=~`, `>`, `>=`, `<`, ``<=``; +# bitwise operators: `|`, `^`, `&`; +# boolean operators: `&&`, `||` +# and "spaceship" operator - ``<=>``. +# +# Simple arithmetic operations are allowed by this cop: `+`, `*`, `**`, `<<` and `>>`. +# Although these can be rewritten in a different way, it should not be necessary to +# do so. Operations such as `-` or `/` where the result will always be the same +# (`x - x` will always be 0; `x / x` will always be 1) are offenses, but these +# are covered by `Lint/NumericOperationWithConstantResult` instead. +# +# @safety +# This cop is unsafe as it does not consider side effects when calling methods +# and thus can generate false positives, for example: +# +# [source,ruby] +# ---- +# if wr.take_char == '\0' && wr.take_char == '\0' +# # ... +# end +# ---- +# +# @example +# # bad +# x.top >= x.top +# +# if a.x != 0 && a.x != 0 +# do_something +# end +# +# def child? +# left_child || left_child +# end +# +# # good +# x + x +# 1 << 1 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:46 +class RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:57 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:62 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:50 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:47 +RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:48 +RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for `:true` and `:false` symbols. +# In most cases it would be a typo. +# +# @safety +# Autocorrection is unsafe for this cop because code relying +# on `:true` or `:false` symbols will break when those are +# changed to actual booleans. +# +# @example +# +# # bad +# :true +# +# # good +# true +# +# # bad +# :false +# +# # good +# false +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/boolean_symbol.rb:27 +class RuboCop::Cop::Lint::BooleanSymbol < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/boolean_symbol.rb:33 + def boolean_symbol?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/boolean_symbol.rb:35 + def on_sym(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/boolean_symbol.rb:48 + def autocorrect(corrector, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/boolean_symbol.rb:30 +RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String) + +# Checks for circular argument references in optional keyword +# arguments and optional ordinal arguments. +# +# NOTE: This syntax was made invalid on Ruby 2.7 - Ruby 3.3 but is allowed +# again since Ruby 3.4. +# +# @example +# +# # bad +# def bake(pie: pie) +# pie.heat_up +# end +# +# # good +# def bake(pie:) +# pie.refrigerate +# end +# +# # good +# def bake(pie: self.pie) +# pie.feed_to(user) +# end +# +# # bad +# def cook(dry_ingredients = dry_ingredients) +# dry_ingredients.reduce(&:+) +# end +# +# # good +# def cook(dry_ingredients = self.dry_ingredients) +# dry_ingredients.combine +# end +# +# # bad +# def foo(pie = pie = pie) +# pie.heat_up +# end +# +# # good +# def foo(pie) +# pie.heat_up +# end +# +# # bad +# def foo(pie = cake = pie) +# [pie, cake].each(&:heat_up) +# end +# +# # good +# def foo(cake = pie) +# [pie, cake].each(&:heat_up) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/circular_argument_reference.rb:58 +class RuboCop::Cop::Lint::CircularArgumentReference < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/circular_argument_reference.rb:63 + def on_kwoptarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/circular_argument_reference.rb:67 + def on_optarg(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/circular_argument_reference.rb:83 + def check_assignment_chain(arg_name, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/circular_argument_reference.rb:73 + def check_for_circular_argument_references(arg_name, arg_value); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/circular_argument_reference.rb:61 +RuboCop::Cop::Lint::CircularArgumentReference::MSG = T.let(T.unsafe(nil), String) + +# Do not define constants within a block, since the block's scope does not +# isolate or namespace the constant in any way. +# +# If you are trying to define that constant once, define it outside of +# the block instead, or use a variable or method if defining the constant +# in the outer scope would be problematic. +# +# For meta-programming, use `const_set`. +# +# @example +# # bad +# task :lint do +# FILES_TO_LINT = Dir['lib/*.rb'] +# end +# +# # bad +# describe 'making a request' do +# class TestRequest; end +# end +# +# # bad +# module M +# extend ActiveSupport::Concern +# included do +# LIST = [] +# end +# end +# +# # good +# task :lint do +# files_to_lint = Dir['lib/*.rb'] +# end +# +# # good +# describe 'making a request' do +# let(:test_request) { Class.new } +# # see also `stub_const` for RSpec +# end +# +# # good +# module M +# extend ActiveSupport::Concern +# included do +# const_set(:LIST, []) +# end +# end +# +# @example AllowedMethods: ['enums'] (default) +# # good +# +# # `enums` for Typed Enums via `T::Enum` in Sorbet. +# # https://sorbet.org/docs/tenum +# class TestEnum < T::Enum +# enums do +# Foo = new("foo") +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:64 +class RuboCop::Cop::Lint::ConstantDefinitionInBlock < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:70 + def constant_assigned_in_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:75 + def module_defined_in_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:79 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:85 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:90 + def on_module(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:94 + def method_name(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_definition_in_block.rb:67 +RuboCop::Cop::Lint::ConstantDefinitionInBlock::MSG = T.let(T.unsafe(nil), String) + +# Checks for overwriting an exception with an exception result by using ``rescue =>``. +# +# You intended to write as `rescue StandardError`. +# However, you have written `rescue => StandardError`. +# In that case, the result of `rescue` will overwrite `StandardError`. +# +# @example +# +# # bad +# begin +# something +# rescue => StandardError +# end +# +# # good +# begin +# something +# rescue StandardError +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb:26 +class RuboCop::Cop::Lint::ConstantOverwrittenInRescue < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb:41 + def on_resbody(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb:33 + def overwritten_constant(param0 = T.unsafe(nil)); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb:37 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb:30 +RuboCop::Cop::Lint::ConstantOverwrittenInRescue::MSG = T.let(T.unsafe(nil), String) + +# Checks for constant reassignments. +# +# Emulates Ruby's runtime warning "already initialized constant X" +# when a constant is reassigned in the same file and namespace. +# +# The cop tracks constants defined via `NAME = value` syntax as well as +# class/module keyword definitions. It detects reassignment when a constant +# is first defined one way and then redefined using the `NAME = value` syntax. +# +# The cop cannot catch all offenses, like, for example, when using metaprogramming +# (`Module#const_set`). +# +# By default the cop also cannot detect reassignment across files. +# When `AllCops/UseProjectIndex` is enabled and the `rubydex` gem is installed, +# the cop additionally consults the project-wide index and reports reassignments +# whose previous definition lives in another file. +# +# The cop only takes into account constants assigned in a "simple" way: directly +# inside class/module definition, or within another constant. Other type of assignments +# (e.g., inside a conditional) are disregarded. +# +# The cop also tracks constant removal using `Module#remove_const` with symbol +# or string argument. +# +# @example +# # bad +# X = :foo +# X = :bar +# +# # bad +# class A +# X = :foo +# X = :bar +# end +# +# # bad +# module A +# X = :foo +# X = :bar +# end +# +# # bad +# class FooError < StandardError; end +# FooError = Class.new(RuntimeError) +# +# # bad +# module M; end +# M = 1 +# +# # good - keep only one assignment +# X = :bar +# +# class A +# X = :bar +# end +# +# module A +# X = :bar +# end +# +# # good - use OR assignment +# X = :foo +# X ||= :bar +# +# # good - use conditional assignment +# X = :foo +# X = :bar unless defined?(X) +# +# # good - remove the assigned constant first +# class A +# X = :foo +# remove_const :X +# X = :bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:81 +class RuboCop::Cop::Lint::ConstantReassignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ProjectIndexHelp + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:107 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:95 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:101 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:122 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:90 + def remove_constant(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:177 + def ancestor_namespaces(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:205 + def constant_definitions; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:169 + def constant_display_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:173 + def constant_namespaces(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:190 + def definition_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:136 + def fixed_constant_path?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:149 + def freeze_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:153 + def fully_qualified_constant_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:165 + def fully_qualified_name_for(namespaces, constant); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:201 + def identifier_namespaces(identifier); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:219 + def prior_definition_in_other_file(declaration); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:209 + def report_cross_file_collision(node, fully_qualified_name, display_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:140 + def simple_assignment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:184 + def unconditional_definition?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:85 +RuboCop::Cop::Lint::ConstantReassignment::CROSS_FILE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:84 +RuboCop::Cop::Lint::ConstantReassignment::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_reassignment.rb:87 +RuboCop::Cop::Lint::ConstantReassignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that certain constants are fully qualified. +# +# This is not enabled by default because it would mark a lot of offenses +# unnecessarily. +# +# Generally, gems should fully qualify all constants to avoid conflicts with +# the code that uses the gem. Enable this cop without using `Only`/`Ignore` +# +# Large projects will over time end up with one or two constant names that +# are problematic because of a conflict with a library or just internally +# using the same name for a namespace and a class. To avoid too many unnecessary +# offenses, enable this cop with `Only: [The, Constant, Names, Causing, Issues]` +# +# NOTE: `Style/RedundantConstantBase` cop is disabled if this cop is enabled, +# to prevent conflicting rules. This is because it respects user configurations +# that want to enable this cop which is disabled by default. +# +# @example +# # By default checks every constant +# +# # bad +# User +# +# # bad +# User::Login +# +# # good +# ::User +# +# # good +# ::User::Login +# +# @example Only: ['Login'] +# # Restrict this cop to only being concerned about certain constants +# +# # bad +# Login +# +# # good +# ::Login +# +# # good +# User::Login +# +# @example Ignore: ['Login'] +# # Restrict this cop not being concerned about certain constants +# +# # bad +# User +# +# # good +# ::User::Login +# +# # good +# Login +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:62 +class RuboCop::Cop::Lint::ConstantResolution < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:70 + def on_const(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:66 + def unqualified_const?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:83 + def allowed_names; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:78 + def const_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:87 + def ignored_names; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/constant_resolution.rb:63 +RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) + +# are strictly formatted. +# +# A comment can be added to the directive by prefixing it with `--`. +# +# @example +# # bad +# +# # good +# +# # bad +# +# # good +# +# # bad +# +# # good +# +# # bad +# +# # good +# +# # bad +# +# # good +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:45 +class RuboCop::Cop::Lint::CopDirectiveSyntax < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:54 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:68 + def offense_message(directive_comment); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:46 +RuboCop::Cop::Lint::CopDirectiveSyntax::COMMON_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:49 +RuboCop::Cop::Lint::CopDirectiveSyntax::INVALID_MODE_NAME_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:51 +RuboCop::Cop::Lint::CopDirectiveSyntax::MALFORMED_COP_NAMES_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:50 +RuboCop::Cop::Lint::CopDirectiveSyntax::MISSING_COP_NAME_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/cop_directive_syntax.rb:48 +RuboCop::Cop::Lint::CopDirectiveSyntax::MISSING_MODE_NAME_MSG = T.let(T.unsafe(nil), String) + +# Checks unexpected overrides of the `Data` built-in methods +# via `Data.define`. +# +# @example +# # bad +# Bad = Data.define(:members, :clone, :to_s) +# b = Bad.new(members: [], clone: true, to_s: 'bad') +# b.members #=> [] (overriding `Data#members`) +# b.clone #=> true (overriding `Object#clone`) +# b.to_s #=> "bad" (overriding `Data#to_s`) +# +# # good +# Good = Data.define(:id, :name) +# g = Good.new(id: 1, name: "foo") +# g.members #=> [:id, :name] +# g.clone #=> # +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:23 +class RuboCop::Cop::Lint::DataDefineOverride < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:41 + def data_define(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:46 + def on_send(node); end +end + +# This is based on `Data.define.instance_methods.sort` in Ruby 4.0.0. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:28 +RuboCop::Cop::Lint::DataDefineOverride::DATA_METHOD_NAMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:38 +RuboCop::Cop::Lint::DataDefineOverride::MEMBER_NAME_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:24 +RuboCop::Cop::Lint::DataDefineOverride::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/data_define_override.rb:25 +RuboCop::Cop::Lint::DataDefineOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for debug calls (such as `debugger` or `binding.pry`) that should +# not be kept for production code. +# +# The cop can be configured using `DebuggerMethods`. By default, a number of gems +# debug entrypoints are configured (`Kernel`, `Byebug`, `Capybara`, `debug.rb`, +# `Pry`, `Rails`, `RubyJard`, and `WebConsole`). Additional methods can be added. +# +# Specific default groups can be disabled if necessary: +# +# [source,yaml] +# ---- +# Lint/Debugger: +# DebuggerMethods: +# WebConsole: ~ +# ---- +# +# You can also add your own methods by adding a new category: +# +# [source,yaml] +# ---- +# Lint/Debugger: +# DebuggerMethods: +# MyDebugger: +# MyDebugger.debug_this +# ---- +# +# Some gems also ship files that will start a debugging session when required, +# for example `require 'debug/start'` from `ruby/debug`. These requires can +# be configured through `DebuggerRequires`. It has the same structure as +# `DebuggerMethods`, which you can read about above. +# +# @example +# +# # bad (ok during development) +# +# # using pry +# def some_method +# binding.pry +# do_something +# end +# +# # bad (ok during development) +# +# # using byebug +# def some_method +# byebug +# do_something +# end +# +# # good +# +# def some_method +# do_something +# end +# +# @example DebuggerMethods: [my_debugger] +# +# # bad (ok during development) +# +# def some_method +# my_debugger +# end +# +# @example DebuggerRequires: [my_debugger/start] +# +# # bad (ok during development) +# +# require 'my_debugger/start' +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:74 +class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:77 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:147 + def assumed_argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:126 + def assumed_usage_context?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:136 + def chained_method_name(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:104 + def debugger_method?(send_node); end + + # The last segment of each configured debugger method, used to cheaply + # rule out the vast majority of `send` nodes before building the + # chained method name. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:113 + def debugger_method_names; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:90 + def debugger_methods; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:119 + def debugger_require?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:97 + def debugger_requires; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:86 + def message(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/debugger.rb:75 +RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String) + +# Checks for uses of the deprecated class method usages. +# +# @example +# +# # bad +# File.exists?(some_path) +# Dir.exists?(some_path) +# iterator? +# attr :name, true +# attr :name, false +# ENV.freeze # Calling `Env.freeze` raises `TypeError` since Ruby 2.7. +# ENV.clone +# ENV.dup # Calling `Env.dup` raises `TypeError` since Ruby 3.1. +# Socket.gethostbyname(host) +# Socket.gethostbyaddr(host) +# +# # good +# File.exist?(some_path) +# Dir.exist?(some_path) +# block_given? +# attr_accessor :name +# attr_reader :name +# ENV # `ENV.freeze` cannot prohibit changes to environment variables. +# ENV.to_h +# ENV.to_h # `ENV.dup` cannot dup `ENV`, use `ENV.to_h` to get a copy of `ENV` as a hash. +# Addrinfo.getaddrinfo(nodename, service) +# Addrinfo.tcp(host, port).getnameinfo +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:33 +class RuboCop::Cop::Lint::DeprecatedClassMethods < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:53 + def deprecated_class_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:63 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:112 + def dir_env_file_const?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:83 + def offense_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:93 + def preferred_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:108 + def socket_const?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:50 +RuboCop::Cop::Lint::DeprecatedClassMethods::DIR_ENV_FILE_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:36 +RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:41 +RuboCop::Cop::Lint::DeprecatedClassMethods::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_class_methods.rb:37 +RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for deprecated constants. +# +# It has `DeprecatedConstants` config. If there is an alternative method, you can set +# alternative value as `Alternative`. And you can set the deprecated version as +# `DeprecatedVersion`. These options can be omitted if they are not needed. +# +# DeprecatedConstants: +# 'DEPRECATED_CONSTANT': +# Alternative: 'alternative_value' +# DeprecatedVersion: 'deprecated_version' +# +# By default, `NIL`, `TRUE`, `FALSE`, `Net::HTTPServerException`, `Random::DEFAULT`, +# `Struct::Group`, and `Struct::Passwd` are configured. +# +# @example +# +# # bad +# NIL +# TRUE +# FALSE +# Net::HTTPServerException +# Random::DEFAULT # Return value of Ruby 2 is `Random` instance, Ruby 3.0 is `Random` class. +# Struct::Group +# Struct::Passwd +# +# # good +# nil +# true +# false +# Net::HTTPClientException +# Random.new # `::DEFAULT` has been deprecated in Ruby 3, `.new` is compatible with Ruby 2. +# Etc::Group +# Etc::Passwd +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_constants.rb:40 +class RuboCop::Cop::Lint::DeprecatedConstants < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_constants.rb:46 + def on_const(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_constants.rb:76 + def deprecated_constants; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_constants.rb:66 + def message(good, bad, deprecated_version); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_constants.rb:44 +RuboCop::Cop::Lint::DeprecatedConstants::DO_NOT_USE_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_constants.rb:43 +RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil), String) + +# Algorithmic constants for `OpenSSL::Cipher` and `OpenSSL::Digest` +# deprecated since OpenSSL version 2.2.0. Prefer passing a string +# instead. +# +# @example +# +# # bad +# OpenSSL::Cipher::AES.new(128, :GCM) +# +# # good +# OpenSSL::Cipher.new('aes-128-gcm') +# +# # bad +# OpenSSL::Digest::SHA256.new +# +# # good +# OpenSSL::Digest.new('SHA256') +# +# # bad +# OpenSSL::Digest::SHA256.digest('foo') +# +# # good +# OpenSSL::Digest.digest('SHA256', 'foo') +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:30 +class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:40 + def algorithm_const(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:50 + def digest_const?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:54 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:101 + def algorithm_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:66 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:133 + def build_cipher_arguments(node, algorithm_name, no_arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:93 + def correction_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:78 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:97 + def openssl_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:119 + def replacement_args(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:111 + def sanitize_arguments(arguments); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:34 +RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:37 +RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::NO_ARG_ALGORITHM = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb:36 +RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks constructors for disjunctive assignments (`||=`) that should +# be plain assignments. +# +# So far, this cop is only concerned with disjunctive assignment of +# instance variables. +# +# In ruby, an instance variable is nil until a value is assigned, so the +# disjunction is unnecessary. A plain assignment has the same effect. +# +# @safety +# This cop is unsafe because it can register a false positive when a +# method is redefined in a subclass that calls super. For example: +# +# [source,ruby] +# ---- +# class Base +# def initialize +# @config ||= 'base' +# end +# end +# +# class Derived < Base +# def initialize +# @config = 'derived' +# super +# end +# end +# ---- +# +# Without the disjunctive assignment, `Derived` will be unable to override +# the value for `@config`. +# +# @example +# # bad +# def initialize +# @x ||= 1 +# end +# +# # good +# def initialize +# @x = 1 +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:48 +class RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:53 + def on_def(node); end + + private + + # @param [DefNode] node a constructor definition + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:60 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:66 + def check_body(body); end + + # @param [Array] lines the logical lines of the constructor + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:78 + def check_body_lines(lines); end + + # Add an offense if the LHS of the given disjunctive assignment is + # an instance variable. + # + # For now, we only care about assignments to instance variables. + # + # @param [Node] node a disjunctive assignment + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:99 + def check_disjunctive_assignment(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb:51 +RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil), String) + +# Checks that there are no repeated bodies +# within `if/unless`, `case-when`, `case-in` and `rescue` constructs. +# +# With `IgnoreLiteralBranches: true`, branches are not registered +# as offenses if they return a basic literal value (string, symbol, +# integer, float, rational, complex, `true`, `false`, or `nil`), or +# return an array, hash, regexp or range that only contains one of +# the above basic literal values. +# +# With `IgnoreConstantBranches: true`, branches are not registered +# as offenses if they return a constant value. +# +# With `IgnoreDuplicateElseBranch: true`, in conditionals with multiple branches, +# duplicate 'else' branches are not registered as offenses. +# +# @example +# # bad +# if foo +# do_foo +# do_something_else +# elsif bar +# do_foo +# do_something_else +# end +# +# # good +# if foo || bar +# do_foo +# do_something_else +# end +# +# # bad +# case x +# when foo +# do_foo +# when bar +# do_foo +# else +# do_something_else +# end +# +# # good +# case x +# when foo, bar +# do_foo +# else +# do_something_else +# end +# +# # bad +# begin +# do_something +# rescue FooError +# handle_error +# rescue BarError +# handle_error +# end +# +# # good +# begin +# do_something +# rescue FooError, BarError +# handle_error +# end +# +# @example IgnoreLiteralBranches: true +# # good +# case size +# when "small" then 100 +# when "medium" then 250 +# when "large" then 1000 +# else 250 +# end +# +# @example IgnoreConstantBranches: true +# # good +# case size +# when "small" then SMALL_SIZE +# when "medium" then MEDIUM_SIZE +# when "large" then LARGE_SIZE +# else MEDIUM_SIZE +# end +# +# @example IgnoreDuplicateElseBranch: true +# # good +# if foo +# do_foo +# elsif bar +# do_bar +# else +# do_foo +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:99 +class RuboCop::Cop::Lint::DuplicateBranch < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:102 + def on_branching_statement(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:110 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:111 + def on_case_match(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:114 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:112 + def on_rescue(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:136 + def branches(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:140 + def consider_branch?(branches, branch); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:174 + def const_branch?(branch); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:178 + def duplicate_else_branch?(branches, branch); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:155 + def ignore_constant_branches?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:159 + def ignore_duplicate_else_branches?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:151 + def ignore_literal_branches?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:163 + def literal_branch?(branch); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:122 + def offense_range(duplicate_branch); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_branch.rb:100 +RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) + +# Checks that there are no repeated conditions +# used in case 'when' expressions. +# +# @example +# +# # bad +# case x +# when 'first' +# do_something +# when 'first' +# do_something_else +# end +# +# # good +# case x +# when 'first' +# do_something +# when 'second' +# do_something_else +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_case_condition.rb:26 +class RuboCop::Cop::Lint::DuplicateCaseCondition < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_case_condition.rb:29 + def on_case(case_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_case_condition.rb:27 +RuboCop::Cop::Lint::DuplicateCaseCondition::MSG = T.let(T.unsafe(nil), String) + +# Checks that there are no repeated conditions used in if 'elsif'. +# +# @example +# # bad +# if x == 1 +# do_something +# elsif x == 1 +# do_something_else +# end +# +# # good +# if x == 1 +# do_something +# elsif x == 2 +# do_something_else +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_elsif_condition.rb:23 +class RuboCop::Cop::Lint::DuplicateElsifCondition < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_elsif_condition.rb:26 + def on_if(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_elsif_condition.rb:24 +RuboCop::Cop::Lint::DuplicateElsifCondition::MSG = T.let(T.unsafe(nil), String) + +# Checks for duplicated keys in hash literals. +# This cop considers both primitive types and constants for the hash keys. +# +# This cop mirrors a warning in Ruby 2.2. +# +# @example +# +# # bad +# hash = { food: 'apple', food: 'orange' } +# +# # good +# hash = { food: 'apple', other_food: 'orange' } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_hash_key.rb:18 +class RuboCop::Cop::Lint::DuplicateHashKey < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Duplication + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_hash_key.rb:23 + def on_hash(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_hash_key.rb:21 +RuboCop::Cop::Lint::DuplicateHashKey::MSG = T.let(T.unsafe(nil), String) + +# Checks for duplicated magic comments. +# +# @example +# +# # bad +# +# +# # good +# +# +# # bad +# +# +# # good +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_magic_comment.rb:28 +class RuboCop::Cop::Lint::DuplicateMagicComment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FrozenStringLiteral + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_magic_comment.rb:35 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_magic_comment.rb:51 + def magic_comment_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_magic_comment.rb:65 + def register_offense(range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_magic_comment.rb:33 +RuboCop::Cop::Lint::DuplicateMagicComment::MSG = T.let(T.unsafe(nil), String) + +# Checks that there are no repeated patterns used in `in` keywords. +# +# @example +# +# # bad +# case x +# in 'first' +# do_something +# in 'first' +# do_something_else +# end +# +# # good +# case x +# in 'first' +# do_something +# in 'second' +# do_something_else +# end +# +# # bad - repeated alternate patterns with the same conditions don't depend on the order +# case x +# in 0 | 1 +# first_method +# in 1 | 0 +# second_method +# end +# +# # good +# case x +# in 0 | 1 +# first_method +# in 2 | 3 +# second_method +# end +# +# # bad - repeated hash patterns with the same conditions don't depend on the order +# case x +# in foo: a, bar: b +# first_method +# in bar: b, foo: a +# second_method +# end +# +# # good +# case x +# in foo: a, bar: b +# first_method +# in bar: b, baz: c +# second_method +# end +# +# # bad - repeated array patterns with elements in the same order +# case x +# in [foo, bar] +# first_method +# in [foo, bar] +# second_method +# end +# +# # good +# case x +# in [foo, bar] +# first_method +# in [bar, foo] +# second_method +# end +# +# # bad - repeated the same patterns and guard conditions +# case x +# in foo if bar +# first_method +# in foo if bar +# second_method +# end +# +# # good +# case x +# in foo if bar +# first_method +# in foo if baz +# second_method +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_match_pattern.rb:90 +class RuboCop::Cop::Lint::DuplicateMatchPattern < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_match_pattern.rb:97 + def on_case_match(case_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_match_pattern.rb:108 + def pattern_identity(pattern); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_match_pattern.rb:93 +RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String) + +# Checks for duplicated instance (or singleton) method +# definitions. +# +# NOTE: Aliasing a method to itself is allowed, as it indicates that +# the developer intends to suppress Ruby's method redefinition warnings. +# See https://bugs.ruby-lang.org/issues/13574. +# +# @example +# +# # bad +# def foo +# 1 +# end +# +# def foo +# 2 +# end +# +# # bad +# def foo +# 1 +# end +# +# alias foo bar +# +# # good +# def foo +# 1 +# end +# +# def bar +# 2 +# end +# +# # good +# def foo +# 1 +# end +# +# alias bar foo +# +# # good +# alias foo foo +# def foo +# 1 +# end +# +# # good +# alias_method :foo, :foo +# def foo +# 1 +# end +# +# # bad +# class MyClass +# extend Forwardable +# +# # or with: `def_instance_delegator`, `def_delegators`, `def_instance_delegators` +# def_delegator :delegation_target, :delegated_method_name +# +# def delegated_method_name +# end +# end +# +# # good +# class MyClass +# extend Forwardable +# +# def_delegator :delegation_target, :delegated_method_name +# +# def non_duplicated_delegated_method_name +# end +# end +# +# @example AllCops:ActiveSupportExtensionsEnabled: false (default) +# +# # good +# def foo +# 1 +# end +# +# delegate :foo, to: :bar +# +# @example AllCops:ActiveSupportExtensionsEnabled: true +# +# # bad +# def foo +# 1 +# end +# +# delegate :foo, to: :bar +# +# # good +# def foo +# 1 +# end +# +# delegate :baz, to: :bar +# +# # good - delegate with splat arguments is ignored +# def foo +# 1 +# end +# +# delegate :foo, **options +# +# # good - delegate inside a condition is ignored +# def foo +# 1 +# end +# +# if cond +# delegate :foo, to: :bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:121 +class RuboCop::Cop::Lint::DuplicateMethods < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:127 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:167 + def alias_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:201 + def class_or_module_new_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:172 + def delegate_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:180 + def delegator?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:190 + def delegators?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:153 + def method_alias?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:157 + def on_alias(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:133 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:141 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:207 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:198 + def sym_name(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:317 + def anon_block_scope_id(anon_block); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:308 + def anonymous_class_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:234 + def check_const_receiver(node, name, const_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:241 + def check_self_receiver(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:270 + def delegate_prefix(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:395 + def found_attr(node, args, readable: T.unsafe(nil), writable: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:286 + def found_instance_method(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:344 + def found_method(node, method_name, scope_id: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:333 + def found_sclass_method(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:282 + def hash_value(node, key); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:300 + def humanize_scope(scope); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:251 + def inside_condition?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:373 + def location(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:405 + def lookup_constant(node, const_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:255 + def message_for_dup(node, method_name, key); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:365 + def method_key(node, method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:328 + def named_receiver(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:381 + def on_attr(node, attr_name, args); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:260 + def on_delegate(node, method_names); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:423 + def qualified_name(enclosing, namespace, mod_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:437 + def source_location(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:122 +RuboCop::Cop::Lint::DuplicateMethods::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_methods.rb:123 +RuboCop::Cop::Lint::DuplicateMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for duplicate elements in `Regexp` character classes. +# +# @example +# +# # bad +# r = /[xyx]/ +# +# # bad +# r = /[0-9x0-9]/ +# +# # good +# r = /[xy]/ +# +# # good +# r = /[0-9x]/ +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:21 +class RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:35 + def each_repeated_character_class_element_loc(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:27 + def on_regexp(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:52 + def group_expressions(node, expressions); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:73 + def interpolation_locs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:60 + def skip_expression?(expr); end + + # Since we blank interpolations with a space for every char of the interpolation, we would + # mark every space (except the first) as duplicate if we do not skip regexp_parser nodes + # that are within an interpolation. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:67 + def within_interpolation?(node, child); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb:25 +RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement::MSG_REPEATED_ELEMENT = T.let(T.unsafe(nil), String) + +# Checks for duplicate ``require``s and ``require_relative``s. +# +# @safety +# This cop's autocorrection is unsafe because it may break the dependency order +# of `require`. +# +# @example +# # bad +# require 'foo' +# require 'bar' +# require 'foo' +# +# # good +# require 'foo' +# require 'bar' +# +# # good +# require 'foo' +# require_relative 'foo' +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:26 +class RuboCop::Cop::Lint::DuplicateRequire < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:39 + def on_new_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:45 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:35 + def require_call?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:30 +RuboCop::Cop::Lint::DuplicateRequire::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:31 +RuboCop::Cop::Lint::DuplicateRequire::REQUIRE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_require.rb:32 +RuboCop::Cop::Lint::DuplicateRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Checks that there are no repeated exceptions +# used in 'rescue' expressions. +# +# @example +# # bad +# begin +# something +# rescue FirstException +# handle_exception +# rescue FirstException +# handle_other_exception +# end +# +# # good +# begin +# something +# rescue FirstException +# handle_exception +# rescue SecondException +# handle_other_exception +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_rescue_exception.rb:28 +class RuboCop::Cop::Lint::DuplicateRescueException < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RescueNode + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_rescue_exception.rb:33 + def on_rescue(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_rescue_exception.rb:31 +RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) + +# Checks for duplicate literal, constant, or variable elements in `Set` and `SortedSet`. +# +# @example +# +# # bad +# Set[:foo, :bar, :foo] +# +# # good +# Set[:foo, :bar] +# +# # bad +# Set.new([:foo, :bar, :foo]) +# +# # good +# Set.new([:foo, :bar]) +# +# # bad +# [:foo, :bar, :foo].to_set +# +# # good +# [:foo, :bar].to_set +# +# # bad +# SortedSet[:foo, :bar, :foo] +# +# # good +# SortedSet[:foo, :bar] +# +# # bad +# SortedSet.new([:foo, :bar, :foo]) +# +# # good +# SortedSet.new([:foo, :bar]) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:39 +class RuboCop::Cop::Lint::DuplicateSetElement < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:71 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:54 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:46 + def set_init_elements(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:75 + def register_offense(current_element, prev_element, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:42 +RuboCop::Cop::Lint::DuplicateSetElement::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/duplicate_set_element.rb:43 +RuboCop::Cop::Lint::DuplicateSetElement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks if each_with_object is called with an immutable +# argument. Since the argument is the object that the given block shall +# make calls on to build something based on the enumerable that +# each_with_object iterates over, an immutable argument makes no sense. +# It's definitely a bug. +# +# @example +# +# # bad +# sum = numbers.each_with_object(0) { |e, a| a += e } +# +# # good +# num = 0 +# sum = numbers.each_with_object(num) { |e, a| a += e } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/each_with_object_argument.rb:20 +class RuboCop::Cop::Lint::EachWithObjectArgument < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/each_with_object_argument.rb:25 + def each_with_object?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/each_with_object_argument.rb:36 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/each_with_object_argument.rb:29 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/each_with_object_argument.rb:21 +RuboCop::Cop::Lint::EachWithObjectArgument::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/each_with_object_argument.rb:22 +RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for odd `else` block layout - like +# having an expression on the same line as the `else` keyword, +# which is usually a mistake. +# +# Its autocorrection tweaks layout to keep the syntax. So, this autocorrection +# is compatible correction for bad case syntax, but if your code makes a mistake +# with `elsif` and `else`, you will have to correct it manually. +# +# @example +# +# # bad +# +# if something +# # ... +# else do_this +# do_that +# end +# +# # good +# +# # This code is compatible with the bad case. It will be autocorrected like this. +# if something +# # ... +# else +# do_this +# do_that +# end +# +# # This code is incompatible with the bad case. +# # If `do_this` is a condition, `elsif` should be used instead of `else`. +# if something +# # ... +# elsif do_this +# do_that +# end +# +# # bad +# +# # For single-line conditionals using `then` the layout is disallowed +# # when the `else` body is multiline because it is treated as a lint offense. +# if something then on_the_same_line_as_then +# else first_line +# second_line +# end +# +# # good +# +# # For single-line conditional using `then` the layout is allowed +# # when `else` body is a single-line because it is treated as intentional. +# +# if something then on_the_same_line_as_then +# else single_line +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/else_layout.rb:59 +class RuboCop::Cop::Lint::ElseLayout < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/else_layout.rb:66 + def on_if(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/else_layout.rb:98 + def autocorrect(corrector, node, first_else); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/else_layout.rb:78 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/else_layout.rb:88 + def check_else(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/else_layout.rb:64 +RuboCop::Cop::Lint::ElseLayout::MSG = T.let(T.unsafe(nil), String) + +# Checks for blocks without a body. +# Such empty blocks are typically an oversight or we should provide a comment +# to clarify what we're aiming for. +# +# Empty lambdas and procs are ignored by default. +# +# NOTE: For backwards compatibility, the configuration that allows/disallows +# empty lambdas and procs is called `AllowEmptyLambdas`, even though it also +# applies to procs. +# +# @example +# # bad +# items.each { |item| } +# +# # good +# items.each { |item| puts item } +# +# @example AllowComments: true (default) +# # good +# items.each do |item| +# # TODO: implement later (inner comment) +# end +# +# items.each { |item| } # TODO: implement later (inline comment) +# +# @example AllowComments: false +# # bad +# items.each do |item| +# # TODO: implement later (inner comment) +# end +# +# items.each { |item| } # TODO: implement later (inline comment) +# +# @example AllowEmptyLambdas: true (default) +# # good +# allow(subject).to receive(:callable).and_return(-> {}) +# +# placeholder = lambda do +# end +# (callable || placeholder).call +# +# proc { } +# +# Proc.new { } +# +# @example AllowEmptyLambdas: false +# # bad +# allow(subject).to receive(:callable).and_return(-> {}) +# +# placeholder = lambda do +# end +# (callable || placeholder).call +# +# proc { } +# +# Proc.new { } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_block.rb:63 +class RuboCop::Cop::Lint::EmptyBlock < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_block.rb:66 + def on_block(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_block.rb:76 + def allow_comment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_block.rb:83 + def allow_empty_lambdas?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_block.rb:87 + def comment_disables_cop?(comment); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_block.rb:64 +RuboCop::Cop::Lint::EmptyBlock::MSG = T.let(T.unsafe(nil), String) + +# Checks for classes and metaclasses without a body. +# Such empty classes and metaclasses are typically an oversight or we should provide a comment +# to be clearer what we're aiming for. +# +# @example +# # bad +# class Foo +# end +# +# class Bar +# class << self +# end +# end +# +# class << obj +# end +# +# # good +# class Foo +# def do_something +# # ... code +# end +# end +# +# class Bar +# class << self +# attr_reader :bar +# end +# end +# +# class << obj +# attr_reader :bar +# end +# +# @example AllowComments: false (default) +# # bad +# class Foo +# # TODO: implement later +# end +# +# class Bar +# class << self +# # TODO: implement later +# end +# end +# +# class << obj +# # TODO: implement later +# end +# +# @example AllowComments: true +# # good +# class Foo +# # TODO: implement later +# end +# +# class Bar +# class << self +# # TODO: implement later +# end +# end +# +# class << obj +# # TODO: implement later +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_class.rb:72 +class RuboCop::Cop::Lint::EmptyClass < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_class.rb:76 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_class.rb:81 + def on_sclass(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_class.rb:87 + def body_or_allowed_comment_lines?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_class.rb:73 +RuboCop::Cop::Lint::EmptyClass::CLASS_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_class.rb:74 +RuboCop::Cop::Lint::EmptyClass::METACLASS_MSG = T.let(T.unsafe(nil), String) + +# Checks for the presence of `if`, `elsif` and `unless` branches without a body. +# +# NOTE: empty `else` branches are handled by `Style/EmptyElse`. +# +# @example +# # bad +# if condition +# end +# +# # bad +# unless condition +# end +# +# # bad +# if condition +# do_something +# elsif other_condition +# end +# +# # good +# if condition +# do_something +# end +# +# # good +# unless condition +# do_something +# end +# +# # good +# if condition +# do_something +# elsif other_condition +# nil +# end +# +# # good +# if condition +# do_something +# elsif other_condition +# do_something_else +# end +# +# @example AllowComments: true (default) +# # good +# if condition +# do_something +# elsif other_condition +# # noop +# end +# +# @example AllowComments: false +# # bad +# if condition +# do_something +# elsif other_condition +# # noop +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:65 +class RuboCop::Cop::Lint::EmptyConditionalBody < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CommentsHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:71 + def on_if(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:86 + def allow_comments?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:130 + def branch_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:99 + def can_simplify_conditional?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:138 + def deletion_range(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:126 + def else_branch?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:118 + def empty_if_branch?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:113 + def flip_orphaned_else(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:91 + def offense_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:103 + def remove_empty_branch(corrector, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_conditional_body.rb:69 +RuboCop::Cop::Lint::EmptyConditionalBody::MSG = T.let(T.unsafe(nil), String) + +# Checks for empty `ensure` blocks. +# +# @example +# +# # bad +# def some_method +# do_something +# ensure +# end +# +# # bad +# begin +# do_something +# ensure +# end +# +# # good +# def some_method +# do_something +# ensure +# do_something_else +# end +# +# # good +# begin +# do_something +# ensure +# do_something_else +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_ensure.rb:35 +class RuboCop::Cop::Lint::EmptyEnsure < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_ensure.rb:40 + def on_ensure(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_ensure.rb:38 +RuboCop::Cop::Lint::EmptyEnsure::MSG = T.let(T.unsafe(nil), String) + +# Checks for the presence of empty expressions. +# +# @example +# +# # bad +# +# foo = () +# if () +# bar +# end +# +# # good +# +# foo = (some_expression) +# if (some_expression) +# bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_expression.rb:23 +class RuboCop::Cop::Lint::EmptyExpression < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_expression.rb:26 + def on_begin(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_expression.rb:34 + def empty_expression?(begin_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_expression.rb:24 +RuboCop::Cop::Lint::EmptyExpression::MSG = T.let(T.unsafe(nil), String) + +# Enforces that Ruby source files are not empty. +# +# @example +# # bad +# # Empty file +# +# # good +# # File containing non commented source lines +# +# @example AllowComments: true (default) +# # good +# # File consisting only of comments +# +# @example AllowComments: false +# # bad +# # File consisting only of comments +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_file.rb:23 +class RuboCop::Cop::Lint::EmptyFile < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_file.rb:26 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_file.rb:40 + def contains_only_comments?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_file.rb:36 + def empty_file?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_file.rb:32 + def offending?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_file.rb:24 +RuboCop::Cop::Lint::EmptyFile::MSG = T.let(T.unsafe(nil), String) + +# Checks for the presence of `in` pattern branches without a body. +# +# @example +# +# # bad +# case condition +# in [a] +# do_something +# in [a, b] +# end +# +# # good +# case condition +# in [a] +# do_something +# in [a, b] +# nil +# end +# +# @example AllowComments: true (default) +# +# # good +# case condition +# in [a] +# do_something +# in [a, b] +# # noop +# end +# +# @example AllowComments: false +# +# # bad +# case condition +# in [a] +# do_something +# in [a, b] +# # noop +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_in_pattern.rb:45 +class RuboCop::Cop::Lint::EmptyInPattern < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CommentsHelp + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_in_pattern.rb:53 + def on_case_match(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_in_pattern.rb:64 + def allow_comments?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_in_pattern.rb:49 +RuboCop::Cop::Lint::EmptyInPattern::MSG = T.let(T.unsafe(nil), String) + +# Checks for empty interpolation. +# +# @example +# +# # bad +# "result is #{}" +# +# # good +# "result is #{some_result}" +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_interpolation.rb:15 +class RuboCop::Cop::Lint::EmptyInterpolation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Interpolation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_interpolation.rb:21 + def on_interpolation(begin_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_interpolation.rb:33 + def in_percent_literal_array?(begin_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_interpolation.rb:19 +RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) + +# Checks for the presence of `when` branches without a body. +# +# @example +# +# # bad +# case foo +# when bar +# do_something +# when baz +# end +# +# # good +# case condition +# when foo +# do_something +# when bar +# nil +# end +# +# @example AllowComments: true (default) +# +# # good +# case condition +# when foo +# do_something +# when bar +# # noop +# end +# +# @example AllowComments: false +# +# # bad +# case condition +# when foo +# do_something +# when bar +# # do nothing +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_when.rb:45 +class RuboCop::Cop::Lint::EmptyWhen < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CommentsHelp + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_when.rb:50 + def on_case(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/empty_when.rb:61 + def allow_comments?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/empty_when.rb:48 +RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) + +# Checks for `return` from an `ensure` block. +# `return` from an ensure block is a dangerous code smell as it +# will take precedence over any exception being raised, +# and the exception will be silently thrown away as if it were rescued. +# +# If you want to rescue some (or all) exceptions, best to do it explicitly +# +# @example +# +# # bad +# def foo +# do_something +# ensure +# cleanup +# return self +# end +# +# # good +# def foo +# do_something +# self +# ensure +# cleanup +# end +# +# # good +# def foo +# begin +# do_something +# rescue SomeException +# # Let's ignore this exception +# end +# self +# ensure +# cleanup +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ensure_return.rb:42 +class RuboCop::Cop::Lint::EnsureReturn < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/ensure_return.rb:45 + def on_ensure(node); end + + private + + # A `return` inside a nested method definition or lambda within the + # `ensure` returns from that inner scope, not from the method whose + # `ensure` this is, so it is not an offense. A `return` inside a plain + # block (or `proc`) does propagate out, so it remains an offense. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/ensure_return.rb:59 + def return_from_inner_scope?(return_node, ensure_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ensure_return.rb:43 +RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String) + +# Emulates the following Ruby warnings in Ruby 2.6. +# +# [source,console] +# ---- +# $ cat example.rb +# ERB.new('hi', nil, '-', '@output_buffer') +# $ ruby -rerb example.rb +# example.rb:1: warning: Passing safe_level with the 2nd argument of ERB.new is +# deprecated. Do not use it, and specify other arguments as keyword arguments. +# example.rb:1: warning: Passing trim_mode with the 3rd argument of ERB.new is +# deprecated. Use keyword argument like ERB.new(str, trim_mode:...) instead. +# example.rb:1: warning: Passing eoutvar with the 4th argument of ERB.new is +# deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead. +# ---- +# +# Now non-keyword arguments other than first one are softly deprecated +# and will be removed when Ruby 2.5 becomes EOL. +# `ERB.new` with non-keyword arguments is deprecated since ERB 2.2.0. +# Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`. +# This cop identifies places where `ERB.new(str, trim_mode, eoutvar)` can +# be replaced by `ERB.new(str, trim_mode: trim_mode, eoutvar: eoutvar)`. +# +# @example +# # Target codes supports Ruby 2.6 and higher only +# # bad +# ERB.new(str, nil, '-', '@output_buffer') +# +# # good +# ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') +# +# # Target codes supports Ruby 2.5 and lower only +# # good +# ERB.new(str, nil, '-', '@output_buffer') +# +# # Target codes supports Ruby 2.6, 2.5 and lower +# # bad +# ERB.new(str, nil, '-', '@output_buffer') +# +# # good +# # Ruby standard library style +# # https://github.com/ruby/ruby/commit/3406c5d +# if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+ +# ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') +# else +# ERB.new(str, nil, '-', '@output_buffer') +# end +# +# # good +# # Use `RUBY_VERSION` style +# if RUBY_VERSION >= '2.6' +# ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') +# else +# ERB.new(str, nil, '-', '@output_buffer') +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:61 +class RuboCop::Cop::Lint::ErbNewArguments < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:81 + def erb_new_with_non_keyword_arguments(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:86 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:115 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:130 + def build_kwargs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:126 + def correct_arguments?(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:104 + def message(positional_argument_index, arg_value); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:147 + def override_by_legacy_args(kwargs, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:74 +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_EOUTVAR = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:68 +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_SAFE_LEVEL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:71 +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_TRIM_MODE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/erb_new_arguments.rb:78 +RuboCop::Cop::Lint::ErbNewArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Looks for uses of flip-flop operator +# based on the Ruby Style Guide. +# +# Here is the history of flip-flops in Ruby. +# flip-flop operator is deprecated in Ruby 2.6.0 and +# the deprecation has been reverted by Ruby 2.7.0 and +# backported to Ruby 2.6. +# See: https://bugs.ruby-lang.org/issues/5400 +# +# @example +# # bad +# (1..20).each do |x| +# puts x if (x == 5) .. (x == 10) +# end +# +# # good +# (1..20).each do |x| +# puts x if (x >= 5) && (x <= 10) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/flip_flop.rb:25 +class RuboCop::Cop::Lint::FlipFlop < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/flip_flop.rb:32 + def on_eflipflop(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/flip_flop.rb:28 + def on_iflipflop(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/flip_flop.rb:26 +RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String) + +# Checks for the presence of precise comparison of floating point numbers. +# +# Floating point values are inherently inaccurate, and comparing them for exact equality +# is almost never the desired semantics. Comparison via the `==/!=` operators checks +# floating-point value representation to be exactly the same, which is very unlikely +# if you perform any arithmetic operations involving precision loss. +# +# @example +# # bad +# x == 0.1 +# x != 0.1 +# +# # bad +# case value +# when 1.0 +# foo +# when 2.0 +# bar +# end +# +# # good - using BigDecimal +# x.to_d == 0.1.to_d +# +# # good - comparing against zero +# x == 0.0 +# x != 0.0 +# +# # good +# (x - 0.1).abs < Float::EPSILON +# +# # good +# tolerance = 0.0001 +# (x - 0.1).abs < tolerance +# +# # good - comparing against nil +# Float(x, exception: false) == nil +# +# # good - using epsilon comparison in case expression +# case +# when (value - 1.0).abs < Float::EPSILON +# foo +# when (value - 2.0).abs < Float::EPSILON +# bar +# end +# +# # Or some other epsilon based type of comparison: +# # https://www.embeddeduse.com/2019/08/26/qt-compare-two-floats/ +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:54 +class RuboCop::Cop::Lint::FloatComparison < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:78 + def on_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:76 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:65 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:90 + def float?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:112 + def float_send?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:105 + def literal_safe?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:123 + def numeric_returning_method?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:59 +RuboCop::Cop::Lint::FloatComparison::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:61 +RuboCop::Cop::Lint::FloatComparison::FLOAT_INSTANCE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:60 +RuboCop::Cop::Lint::FloatComparison::FLOAT_RETURNING_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:57 +RuboCop::Cop::Lint::FloatComparison::MSG_CASE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:55 +RuboCop::Cop::Lint::FloatComparison::MSG_EQUALITY = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:56 +RuboCop::Cop::Lint::FloatComparison::MSG_INEQUALITY = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_comparison.rb:63 +RuboCop::Cop::Lint::FloatComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Identifies `Float` literals which are, like, really really really +# really really really really really big. Too big. No-one needs Floats +# that big. If you need a float that big, something is wrong with you. +# +# @example +# +# # bad +# float = 3.0e400 +# +# # good +# float = 42.9 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_out_of_range.rb:17 +class RuboCop::Cop::Lint::FloatOutOfRange < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/float_out_of_range.rb:20 + def on_float(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/float_out_of_range.rb:18 +RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String) + +# This lint sees if there is a mismatch between the number of +# expected fields for format/sprintf/#% and what is actually +# passed as arguments. +# +# In addition, it checks whether different formats are used in the same +# format string. Do not mix numbered, unnumbered, and named formats in +# the same format string. +# +# @example +# +# # bad +# format('A value: %s and another: %i', a_value) +# +# # good +# format('A value: %s and another: %i', a_value, another) +# +# # bad +# format('Unnumbered format: %s and numbered: %2$s', a_value, another) +# +# # good +# format('Numbered format: %1$s and numbered %2$s', a_value, another) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:27 +class RuboCop::Cop::Lint::FormatParameterMismatch < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:90 + def called_on_string?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:39 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:127 + def count_format_matches(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:109 + def count_matches(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:131 + def count_percent_matches(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:119 + def countable_format?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:123 + def countable_percent?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:143 + def expected_fields_count(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:158 + def format?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:136 + def format_method?(name, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:54 + def format_string?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:105 + def heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:58 + def invalid_format_string?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:81 + def matched_arguments_count?(expected, passed); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:176 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:95 + def method_with_format_args?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:67 + def offending_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:166 + def percent?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:99 + def splat_args?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:162 + def sprintf?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:185 + def string_type?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:34 +RuboCop::Cop::Lint::FormatParameterMismatch::KERNEL = T.let(T.unsafe(nil), String) + +# http://rubular.com/r/CvpbxkcTzy +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:29 +RuboCop::Cop::Lint::FormatParameterMismatch::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:31 +RuboCop::Cop::Lint::FormatParameterMismatch::MSG_INVALID = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:37 +RuboCop::Cop::Lint::FormatParameterMismatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:35 +RuboCop::Cop::Lint::FormatParameterMismatch::SHOVEL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/format_parameter_mismatch.rb:36 +RuboCop::Cop::Lint::FormatParameterMismatch::STRING_TYPES = T.let(T.unsafe(nil), Array) + +# Prefer using `Hash#compare_by_identity` rather than using `object_id` +# for hash keys. +# +# This cop looks for hashes being keyed by objects' `object_id`, using +# one of these methods: `key?`, `has_key?`, `fetch`, `[]` and `[]=`. +# +# @safety +# This cop is unsafe. Although unlikely, the hash could store both object +# ids and other values that need be compared by value, and thus +# could be a false positive. +# +# Furthermore, this cop cannot guarantee that the receiver of one of the +# methods (`key?`, etc.) is actually a hash. +# +# @example +# # bad +# hash = {} +# hash[foo.object_id] = :bar +# hash.key?(baz.object_id) +# +# # good +# hash = {}.compare_by_identity +# hash[foo] = :bar +# hash.key?(baz) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/hash_compare_by_identity.rb:31 +class RuboCop::Cop::Lint::HashCompareByIdentity < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/hash_compare_by_identity.rb:37 + def id_as_hash_key?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/hash_compare_by_identity.rb:44 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/hash_compare_by_identity.rb:41 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/hash_compare_by_identity.rb:34 +RuboCop::Cop::Lint::HashCompareByIdentity::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/hash_compare_by_identity.rb:32 +RuboCop::Cop::Lint::HashCompareByIdentity::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the deprecated use of keyword arguments as a default in `Hash.new`. +# +# This usage raises a warning in Ruby 3.3 and results in an error in Ruby 3.4. +# In Ruby 3.4, keyword arguments will instead be used to change the behavior of a hash. +# For example, the capacity option can be passed to create a hash with a certain size +# if you know it in advance, for better performance. +# +# NOTE: The following corner case may result in a false negative when upgrading from Ruby 3.3 +# or earlier, but it is intentionally not detected to respect the expected usage in Ruby 3.4. +# +# [source,ruby] +# ---- +# Hash.new(capacity: 42) +# ---- +# +# @example +# +# # bad +# Hash.new(key: :value) +# +# # good +# Hash.new({key: :value}) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb:29 +class RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb:36 + def hash_new(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb:40 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb:32 +RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb:33 +RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the ordering of a method call where +# the receiver of the call is a HEREDOC. +# +# @example +# # bad +# <<-SQL +# bar +# SQL +# .strip_indent +# +# <<-SQL +# bar +# SQL +# .strip_indent +# .trim +# +# # good +# <<~SQL +# bar +# SQL +# +# <<~SQL.trim +# bar +# SQL +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:31 +class RuboCop::Cop::Lint::HeredocMethodCallPosition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:46 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:37 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:97 + def all_on_same_line?(nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:50 + def autocorrect(corrector, node, heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:77 + def call_after_heredoc_range(heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:107 + def call_end_pos(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:116 + def call_line_range(node); end + + # Returns nil if no range can be safely repositioned. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:122 + def call_range_to_safely_reposition(node, heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:86 + def calls_on_multiple_lines?(node, _heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:82 + def correctly_positioned?(node, heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:111 + def heredoc_begin_line_range(heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:103 + def heredoc_end_pos(heredoc); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:73 + def heredoc_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:59 + def heredoc_node_descendent_receiver(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:67 + def send_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:146 + def trailing_comma?(call_source, call_line_source); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/heredoc_method_call_position.rb:35 +RuboCop::Cop::Lint::HeredocMethodCallPosition::MSG = T.let(T.unsafe(nil), String) + +# Prefer `equal?` over `==` when comparing `object_id`. +# +# `Object#equal?` is provided to compare objects for identity, and in contrast +# `Object#==` is provided for the purpose of doing value comparison. +# +# @example +# # bad +# foo.object_id == bar.object_id +# foo.object_id != baz.object_id +# +# # good +# foo.equal?(bar) +# !foo.equal?(baz) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/identity_comparison.rb:20 +class RuboCop::Cop::Lint::IdentityComparison < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/identity_comparison.rb:27 + def object_id_comparison(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/identity_comparison.rb:35 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/identity_comparison.rb:23 +RuboCop::Cop::Lint::IdentityComparison::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/identity_comparison.rb:24 +RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for implicit string concatenation of string literals +# which are on the same line. +# +# @example +# +# # bad +# array = ['Item 1' 'Item 2'] +# +# # good +# array = ['Item 1Item 2'] +# array = ['Item 1' + 'Item 2'] +# array = [ +# 'Item 1' \ +# 'Item 2' +# ] +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:21 +class RuboCop::Cop::Lint::ImplicitStringConcatenation < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:32 + def on_dstr(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:92 + def display_str(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:59 + def each_bad_cons(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:74 + def ending_delimiter(str); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:100 + def str_content(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:84 + def string_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:88 + def string_literals?(node1, node2); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:26 +RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_ARRAY = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:28 +RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_METHOD = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/implicit_string_concatenation.rb:24 +RuboCop::Cop::Lint::ImplicitStringConcatenation::MSG = T.let(T.unsafe(nil), String) + +# Checks for `IO.select` that is incompatible with Fiber Scheduler since Ruby 3.0. +# +# When an array of IO objects waiting for an exception (the third argument of `IO.select`) +# is used as an argument, there is no alternative API, so offenses are not registered. +# +# NOTE: When the method is successful the return value of `IO.select` is `[[IO]]`, +# and the return value of `io.wait_readable` and `io.wait_writable` are `self`. +# They are not autocorrected when assigning a return value because these types are different. +# It's up to user how to handle the return value. +# +# @safety +# This cop's autocorrection is unsafe because `NoMethodError` occurs +# if `require 'io/wait'` is not called. +# +# @example +# +# # bad +# IO.select([io], [], [], timeout) +# +# # good +# io.wait_readable(timeout) +# +# # bad +# IO.select([], [io], [], timeout) +# +# # good +# io.wait_writable(timeout) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:34 +class RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:41 + def io_select(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:46 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:73 + def preferred_method(read, write, timeout); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:63 + def scheduler_compatible?(io1, io2); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:69 + def single_io_array?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:37 +RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb:38 +RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for `private` or `protected` access modifiers which are +# applied to a singleton method. These access modifiers do not make +# singleton methods private/protected. `private_class_method` can be +# used for that. +# +# @example +# +# # bad +# class C +# private +# +# def self.method +# puts 'hi' +# end +# end +# +# # good +# class C +# def self.method +# puts 'hi' +# end +# +# private_class_method :method +# end +# +# # good +# class C +# class << self +# private +# +# def method +# puts 'hi' +# end +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:41 +class RuboCop::Cop::Lint::IneffectiveAccessModifier < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:52 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:55 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:48 + def private_class_methods(param0); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:102 + def access_modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:59 + def check_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:106 + def correct_visibility?(node, modifier, ignored_methods); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:71 + def format_message(modifier); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:84 + def ineffective_modifier(node, ignored_methods = T.unsafe(nil), modifier = T.unsafe(nil), &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:67 + def private_class_method_names(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:44 +RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PRIVATE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:45 +RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PROTECTED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ineffective_access_modifier.rb:42 +RuboCop::Cop::Lint::IneffectiveAccessModifier::MSG = T.let(T.unsafe(nil), String) + +# Looks for error classes inheriting from `Exception`. +# It is configurable to suggest using either `StandardError` (default) or +# `RuntimeError` instead. +# +# @safety +# This cop's autocorrection is unsafe because `rescue` that omit +# exception class handle `StandardError` and its subclasses, +# but not `Exception` and its subclasses. +# +# @example EnforcedStyle: standard_error (default) +# # bad +# +# class C < Exception; end +# +# C = Class.new(Exception) +# +# # good +# +# class C < StandardError; end +# +# C = Class.new(StandardError) +# +# @example EnforcedStyle: runtime_error +# # bad +# +# class C < Exception; end +# +# C = Class.new(Exception) +# +# # good +# +# class C < RuntimeError; end +# +# C = Class.new(RuntimeError) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:40 +class RuboCop::Cop::Lint::InheritException < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:53 + def class_new_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:59 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:70 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:87 + def exception_class?(class_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:91 + def inherit_exception_class_with_omitted_namespace?(class_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:83 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:99 + def preferred_base_class; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:44 +RuboCop::Cop::Lint::InheritException::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:45 +RuboCop::Cop::Lint::InheritException::PREFERRED_BASE_CLASS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/inherit_exception.rb:50 +RuboCop::Cop::Lint::InheritException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for interpolation in a single quoted string. +# +# @safety +# This cop's autocorrection is unsafe because although it always replaces single quotes as +# if it were miswritten double quotes, it is not always the case. For example, +# `'#{foo} bar'` would be replaced by `"#{foo} bar"`, so the replaced code would evaluate +# the expression `foo`. +# +# @example +# +# # bad +# foo = 'something with #{interpolation} inside' +# +# # good +# foo = "something with #{interpolation} inside" +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:21 +class RuboCop::Cop::Lint::InterpolationCheck < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # A multiline single-quoted string is parsed as a `dstr` of `str` segments, so it + # is not covered by `on_str`. Inspect single-quoted `dstr`s here; double-quoted + # interpolation is also a `dstr`, hence the delimiter check. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:34 + def on_dstr(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:27 + def on_str(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:56 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:45 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:67 + def heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:71 + def valid_syntax?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/interpolation_check.rb:24 +RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String) + +# Emulates the following Ruby warning in Ruby 3.3. +# +# [source,ruby] +# ---- +# $ ruby -e '0.times { it }' +# -e:1: warning: `it` calls without arguments will refer to the first block param in Ruby 3.4; +# use it() or self.it +# ---- +# +# `it` calls without arguments will refer to the first block param in Ruby 3.4. +# So use `it()` or `self.it` to ensure compatibility. +# +# @example +# +# # bad +# do_something { it } +# +# # good +# do_something { it() } +# do_something { self.it } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/it_without_arguments_in_block.rb:27 +class RuboCop::Cop::Lint::ItWithoutArgumentsInBlock < ::RuboCop::Cop::Base + include ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/it_without_arguments_in_block.rb:44 + def deprecated_it_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/it_without_arguments_in_block.rb:37 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/it_without_arguments_in_block.rb:33 +RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/it_without_arguments_in_block.rb:35 +RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks uses of lambda without a literal block. +# It emulates the following warning in Ruby 3.0: +# +# $ ruby -vwe 'lambda(&proc {})' +# ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19] +# -e:1: warning: lambda without a literal block is deprecated; use the proc without +# lambda instead +# +# This way, proc object is never converted to lambda. +# Autocorrection replaces with compatible proc argument. +# +# @example +# +# # bad +# lambda(&proc { do_something }) +# lambda(&Proc.new { do_something }) +# +# # good +# proc { do_something } +# Proc.new { do_something } +# lambda { do_something } # If you use lambda. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/lambda_without_literal_block.rb:28 +class RuboCop::Cop::Lint::LambdaWithoutLiteralBlock < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/lambda_without_literal_block.rb:35 + def lambda_with_symbol_proc?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/lambda_without_literal_block.rb:39 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/lambda_without_literal_block.rb:31 +RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/lambda_without_literal_block.rb:32 +RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for literals used as the conditions or as +# operands in and/or expressions serving as the conditions of +# if/while/until/case-when/case-in. +# +# NOTE: Literals in `case-in` condition where the match variable is used in +# `in` are accepted as a pattern matching. +# +# @example +# +# # bad +# if 20 +# do_something +# end +# +# # bad +# # We're only interested in the left hand side being a truthy literal, +# # because it affects the evaluation of the &&, whereas the right hand +# # side will be conditionally executed/called and can be a literal. +# if true && some_var +# do_something +# end +# +# # good +# if some_var +# do_something +# end +# +# # good +# # When using a boolean value for an infinite loop. +# while true +# break if condition +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:38 +class RuboCop::Cop::Lint::LiteralAsCondition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:174 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:45 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:137 + def on_case(case_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:154 + def on_case_match(case_match_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:69 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:57 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:168 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:107 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:122 + def on_until_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:77 + def on_while(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:92 + def on_while_post(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:189 + def basic_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:221 + def check_case(case_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:180 + def check_for_literal(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:201 + def check_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:230 + def condition(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:245 + def condition_evaluation?(node, cond); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:254 + def correct_if_node(node, cond); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:211 + def handle_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:197 + def primitive_array?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:238 + def when_conditions_range(when_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:42 +RuboCop::Cop::Lint::LiteralAsCondition::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_as_condition.rb:43 +RuboCop::Cop::Lint::LiteralAsCondition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for literal assignments in the conditions of `if`, `while`, and `until`. +# It emulates the following Ruby warning: +# +# [source,console] +# ---- +# $ ruby -we 'if x = true; end' +# -e:1: warning: found `= literal' in conditional, should be == +# ---- +# +# As a lint cop, it cannot be determined if `==` is appropriate as intended, +# therefore this cop does not provide autocorrection. +# +# @example +# +# # bad +# if x = 42 +# do_something +# end +# +# # good +# if x == 42 +# do_something +# end +# +# # good +# if x = y +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:35 +class RuboCop::Cop::Lint::LiteralAssignmentInCondition < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:39 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:52 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:51 + def on_while(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:72 + def all_literals?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:89 + def offense_range(asgn_node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:85 + def parallel_assignment_with_splat_operator?(node); end + + # An assignment inside a block or method body within the condition belongs to + # that inner scope rather than the condition itself, so it is not inspected. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:68 + def scope_body?(node, child); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:56 + def traverse_node(node, &block); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_assignment_in_condition.rb:36 +RuboCop::Cop::Lint::LiteralAssignmentInCondition::MSG = T.let(T.unsafe(nil), String) + +# Checks for interpolated literals. +# +# NOTE: Array literals interpolated in regexps are not handled by this cop, but +# by `Lint/ArrayLiteralInRegexp` instead. +# +# @example +# +# # bad +# "result is #{10}" +# +# # good +# "result is 10" +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:18 +class RuboCop::Cop::Lint::LiteralInInterpolation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Interpolation + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::PercentLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:28 + def on_interpolation(begin_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:72 + def array_in_regexp?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:78 + def autocorrected_value(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:142 + def autocorrected_value_for_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:148 + def autocorrected_value_for_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:121 + def autocorrected_value_for_string(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:131 + def autocorrected_value_for_symbol(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:159 + def autocorrected_value_in_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:138 + def autocorrected_value_in_hash_for_symbol(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:189 + def ends_heredoc_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:127 + def escape_string_content(string); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:100 + def handle_special_regexp_chars(begin_node, value); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:197 + def in_array_percent_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:57 + def offending?(node); end + + # Does node print its own source when converted to a string? + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:180 + def prints_as_self?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:185 + def space_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:67 + def special_keyword?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:25 +RuboCop::Cop::Lint::LiteralInInterpolation::COMPOSITE = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/literal_in_interpolation.rb:24 +RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) + +# Checks for uses of `begin...end while/until something`. +# +# @safety +# The cop is unsafe because behavior can change in some cases, including +# if a local variable inside the loop body is accessed outside of it, or if the +# loop body raises a `StopIteration` exception (which `Kernel#loop` rescues). +# +# @example +# +# # bad +# +# # using while +# begin +# do_something +# end while some_condition +# +# # good +# +# # while replacement +# loop do +# do_something +# break unless some_condition +# end +# +# # bad +# +# # using until +# begin +# do_something +# end until some_condition +# +# # good +# +# # until replacement +# loop do +# do_something +# break if some_condition +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:44 +class RuboCop::Cop::Lint::Loop < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:53 + def on_until_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:49 + def on_while_post(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:73 + def build_break_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:69 + def keyword_and_condition_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:59 + def register_offense(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/loop.rb:47 +RuboCop::Cop::Lint::Loop::MSG = T.let(T.unsafe(nil), String) + +# cop disables on wide ranges of code, that later contributors to +# a file wouldn't be aware of. +# +# You can set `MaxRangeSize` to define the maximum number of +# consecutive lines a cop can be disabled for. +# +# - `.inf` any size (default) +# - `0` allows only single-line disables +# - `1` means the maximum allowed is as follows: +# +# [source,ruby] +# ---- +# a = 1 +# ---- +# +# @example MaxRangeSize: .inf (default) +# +# # good +# x= 0 +# # y = 1 +# # EOF +# +# # bad +# x= 0 +# # EOF +# +# @example MaxRangeSize: 2 +# +# # good +# x= 0 +# # With the previous, there are 2 lines on which cop is disabled. +# +# # bad +# x= 0 +# x += 1 +# # Including this, that's 3 lines on which the cop is disabled. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:55 +class RuboCop::Cop::Lint::MissingCopEnableDirective < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:61 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:79 + def acceptable_range?(cop, line_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:113 + def department_enabled?(cop, comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:73 + def each_missing_enable; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:96 + def max_range; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:100 + def message(cop, comment, type = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:58 +RuboCop::Cop::Lint::MissingCopEnableDirective::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_cop_enable_directive.rb:59 +RuboCop::Cop::Lint::MissingCopEnableDirective::MSG_BOUND = T.let(T.unsafe(nil), String) + +# Checks for the presence of constructors and lifecycle callbacks +# without calls to `super`. +# +# This cop does not consider `method_missing` (and `respond_to_missing?`) +# because in some cases it makes sense to overtake what is considered a +# missing method. In other cases, the theoretical ideal handling could be +# challenging or verbose for no actual gain. +# +# Autocorrection is not supported because the position of `super` cannot be +# determined automatically. +# +# `Object` and `BasicObject` are allowed by this cop because of their +# stateless nature. However, sometimes you might want to allow other parent +# classes from this cop, for example in the case of an abstract class that is +# not meant to be called with `super`. In those cases, you can use the +# `AllowedParentClasses` option to specify which classes should be allowed +# *in addition to* `Object` and `BasicObject`. +# +# @example +# # bad +# class Employee < Person +# def initialize(name, salary) +# @salary = salary +# end +# end +# +# # good +# class Employee < Person +# def initialize(name, salary) +# super(name) +# @salary = salary +# end +# end +# +# # bad +# Employee = Class.new(Person) do +# def initialize(name, salary) +# @salary = salary +# end +# end +# +# # good +# Employee = Class.new(Person) do +# def initialize(name, salary) +# super(name) +# @salary = salary +# end +# end +# +# # bad +# class Parent +# def self.inherited(base) +# do_something +# end +# end +# +# # good +# class Parent +# def self.inherited(base) +# super +# do_something +# end +# end +# +# # good +# class ClassWithNoParent +# def initialize +# do_something +# end +# end +# +# @example AllowedParentClasses: [MyAbstractClass] +# # good +# class MyConcreteClass < MyAbstractClass +# def initialize +# do_something +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:85 +class RuboCop::Cop::Lint::MissingSuper < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:99 + def class_new_block(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:105 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:115 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:149 + def allowed_class?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:153 + def allowed_classes; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:127 + def callback_method_def?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:133 + def contains_super?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:137 + def inside_class_with_stateful_parent?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:123 + def offender?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:96 +RuboCop::Cop::Lint::MissingSuper::CALLBACKS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:87 +RuboCop::Cop::Lint::MissingSuper::CALLBACK_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:91 +RuboCop::Cop::Lint::MissingSuper::CLASS_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:86 +RuboCop::Cop::Lint::MissingSuper::CONSTRUCTOR_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:92 +RuboCop::Cop::Lint::MissingSuper::METHOD_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/missing_super.rb:89 +RuboCop::Cop::Lint::MissingSuper::STATELESS_CLASSES = T.let(T.unsafe(nil), Array) + +# Checks for mixed-case character ranges since they include likely unintended characters. +# +# Offenses are registered for regexp character classes like `/[A-z]/` +# as well as range objects like `('A'..'z')`. +# +# NOTE: `Range` objects cannot be autocorrected. +# +# @safety +# The cop autocorrects regexp character classes +# by replacing one character range with two: `A-z` becomes `A-Za-z`. +# In most cases this is probably what was originally intended +# but it changes the regexp to no longer match symbols it used to include. +# For this reason, this cop's autocorrect is unsafe (it will +# change the behavior of the code). +# +# @example +# +# # bad +# r = /[A-z]/ +# +# # good +# r = /[A-Za-z]/ +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:28 +class RuboCop::Cop::Lint::MixedCaseRange < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:55 + def each_unsafe_regexp_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:43 + def on_erange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:37 + def on_irange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:45 + def on_regexp(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:71 + def build_source_range(range_start, range_end); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:75 + def range_for(char); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:81 + def range_pairs(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:101 + def regexp_range(source); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:91 + def skip_expression?(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:95 + def skip_range?(range_start, range_end); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:85 + def unsafe_range?(range_start, range_end); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:32 +RuboCop::Cop::Lint::MixedCaseRange::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_case_range.rb:35 +RuboCop::Cop::Lint::MixedCaseRange::RANGES = T.let(T.unsafe(nil), Array) + +# Do not mix named captures and numbered captures in a `Regexp` literal +# because numbered capture is ignored if they're mixed. +# Replace numbered captures with non-capturing groupings or +# named captures. +# +# @example +# # bad +# /(?FOO)(BAR)/ +# +# # good +# /(?FOO)(?BAR)/ +# +# # good +# /(?FOO)(?:BAR)/ +# +# # good +# /(FOO)(BAR)/ +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_regexp_capture_types.rb:24 +class RuboCop::Cop::Lint::MixedRegexpCaptureTypes < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_regexp_capture_types.rb:27 + def on_regexp(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/mixed_regexp_capture_types.rb:25 +RuboCop::Cop::Lint::MixedRegexpCaptureTypes::MSG = T.let(T.unsafe(nil), String) + +# In math and Python, we can use `x < y < z` style comparison to compare +# multiple values. However, we can't use the comparison in Ruby. However, +# the comparison is not a syntax error. This cop checks the bad usage of +# comparison operators. +# +# @example +# +# # bad +# x < y < z +# 10 <= x <= 20 +# +# # good +# x < y && y < z +# 10 <= x && x <= 20 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:20 +class RuboCop::Cop::Lint::MultipleComparison < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:29 + def multiple_compare?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:33 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:24 +RuboCop::Cop::Lint::MultipleComparison::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:23 +RuboCop::Cop::Lint::MultipleComparison::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:26 +RuboCop::Cop::Lint::MultipleComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/multiple_comparison.rb:25 +RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe(nil), Array) + +# Checks for nested method definitions. +# +# @example +# +# # bad +# +# # `bar` definition actually produces methods in the same scope +# # as the outer `foo` method. Furthermore, the `bar` method +# # will be redefined every time `foo` is invoked. +# def foo +# def bar +# end +# end +# +# # good +# +# def foo +# bar = -> { puts 'hello' } +# bar.call +# end +# +# # good +# +# # `class_eval`, `instance_eval`, `module_eval`, `class_exec`, `instance_exec`, and +# # `module_exec` blocks are allowed by default. +# +# def foo +# self.class.class_eval do +# def bar +# end +# end +# end +# +# def foo +# self.class.module_exec do +# def bar +# end +# end +# end +# +# # good +# +# def foo +# class << self +# def bar +# end +# end +# end +# +# @example AllowedMethods: [] (default) +# # bad +# def do_something +# has_many :articles do +# def find_or_create_by_name(name) +# end +# end +# end +# +# @example AllowedMethods: ['has_many'] +# # bad +# def do_something +# has_many :articles do +# def find_or_create_by_name(name) +# end +# end +# end +# +# @example AllowedPatterns: [] (default) +# # bad +# def foo(obj) +# obj.do_baz do +# def bar +# end +# end +# end +# +# @example AllowedPatterns: ['baz'] +# # good +# def foo(obj) +# obj.do_baz do +# def bar +# end +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:91 +class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:131 + def eval_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:136 + def exec_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:97 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:111 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:124 + def allowed_method_name?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:120 + def allowed_subject_type?(subject); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:115 + def scoping_method_call?(child); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/nested_method_definition.rb:95 +RuboCop::Cop::Lint::NestedMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +# Checks for nested percent literals. +# +# @example +# +# # bad +# +# # The percent literal for nested_attributes is parsed as four tokens, +# # yielding the array [:name, :content, :"%i[incorrectly", :"nested]"]. +# attributes = { +# valid_attributes: %i[name content], +# nested_attributes: %i[name content %i[incorrectly nested]] +# } +# +# # good +# +# # Neither is incompatible with the bad case, but probably the intended code. +# attributes = { +# valid_attributes: %i[name content], +# nested_attributes: [:name, :content, %i[incorrectly nested]] +# } +# +# attributes = { +# valid_attributes: %i[name content], +# nested_attributes: [:name, :content, [:incorrectly, :nested]] +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:32 +class RuboCop::Cop::Lint::NestedPercentLiteral < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::PercentLiteral + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:44 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:48 + def on_percent_literal(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:54 + def contains_percent_literals?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:35 +RuboCop::Cop::Lint::NestedPercentLiteral::MSG = T.let(T.unsafe(nil), String) + +# The array of regular expressions representing percent literals that, +# if found within a percent literal expression, will cause a +# NestedPercentLiteral violation to be emitted. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:41 +RuboCop::Cop::Lint::NestedPercentLiteral::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/nested_percent_literal.rb:42 +RuboCop::Cop::Lint::NestedPercentLiteral::REGEXES = T.let(T.unsafe(nil), Array) + +# Don't omit the accumulator when calling `next` in a `reduce` block. +# +# @example +# +# # bad +# result = (1..4).reduce(0) do |acc, i| +# next if i.odd? +# acc + i +# end +# +# # good +# result = (1..4).reduce(0) do |acc, i| +# next acc if i.odd? +# acc + i +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:21 +class RuboCop::Cop::Lint::NextWithoutAccumulator < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:24 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:39 + def on_block_body_of_reduce(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:34 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:33 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:47 + def parent_block_node(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/next_without_accumulator.rb:22 +RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) + +# Checks for the presence of a `return` inside a `begin..end` block +# in assignment contexts. +# In this situation, the `return` will result in an exit from the current +# method, possibly leading to unexpected behavior. +# +# @example +# +# # bad +# @some_variable ||= begin +# return some_value if some_condition_is_met +# +# do_something +# end +# +# # good +# @some_variable ||= begin +# if some_condition_is_met +# some_value +# else +# do_something +# end +# end +# +# # good +# some_variable = if some_condition_is_met +# return if another_condition_is_met +# +# some_value +# else +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:38 +class RuboCop::Cop::Lint::NoReturnInBeginEndBlocks < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:53 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:51 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:52 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:50 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:41 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:55 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:54 + def on_or_asgn(node); end + + private + + # A `return` inside a nested method definition or lambda within the + # `begin..end` returns from that inner scope rather than the assignment + # context, so it is not an offense. A `return` inside a plain block (or + # `proc`) does propagate out, so it remains an offense. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:63 + def return_from_inner_scope?(return_node, kwbegin_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb:39 +RuboCop::Cop::Lint::NoReturnInBeginEndBlocks::MSG = T.let(T.unsafe(nil), String) + +# Checks for non-atomic file operation. +# And then replace it with a nearly equivalent and atomic method. +# +# These can cause problems that are difficult to reproduce, +# especially in cases of frequent file operations in parallel, +# such as test runs with parallel_rspec. +# +# For examples: creating a directory if there is none, has the following problems +# +# An exception occurs when the directory didn't exist at the time of `exist?`, +# but someone else created it before `mkdir` was executed. +# +# Subsequent processes are executed without the directory that should be there +# when the directory existed at the time of `exist?`, +# but someone else deleted it shortly afterwards. +# +# @safety +# This cop is unsafe, because autocorrection change to atomic processing. +# The atomic processing of the replacement destination is not guaranteed +# to be strictly equivalent to that before the replacement. +# +# @example +# # bad - race condition with another process may result in an error in `mkdir` +# unless Dir.exist?(path) +# FileUtils.mkdir(path) +# end +# +# # good - atomic and idempotent creation +# FileUtils.mkdir_p(path) +# +# # bad - race condition with another process may result in an error in `remove` +# if File.exist?(path) +# FileUtils.remove(path) +# end +# +# # good - atomic and idempotent removal +# FileUtils.rm_f(path) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:44 +class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:76 + def explicit_not_force?(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:71 + def force?(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:80 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:66 + def receiver_and_method_name(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:61 + def send_exist_node(param0); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:98 + def allowable_use_with_if?(if_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:123 + def autocorrect(corrector, node, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:134 + def autocorrect_replace_method(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:154 + def force_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:168 + def force_method_name?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:164 + def force_option?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:92 + def if_node_child?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:113 + def message_change_force_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:117 + def message_remove_file_exist_check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:102 + def register_offense(node, exist_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:142 + def replacement_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:158 + def require_mode_keyword?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:50 +RuboCop::Cop::Lint::NonAtomicFileOperation::MAKE_FORCE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:51 +RuboCop::Cop::Lint::NonAtomicFileOperation::MAKE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:49 +RuboCop::Cop::Lint::NonAtomicFileOperation::MSG_CHANGE_FORCE_METHOD = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:47 +RuboCop::Cop::Lint::NonAtomicFileOperation::MSG_REMOVE_FILE_EXIST_CHECK = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:54 +RuboCop::Cop::Lint::NonAtomicFileOperation::RECURSIVE_REMOVE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:52 +RuboCop::Cop::Lint::NonAtomicFileOperation::REMOVE_FORCE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:53 +RuboCop::Cop::Lint::NonAtomicFileOperation::REMOVE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_atomic_file_operation.rb:55 +RuboCop::Cop::Lint::NonAtomicFileOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# `Dir[...]` and `Dir.glob(...)` do not make any guarantees about +# the order in which files are returned. The final order is +# determined by the operating system and file system. +# This means that using them in cases where the order matters, +# such as requiring files, can lead to intermittent failures +# that are hard to debug. To ensure this doesn't happen, +# always sort the list. +# +# `Dir.glob` and `Dir[]` sort globbed results by default in Ruby 3.0. +# So all bad cases are acceptable when Ruby 3.0 or higher is used. +# +# NOTE: This cop will be deprecated and removed when supporting only Ruby 3.0 and higher. +# +# @safety +# This cop is unsafe in the case where sorting files changes existing +# expected behavior. +# +# @example +# +# # bad +# Dir["./lib/**/*.rb"].each do |file| +# require file +# end +# +# # good +# Dir["./lib/**/*.rb"].sort.each do |file| +# require file +# end +# +# # bad +# Dir.glob(Rails.root.join(__dir__, 'test', '*.rb')) do |file| +# require file +# end +# +# # good +# Dir.glob(Rails.root.join(__dir__, 'test', '*.rb')).sort.each do |file| +# require file +# end +# +# # bad +# Dir['./lib/**/*.rb'].each(&method(:require)) +# +# # good +# Dir['./lib/**/*.rb'].sort.each(&method(:require)) +# +# # bad +# Dir.glob(Rails.root.join('test', '*.rb'), &method(:require)) +# +# # good +# Dir.glob(Rails.root.join('test', '*.rb')).sort.each(&method(:require)) +# +# # good - Respect intent if `sort` keyword option is specified in Ruby 3.0 or higher. +# Dir.glob(Rails.root.join(__dir__, 'test', '*.rb'), sort: false).each(&method(:require)) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:60 +class RuboCop::Cop::Lint::NonDeterministicRequireOrder < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:174 + def loop_variable(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:157 + def method_require?(param0 = T.unsafe(nil)); end + + # NOTE: itblock is not handled because this cop is limited to Ruby <= 2.7 + # via `maximum_target_ruby_version`, so itblock nodes (Ruby 3.4+) are never encountered. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:70 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:92 + def on_block_pass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:81 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:147 + def unsorted_dir_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:152 + def unsorted_dir_each?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:168 + def unsorted_dir_each_pass?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:162 + def unsorted_dir_glob_pass?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:179 + def var_is_required?(param0, param1); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:109 + def correct_block(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:119 + def correct_block_pass(corrector, node); end + + # Returns range of last argument including comma and whitespace. + # + # @return [Parser::Source::Range] + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:134 + def last_arg_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:138 + def unsorted_dir_loop?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:142 + def unsorted_dir_pass?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_deterministic_require_order.rb:64 +RuboCop::Cop::Lint::NonDeterministicRequireOrder::MSG = T.let(T.unsafe(nil), String) + +# Checks for non-local exits from iterators without a return +# value. It registers an offense under these conditions: +# +# * No value is returned, +# * the block is preceded by a method chain, +# * the block has arguments, +# * the method which receives the block is not `define_method` +# or `define_singleton_method`, +# * the return is not contained in an inner scope, e.g. a lambda or a +# method definition. +# +# @example +# +# class ItemApi +# rescue_from ValidationError do |e| # non-iteration block with arg +# return { message: 'validation error' } unless e.errors # allowed +# error_array = e.errors.map do |error| # block with method chain +# return if error.suppress? # warned +# return "#{error.param}: invalid" unless error.message # allowed +# "#{error.param}: #{error.message}" +# end +# { message: 'validation error', errors: error_array } +# end +# +# def update_items +# transaction do # block without arguments +# return unless update_necessary? # allowed +# find_each do |item| # block without method chain +# return if item.stock == 0 # false-negative... +# item.update!(foobar: true) +# end +# end +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:41 +class RuboCop::Cop::Lint::NonLocalExitFromIterator < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:77 + def chained_send?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:80 + def define_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:46 + def on_return(return_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:72 + def return_value?(return_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:68 + def scoped_node?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/non_local_exit_from_iterator.rb:42 +RuboCop::Cop::Lint::NonLocalExitFromIterator::MSG = T.let(T.unsafe(nil), String) + +# Warns against the usage of unsafe number conversions. Unsafe +# number conversion can cause an unexpected error if auto type conversion +# fails. The cop prefers parsing with a number class instead. +# +# Conversion with `Integer`, `Float`, etc. will raise an `ArgumentError` +# if given input that is not numeric (eg. an empty string), whereas +# `to_i`, etc. will try to convert regardless of input (``''.to_i => 0``). +# As such, this cop is disabled by default because it's not necessarily +# always correct to raise if a value is not numeric. +# +# NOTE: Some values cannot be converted properly using one of the `Kernel` +# methods (for instance, `Time` and `DateTime` values are allowed by this +# cop by default). Similarly, Rails' duration methods do not work well +# with `Integer()` and can be allowed with `AllowedMethods`. By default, +# there are no allowed methods. +# +# @safety +# Autocorrection is unsafe because it is not guaranteed that the +# replacement `Kernel` methods are able to properly handle the +# input if it is not a standard class. +# +# @example +# +# # bad +# +# '10'.to_i +# '10.2'.to_f +# '10'.to_c +# '1/3'.to_r +# ['1', '2', '3'].map(&:to_i) +# foo.try(:to_f) +# bar.send(:to_c) +# +# # good +# +# Integer('10', 10) +# Float('10.2') +# Complex('10') +# Rational('1/3') +# ['1', '2', '3'].map { |i| Integer(i, 10) } +# foo.try { |i| Float(i) } +# bar.send { |i| Complex(i) } +# +# @example AllowedMethods: [] (default) +# +# # bad +# 10.minutes.to_i +# +# @example AllowedMethods: [minutes] +# +# # good +# 10.minutes.to_i +# +# @example AllowedPatterns: [] (default) +# +# # bad +# 10.minutes.to_i +# +# @example AllowedPatterns: ['min*'] +# +# # good +# 10.minutes.to_i +# +# @example AllowedClasses: [Time, DateTime] (default) +# +# # good +# Time.now.to_datetime.to_i +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:73 +class RuboCop::Cop::Lint::NumberConversion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:110 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:106 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:92 + def to_method(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:97 + def to_method_symbol(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:173 + def allow_receiver?(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:185 + def allowed_method_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:195 + def conversion_method?(method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:150 + def correct_method(node, receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:154 + def correct_sym_method(to_method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:159 + def current_method(node, receiver, to_method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:133 + def handle_as_symbol(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:114 + def handle_conversion_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:203 + def ignored_class?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:199 + def ignored_classes; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:164 + def remove_parentheses(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:169 + def safe_navigation?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:189 + def top_receiver(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:88 +RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:78 +RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHOD_CLASS_MAPPING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:89 +RuboCop::Cop::Lint::NumberConversion::METHODS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/number_conversion.rb:84 +RuboCop::Cop::Lint::NumberConversion::MSG = T.let(T.unsafe(nil), String) + +# Checks for uses of numbered parameter assignment. +# It emulates the following warning in Ruby 2.7: +# +# $ ruby -ve '_1 = :value' +# ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19] +# -e:1: warning: `_1' is reserved for numbered parameter; consider another name +# +# Assigning to a numbered parameter (from `_1` to `_9`) causes an error in Ruby 3.0. +# +# $ ruby -ve '_1 = :value' +# ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19] +# -e:1: _1 is reserved for numbered parameter +# +# NOTE: The numbered parameters are from `_1` to `_9`. This cop checks `_0`, and over `_10` +# as well to prevent confusion. +# +# @example +# +# # bad +# _1 = :value +# +# # good +# non_numbered_parameter_name = :value +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/numbered_parameter_assignment.rb:30 +class RuboCop::Cop::Lint::NumberedParameterAssignment < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/numbered_parameter_assignment.rb:35 + def on_lvasgn(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/numbered_parameter_assignment.rb:32 +RuboCop::Cop::Lint::NumberedParameterAssignment::LVAR_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/numbered_parameter_assignment.rb:33 +RuboCop::Cop::Lint::NumberedParameterAssignment::NUMBERED_PARAMETER_RANGE = T.let(T.unsafe(nil), Range) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/numbered_parameter_assignment.rb:31 +RuboCop::Cop::Lint::NumberedParameterAssignment::NUM_PARAM_MSG = T.let(T.unsafe(nil), String) + +# Certain numeric operations have a constant result, usually 0 or 1. +# Multiplying a number by 0 will always return 0. +# Dividing a number by itself or raising it to the power of 0 will always return 1. +# As such, they can be replaced with that result. +# These are probably leftover from debugging, or are mistakes. +# Other numeric operations that are similarly leftover from debugging or mistakes +# are handled by `Lint/UselessNumericOperation`. +# +# NOTE: This cop doesn't detect offenses for the `-` and `%` operator because it +# can't determine the type of `x`. If `x` is an `Array` or `String`, it doesn't perform +# a numeric operation. +# +# @safety +# This cop is unsafe because the autocorrection drops the operands, which +# discards any side effects of evaluating them and can change behavior when +# the result is not actually constant. For example, `x / x` raises +# `ZeroDivisionError` when `x` is `0`, and returns `Float::NAN` (not `1`) +# when `x` is `0.0`; replacing it with `1` silences that. +# +# @example +# +# # bad +# x * 0 +# +# # good +# 0 +# +# # bad +# x *= 0 +# +# # good +# x = 0 +# +# # bad +# x / x +# x ** 0 +# +# # good +# 1 +# +# # bad +# x /= x +# x **= 0 +# +# # good +# x = 1 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:53 +class RuboCop::Cop::Lint::NumericOperationWithConstantResult < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:64 + def abbreviated_assignment_with_constant_result?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:78 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:80 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:67 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:60 + def operation_with_constant_result?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:91 + def constant_result?(lhs, operation, rhs); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:56 +RuboCop::Cop::Lint::NumericOperationWithConstantResult::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb:57 +RuboCop::Cop::Lint::NumericOperationWithConstantResult::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for unintended or-assignment to a constant. +# +# Constants should always be assigned in the same location. And its value +# should always be the same. If constants are assigned in multiple +# locations, the result may vary depending on the order of `require`. +# +# @safety +# This cop is unsafe because code that is already conditionally +# assigning a constant may have its behavior changed by autocorrection. +# +# @example +# +# # bad +# CONST ||= 1 +# +# # good +# CONST = 1 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/or_assignment_to_constant.rb:24 +class RuboCop::Cop::Lint::OrAssignmentToConstant < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/or_assignment_to_constant.rb:29 + def on_or_asgn(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/or_assignment_to_constant.rb:27 +RuboCop::Cop::Lint::OrAssignmentToConstant::MSG = T.let(T.unsafe(nil), String) + +# Checks the proper ordering of magic comments and whether +# a magic comment is not placed before a shebang. +# +# @safety +# This cop's autocorrection is unsafe because file encoding may change. +# +# @example +# # bad +# +# p [''.frozen?, ''.encoding] #=> [true, #] +# +# # good +# +# p [''.frozen?, ''.encoding] #=> [true, #] +# +# # good +# +# #!/usr/bin/env ruby +# p [''.frozen?, ''.encoding] #=> [true, #] +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/ordered_magic_comments.rb:32 +class RuboCop::Cop::Lint::OrderedMagicComments < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FrozenStringLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ordered_magic_comments.rb:38 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ordered_magic_comments.rb:55 + def autocorrect(corrector, encoding_line, other_magic_comment_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/ordered_magic_comments.rb:63 + def magic_comment_lines; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/ordered_magic_comments.rb:36 +RuboCop::Cop::Lint::OrderedMagicComments::MSG = T.let(T.unsafe(nil), String) + +# Looks for references of `Regexp` captures that are out of range +# and thus always returns nil. +# +# @safety +# This cop is unsafe because it is naive in how it determines what +# references are available based on the last encountered regexp, but +# it cannot handle some cases, such as conditional regexp matches, which +# leads to false positives, such as: +# +# [source,ruby] +# ---- +# foo ? /(c)(b)/ =~ str : /(b)/ =~ str +# do_something if $2 +# # $2 is defined for the first condition but not the second, however +# # the cop will mark this as an offense. +# ---- +# +# This might be a good indication of code that should be refactored, +# however. +# +# @example +# +# /(foo)bar/ =~ 'foobar' +# +# # bad - always returns nil +# +# puts $2 # => nil +# +# # good +# +# puts $1 # => foo +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:38 +class RuboCop::Cop::Lint::OutOfRangeRegexpRef < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:64 + def after_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:55 + def after_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:72 + def on_in_pattern(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:51 + def on_match_with_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:47 + def on_new_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:78 + def on_nth_ref(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:66 + def on_when(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:103 + def check_regexp(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:123 + def nth_ref_receiver?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:114 + def regexp_first_argument?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:94 + def regexp_patterns(in_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:119 + def regexp_receiver?(send_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:39 +RuboCop::Cop::Lint::OutOfRangeRegexpRef::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:42 +RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_ARGUMENT_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:44 +RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_CAPTURE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:41 +RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_RECEIVER_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/out_of_range_regexp_ref.rb:45 +RuboCop::Cop::Lint::OutOfRangeRegexpRef::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Checks for space between the name of a called method and a left +# parenthesis. +# +# @example +# +# # bad +# do_something (foo) +# +# # good +# do_something(foo) +# do_something (2 + 3) * 4 +# do_something (foo * bar).baz +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:18 +class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:35 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:24 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:56 + def chained_calls?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:52 + def compound_range?(first_arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:71 + def space_range(expr, space_length); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:65 + def spaces_before_left_parenthesis(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:61 + def ternary_expression?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:39 + def valid_context?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:47 + def valid_first_argument?(first_arg); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb:22 +RuboCop::Cop::Lint::ParenthesesAsGroupedExpression::MSG = T.let(T.unsafe(nil), String) + +# Checks for quotes and commas in %w, e.g. `%w('foo', "bar")` +# +# It is more likely that the additional characters are unintended (for +# example, mistranslating an array of literals to percent string notation) +# rather than meant to be part of the resulting strings. +# +# @safety +# The cop is unsafe because the correction changes the values in the array +# and that might have been done purposely. +# +# [source,ruby] +# ---- +# %w('foo', "bar") #=> ["'foo',", '"bar"'] +# %w(foo bar) #=> ['foo', 'bar'] +# ---- +# +# @example +# +# # bad +# %w('foo', "bar") +# +# # good +# %w(foo bar) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:29 +class RuboCop::Cop::Lint::PercentStringArray < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::PercentLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:40 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:44 + def on_percent_literal(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:61 + def contains_quotes_or_commas?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:34 +RuboCop::Cop::Lint::PercentStringArray::LEADING_QUOTE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:37 +RuboCop::Cop::Lint::PercentStringArray::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:33 +RuboCop::Cop::Lint::PercentStringArray::QUOTES_AND_COMMAS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_string_array.rb:35 +RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Regexp) + +# Checks for colons and commas in %i, e.g. `%i(:foo, :bar)` +# +# It is more likely that the additional characters are unintended (for +# example, mistranslating an array of literals to percent string notation) +# rather than meant to be part of the resulting symbols. +# +# @example +# +# # bad +# %i(:foo, :bar) +# +# # good +# %i(foo bar) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:19 +class RuboCop::Cop::Lint::PercentSymbolArray < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::PercentLiteral + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:26 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:30 + def on_percent_literal(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:38 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:48 + def contains_colons_or_commas?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:58 + def non_alphanumeric_literal?(literal); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/percent_symbol_array.rb:23 +RuboCop::Cop::Lint::PercentSymbolArray::MSG = T.let(T.unsafe(nil), String) + +# Checks for `raise` or `fail` statements which raise `Exception` or +# `Exception.new`. Use `StandardError` or a specific exception class instead. +# +# If you have defined your own namespaced `Exception` class, it is possible +# to configure the cop to allow it by setting `AllowedImplicitNamespaces` to +# an array with the names of the namespaces to allow. By default, this is set to +# `['Gem']`, which allows `Gem::Exception` to be raised without an explicit namespace. +# If not allowed, a false positive may be registered if `raise Exception` is called +# within the namespace. +# +# Alternatively, use a fully qualified name with `raise`/`fail` +# (eg. `raise Namespace::Exception`). +# +# @safety +# This cop is unsafe because it will change the exception class being +# raised, which is a change in behavior. +# +# @example +# # bad +# raise Exception, 'Error message here' +# raise Exception.new('Error message here') +# +# # good +# raise StandardError, 'Error message here' +# raise MyError.new, 'Error message here' +# +# @example AllowedImplicitNamespaces: ['Gem'] (default) +# # bad - `Foo` is not an allowed implicit namespace +# module Foo +# def self.foo +# raise Exception # This is qualified to `Foo::Exception`. +# end +# end +# +# # good +# module Gem +# def self.foo +# raise Exception # This is qualified to `Gem::Exception`. +# end +# end +# +# # good +# module Foo +# def self.foo +# raise Foo::Exception +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:53 +class RuboCop::Cop::Lint::RaiseException < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:60 + def exception?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:65 + def exception_new_with_message?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:70 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:104 + def allow_implicit_namespaces; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:76 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:92 + def implicit_namespace?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:56 +RuboCop::Cop::Lint::RaiseException::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/raise_exception.rb:57 +RuboCop::Cop::Lint::RaiseException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for `rand(1)` calls. +# Such calls always return `0`, and so do `rand(-1)`, `rand(1.0)`, and `rand(-1.0)`. +# +# @example +# +# # bad +# rand 1 +# Kernel.rand(-1) +# rand 1.0 +# rand(-1.0) +# +# # good +# 0 # just use 0 instead +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/rand_one.rb:19 +class RuboCop::Cop::Lint::RandOne < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/rand_one.rb:28 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rand_one.rb:24 + def rand_one?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rand_one.rb:36 + def message(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/rand_one.rb:20 +RuboCop::Cop::Lint::RandOne::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/rand_one.rb:21 +RuboCop::Cop::Lint::RandOne::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# removed without causing any offenses to be reported. It's implemented +# as a cop in that it inherits from the Cop base class and calls +# add_offense. The unusual part of its implementation is that it doesn't +# have any on_* methods or an investigate method. This means that it +# doesn't take part in the investigation phase when the other cops do +# their work. Instead, it waits until it's called in a later stage of the +# execution. The reason it can't be implemented as a normal cop is that +# it depends on the results of all other cops to do its work. +# +# +# @example +# # bad +# x += 1 +# +# # good +# x += 1 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:28 +class RuboCop::Cop::Lint::RedundantCopDisableDirective < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:37 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil), offenses = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:35 + def offenses_to_check; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:35 + def offenses_to_check=(_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:42 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:340 + def add_department_marker(department); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:243 + def add_offense_for_entire_comment(comment, cops); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:258 + def add_offense_for_some_cops(comment, cops); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:233 + def add_offenses(redundant_cops); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:323 + def all_cop_names; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:204 + def all_disabled?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:69 + def comment_range_with_surrounding_space(directive_comment_range, line_comment_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:57 + def cop_disabled_line_ranges; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:278 + def cop_range(comment, cop); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:224 + def department_disabled?(cop, comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:332 + def department_marker?(department); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:310 + def describe(cop); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:229 + def directive_count(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:92 + def directive_range_in_list(range, ranges); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:61 + def disabled_ranges; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:146 + def each_already_disabled(cop, line_ranges); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:113 + def each_line_range(cop, line_ranges); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:106 + def each_redundant_disable(&block); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:327 + def ends_its_line?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:216 + def expected_final_disable?(cop, line_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:180 + def find_redundant_all(range, next_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:175 + def find_redundant_cop(cop, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:190 + def find_redundant_department(cop, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:135 + def find_redundant_directive(cop, comment, line_range, next_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:196 + def followed_ranges?(range, next_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:208 + def ignore_offense?(line_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:272 + def leave_free_comment?(comment, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:285 + def matching_range(haystack, needle); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:319 + def message(cop_names); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:65 + def previous_line_blank?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:200 + def range_with_offense?(range, offenses = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:336 + def remove_department_marker(department); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:126 + def should_skip_line_range?(cop, line_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:130 + def skip_directive?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:296 + def trailing_range?(ranges, range); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:32 +RuboCop::Cop::Lint::RedundantCopDisableDirective::COP_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:33 +RuboCop::Cop::Lint::RedundantCopDisableDirective::DEPARTMENT_MARKER = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:304 +RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.let(T.unsafe(nil), Hash) + +# removed. +# +# the cop checks whether any cop was actually enabled. +# +# @example +# +# # bad +# foo = 1 +# +# # good +# foo = 1 +# +# # bad +# foo = "1" +# baz +# +# # good +# foo = "1" +# baz +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:33 +class RuboCop::Cop::Lint::RedundantCopEnableDirective < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::SurroundingSpace + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:40 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:119 + def all_or_name(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:72 + def comment_start(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:76 + def cop_name_indention(comment, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:123 + def department?(directive, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:67 + def range_of_offense(comment, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:94 + def range_to_remove(begin_pos, end_pos, comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:83 + def range_with_comma(comment, name); end + + # If the list of cops is comma-separated, but without an empty space after the comma, + # we should **not** remove the prepending empty space, thus begin_pos += 1 + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:113 + def range_with_comma_after(comment, start, begin_pos, end_pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:107 + def range_with_comma_before(start, begin_pos, end_pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:49 + def register_offense(comment, cop_names); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_cop_enable_directive.rb:38 +RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String) + +# Sort globbed results by default in Ruby 3.0. +# This cop checks for redundant `sort` method to `Dir.glob` and `Dir[]`. +# +# @safety +# This cop is unsafe, in case of having a file and a directory with +# identical names, since directory will be loaded before the file, which +# will break `exe/files.rb` that rely on `exe.rb` file. +# +# @example +# +# # bad +# Dir.glob('./lib/**/*.rb').sort.each do |file| +# end +# +# Dir['./lib/**/*.rb'].sort.each do |file| +# end +# +# # good +# Dir.glob('./lib/**/*.rb').each do |file| +# end +# +# Dir['./lib/**/*.rb'].each do |file| +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:30 +class RuboCop::Cop::Lint::RedundantDirGlobSort < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:40 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:56 + def dir_glob?(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:63 + def multiple_argument?(glob_method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:67 + def sort_with_comparator?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:38 +RuboCop::Cop::Lint::RedundantDirGlobSort::GLOB_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:36 +RuboCop::Cop::Lint::RedundantDirGlobSort::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_dir_glob_sort.rb:37 +RuboCop::Cop::Lint::RedundantDirGlobSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for redundant quantifiers inside `Regexp` literals. +# +# It is always allowed when interpolation is used in a regexp literal, +# because it's unknown what kind of string will be expanded as a result: +# +# [source,ruby] +# ---- +# /(?:a*#{interpolation})?/x +# ---- +# +# @example +# # bad +# /(?:x+)+/ +# +# # good +# /(?:x)+/ +# +# # good +# /(?:x+)/ +# +# # bad +# /(?:x+)?/ +# +# # good +# /(?:x)*/ +# +# # good +# /(?:x*)/ +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:34 +class RuboCop::Cop::Lint::RedundantRegexpQuantifiers < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:42 + def on_regexp(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:83 + def character_set?(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:61 + def each_redundantly_quantified_pair(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:87 + def mergeable_quantifier(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:103 + def merged_quantifier(exp1, exp2); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:119 + def message(group, child, replacement); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:115 + def quantifier_range(group, child); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:75 + def redundant_group?(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:79 + def redundantly_quantifiable?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb:38 +RuboCop::Cop::Lint::RedundantRegexpQuantifiers::MSG_REDUNDANT_QUANTIFIER = T.let(T.unsafe(nil), String) + +# Checks for unnecessary `require` statement. +# +# The following features are unnecessary `require` statement because +# they are already loaded. e.g. Ruby 2.2: +# +# ruby -ve 'p $LOADED_FEATURES.reject { |feature| %r|/| =~ feature }' +# ruby 2.2.8p477 (2017-09-14 revision 59906) [x86_64-darwin13] +# ["enumerator.so", "rational.so", "complex.so", "thread.rb"] +# +# Below are the features that each `TargetRubyVersion` targets. +# +# * 2.0+ ... `enumerator` +# * 2.1+ ... `thread` +# * 2.2+ ... Add `rational` and `complex` above +# * 2.7+ ... Add `ruby2_keywords` above +# * 3.1+ ... Add `fiber` above +# * 3.2+ ... Add `set` above +# * 4.0+ ... Add `pathname` above +# +# This cop target those features. +# +# @example +# # bad +# require 'unloaded_feature' +# require 'thread' +# +# # good +# require 'unloaded_feature' +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:34 +class RuboCop::Cop::Lint::RedundantRequireStatement < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:48 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:43 + def redundant_require_statement?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:67 + def redundant_feature?(feature_name); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:38 +RuboCop::Cop::Lint::RedundantRequireStatement::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:39 +RuboCop::Cop::Lint::RedundantRequireStatement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_require_statement.rb:40 +RuboCop::Cop::Lint::RedundantRequireStatement::RUBY_22_LOADED_FEATURES = T.let(T.unsafe(nil), Array) + +# Checks for redundant safe navigation calls. +# Use cases where a constant, named in camel case for classes and modules is `nil` are rare, +# and an offense is not detected when the receiver is a constant. The detection also applies +# to `self`, and to literal receivers, except for `nil`. +# +# For all receivers, the `instance_of?`, `kind_of?`, `is_a?`, `eql?`, `respond_to?`, +# and `equal?` methods are checked by default. +# These are customizable with `AllowedMethods` option. +# +# The `AllowedMethods` option specifies nil-safe methods, +# in other words, it is a method that is allowed to skip safe navigation. +# Note that the `AllowedMethod` option is not an option that specifies methods +# for which to suppress (allow) this cop's check. +# +# In the example below, the safe navigation operator (`&.`) is unnecessary +# because `NilClass` has methods like `respond_to?` and `is_a?`. +# +# The `InferNonNilReceiver` option specifies whether to look into previous code +# paths to infer if the receiver can't be nil. This check is unsafe because the receiver +# can be redefined between the safe navigation call and previous regular method call. +# It does the inference only in the current scope, e.g. within the same method definition etc. +# +# The `AdditionalNilMethods` option specifies additional custom methods which are +# defined on `NilClass`. When `InferNonNilReceiver` is set, they are used to determine +# whether the receiver can be nil. +# +# @safety +# This cop is unsafe, because autocorrection can change the return type of +# the expression. An offending expression that previously could return `nil` +# will be autocorrected to never return `nil`. +# +# @example +# # bad +# CamelCaseConst&.do_something +# +# # good +# CamelCaseConst.do_something +# +# # bad +# foo.to_s&.strip +# foo.to_i&.zero? +# foo.to_f&.zero? +# foo.to_a&.size +# foo.to_h&.size +# +# # good +# foo.to_s.strip +# foo.to_i.zero? +# foo.to_f.zero? +# foo.to_a.size +# foo.to_h.size +# +# # bad +# do_something if attrs&.respond_to?(:[]) +# +# # good +# do_something if attrs.respond_to?(:[]) +# +# # bad +# foo&.bar ? foo&.bar.baz : qux +# +# # good +# foo&.bar ? foo.bar.baz : qux +# +# # bad +# if foo&.bar +# foo&.bar.baz +# end +# +# # good +# if foo&.bar +# foo.bar.baz +# end +# +# # bad +# while node&.is_a?(BeginNode) +# node = node.parent +# end +# +# # good +# while node.is_a?(BeginNode) +# node = node.parent +# end +# +# # good - without `&.` this changes the return value for `nil` +# foo&.respond_to?(:to_a) +# foo&.respond_to?(:class) +# +# # bad - for `nil`s conversion methods return default values for the type +# foo&.to_h || {} +# foo&.to_h { |k, v| [k, v] } || {} +# foo&.to_a || [] +# foo&.to_i || 0 +# foo&.to_f || 0.0 +# foo&.to_s || '' +# +# # good +# foo.to_h +# foo.to_h { |k, v| [k, v] } +# foo.to_a +# foo.to_i +# foo.to_f +# foo.to_s +# +# # bad +# self&.foo +# +# # good +# self.foo +# +# @example AllowedMethods: [nil_safe_method] +# # bad +# do_something if attrs&.nil_safe_method(:[]) +# +# # good +# do_something if attrs.nil_safe_method(:[]) +# do_something if attrs&.not_nil_safe_method(:[]) +# +# @example InferNonNilReceiver: false (default) +# # good +# foo.bar +# foo&.baz +# +# @example InferNonNilReceiver: true +# # bad +# foo.bar +# foo&.baz # would raise on previous line if `foo` is nil +# +# # good +# foo.bar +# foo.baz +# +# # bad +# if foo.condition? +# foo&.bar +# end +# +# # good +# if foo.condition? +# foo.bar +# end +# +# # good (different scopes) +# def method1 +# foo.bar +# end +# +# def method2 +# foo&.bar +# end +# +# @example AdditionalNilMethods: [present?] +# # good +# foo.present? +# foo&.bar +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:162 +class RuboCop::Cop::Lint::RedundantSafeNavigation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:183 + def conversion_with_default?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:194 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:212 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:178 + def respond_to_nil_method?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:276 + def additional_nil_methods; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:240 + def assume_receiver_instance_exists?(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:257 + def check?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:268 + def condition?(parent, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:246 + def guaranteed_instance?(node); end + + # Returns true when the `&.` is meaningful because the receiver may actually be nil. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:229 + def guarded_by_nil_receiver?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:272 + def infer_non_nil_receiver?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:175 +RuboCop::Cop::Lint::RedundantSafeNavigation::GUARANTEED_INSTANCE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:166 +RuboCop::Cop::Lint::RedundantSafeNavigation::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:167 +RuboCop::Cop::Lint::RedundantSafeNavigation::MSG_LITERAL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:168 +RuboCop::Cop::Lint::RedundantSafeNavigation::MSG_NON_NIL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:171 +RuboCop::Cop::Lint::RedundantSafeNavigation::NIL_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_safe_navigation.rb:173 +RuboCop::Cop::Lint::RedundantSafeNavigation::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) + +# Checks for unneeded usages of splat expansion. +# +# @example +# +# # bad +# a = *[1, 2, 3] +# a = *'a' +# a = *1 +# ['a', 'b', *%w(c d e), 'f', 'g'] +# +# # good +# c = [1, 2, 3] +# a = *c +# a, b = *c +# a, *b = *c +# a = *1..10 +# a = ['a'] +# ['a', 'b', 'c', 'd', 'e', 'f', 'g'] +# +# # bad +# do_something(*['foo', 'bar', 'baz']) +# +# # good +# do_something('foo', 'bar', 'baz') +# +# # bad +# begin +# foo +# rescue *[StandardError, ApplicationError] +# bar +# end +# +# # good +# begin +# foo +# rescue StandardError, ApplicationError +# bar +# end +# +# # bad +# case foo +# when *[1, 2, 3] +# bar +# else +# baz +# end +# +# # good +# case foo +# when 1, 2, 3 +# bar +# else +# baz +# end +# +# @example AllowPercentLiteralArrayArgument: true (default) +# +# # good +# do_something(*%w[foo bar baz]) +# +# @example AllowPercentLiteralArrayArgument: false +# +# # bad +# do_something(*%w[foo bar baz]) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:71 +class RuboCop::Cop::Lint::RedundantSplatExpansion < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:83 + def array_new?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:91 + def literal_expansion(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:95 + def on_splat(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:214 + def allow_percent_literal_array_argument?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:135 + def array_new_inside_array_literal?(array_new_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:162 + def array_splat?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:112 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:166 + def method_argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:170 + def part_of_an_array?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:177 + def redundant_brackets?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:118 + def redundant_splat_expansion(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:189 + def remove_brackets(array); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:143 + def replacement_range_and_content(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:207 + def use_percent_literal_array_argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:185 + def wrap_in_brackets?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:75 +RuboCop::Cop::Lint::RedundantSplatExpansion::ARRAY_PARAM_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:80 +RuboCop::Cop::Lint::RedundantSplatExpansion::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:74 +RuboCop::Cop::Lint::RedundantSplatExpansion::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:79 +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_I = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:77 +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_W = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:78 +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_I = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_splat_expansion.rb:76 +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_W = T.let(T.unsafe(nil), String) + +# Checks for string conversion in string interpolation, `print`, `puts`, and `warn` arguments, +# which is redundant. +# +# @example +# +# # bad +# "result is #{something.to_s}" +# print something.to_s +# puts something.to_s +# warn something.to_s +# +# # good +# "result is #{something}" +# print something +# puts something +# warn something +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:23 +class RuboCop::Cop::Lint::RedundantStringCoercion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Interpolation + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:34 + def on_interpolation(begin_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:42 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:32 + def to_s_without_args?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:54 + def register_offense(node, context); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:27 +RuboCop::Cop::Lint::RedundantStringCoercion::MSG_DEFAULT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:28 +RuboCop::Cop::Lint::RedundantStringCoercion::MSG_SELF = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_string_coercion.rb:29 +RuboCop::Cop::Lint::RedundantStringCoercion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for redundant uses of `to_s`, `to_sym`, `to_i`, `to_f`, `to_d`, `to_r`, `to_c`, +# `to_a`, `to_h`, and `to_set`. +# +# When one of these methods is called on an object of the same type, that object +# is returned, making the call unnecessary. The cop detects conversion methods called +# on object literals, class constructors, class `[]` methods, and the `Kernel` methods +# `String()`, `Integer()`, `Float()`, BigDecimal(), `Rational()`, `Complex()`, and `Array()`. +# +# Specifically, these cases are detected for each conversion method: +# +# * `to_s` when called on a string literal, interpolated string, heredoc, +# or with `String.new` or `String()`. +# * `to_sym` when called on a symbol literal or interpolated symbol. +# * `to_i` when called on an integer literal or with `Integer()`. +# * `to_f` when called on a float literal or with `Float()`. +# * `to_d` when called with `BigDecimal()`. +# * `to_r` when called on a rational literal or with `Rational()`. +# * `to_c` when called on a complex literal or with `Complex()`. +# * `to_a` when called on an array literal, or with `Array.new`, `Array()` or `Array[]`. +# * `to_h` when called on a hash literal, or with `Hash.new`, `Hash()` or `Hash[]`. +# * `to_set` when called on `Set.new` or `Set[]`. +# +# In all cases, chaining one of the same `to_*` conversion methods listed above is redundant. +# +# The cop can also register an offense for chaining conversion methods on methods that are +# expected to return a specific type regardless of receiver (eg. `foo.inspect.to_s` and +# `foo.to_json.to_s`). +# +# @example +# # bad +# "text".to_s +# :sym.to_sym +# 42.to_i +# 8.5.to_f +# 12r.to_r +# 1i.to_c +# [].to_a +# {}.to_h +# Set.new.to_set +# +# # good +# "text" +# :sym +# 42 +# 8.5 +# 12r +# 1i +# [] +# {} +# Set.new +# +# # bad +# Integer(var).to_i +# +# # good +# Integer(var) +# +# # good - chaining to a type constructor with exceptions suppressed +# # in this case, `Integer()` could return `nil` +# Integer(var, exception: false).to_i +# +# # bad +# BigDecimal(var).to_d +# +# # good +# BigDecimal(var) +# +# # bad - chaining the same conversion +# foo.to_s.to_s +# +# # good +# foo.to_s +# +# # bad - chaining a conversion to a method that is expected to return the same type +# foo.inspect.to_s +# foo.to_json.to_s +# +# # good +# foo.inspect +# foo.to_json +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:87 +class RuboCop::Cop::Lint::RedundantTypeConversion < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:167 + def array_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:152 + def bigdecimal_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:162 + def complex_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:191 + def exception_false_keyword_argument?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:147 + def float_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:175 + def hash_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:142 + def integer_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:212 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:196 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:157 + def rational_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:184 + def set_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:134 + def string_constructor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:129 + def type_constructor?(param0 = T.unsafe(nil), param1); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:254 + def chained_conversion?(node, receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:260 + def chained_to_typed_method?(node, receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:241 + def constructor?(node, receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:248 + def constructor_suppresses_exceptions?(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:222 + def find_receiver(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:216 + def hash_or_set_with_block?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:235 + def literal_receiver?(node, receiver); end +end + +# Maps each conversion method to the pattern matcher for that type's constructors +# Not every type has a constructor, for instance Symbol. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:107 +RuboCop::Cop::Lint::RedundantTypeConversion::CONSTRUCTOR_MAPPING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:123 +RuboCop::Cop::Lint::RedundantTypeConversion::CONVERSION_METHODS = T.let(T.unsafe(nil), Set) + +# Maps conversion methods to the node types for the literals of that type +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:93 +RuboCop::Cop::Lint::RedundantTypeConversion::LITERAL_NODE_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:90 +RuboCop::Cop::Lint::RedundantTypeConversion::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:124 +RuboCop::Cop::Lint::RedundantTypeConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +# Methods that already are expected to return a given type, which makes a further +# conversion redundant. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_type_conversion.rb:121 +RuboCop::Cop::Lint::RedundantTypeConversion::TYPED_METHODS = T.let(T.unsafe(nil), Hash) + +# Checks for redundant `with_index`. +# +# @example +# # bad +# ary.each_with_index do |v| +# v +# end +# +# # good +# ary.each do |v| +# v +# end +# +# # bad +# ary.each.with_index do |v| +# v +# end +# +# # good +# ary.each do |v| +# v +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:29 +class RuboCop::Cop::Lint::RedundantWithIndex < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:37 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:56 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:55 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:61 + def redundant_with_index?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:73 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:81 + def with_index_range(send); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:33 +RuboCop::Cop::Lint::RedundantWithIndex::MSG_EACH_WITH_INDEX = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_index.rb:34 +RuboCop::Cop::Lint::RedundantWithIndex::MSG_WITH_INDEX = T.let(T.unsafe(nil), String) + +# Checks for redundant `with_object`. +# +# @safety +# This cop's autocorrection is unsafe because the return value changes: +# `each_with_object` returns the memo object, while the corrected `each` returns +# the receiver. This matters when the result of the expression is used. +# +# @example +# # bad +# ary.each_with_object([]) do |v| +# v +# end +# +# # good +# ary.each do |v| +# v +# end +# +# # bad +# ary.each.with_object([]) do |v| +# v +# end +# +# # good +# ary.each do |v| +# v +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:34 +class RuboCop::Cop::Lint::RedundantWithObject < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:41 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:57 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:56 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:62 + def redundant_with_object?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:73 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:81 + def with_object_range(send); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:38 +RuboCop::Cop::Lint::RedundantWithObject::MSG_EACH_WITH_OBJECT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/redundant_with_object.rb:39 +RuboCop::Cop::Lint::RedundantWithObject::MSG_WITH_OBJECT = T.let(T.unsafe(nil), String) + +# Checks if `include` or `prepend` is called in `refine` block. +# These methods are deprecated and should be replaced with `Refinement#import_methods`. +# +# It emulates deprecation warnings in Ruby 3.1. Functionality has been removed in Ruby 3.2. +# +# @safety +# This cop's autocorrection is unsafe because `include M` will affect the included class +# if any changes are made to module `M`. +# On the other hand, `import_methods M` uses a snapshot of method definitions, +# thus it will not be affected if module `M` changes. +# +# @example +# +# # bad +# refine Foo do +# include Bar +# end +# +# # bad +# refine Foo do +# prepend Bar +# end +# +# # good +# refine Foo do +# import_methods Bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/refinement_import_methods.rb:34 +class RuboCop::Cop::Lint::RefinementImportMethods < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/refinement_import_methods.rb:45 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/refinement_import_methods.rb:38 +RuboCop::Cop::Lint::RefinementImportMethods::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/refinement_import_methods.rb:39 +RuboCop::Cop::Lint::RefinementImportMethods::MSG_REMOVED = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/refinement_import_methods.rb:41 +RuboCop::Cop::Lint::RefinementImportMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for regexp literals used as `match-current-line`. +# If a regexp literal is in condition, the regexp matches `$_` implicitly. +# +# @example +# # bad +# if /foo/ +# do_something +# end +# +# # good +# if /foo/ =~ $_ +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/regexp_as_condition.rb:19 +class RuboCop::Cop::Lint::RegexpAsCondition < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/regexp_as_condition.rb:25 + def on_match_current_line(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/regexp_as_condition.rb:22 +RuboCop::Cop::Lint::RegexpAsCondition::MSG = T.let(T.unsafe(nil), String) + +# Checks for method calls with at least one argument where no parentheses +# are used around the parameter list, and the call could be misread as an +# operand of a boolean operator (`&&` or `||`). Two forms are flagged: +# +# * a predicate method whose last argument is a `&&`/`||` expression, and +# * any method whose first argument is a ternary expression with a +# `&&`/`||` condition. +# +# The idea behind warning for these constructs is that the user might +# be under the impression that the return value from the method call is +# an operand of &&/||. +# +# @example +# +# # bad +# if day.is? :tuesday && month == :jan +# # ... +# end +# +# # good +# if day.is?(:tuesday) && month == :jan +# # ... +# end +# +# # bad +# foo a && b ? c : d +# +# # good +# foo(a && b ? c : d) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_parentheses.rb:35 +class RuboCop::Cop::Lint::RequireParentheses < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_parentheses.rb:49 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_parentheses.rb:40 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_parentheses.rb:63 + def check_predicate(predicate, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_parentheses.rb:53 + def check_ternary(ternary, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_parentheses.rb:38 +RuboCop::Cop::Lint::RequireParentheses::MSG = T.let(T.unsafe(nil), String) + +# Checks that a range literal is enclosed in parentheses when the end of the range is +# at a line break. +# +# NOTE: The following is maybe intended for `(42..)`. But, compatible is `42..do_something`. +# So, this cop does not provide autocorrection because it is left to user. +# +# [source,ruby] +# ---- +# case condition +# when 42.. +# do_something +# end +# ---- +# +# @example +# +# # bad - Represents `(1..42)`, not endless range. +# 1.. +# 42 +# +# # good - It's incompatible, but your intentions when using endless range may be: +# (1..) +# 42 +# +# # good +# 1..42 +# +# # good +# (1..42) +# +# # good +# (1.. +# 42) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_range_parentheses.rb:40 +class RuboCop::Cop::Lint::RequireRangeParentheses < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_range_parentheses.rb:54 + def on_erange(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_range_parentheses.rb:44 + def on_irange(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_range_parentheses.rb:41 +RuboCop::Cop::Lint::RequireRangeParentheses::MSG = T.let(T.unsafe(nil), String) + +# Checks for a file requiring itself with `require_relative`. +# +# @example +# +# # bad +# +# # foo.rb +# require_relative 'foo' +# require_relative 'bar' +# +# # good +# +# # foo.rb +# require_relative 'bar' +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_relative_self_path.rb:21 +class RuboCop::Cop::Lint::RequireRelativeSelfPath < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_relative_self_path.rb:28 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/require_relative_self_path.rb:40 + def same_file?(file_path, required_feature); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_relative_self_path.rb:25 +RuboCop::Cop::Lint::RequireRelativeSelfPath::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/require_relative_self_path.rb:26 +RuboCop::Cop::Lint::RequireRelativeSelfPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for `rescue` blocks targeting the `Exception` class. +# +# @example +# +# # bad +# begin +# do_something +# rescue Exception +# handle_exception +# end +# +# # good +# begin +# do_something +# rescue ArgumentError +# handle_exception +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_exception.rb:23 +class RuboCop::Cop::Lint::RescueException < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_exception.rb:26 + def on_resbody(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_exception.rb:32 + def targets_exception?(rescue_arg_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_exception.rb:24 +RuboCop::Cop::Lint::RescueException::MSG = T.let(T.unsafe(nil), String) + +# Checks for arguments to `rescue` that will result in a `TypeError` +# if an exception is raised. +# +# @example +# # bad +# begin +# bar +# rescue nil +# baz +# end +# +# # bad +# def foo +# bar +# rescue 1, 'a', "#{b}", 0.0, [], {} +# baz +# end +# +# # good +# begin +# bar +# rescue +# baz +# end +# +# # good +# def foo +# bar +# rescue NameError +# baz +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:37 +class RuboCop::Cop::Lint::RescueType < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:56 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:44 + def on_resbody(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:65 + def correction(*exceptions); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:76 + def invalid_exceptions(exceptions); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:72 + def valid_exceptions(exceptions); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:42 +RuboCop::Cop::Lint::RescueType::INVALID_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/rescue_type.rb:40 +RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String) + +# Checks for the use of a return with a value in a context +# where the value will be ignored. (initialize and setter methods) +# +# @example +# +# # bad +# def initialize +# foo +# return :qux if bar? +# baz +# end +# +# def foo=(bar) +# return 42 +# end +# +# # good +# def initialize +# foo +# return if bar? +# baz +# end +# +# def foo=(bar) +# return +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/return_in_void_context.rb:32 +class RuboCop::Cop::Lint::ReturnInVoidContext < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/return_in_void_context.rb:38 + def on_return(return_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/return_in_void_context.rb:33 +RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) + +# Returning out of these methods only exits the block itself. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/return_in_void_context.rb:36 +RuboCop::Cop::Lint::ReturnInVoidContext::SCOPE_CHANGING_METHODS = T.let(T.unsafe(nil), Array) + +# The safe navigation operator returns nil if the receiver is +# nil. If you chain an ordinary method call after a safe +# navigation operator, it raises NoMethodError. We should use a +# safe navigation operator after a safe navigation operator. +# This cop checks for the problem outlined above. +# +# @example +# +# # bad +# x&.foo.bar +# x&.foo + bar +# x&.foo[bar] +# +# # good +# x&.foo&.bar +# x&.foo || bar +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:22 +class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::NilMethods + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:33 + def bad_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:42 + def on_send(node); end + + private + + # @param [Parser::Source::Range] offense_range + # @param [RuboCop::AST::SendNode] send_node + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:85 + def add_safe_navigation_operator(offense_range:, send_node:); end + + # @param [RuboCop::Cop::Corrector] corrector + # @param [Parser::Source::Range] offense_range + # @param [RuboCop::AST::SendNode] send_node + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:104 + def autocorrect(corrector, offense_range:, send_node:); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:113 + def brackets?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:126 + def operator_inside_collection_literal?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:117 + def require_parentheses?(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:63 + def require_safe_navigation?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:76 + def ternary_else_branch?(node, safe_nav); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:70 + def ternary_safe_navigation?(node, safe_nav); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:29 +RuboCop::Cop::Lint::SafeNavigationChain::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_chain.rb:30 +RuboCop::Cop::Lint::SafeNavigationChain::PLUS_MINUS_METHODS = T.let(T.unsafe(nil), Array) + +# Checks that if safe navigation is used in an `&&` or `||` condition, +# consistent and appropriate safe navigation, without excess or deficiency, +# is used for all method calls on the same object. +# +# @safety +# Autocorrection is unsafe because if the receiver is not a local variable +# but a method call, it may not be idempotent. For example, replacing +# `foo&.bar` with `foo.bar` could raise `NoMethodError` if `foo` returns +# `nil` on a subsequent call. +# +# @example +# # bad +# foo&.bar && foo&.baz +# +# # good +# foo&.bar && foo.baz +# +# # bad +# foo.bar && foo&.baz +# +# # good +# foo.bar && foo.baz +# +# # bad +# foo&.bar || foo.baz +# +# # good +# foo&.bar || foo&.baz +# +# # bad +# foo.bar || foo&.baz +# +# # good +# foo.bar || foo.baz +# +# # bad +# foo&.bar && (foobar.baz || foo&.baz) +# +# # good +# foo&.bar && (foobar.baz || foo.baz) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:47 +class RuboCop::Cop::Lint::SafeNavigationConsistency < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::NilMethods + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:54 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:69 + def on_or(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:104 + def already_appropriate_call?(operand, dot_op); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:73 + def collect_operands(node, operand_nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:89 + def find_consistent_parts(grouped_operands); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:130 + def most_left_indices(grouped_operands); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:160 + def nilable?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:144 + def operand_in_and?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:152 + def operand_in_or?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:121 + def operand_nodes(operand, operand_nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:80 + def receiver_name_as_key(method, fully_receivers); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:110 + def register_offense(operand, dot_operator); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:51 +RuboCop::Cop::Lint::SafeNavigationConsistency::USE_DOT_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_consistency.rb:52 +RuboCop::Cop::Lint::SafeNavigationConsistency::USE_SAFE_NAVIGATION_MSG = T.let(T.unsafe(nil), String) + +# Checks to make sure safe navigation isn't used with `empty?` in +# a conditional. +# +# While the safe navigation operator is generally a good idea, when +# checking `foo&.empty?` in a conditional, `foo` being `nil` will actually +# do the opposite of what the author intends. +# +# @example +# # bad +# return if foo&.empty? +# return unless foo&.empty? +# +# # good +# return if foo && foo.empty? +# return unless foo && foo.empty? +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_with_empty.rb:22 +class RuboCop::Cop::Lint::SafeNavigationWithEmpty < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_with_empty.rb:32 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_with_empty.rb:28 + def safe_navigation_empty_in_conditional?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/safe_navigation_with_empty.rb:25 +RuboCop::Cop::Lint::SafeNavigationWithEmpty::MSG = T.let(T.unsafe(nil), String) + +# Checks if a file which has a shebang line as +# its first line is granted execute permission. +# +# @example +# # bad +# +# # A file which has a shebang line as its first line is not +# # granted execute permission. +# +# #!/usr/bin/env ruby +# puts 'hello, world' +# +# # good +# +# # A file which has a shebang line as its first line is +# # granted execute permission. +# +# #!/usr/bin/env ruby +# puts 'hello, world' +# +# # good +# +# # A file which has not a shebang line as its first line is not +# # granted execute permission. +# +# puts 'hello, world' +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:33 +class RuboCop::Cop::Lint::ScriptPermission < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:39 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:55 + def autocorrect; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:59 + def executable?(processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:70 + def format_message_from(processed_source); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:36 +RuboCop::Cop::Lint::ScriptPermission::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/script_permission.rb:37 +RuboCop::Cop::Lint::ScriptPermission::SHEBANG = T.let(T.unsafe(nil), String) + +# Checks for self-assignments. +# +# @example +# # bad +# foo = foo +# foo, bar = foo, bar +# Foo = Foo +# hash['foo'] = hash['foo'] +# obj.attr = obj.attr +# +# # good +# foo = bar +# foo, bar = bar, foo +# Foo = Bar +# hash['foo'] = hash['bar'] +# obj.attr = obj.attr2 +# +# # good (method calls possibly can return different results) +# hash[foo] = hash[foo] +# +# @example AllowRBSInlineAnnotation: false (default) +# # bad +# foo = foo #: Integer +# foo, bar = foo, bar #: Integer +# Foo = Foo #: Integer +# hash['foo'] = hash['foo'] #: Integer +# obj.attr = obj.attr #: Integer +# +# @example AllowRBSInlineAnnotation: true +# # good +# foo = foo #: Integer +# foo, bar = foo, bar #: Integer +# Foo = Foo #: Integer +# hash['foo'] = hash['foo'] #: Integer +# obj.attr = obj.attr #: Integer +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:42 +class RuboCop::Cop::Lint::SelfAssignment < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:95 + def on_and_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:75 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:61 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:72 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:73 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:71 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:63 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:83 + def on_masgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:90 + def on_or_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:52 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:165 + def allow_rbs_inline_annotation?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:150 + def handle_attribute_assignment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:138 + def handle_key_assignment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:122 + def multiple_self_assignment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:99 + def or_and_asgn_self_assignment?(lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:161 + def rbs_inline_annotation?(node); end + + # Compares two reader calls (attribute `foo.bar` or key `hash['foo']`). + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:111 + def reader_self_assignment?(lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:133 + def rhs_matches_lhs?(rhs, lhs); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:45 +RuboCop::Cop::Lint::SelfAssignment::ASSIGNMENT_TYPE_TO_RHS_TYPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/self_assignment.rb:43 +RuboCop::Cop::Lint::SelfAssignment::MSG = T.let(T.unsafe(nil), String) + +# Checks for `send`, `public_send`, and `__send__` methods +# when using mix-in. +# +# `include` and `prepend` methods were private methods until Ruby 2.0, +# they were mixed-in via `send` method. This cop uses Ruby 2.1 or +# higher style that can be called by public methods. +# And `extend` method that was originally a public method is also targeted +# for style unification. +# +# @example +# # bad +# Foo.send(:include, Bar) +# Foo.send(:prepend, Bar) +# Foo.send(:extend, Bar) +# +# # bad +# Foo.public_send(:include, Bar) +# Foo.public_send(:prepend, Bar) +# Foo.public_send(:extend, Bar) +# +# # bad +# Foo.__send__(:include, Bar) +# Foo.__send__(:prepend, Bar) +# Foo.__send__(:extend, Bar) +# +# # good +# Foo.include Bar +# Foo.prepend Bar +# Foo.extend Bar +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:36 +class RuboCop::Cop::Lint::SendWithMixinArgument < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:53 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:46 + def send_with_mixin_argument?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:67 + def bad_location(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:73 + def message(method, module_name, bad_method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:77 + def mixin_method?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:41 +RuboCop::Cop::Lint::SendWithMixinArgument::MIXIN_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:40 +RuboCop::Cop::Lint::SendWithMixinArgument::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:43 +RuboCop::Cop::Lint::SendWithMixinArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/send_with_mixin_argument.rb:42 +RuboCop::Cop::Lint::SendWithMixinArgument::SEND_METHODS = T.let(T.unsafe(nil), Array) + +# Checks for shadowed arguments. +# +# This cop has `IgnoreImplicitReferences` configuration option. +# It means argument shadowing is used in order to pass parameters +# to zero arity `super` when `IgnoreImplicitReferences` is `true`. +# +# @example +# +# # bad +# do_something do |foo| +# foo = 42 +# puts foo +# end +# +# def do_something(foo) +# foo = 42 +# puts foo +# end +# +# # good +# do_something do |foo| +# foo = foo + 42 +# puts foo +# end +# +# def do_something(foo) +# foo = foo + 42 +# puts foo +# end +# +# def do_something(foo) +# puts foo +# end +# +# @example IgnoreImplicitReferences: false (default) +# +# # bad +# def do_something(foo) +# foo = 42 +# super +# end +# +# def do_something(foo) +# foo = super +# bar +# end +# +# @example IgnoreImplicitReferences: true +# +# # good +# def do_something(foo) +# foo = 42 +# super +# end +# +# def do_something(foo) +# foo = super +# bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:66 +class RuboCop::Cop::Lint::ShadowedArgument < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:76 + def after_leaving_scope(scope, _variable_table); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:70 + def uses_var?(param0, param1); end + + private + + # Get argument references without assignments' references + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:161 + def argument_references(argument); end + + # Find the first argument assignment, which doesn't reference the + # argument at the rhs. If the assignment occurs inside a branch or + # block, it is impossible to tell whether it's executed, so precise + # shadowing location is not known. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:120 + def assignment_without_argument_usage(argument); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:82 + def check_argument(argument); end + + # Check whether the given node is always executed or not + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:152 + def conditional_assignment?(node, stop_search_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:171 + def ignore_implicit_references?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:144 + def reference_pos(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:95 + def shadowing_assignment(argument); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:72 + def joining_forces; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_argument.rb:67 +RuboCop::Cop::Lint::ShadowedArgument::MSG = T.let(T.unsafe(nil), String) + +# Checks for a rescued exception that gets shadowed by a +# less specific exception being rescued before a more specific +# exception is rescued. +# +# An exception is considered shadowed if it is rescued after its +# ancestor is, or if it and its ancestor are both rescued in the +# same `rescue` statement. In both cases, the more specific rescue is +# unnecessary because it is covered by rescuing the less specific +# exception. (ie. `rescue Exception, StandardError` has the same behavior +# whether `StandardError` is included or not, because all ``StandardError``s +# are rescued by `rescue Exception`). +# +# @example +# +# # bad +# +# begin +# something +# rescue Exception +# handle_exception +# rescue StandardError +# handle_standard_error +# end +# +# # bad +# begin +# something +# rescue Exception, StandardError +# handle_error +# end +# +# # good +# +# begin +# something +# rescue StandardError +# handle_standard_error +# rescue Exception +# handle_exception +# end +# +# # good, however depending on runtime environment. +# # +# # This is a special case for system call errors. +# # System dependent error code depends on runtime environment. +# # For example, whether `Errno::EAGAIN` and `Errno::EWOULDBLOCK` are +# # the same error code or different error code depends on environment. +# # This good case is for `Errno::EAGAIN` and `Errno::EWOULDBLOCK` with +# # the same error code. +# begin +# something +# rescue Errno::EAGAIN, Errno::EWOULDBLOCK +# handle_standard_error +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:61 +class RuboCop::Cop::Lint::ShadowedException < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RescueNode + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:67 + def on_rescue(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:101 + def compare_exceptions(exception, other_exception); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:94 + def contains_multiple_levels_of_exceptions?(group); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:119 + def evaluate_exceptions(group); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:152 + def find_shadowing_rescue(rescues); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:84 + def offense_range(rescues); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:90 + def rescued_groups_for(rescues); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:137 + def sorted?(rescued_groups); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:115 + def system_call_err?(error); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/shadowed_exception.rb:65 +RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) + +# Checks for the use of local variable names from an outer scope +# in block arguments or block-local variables. This mirrors the warning +# given by `ruby -cw` prior to Ruby 2.6: +# "shadowing outer local variable - foo". +# +# The cop is now disabled by default to match the upstream Ruby behavior. +# It's useful, however, if you'd like to avoid shadowing variables from outer +# scopes, which some people consider an anti-pattern that makes it harder +# to keep track of what's going on in a program. +# +# NOTE: Shadowing of variables in block passed to `Ractor.new` is allowed +# because `Ractor` should not access outer variables. +# eg. following style is encouraged: +# +# [source,ruby] +# ---- +# worker_id, pipe = env +# Ractor.new(worker_id, pipe) do |worker_id, pipe| +# end +# ---- +# +# @example +# +# # bad +# def some_method +# foo = 1 +# +# 2.times do |foo| # shadowing outer `foo` +# do_something(foo) +# end +# end +# +# # good +# def some_method +# foo = 1 +# +# 2.times do |bar| +# do_something(bar) +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:46 +class RuboCop::Cop::Lint::ShadowingOuterLocalVariable < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:58 + def before_declaring_variable(variable, variable_table); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:50 + def ractor_block?(param0 = T.unsafe(nil)); end + + private + + # `case ... in` binds variables in the pattern itself, so a block argument in one + # `in` branch does not shadow a pattern variable from a different `in` branch of the + # same `case` (the branches are mutually exclusive). + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:96 + def different_case_in_branch?(variable, outer_local_variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:115 + def find_conditional_node_from_ascendant(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:122 + def node_or_its_ascendant_conditional?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:77 + def same_conditions_node_different_branch?(variable, outer_local_variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:105 + def variable_node(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:73 + def variable_used_in_declaration_of_outer?(variable, outer_local_variable); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:54 + def joining_forces; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/shadowing_outer_local_variable.rb:47 +RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String) + +# Checks for `Hash` creation with a mutable default value. +# Creating a `Hash` in such a way will share the default value +# across all keys, causing unexpected behavior when modifying it. +# +# For example, when the `Hash` was created with an `Array` as the argument, +# calling `hash[:foo] << 'bar'` will also change the value of all +# other keys that have not been explicitly assigned to. +# +# @example +# # bad +# Hash.new([]) +# Hash.new({}) +# Hash.new(Array.new) +# Hash.new(Hash.new) +# +# # okay -- In rare cases that intentionally have this behavior, +# # without disabling the cop, you can set the default explicitly. +# h = Hash.new +# h.default = [] +# h[:a] << 1 +# h[:b] << 2 +# h # => {:a => [1, 2], :b => [1, 2]} +# +# # okay -- beware this will discard mutations and only remember assignments +# Hash.new { Array.new } +# Hash.new { Hash.new } +# Hash.new { {} } +# Hash.new { [] } +# +# # good - frozen solution will raise an error when mutation attempted +# Hash.new([].freeze) +# Hash.new({}.freeze) +# +# # good - using a proc will create a new object for each key +# h = Hash.new +# h.default_proc = ->(h, k) { [] } +# h.default_proc = ->(h, k) { {} } +# +# # good - using a block will create a new object for each key +# Hash.new { |h, k| h[k] = [] } +# Hash.new { |h, k| h[k] = {} } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/shared_mutable_default.rb:47 +class RuboCop::Cop::Lint::SharedMutableDefault < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/shared_mutable_default.rb:66 + def capacity_keyword_argument?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shared_mutable_default.rb:53 + def hash_initialized_with_mutable_shared_object?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/shared_mutable_default.rb:70 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/shared_mutable_default.rb:48 +RuboCop::Cop::Lint::SharedMutableDefault::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/shared_mutable_default.rb:50 +RuboCop::Cop::Lint::SharedMutableDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks unexpected overrides of the `Struct` built-in methods +# via `Struct.new`. +# +# @example +# # bad +# Bad = Struct.new(:members, :clone, :count) +# b = Bad.new([], true, 1) +# b.members #=> [] (overriding `Struct#members`) +# b.clone #=> true (overriding `Object#clone`) +# b.count #=> 1 (overriding `Enumerable#count`) +# +# # good +# Good = Struct.new(:id, :name) +# g = Good.new(1, "foo") +# g.members #=> [:id, :name] +# g.clone #=> # +# g.count #=> 2 +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:24 +class RuboCop::Cop::Lint::StructNewOverride < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:54 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:49 + def struct_new(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:25 +RuboCop::Cop::Lint::StructNewOverride::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:27 +RuboCop::Cop::Lint::StructNewOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:46 +RuboCop::Cop::Lint::StructNewOverride::STRUCT_MEMBER_NAME_TYPES = T.let(T.unsafe(nil), Array) + +# This is based on `Struct.instance_methods.sort` in Ruby 4.0.0. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/struct_new_override.rb:30 +RuboCop::Cop::Lint::StructNewOverride::STRUCT_METHOD_NAMES = T.let(T.unsafe(nil), Array) + +# Checks for `rescue` blocks with no body. +# +# @example +# +# # bad +# def some_method +# do_something +# rescue +# end +# +# # bad +# begin +# do_something +# rescue +# end +# +# # good +# def some_method +# do_something +# rescue +# handle_exception +# end +# +# # good +# begin +# do_something +# rescue +# handle_exception +# end +# +# @example AllowComments: true (default) +# +# # good +# def some_method +# do_something +# rescue +# # do nothing +# end +# +# # good +# begin +# do_something +# rescue +# # do nothing +# end +# +# @example AllowComments: false +# +# # bad +# def some_method +# do_something +# rescue +# # do nothing +# end +# +# # bad +# begin +# do_something +# rescue +# # do nothing +# end +# +# @example AllowNil: true (default) +# +# # good +# def some_method +# do_something +# rescue +# nil +# end +# +# # good +# begin +# do_something +# rescue +# # do nothing +# end +# +# # good +# do_something rescue nil +# +# @example AllowNil: false +# +# # bad +# def some_method +# do_something +# rescue +# nil +# end +# +# # bad +# begin +# do_something +# rescue +# nil +# end +# +# # bad +# do_something rescue nil +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception.rb:105 +class RuboCop::Cop::Lint::SuppressedException < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception.rb:108 + def on_resbody(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception.rb:118 + def comment_between_rescue_and_end?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception.rb:126 + def nil_body?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception.rb:106 +RuboCop::Cop::Lint::SuppressedException::MSG = T.let(T.unsafe(nil), String) + +# Checks for cases where exceptions unrelated to the numeric constructors `Integer()`, +# `Float()`, `BigDecimal()`, `Complex()`, and `Rational()` may be unintentionally swallowed. +# +# @safety +# The cop is unsafe for autocorrection because unexpected errors occurring in the argument +# passed to numeric constructor (e.g., `Integer()`) can lead to incompatible behavior. +# For example, changing it to `Integer(potential_exception_method_call, exception: false)` +# ensures that exceptions raised by `potential_exception_method_call` are not ignored. +# +# [source,ruby] +# ---- +# Integer(potential_exception_method_call) rescue nil +# ---- +# +# @example +# +# # bad +# Integer(arg) rescue nil +# +# # bad +# begin +# Integer(arg) +# rescue +# nil +# end +# +# # bad +# begin +# Integer(arg) +# rescue +# end +# +# # good +# Integer(arg, exception: false) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:41 +class RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:56 + def begin_numeric_constructor_rescue_nil(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:75 + def constructor_receiver?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:49 + def numeric_constructor_rescue_nil(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:65 + def numeric_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:82 + def on_rescue(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:107 + def exception_keyword_argument?(method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:115 + def expected_exception_classes_only?(exception_classes); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:46 +RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion::EXPECTED_EXCEPTION_CLASSES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb:45 +RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion::MSG = T.let(T.unsafe(nil), String) + +# Checks for uses of literal strings converted to +# a symbol where a literal symbol could be used instead. +# +# There are two possible styles for this cop. +# `strict` (default) will register an offense for any incorrect usage. +# `consistent` additionally requires hashes to use the same style for +# every symbol key (ie. if any symbol key needs to be quoted it requires +# all keys to be quoted). +# +# @example +# # bad +# 'string'.to_sym +# :symbol.to_sym +# 'underscored_string'.to_sym +# :'underscored_symbol' +# 'hyphenated-string'.to_sym +# "string_#{interpolation}".to_sym +# +# # good +# :string +# :symbol +# :underscored_string +# :underscored_symbol +# :'hyphenated-string' +# :"string_#{interpolation}" +# +# @example EnforcedStyle: strict (default) +# +# # bad +# { +# 'a': 1, +# "b": 2, +# 'c-d': 3 +# } +# +# # good (don't quote keys that don't require quoting) +# { +# a: 1, +# b: 2, +# 'c-d': 3 +# } +# +# @example EnforcedStyle: consistent +# +# # bad +# { +# a: 1, +# 'b-c': 2 +# } +# +# # good (quote all keys if any need quoting) +# { +# 'a': 1, +# 'b-c': 2 +# } +# +# # good (no quoting required) +# { +# a: 1, +# b: 2 +# } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:68 +class RuboCop::Cop::Lint::SymbolConversion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::SymbolHelp + extend ::RuboCop::Cop::AutoCorrector + + # Reuse the already-escaped inner source for a plain `"..."` string so embedded + # quotes stay escaped. Percent literals (`%{}`, `%Q{}`, ...) and adjacent string + # concatenation have multi-character or no delimiters, so slicing the source would + # corrupt them; fall back to the node's value there. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:97 + def dstr_correction(receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:122 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:78 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:105 + def on_sym(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:85 + def symbol_conversion_correction(receiver); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:164 + def correct_hash_key(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:183 + def correct_inconsistent_hash_keys(keys); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:156 + def in_alias?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:160 + def in_percent_literal_array?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:143 + def properly_quoted?(source, value); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:139 + def register_offense(node, correction:, message: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:152 + def requires_quotes?(sym_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:73 +RuboCop::Cop::Lint::SymbolConversion::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:74 +RuboCop::Cop::Lint::SymbolConversion::MSG_CONSISTENCY = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/symbol_conversion.rb:76 +RuboCop::Cop::Lint::SymbolConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Repacks Parser's diagnostics/errors +# into RuboCop's offenses. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:8 +class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:11 + def on_other_file; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:22 + def add_offense_from_diagnostic(diagnostic, ruby_version); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:56 + def add_offense_from_error(error); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:61 + def beautify_message(message); end + + # Expand zero-length diagnostic ranges so that editors and formatters + # can display them. This typically occurs when the parser reports + # `unexpected token $end` at EOF. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:36 + def diagnostic_location(location); end + + # Override to skip multiline_ranges check which requires AST. + # Syntax errors mean the AST is nil, so we go directly to + # the EOL comment insertion path. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:52 + def disable_offense(offense_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:67 + def find_severity(_range, _severity); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/syntax.rb:9 +RuboCop::Cop::Lint::Syntax::LEVELS = T.let(T.unsafe(nil), Array) + +# Ensures that `to_enum`/`enum_for`, called for the current method, +# has correct arguments. +# +# @example +# # bad +# def foo(x, y = 1) +# return to_enum(__callee__, x) # `y` is missing +# end +# +# # good +# def foo(x, y = 1) +# # Alternatives to `__callee__` are `__method__` and `:foo`. +# return to_enum(__callee__, x, y) +# end +# +# # good +# def foo(x, y = 1) +# # It is also allowed if it is wrapped in some method like Sorbet. +# return to_enum(T.must(__callee__), x, y) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:27 +class RuboCop::Cop::Lint::ToEnumArguments < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:33 + def enum_conversion_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:38 + def method_name?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:47 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:43 + def passing_keyword_arg?(param0 = T.unsafe(nil), param1); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:103 + def argument_match?(send_arg, def_arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:61 + def arguments_match?(arguments, def_node); end + + # A splat or argument forwarding on the call side can expand to any arity. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:90 + def expandable_arguments?(arguments); end + + # The enumerator re-invokes the method with these arguments, so passing more + # positional arguments than the method accepts raises `ArgumentError` at runtime. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:79 + def extra_positional_arguments?(arguments, def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:126 + def keyword_hash_argument?(send_arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:94 + def positional_arguments(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:98 + def positional_parameters(def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:85 + def variadic_parameters?(def_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:28 +RuboCop::Cop::Lint::ToEnumArguments::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/to_enum_arguments.rb:30 +RuboCop::Cop::Lint::ToEnumArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks to make sure `#to_json` includes an optional argument. +# When overriding `#to_json`, callers may invoke JSON +# generation via `JSON.generate(your_obj)`. Since `JSON#generate` allows +# for an optional argument, your method should too. +# +# @example +# # bad - incorrect arity +# def to_json +# JSON.generate([x, y]) +# end +# +# # good - preserving args +# def to_json(*args) +# JSON.generate([x, y], *args) +# end +# +# # good - discarding args +# def to_json(*_args) +# JSON.generate([x, y]) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/to_json.rb:27 +class RuboCop::Cop::Lint::ToJSON < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_json.rb:32 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/to_json.rb:48 + def on_defs(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/to_json.rb:30 +RuboCop::Cop::Lint::ToJSON::MSG = T.let(T.unsafe(nil), String) + +# Checks for top level return with arguments. If there is a +# top-level return statement with an argument, then the argument is +# always ignored. This is detected automatically since Ruby 2.7. +# +# @example +# # bad +# return 1 +# +# # good +# return +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/top_level_return_with_argument.rb:16 +class RuboCop::Cop::Lint::TopLevelReturnWithArgument < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/top_level_return_with_argument.rb:21 + def on_return(return_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/top_level_return_with_argument.rb:35 + def remove_arguments(corrector, return_node); end + + # This cop works by validating the ancestors of the return node. A + # top-level return node's ancestors should not be of block, def, or + # defs type. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/top_level_return_with_argument.rb:42 + def top_level_return?(return_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/top_level_return_with_argument.rb:31 + def top_level_return_with_any_argument?(return_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/top_level_return_with_argument.rb:19 +RuboCop::Cop::Lint::TopLevelReturnWithArgument::MSG = T.let(T.unsafe(nil), String) + +# Checks for trailing commas in attribute declarations, such as +# `#attr_reader`. Leaving a trailing comma will nullify the next method +# definition by overriding it with a getter method. +# +# @example +# +# # bad +# class Foo +# attr_reader :foo, +# +# def bar +# puts "Unreachable." +# end +# end +# +# # good +# class Foo +# attr_reader :foo +# +# def bar +# puts "No problem!" +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb:30 +class RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb:37 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb:50 + def trailing_comma_range(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb:34 +RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb:35 +RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for "triple quotes" (strings delimited by any odd number +# of quotes greater than 1). +# +# Ruby allows multiple strings to be implicitly concatenated by just +# being adjacent in a statement (ie. `"foo""bar" == "foobar"`). This sometimes +# gives the impression that there is something special about triple quotes, but +# in fact it is just extra unnecessary quotes and produces the same string. Each +# pair of quotes produces an additional concatenated empty string, so the result +# is still only the "actual" string within the delimiters. +# +# NOTE: Although this cop is called triple quotes, the same behavior is present +# for strings delimited by 5, 7, etc. quotation marks. +# +# @example +# # bad +# """ +# A string +# """ +# +# # bad +# ''' +# A string +# ''' +# +# # good +# " +# A string +# " +# +# # good +# < b } +# values.sort { |*x| x[0] <=> x[1] } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:41 +class RuboCop::Cop::Lint::UnexpectedBlockArity < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:44 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:56 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:55 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:64 + def acceptable?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:76 + def arg_count(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:72 + def expected_arity(method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:68 + def included_method?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:60 + def methods; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unexpected_block_arity.rb:42 +RuboCop::Cop::Lint::UnexpectedBlockArity::MSG = T.let(T.unsafe(nil), String) + +# Checks for using Fixnum or Bignum constant. +# +# @example +# +# # bad +# 1.is_a?(Fixnum) +# 1.is_a?(Bignum) +# +# # good +# 1.is_a?(Integer) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unified_integer.rb:16 +class RuboCop::Cop::Lint::UnifiedInteger < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unified_integer.rb:22 + def fixnum_or_bignum_const(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unified_integer.rb:26 + def on_const(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unified_integer.rb:19 +RuboCop::Cop::Lint::UnifiedInteger::MSG = T.let(T.unsafe(nil), String) + +# Looks for `reduce` or `inject` blocks where the value returned (implicitly or +# explicitly) does not include the accumulator. A block is considered valid as +# long as at least one return value includes the accumulator. +# +# If the accumulator is not included in the return value, then the entire +# block will just return a transformation of the last element value, and +# could be rewritten as such without a loop. +# +# Also catches instances where an index of the accumulator is returned, as +# this may change the type of object being retained. +# +# NOTE: For the purpose of reducing false positives, this cop only flags +# returns in `reduce` blocks where the element is the only variable in +# the expression (since we will not be able to tell what other variables +# relate to via static analysis). +# +# @example +# +# # bad +# (1..4).reduce(0) do |acc, el| +# el * 2 +# end +# +# # bad, may raise a NoMethodError after the first iteration +# %w(a b c).reduce({}) do |acc, letter| +# acc[letter] = true +# end +# +# # good +# (1..4).reduce(0) do |acc, el| +# acc + el * 2 +# end +# +# # good, element is returned but modified using the accumulator +# values.reduce do |acc, el| +# el << acc +# el +# end +# +# # good, returns the accumulator instead of the index +# %w(a b c).reduce({}) do |acc, letter| +# acc[letter] = true +# acc +# end +# +# # good, at least one branch returns the accumulator +# values.reduce(nil) do |result, value| +# break result if something? +# value +# end +# +# # good, recursive +# keys.reduce(self) { |result, key| result[key] } +# +# # ignored as the return value cannot be determined +# enum.reduce do |acc, el| +# x = foo(acc, el) +# bar(x) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:65 +class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:78 + def accumulator_index?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:83 + def element_modified?(param0, param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:104 + def expression_values(param0); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:93 + def lvar_used?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:115 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:123 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:122 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:70 + def reduce_with_block?(param0 = T.unsafe(nil)); end + + private + + # Determine if a return value is acceptable for the purposes of this cop + # If it is an expression containing the accumulator, it is acceptable + # Otherwise, it is only unacceptable if it contains the iterated element, since we + # otherwise do not have enough information to prevent false positives. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:192 + def acceptable_return?(return_val, element_name); end + + # Exclude `begin` nodes inside a `dstr` from being collected by `return_values` + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:200 + def allowed_type?(parent_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:160 + def block_arg_name(node, index); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:143 + def check_return_values(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:177 + def potential_offense?(return_values, block_body, element_name, accumulator_name); end + + # Return values in a block are either the value given to next, + # the last line of a multiline block, or the only line of the block + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:129 + def return_values(block_body_node); end + + # Look for an index of the accumulator being returned, except where the index + # is the element. + # This is always an offense, in order to try to catch potential exceptions + # due to type mismatches + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:168 + def returned_accumulator_index(return_values, accumulator_name, element_name); end + + # If the accumulator is used in any return value, the node is acceptable since + # the accumulator has a chance to change each iteration + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:184 + def returns_accumulator_anywhere?(return_values, accumulator_name); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:66 +RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb:67 +RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil), String) + +# Checks for unreachable code. +# The check is based on the presence of flow-of-control +# statements in non-final position in `begin` (implicit) blocks. +# +# @example +# +# # bad +# def some_method +# return +# do_something +# end +# +# # bad +# def some_method +# if cond +# return +# else +# return +# end +# do_something +# end +# +# # good +# def some_method +# do_something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:32 +class RuboCop::Cop::Lint::UnreachableCode < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:35 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:48 + def after_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:76 + def flow_command?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:52 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:41 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:46 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:67 + def on_kwbegin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:45 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:113 + def check_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:107 + def check_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:87 + def flow_expression?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:127 + def instance_eval_block?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:71 + def redefinable_flow_method?(method); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:123 + def register_redefinition(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:131 + def report_on_flow_command?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_code.rb:33 +RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String) + +# Checks for loops that will have at most one iteration. +# +# A loop that can never reach the second iteration is a possible error in the code. +# In rare cases where only one iteration (or at most one iteration) is intended behavior, +# the code should be refactored to use `if` conditionals. +# +# NOTE: Block methods that are used with ``Enumerable``s are considered to be loops. +# +# `AllowedPatterns` can be used to match against the block receiver in order to allow +# code that would otherwise be registered as an offense (eg. `times` used not in an +# `Enumerable` context). +# +# @example +# # bad +# while node +# do_something(node) +# node = node.parent +# break +# end +# +# # good +# while node +# do_something(node) +# node = node.parent +# end +# +# # bad +# def verify_list(head) +# item = head +# begin +# if verify(item) +# return true +# else +# return false +# end +# end while(item) +# end +# +# # good +# def verify_list(head) +# item = head +# begin +# if verify(item) +# item = item.next +# else +# return false +# end +# end while(item) +# +# true +# end +# +# # bad +# def find_something(items) +# items.each do |item| +# if something?(item) +# return item +# else +# raise NotFoundError +# end +# end +# end +# +# # good +# def find_something(items) +# items.each do |item| +# if something?(item) +# return item +# end +# end +# raise NotFoundError +# end +# +# # bad +# 2.times { raise ArgumentError } +# +# @example AllowedPatterns: ['(exactly|at_least|at_most)\(\d+\)\.times'] (default) +# +# # good +# exactly(2).times { raise StandardError } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:86 +class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:142 + def break_command?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:100 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:98 + def on_for(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:105 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:104 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:95 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:97 + def on_until_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:92 + def on_while(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:96 + def on_while_post(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:152 + def break_statement?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:118 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:175 + def check_case(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:169 + def check_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:200 + def conditional_continue_keyword?(break_statement); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:109 + def loop_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:189 + def preceded_by_continue_statement?(break_statement); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:129 + def statements(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:90 +RuboCop::Cop::Lint::UnreachableLoop::CONTINUE_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_loop.rb:89 +RuboCop::Cop::Lint::UnreachableLoop::MSG = T.let(T.unsafe(nil), String) + +# Checks for unreachable `in` pattern branches in `case...in` statements. +# +# An `in` branch is unreachable when a previous branch uses an unguarded +# catch-all pattern that matches any value unconditionally. Any `in` branches +# (and `else`) that follow such a catch-all are dead code. +# +# A catch-all pattern is one of: +# +# * A bare variable capture (`in x`) +# * An underscore (`in _`) +# * A pattern alias where the left side is a catch-all (`in _ => y`) +# * An alternation pattern where at least one alternative is a catch-all +# (`in _ | Integer`) +# +# NOTE: A catch-all pattern with a guard clause (e.g., `in _ if condition`) +# does NOT make subsequent branches unreachable because the guard might +# not be satisfied. +# +# @example +# +# # bad +# case value +# in Integer +# handle_integer +# in x +# handle_other +# in String +# handle_string +# else +# handle_else +# end +# +# # good +# case value +# in Integer +# handle_integer +# in String +# handle_string +# in x +# handle_other +# end +# +# # bad - else is unreachable after catch-all +# case value +# in Integer +# handle_integer +# in _ +# handle_other +# else +# handle_else +# end +# +# # good - guard clause means catch-all might not match +# case value +# in x if x.positive? +# handle_positive +# in Integer +# handle_integer +# else +# handle_other +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_pattern_branch.rb:68 +class RuboCop::Cop::Lint::UnreachablePatternBranch < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_pattern_branch.rb:76 + def on_case_match(case_node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_pattern_branch.rb:98 + def catch_all_pattern?(pattern); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_pattern_branch.rb:71 +RuboCop::Cop::Lint::UnreachablePatternBranch::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/unreachable_pattern_branch.rb:72 +RuboCop::Cop::Lint::UnreachablePatternBranch::MSG_ELSE = T.let(T.unsafe(nil), String) + +# Common functionality for cops handling unused arguments. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/unused_argument.rb:7 +module RuboCop::Cop::Lint::UnusedArgument + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/unused_argument.rb:10 + def after_leaving_scope(scope, _variable_table); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/unused_argument.rb:16 + def check_argument(variable); end +end + +# Checks for unused block arguments. +# +# @example +# # bad +# do_something do |used, unused| +# puts used +# end +# +# do_something do |bar| +# puts :foo +# end +# +# define_method(:foo) do |bar| +# puts :baz +# end +# +# # good +# do_something do |used, _unused| +# puts used +# end +# +# do_something do +# puts :foo +# end +# +# define_method(:foo) do |_bar| +# puts :baz +# end +# +# @example IgnoreEmptyBlocks: true (default) +# # good +# do_something { |unused| } +# +# @example IgnoreEmptyBlocks: false +# # bad +# do_something { |unused| } +# +# @example AllowUnusedKeywordArguments: false (default) +# # bad +# do_something do |unused: 42| +# foo +# end +# +# @example AllowUnusedKeywordArguments: true +# # good +# do_something do |unused: 42| +# foo +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:55 +class RuboCop::Cop::Lint::UnusedBlockArgument < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Lint::UnusedArgument + extend ::RuboCop::Cop::AutoCorrector + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:162 + def allow_unused_keyword_arguments?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:81 + def allowed_block?(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:85 + def allowed_keyword_argument?(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:99 + def augment_message(message, variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:65 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:69 + def check_argument(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:149 + def define_method_call?(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:156 + def empty_block?(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:166 + def ignore_empty_blocks?; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:89 + def message(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:132 + def message_for_lambda(variable, all_arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:120 + def message_for_normal_block(variable, all_arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:144 + def message_for_underscore_prefix(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:77 + def used_block_local?(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:112 + def variable_type(variable); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_block_argument.rb:59 + def joining_forces; end + end +end + +# Checks for unused method arguments. +# +# @example +# # bad +# def some_method(used, unused, _unused_but_allowed) +# puts used +# end +# +# # good +# def some_method(used, _unused, _unused_but_allowed) +# puts used +# end +# +# @example AllowUnusedKeywordArguments: false (default) +# # bad +# def do_something(used, unused: 42) +# used +# end +# +# @example AllowUnusedKeywordArguments: true +# # good +# def do_something(used, unused: 42) +# used +# end +# +# @example IgnoreEmptyMethods: true (default) +# # good +# def do_something(unused) +# end +# +# @example IgnoreEmptyMethods: false +# # bad +# def do_something(unused) +# end +# +# @example IgnoreNotImplementedMethods: true (default) +# # with default value of `NotImplementedExceptions: ['NotImplementedError']` +# +# # good +# def do_something(unused) +# raise NotImplementedError +# end +# +# def do_something_else(unused) +# fail "TODO" +# end +# +# @example IgnoreNotImplementedMethods: true +# # with `NotImplementedExceptions: ['AbstractMethodError']` +# +# # good +# def do_something(unused) +# raise AbstractMethodError +# end +# +# @example IgnoreNotImplementedMethods: false +# # bad +# def do_something(unused) +# raise NotImplementedError +# end +# +# def do_something_else(unused) +# fail "TODO" +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:70 +class RuboCop::Cop::Lint::UnusedMethodArgument < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Lint::UnusedArgument + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:75 + def not_implemented?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:138 + def allowed_exception_class?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:90 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:103 + def block_argument_with_yield?(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:94 + def check_argument(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:112 + def ignored_method?(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:117 + def message(variable); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:80 + def autocorrect_incompatible_with; end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/unused_method_argument.rb:84 + def joining_forces; end + end +end + +# Identifies places where `URI.escape` can be replaced by +# `CGI.escape`, `URI.encode_www_form`, or `URI.encode_www_form_component` +# depending on your specific use case. +# Also this cop identifies places where `URI.unescape` can be replaced by +# `CGI.unescape`, `URI.decode_www_form`, +# or `URI.decode_www_form_component` depending on your specific use case. +# +# @example +# # bad +# URI.escape('http://example.com') +# URI.encode('http://example.com') +# +# # good +# CGI.escape('http://example.com') +# URI.encode_uri_component(uri) # Since Ruby 3.1 +# URI.encode_www_form([['example', 'param'], ['lang', 'en']]) +# URI.encode_www_form(page: 10, locale: 'en') +# URI.encode_www_form_component('http://example.com') +# +# # bad +# URI.unescape(enc_uri) +# URI.decode(enc_uri) +# +# # good +# CGI.unescape(enc_uri) +# URI.decode_uri_component(uri) # Since Ruby 3.1 +# URI.decode_www_form(enc_uri) +# URI.decode_www_form_component(enc_uri) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:34 +class RuboCop::Cop::Lint::UriEscapeUnescape < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:59 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:53 + def uri_escape_unescape?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:35 +RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_ESCAPE = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:40 +RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_UNESCAPE = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:49 +RuboCop::Cop::Lint::UriEscapeUnescape::METHOD_NAMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:46 +RuboCop::Cop::Lint::UriEscapeUnescape::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_escape_unescape.rb:50 +RuboCop::Cop::Lint::UriEscapeUnescape::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Identifies places where `URI.regexp` is obsolete and should not be used. +# +# For Ruby 3.3 or lower, use `URI::DEFAULT_PARSER.make_regexp`. +# For Ruby 3.4 or higher, use `URI::RFC2396_PARSER.make_regexp`. +# +# NOTE: If you need to support both Ruby 3.3 and lower as well as Ruby 3.4 and higher, +# consider manually changing the code as follows: +# +# [source,ruby] +# ---- +# defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER +# ---- +# +# @example +# # bad +# URI.regexp('http://example.com') +# +# # good - Ruby 3.3 or lower +# URI::DEFAULT_PARSER.make_regexp('http://example.com') +# +# # good - Ruby 3.4 or higher +# URI::RFC2396_PARSER.make_regexp('http://example.com') +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_regexp.rb:29 +class RuboCop::Cop::Lint::UriRegexp < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/uri_regexp.rb:40 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/uri_regexp.rb:36 + def uri_constant?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_regexp.rb:32 +RuboCop::Cop::Lint::UriRegexp::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/uri_regexp.rb:33 +RuboCop::Cop::Lint::UriRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for redundant access modifiers, including those with no +# code, those which are repeated, those which are on top-level, and +# leading `public` modifiers in a class or module body. +# Conditionally-defined methods are considered as always being defined, +# and thus access modifiers guarding such methods are not redundant. +# +# This cop has `ContextCreatingMethods` option. The default setting value +# is an empty array that means no method is specified. +# This setting is an array of methods which, when called, are known to +# create its own context in the module's current access context. +# +# It also has `MethodCreatingMethods` option. The default setting value +# is an empty array that means no method is specified. +# This setting is an array of methods which, when called, are known to +# create other methods in the module's current access context. +# +# @example +# # bad +# class Foo +# public # this is redundant (default access is public) +# +# def method +# end +# end +# +# # bad +# class Foo +# # The following is redundant (methods defined on the class' +# # singleton class are not affected by the private modifier) +# private +# +# def self.method3 +# end +# end +# +# # bad +# class Foo +# protected +# +# define_method(:method2) do +# end +# +# protected # this is redundant (repeated from previous modifier) +# +# [1,2,3].each do |i| +# define_method("foo#{i}") do +# end +# end +# end +# +# # bad +# class Foo +# private # this is redundant (no following methods are defined) +# end +# +# # bad +# private # this is useless (access modifiers have no effect on top-level) +# +# def method +# end +# +# # good +# class Foo +# private # this is not redundant (a method is defined) +# +# def method2 +# end +# end +# +# # good +# class Foo +# # The following is not redundant (conditionally defined methods are +# # considered as always defining a method) +# private +# +# if condition? +# def method +# end +# end +# end +# +# # good +# class Foo +# protected # this is not redundant (a method is defined) +# +# define_method(:method2) do +# end +# end +# +# @example ContextCreatingMethods: concerning +# # Lint/UselessAccessModifier: +# # ContextCreatingMethods: +# # - concerning +# +# # good +# require 'active_support/concern' +# class Foo +# concerning :Bar do +# def some_public_method +# end +# +# private +# +# def some_private_method +# end +# end +# +# # this is not redundant because `concerning` created its own context +# private +# +# def some_other_private_method +# end +# end +# +# @example MethodCreatingMethods: delegate +# # Lint/UselessAccessModifier: +# # MethodCreatingMethods: +# # - delegate +# +# # good +# require 'active_support/core_ext/module/delegation' +# class Foo +# # this is not redundant because `delegate` creates methods +# private +# +# delegate :method_a, to: :method_b +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:133 +class RuboCop::Cop::Lint::UselessAccessModifier < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:184 + def class_or_instance_eval?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:179 + def dynamic_method_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:154 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:145 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:139 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:152 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:142 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:151 + def on_numblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:143 + def on_sclass(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:174 + def static_method_definition?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:200 + def access_modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:302 + def any_context_creating_methods?(child); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:275 + def any_method_definition?(child); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:167 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:214 + def check_child_nodes(node, unused, cur_vis); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:244 + def check_new_visibility(node, unused, new_vis, cur_vis); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:188 + def check_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:204 + def check_scope(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:233 + def check_send_node(node, cur_vis, unused); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:296 + def eval_call?(child); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:265 + def included_block?(block_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:269 + def method_definition?(child); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:292 + def start_of_new_scope?(child); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_access_modifier.rb:137 +RuboCop::Cop::Lint::UselessAccessModifier::MSG = T.let(T.unsafe(nil), String) + +# Checks for every useless assignment to local variable in every +# scope. +# The basic idea for this cop was from the warning of `ruby -cw`: +# +# [source,console] +# ---- +# assigned but unused variable - foo +# ---- +# +# Currently this cop has advanced logic that detects unreferenced +# reassignments and properly handles varied cases such as branch, loop, +# rescue, ensure, etc. +# +# This cop's autocorrection avoids cases like `a ||= 1` because removing assignment from +# operator assignment can cause `NameError` if this assignment has been used to declare +# a local variable. For example, replacing `a ||= 1` with `a || 1` may cause +# "undefined local variable or method `a' for main:Object (NameError)". +# +# NOTE: Given the assignment `foo = 1, bar = 2`, removing unused variables +# can lead to a syntax error, so this case is not autocorrected. +# +# @example +# +# # bad +# def some_method +# some_var = 1 +# do_something +# end +# +# # good +# def some_method +# some_var = 1 +# do_something(some_var) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:40 +class RuboCop::Cop::Lint::UselessAssignment < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:49 + def after_leaving_scope(scope, _variable_table); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:177 + def autocorrect(corrector, assignment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:116 + def chained_assignment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:61 + def check_for_unused_assignment(variable, assignment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:53 + def check_for_unused_assignments(variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:161 + def collect_variable_like_names(scope); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:87 + def ignored_assignment?(variable, assignment_node, assignment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:92 + def message_for_useless_assignment(assignment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:122 + def message_specification(assignment, variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:132 + def multiple_assignment_message(variable_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:98 + def offense_range(assignment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:137 + def operator_assignment_message(scope, assignment); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:194 + def remove_exception_assignment_part(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:215 + def remove_local_variable_assignment_part(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:204 + def remove_trailing_character_from_operator(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:200 + def rename_variable_with_underscore(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:208 + def replace_named_capture_group_with_non_capturing_group(corrector, node, variable_name); end + + # TODO: More precise handling (rescue, ensure, nested begin, etc.) + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:151 + def return_value_node_of_scope(scope); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:106 + def sequential_assignment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:144 + def similar_name_message(variable); end + + # Autocorrect is skipped when removing a variable would cause a syntax error + # (`x = 1, y = 2`), or where rewriting `x ||= 1`/`x &&= 1` to `x = 1` would raise + # `NameError` because the variable is not declared before the operator assignment. + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:81 + def uncorrectable_assignment?(assignment_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:219 + def variable_in_loop_condition?(assignment_node, variable); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:170 + def variable_like_method_invocation?(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:45 + def joining_forces; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_assignment.rb:43 +RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) + +# Checks for useless constant scoping. Private constants must be defined using +# `private_constant`. Even if `private` access modifier is used, it is public scope despite +# its appearance. +# +# It does not support autocorrection due to behavior change and multiple ways to fix it. +# Or a public constant may be intended. +# +# @example +# +# # bad +# class Foo +# private +# PRIVATE_CONST = 42 +# end +# +# # good +# class Foo +# PRIVATE_CONST = 42 +# private_constant :PRIVATE_CONST +# end +# +# # good +# class Foo +# PUBLIC_CONST = 42 # If private scope is not intended. +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_constant_scoping.rb:32 +class RuboCop::Cop::Lint::UselessConstantScoping < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_constant_scoping.rb:40 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_constant_scoping.rb:36 + def private_constants(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_constant_scoping.rb:49 + def after_private_modifier?(left_siblings); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_constant_scoping.rb:59 + def private_constantize?(right_siblings, const_value); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_constant_scoping.rb:33 +RuboCop::Cop::Lint::UselessConstantScoping::MSG = T.let(T.unsafe(nil), String) + +# Checks for usage of method `fetch` or `Array.new` with default value argument +# and block. In such cases, block will always be used as default value. +# +# This cop emulates Ruby warning "block supersedes default value argument" which +# applies to `Array.new`, `Array#fetch`, `Hash#fetch`, `ENV.fetch` and +# `Thread#fetch`. +# +# A `fetch` call without a receiver is considered a custom method and does not register +# an offense. +# +# @safety +# This cop is unsafe because the receiver could have nonstandard implementation +# of `fetch`, or be a class other than the one listed above. +# +# It is also unsafe because default value argument could have side effects: +# +# [source,ruby] +# ---- +# def x(a) = puts "side effect" +# Array.new(5, x(1)) { 2 } +# ---- +# +# so removing it would change behavior. +# +# @example +# # bad +# x.fetch(key, default_value) { block_value } +# Array.new(size, default_value) { block_value } +# +# # good +# x.fetch(key) { block_value } +# Array.new(size) { block_value } +# +# # also good - in case default value argument is desired instead +# x.fetch(key, default_value) +# Array.new(size, default_value) +# +# # good - keyword arguments aren't registered as offenses +# x.fetch(key, keyword: :arg) { block_value } +# +# @example AllowedReceivers: ['Rails.cache'] +# # good +# Rails.cache.fetch(name, options) { block } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:50 +class RuboCop::Cop::Lint::UselessDefaultValueArgument < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedReceivers + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:59 + def default_value_argument_and_block(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:82 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:69 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:86 + def hash_without_braces?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:54 +RuboCop::Cop::Lint::UselessDefaultValueArgument::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_default_value_argument.rb:56 +RuboCop::Cop::Lint::UselessDefaultValueArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for calls to `defined?` with strings or symbols as the argument. +# Such calls will always return `'expression'`, you probably meant to +# check for the existence of a constant, method, or variable instead. +# +# `defined?` is part of the Ruby syntax and doesn't behave like normal methods. +# You can safely pass in what you are checking for directly, without encountering +# a `NameError`. +# +# When interpolation is used, oftentimes it is not possible to write the +# code with `defined?`. In these cases, switch to one of the more specific methods: +# +# * `class_variable_defined?` +# * `const_defined?` +# * `method_defined?` +# * `instance_variable_defined?` +# * `binding.local_variable_defined?` +# +# @example +# +# # bad +# defined?('FooBar') +# defined?(:FooBar) +# defined?(:foo_bar) +# defined?('foo_bar') +# +# # good +# defined?(FooBar) +# defined?(foo_bar) +# +# # bad - interpolation +# bar = 'Bar' +# defined?("Foo::#{bar}::Baz") +# +# # good +# bar = 'Bar' +# defined?(Foo) && Foo.const_defined?(bar) && Foo.const_get(bar).const_defined?(:Baz) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_defined.rb:42 +class RuboCop::Cop::Lint::UselessDefined < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_defined.rb:46 + def on_defined?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_defined.rb:43 +RuboCop::Cop::Lint::UselessDefined::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_defined.rb:44 +RuboCop::Cop::Lint::UselessDefined::TYPES = T.let(T.unsafe(nil), Hash) + +# Checks for useless `else` in `begin..end` without `rescue`. +# +# NOTE: This syntax is no longer valid on Ruby 2.6 or higher. +# +# @example +# +# # bad +# begin +# do_something +# else +# do_something_else # This will never be run. +# end +# +# # good +# begin +# do_something +# rescue +# handle_errors +# else +# do_something_else +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_else_without_rescue.rb:27 +class RuboCop::Cop::Lint::UselessElseWithoutRescue < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_else_without_rescue.rb:34 + def on_new_investigation; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_else_without_rescue.rb:30 +RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String) + +# Checks for useless method definitions, specifically: empty constructors +# and methods just delegating to `super`. +# +# @safety +# This cop is unsafe as it can register false positives for cases when an empty +# constructor just overrides the parent constructor, which is bad anyway. +# +# @example +# # bad +# def initialize +# super +# end +# +# def method +# super +# end +# +# # good - with default arguments +# def initialize(x = Object.new) +# super +# end +# +# # good +# def initialize +# super +# initialize_internals +# end +# +# def method(*args) +# super(:extra_arg, *args) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:38 +class RuboCop::Cop::Lint::UselessMethodDefinition < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:43 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:53 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:65 + def delegating?(node, def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:57 + def method_definition_with_modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:61 + def use_rest_or_optional_args?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_method_definition.rb:41 +RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +# Certain numeric operations have no impact, being: +# Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. +# These are probably leftover from debugging, or are mistakes. +# +# @example +# +# # bad +# x + 0 +# x - 0 +# x * 1 +# x / 1 +# x ** 1 +# +# # good +# x +# +# # bad +# x += 0 +# x -= 0 +# x *= 1 +# x /= 1 +# x **= 1 +# +# # good +# x = x +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:32 +class RuboCop::Cop::Lint::UselessNumericOperation < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:56 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:58 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:48 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:44 + def useless_abbreviated_assignment?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:39 + def useless_operation?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:69 + def useless?(operation, number); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:35 +RuboCop::Cop::Lint::UselessNumericOperation::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_numeric_operation.rb:36 +RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for useless OR (`||` and `or`) expressions. +# +# Some methods always return a truthy value, even when called +# on `nil` (e.g. `nil.to_i` evaluates to `0`). Therefore, OR expressions +# appended after these methods will never evaluate. +# +# @safety +# As shown in the examples below, there are generally two possible ways to correct the +# offense, but this cop's autocorrection always chooses the option that preserves the +# current behavior. While this does not change how the code behaves, that option is not +# necessarily the appropriate fix in every situation. For this reason, the autocorrection +# provided by this cop is considered unsafe. +# +# @example +# +# # bad +# x.to_a || fallback +# x.to_c || fallback +# x.to_d || fallback +# x.to_i || fallback +# x.to_f || fallback +# x.to_h || fallback +# x.to_r || fallback +# x.to_s || fallback +# x.to_sym || fallback +# x.intern || fallback +# x.inspect || fallback +# x.hash || fallback +# x.object_id || fallback +# x.__id__ || fallback +# +# x.to_s or fallback +# +# # good - if fallback is same as return value of method called on nil +# x.to_a # nil.to_a returns [] +# x.to_c # nil.to_c returns (0+0i) +# x.to_d # nil.to_d returns 0.0 +# x.to_i # nil.to_i returns 0 +# x.to_f # nil.to_f returns 0.0 +# x.to_h # nil.to_h returns {} +# x.to_r # nil.to_r returns (0/1) +# x.to_s # nil.to_s returns '' +# x.to_sym # nil.to_sym raises an error +# x.intern # nil.intern raises an error +# x.inspect # nil.inspect returns "nil" +# x.hash # nil.hash returns an Integer +# x.object_id # nil.object_id returns an Integer +# x.__id__ # nil.object_id returns an Integer +# +# # good - if the intention is not to call the method on nil +# x&.to_a || fallback +# x&.to_c || fallback +# x&.to_d || fallback +# x&.to_i || fallback +# x&.to_f || fallback +# x&.to_h || fallback +# x&.to_r || fallback +# x&.to_s || fallback +# x&.to_sym || fallback +# x&.intern || fallback +# x&.inspect || fallback +# x&.hash || fallback +# x&.object_id || fallback +# x&.__id__ || fallback +# +# x&.to_s or fallback +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_or.rb:73 +class RuboCop::Cop::Lint::UselessOr < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_or.rb:87 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_or.rb:83 + def truthy_return_value_method?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_or.rb:100 + def report_offense(or_node, truthy_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_or.rb:76 +RuboCop::Cop::Lint::UselessOr::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_or.rb:78 +RuboCop::Cop::Lint::UselessOr::TRUTHY_RETURN_VALUE_METHODS = T.let(T.unsafe(nil), Set) + +# Checks for useless ``rescue``s, which only reraise rescued exceptions. +# +# @example +# # bad +# def foo +# do_something +# rescue +# raise +# end +# +# # bad +# def foo +# do_something +# rescue => e +# raise # or 'raise e', or 'raise $!', or 'raise $ERROR_INFO' +# end +# +# # good +# def foo +# do_something +# rescue +# do_cleanup +# raise +# end +# +# # bad (latest rescue) +# def foo +# do_something +# rescue ArgumentError +# # noop +# rescue +# raise +# end +# +# # good (not the latest rescue) +# def foo +# do_something +# rescue ArgumentError +# raise +# rescue +# # noop +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_rescue.rb:49 +class RuboCop::Cop::Lint::UselessRescue < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_rescue.rb:52 + def on_rescue(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_rescue.rb:83 + def exception_objects(resbody_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_rescue.rb:60 + def only_reraising?(resbody_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_rescue.rb:75 + def use_exception_variable_in_ensure?(resbody_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_rescue.rb:50 +RuboCop::Cop::Lint::UselessRescue::MSG = T.let(T.unsafe(nil), String) + +# Looks for `ruby2_keywords` calls for methods that do not need it. +# +# `ruby2_keywords` should only be called on methods that accept an argument splat +# (`\*args`) but do not have explicit keyword arguments (`k:` or `k: true`) or +# a keyword splat (`**kwargs`). +# +# @example +# # good (splat argument without keyword arguments) +# ruby2_keywords def foo(*args); end +# +# # bad (no arguments) +# ruby2_keywords def foo; end +# +# # good +# def foo; end +# +# # bad (positional argument) +# ruby2_keywords def foo(arg); end +# +# # good +# def foo(arg); end +# +# # bad (double splatted argument) +# ruby2_keywords def foo(**args); end +# +# # good +# def foo(**args); end +# +# # bad (keyword arguments) +# ruby2_keywords def foo(i:, j:); end +# +# # good +# def foo(i:, j:); end +# +# # bad (splat argument with keyword arguments) +# ruby2_keywords def foo(*args, i:, j:); end +# +# # good +# def foo(*args, i:, j:); end +# +# # bad (splat argument with double splat) +# ruby2_keywords def foo(*args, **kwargs); end +# +# # good +# def foo(*args, **kwargs); end +# +# # bad (ruby2_keywords given a symbol) +# def foo; end +# ruby2_keywords :foo +# +# # good +# def foo; end +# +# # bad (ruby2_keywords with dynamic method) +# define_method(:foo) { |arg| } +# ruby2_keywords :foo +# +# # good +# define_method(:foo) { |arg| } +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:66 +class RuboCop::Cop::Lint::UselessRuby2Keywords < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:72 + def method_definition(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:79 + def on_send(node); end + + private + + # `ruby2_keywords` is only allowed if there's a `restarg` and no keyword arguments + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:122 + def allowed_arguments?(arguments); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:109 + def find_method_definition(node, method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:91 + def inspect_def(node, def_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:97 + def inspect_sym(node, sym_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:67 +RuboCop::Cop::Lint::UselessRuby2Keywords::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_ruby2_keywords.rb:68 +RuboCop::Cop::Lint::UselessRuby2Keywords::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for setter call to local variable as the final +# expression of a function definition. +# +# @safety +# There are edge cases in which the local variable references a +# value that is also accessible outside the local scope. This is not +# detected by the cop, and it can yield a false positive. +# +# As well, autocorrection is unsafe because the method's +# return value will be changed. +# +# @example +# +# # bad +# def something +# x = Something.new +# x.attr = 5 +# end +# +# # good +# def something +# x = Something.new +# x.attr = 5 +# x +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:31 +class RuboCop::Cop::Lint::UselessSetterCall < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:37 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:54 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:59 + def setter_call_to_local_variable?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:63 + def last_expression(body); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:35 +RuboCop::Cop::Lint::UselessSetterCall::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:34 +RuboCop::Cop::Lint::UselessSetterCall::MSG = T.let(T.unsafe(nil), String) + +# This class tracks variable assignments in a method body +# and if a variable contains object passed as argument at the end of +# the method. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:72 +class RuboCop::Cop::Lint::UselessSetterCall::MethodVariableTracker + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:73 + def initialize(body_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:151 + def constructor?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:78 + def contain_local_object?(variable_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:143 + def process_assignment(asgn_node, rhs_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:96 + def process_assignment_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:134 + def process_binary_operator_assignment(op_asgn_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:126 + def process_logical_operator_assignment(asgn_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:109 + def process_multiple_assignment(masgn_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_setter_call.rb:88 + def scan(node, &block); end +end + +# Checks for uses of `Integer#times` that will never yield +# (when the integer ``<= 0``) or that will only ever yield once +# (`1.times`). +# +# @safety +# This cop is unsafe as `times` returns its receiver, which is +# *usually* OK, but might change behavior. +# +# @example +# # bad +# -5.times { do_something } +# 0.times { do_something } +# 1.times { do_something } +# 1.times { |i| do_something(i) } +# +# # good +# do_something +# do_something(1) +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:24 +class RuboCop::Cop::Lint::UselessTimes < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:37 + def block_arg(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:42 + def block_reassigns_arg?(param0, param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:46 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:32 + def times_call?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:62 + def autocorrect(corrector, count, node, proc_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:84 + def autocorrect_block(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:80 + def autocorrect_block_pass(corrector, node, proc_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:115 + def fix_indentation(source, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:72 + def never_process?(count, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:108 + def orphans_loop_control_keyword?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:127 + def own_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:94 + def reducible_to_body?(node, block_arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:76 + def remove_node(corrector, node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:28 +RuboCop::Cop::Lint::UselessTimes::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/useless_times.rb:29 +RuboCop::Cop::Lint::UselessTimes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:6 +module RuboCop::Cop::Lint::Utils; end + +# Utility class that checks if the receiver can't be nil. +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:8 +class RuboCop::Cop::Lint::Utils::NilReceiverChecker + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:11 + def initialize(receiver, additional_nil_methods); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:17 + def cant_be_nil?; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:24 + def _cant_be_nil?(node, receiver); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:136 + def csend_root_receiver(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:126 + def else_branch?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:130 + def find_top_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:109 + def non_nil_condition?(condition, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:79 + def non_nil_method?(method_name); end + + # Whether control reaches `node` by falling through its left siblings rather than by + # a non-sequential entry. A `resbody` is entered via an exception, the `ensure` branch + # runs even after a partway raise, and the `else` arm of an `if/elsif` chain is reached by + # branching (its `if/case` siblings are walked via parent recursion instead). + # + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:119 + def sequentially_reached?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:84 + def sole_condition_of_parent_if?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/utils/nil_receiver_checker.rb:9 +RuboCop::Cop::Lint::Utils::NilReceiverChecker::NIL_METHODS = T.let(T.unsafe(nil), Set) + +# Checks for operators, variables, literals, lambda, proc and nonmutating +# methods used in void context. +# +# `each` blocks are allowed to prevent false positives. +# For example, the expression inside the `each` block below. +# It's not void, especially when the receiver is an `Enumerator`: +# +# [source,ruby] +# ---- +# enumerator = [1, 2, 3].filter +# enumerator.each { |item| item >= 2 } #=> [2, 3] +# ---- +# +# NOTE: Return values in assignment method definitions such as `def foo=(arg)` are +# detected because they are in a void context. However, autocorrection does not remove +# the return value, as that would change behavior. In such cases, whether to remove +# the return value or rename the method to something more appropriate should be left to +# the user. +# +# @example CheckForMethodsWithNoSideEffects: false (default) +# # bad +# def some_method +# some_num * 10 +# do_something +# end +# +# def some_method(some_var) +# some_var +# do_something +# end +# +# @example CheckForMethodsWithNoSideEffects: true +# # bad +# def some_method(some_array) +# some_array.sort +# do_something(some_array) +# end +# +# # good +# def some_method +# do_something +# some_num * 10 +# end +# +# def some_method(some_var) +# do_something +# some_var +# end +# +# def some_method(some_array) +# some_array.sort! +# do_something(some_array) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:59 +class RuboCop::Cop::Lint::Void < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:98 + def on_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:87 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:103 + def on_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:96 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:101 + def on_kwbegin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:95 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:289 + def all_keys_entirely_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:293 + def all_values_entirely_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:267 + def autocorrect_nonmutating_send(corrector, node, suggestion); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:260 + def autocorrect_void_expression(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:247 + def autocorrect_void_op(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:109 + def check_begin(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:141 + def check_case_expression(case_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:146 + def check_case_match_expression(case_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:232 + def check_ensure(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:119 + def check_expression(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:137 + def check_if_expression(if_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:188 + def check_literal(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:214 + def check_nonmutating(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:198 + def check_self(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:170 + def check_var(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:206 + def check_void_expression(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:127 + def check_void_expression_nodes(expr); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:154 + def check_void_op(node, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:276 + def entirely_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:240 + def in_void_context?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:72 +RuboCop::Cop::Lint::Void::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:66 +RuboCop::Cop::Lint::Void::CONST_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:69 +RuboCop::Cop::Lint::Void::EXPRESSION_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:67 +RuboCop::Cop::Lint::Void::LIT_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:82 +RuboCop::Cop::Lint::Void::METHODS_REPLACEABLE_BY_EACH = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:84 +RuboCop::Cop::Lint::Void::NONMUTATING_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:75 +RuboCop::Cop::Lint::Void::NONMUTATING_METHODS_WITH_BANG_VERSION = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:70 +RuboCop::Cop::Lint::Void::NONMUTATING_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:74 +RuboCop::Cop::Lint::Void::OPERATORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:64 +RuboCop::Cop::Lint::Void::OP_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:68 +RuboCop::Cop::Lint::Void::SELF_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:73 +RuboCop::Cop::Lint::Void::UNARY_OPERATORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/lint/void.rb:65 +RuboCop::Cop::Lint::Void::VAR_MSG = T.let(T.unsafe(nil), String) + +# Common functionality for obtaining source ranges from regexp matches +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/match_range.rb:6 +module RuboCop::Cop::MatchRange + include ::RuboCop::Cop::RangeHelp + + private + + # Return a new `Range` covering the first matching group number for each + # match of `regex` inside `range` + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/match_range.rb:13 + def each_match_range(range, regex); end + + # For a `match` inside `range`, return a new `Range` covering the match + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/match_range.rb:18 + def match_range(range, match); end +end + +# Message Annotator class annotates a basic offense message +# based on params passed into initializer. +# +# @see #initialize +# +# @example +# RuboCop::Cop::MessageAnnotator.new( +# config, cop_name, cop_config, @options +# ).annotate('message') +# #=> 'Cop/CopName: message (http://example.org/styleguide)' +# +# pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:15 +class RuboCop::Cop::MessageAnnotator + # @param config [RuboCop::Config] Check configs for all cops + # @note Message Annotator specifically checks the + # following config options for_all_cops + # :StyleGuideBaseURL [String] URL for styleguide + # :DisplayStyleGuide [Boolean] Include styleguide and reference URLs + # :ExtraDetails [Boolean] Include cop details + # :DisplayCopNames [Boolean] Include cop name + # + # @param [String] cop_name for specific cop name + # @param [Hash] cop_config configs for specific cop, from config#for_cop + # @option cop_config [String] :StyleGuide Extension of base styleguide URL + # @option cop_config [String] :References Full reference URLs + # @option cop_config [String] :Details + # + # @param [Hash, nil] options optional + # @option options [Boolean] :display_style_guide + # Include style guide and reference URLs + # @option options [Boolean] :extra_details + # Include cop specific details + # @option options [Boolean] :debug + # Include debug output + # @option options [Boolean] :display_cop_names + # Include cop name + # + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:47 + def initialize(config, cop_name, cop_config, options); end + + # Returns the annotated message, + # based on params passed into initializer + # + # @return [String] annotated message + # + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:58 + def annotate(message); end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:16 + def config; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:16 + def cop_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:16 + def cop_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:16 + def options; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:68 + def urls; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:115 + def debug?; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:128 + def details; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:119 + def display_cop_names?; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:98 + def display_style_guide?; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:111 + def extra_details?; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:102 + def reference_urls; end + + # Returns the base style guide URL from AllCops or the specific department + # + # @return [String] style guide URL + # + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:91 + def style_guide_base_url; end + + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:74 + def style_guide_url; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/message_annotator.rb:21 + def style_guide_urls; end + end +end + +# @api private +# +# This module handles measurement and reporting of complexity in methods. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:8 +module RuboCop::Cop::MethodComplexity + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount + extend ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::ExcludeLimit + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:38 + def define_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:15 + def max=(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:24 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:17 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:22 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:33 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:32 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:43 + def check_complexity(node, method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:62 + def complexity(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_complexity.rb:74 + def location(node); end +end + +# Common code for cops that deal with preferred methods. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/method_preference.rb:6 +module RuboCop::Cop::MethodPreference + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_preference.rb:25 + def default_cop_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_preference.rb:9 + def preferred_method(method); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/method_preference.rb:13 + def preferred_methods; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb:5 +module RuboCop::Cop::Metrics; end + +# Checks that the ABC size of methods is not higher than the +# configured maximum. The ABC size is based on assignments, branches +# (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric +# and https://en.wikipedia.org/wiki/ABC_Software_Metric. +# +# Interpreting ABC size: +# +# * ``<= 17`` satisfactory +# * `18..30` unsatisfactory +# * `>` 30 dangerous +# +# You can have repeated "attributes" calls count as a single "branch". +# For this purpose, attributes are any method with no argument; no attempt +# is meant to distinguish actual `attr_reader` from other methods. +# +# @example CountRepeatedAttributes: false (default is true) +# +# # `model` and `current_user`, referenced 3 times each, +# # are each counted as only 1 branch each if +# # `CountRepeatedAttributes` is set to 'false' +# +# def search +# @posts = model.active.visible_by(current_user) +# .search(params[:q]) +# @posts = model.some_process(@posts, current_user) +# @posts = model.another_process(@posts, current_user) +# +# render 'pages/search/page' +# end +# +# This cop also takes into account `AllowedMethods` (defaults to `[]`) +# And `AllowedPatterns` (defaults to `[]`) +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/abc_size.rb:39 +class RuboCop::Cop::Metrics::AbcSize < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount + include ::RuboCop::Cop::MethodComplexity + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/abc_size.rb:47 + def complexity(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/abc_size.rb:42 +RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) + +# Checks if the length of a block exceeds some maximum value. +# Comment lines can optionally be ignored. +# The maximum allowed length is configurable. +# The cop can be configured to ignore blocks passed to certain methods. +# +# You can set constructs you want to fold with `CountAsOne`. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. +# +# NOTE: This cop does not apply for `Struct` definitions. +# +# NOTE: The `ExcludedMethods` configuration is deprecated and only kept +# for backwards compatibility. Please use `AllowedMethods` and `AllowedPatterns` +# instead. By default, there are no allowed methods. +# +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] +# +# something do +# array = [ # +1 +# 1, +# 2 +# ] +# +# hash = { # +1 +# key: 'value' +# } +# +# msg = <<~HEREDOC # +1 +# Heredoc +# content. +# HEREDOC +# +# foo( # +1 +# 1, +# 2 +# ) +# end # 4 points +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:45 +class RuboCop::Cop::Metrics::BlockLength < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CodeLength + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:52 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:60 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:59 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:82 + def cop_label; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:64 + def method_receiver_excluded?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/block_length.rb:50 +RuboCop::Cop::Metrics::BlockLength::LABEL = T.let(T.unsafe(nil), String) + +# Checks for excessive nesting of conditional and looping constructs. +# Deeply nested code is harder to read, understand, and maintain. +# Extracting nested logic into methods improves clarity. +# +# You can configure if blocks are considered using the `CountBlocks` and `CountModifierForms` +# options. When both are set to `false` (the default) blocks and modifier forms are not +# counted towards the nesting level. Set them to `true` to include these in the nesting level +# calculation as well. +# +# The maximum level of nesting allowed is configurable. +# +# @example Max: 3 (default) +# # bad +# if condition1 +# if condition2 +# if condition3 +# if condition4 +# do_something +# end +# end +# end +# end +# +# # good +# if condition1 +# if condition2 +# if condition3 +# do_something +# end +# end +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:37 +class RuboCop::Cop::Metrics::BlockNesting < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:40 + def max=(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:42 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:51 + def check_nesting_level(node, max, current_level); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:75 + def consider_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:85 + def count_blocks?; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:67 + def count_if_block?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:89 + def count_modifier_forms?; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:81 + def message(max); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/block_nesting.rb:38 +RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array) + +# Checks if the length of a class exceeds some maximum value. +# Comment lines can optionally be ignored. +# The maximum allowed length is configurable. +# +# You can set constructs you want to fold with `CountAsOne`. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. +# +# NOTE: This cop also applies for `Struct` definitions. +# +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] +# +# class Foo +# ARRAY = [ # +1 +# 1, +# 2 +# ] +# +# HASH = { # +1 +# key: 'value' +# } +# +# MSG = <<~HEREDOC # +1 +# Heredoc +# content. +# HEREDOC +# +# foo( # +1 +# 1, +# 2 +# ) +# end # 4 points +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/class_length.rb:40 +class RuboCop::Cop::Metrics::ClassLength < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CodeLength + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/class_length.rb:53 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/class_length.rb:43 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/class_length.rb:47 + def on_sclass(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/class_length.rb:67 + def find_expression_within_parent(parent); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/class_length.rb:63 + def message(length, max_length); end +end + +# Checks for literals with extremely many entries. This is indicative of +# configuration or data that may be better extracted somewhere else, like +# a database, fetched from an API, or read from a non-code file (CSV, +# JSON, YAML, etc.). +# +# @example +# # bad +# # Huge Array literal +# [1, 2, '...', 999_999_999] +# +# # bad +# # Huge Hash literal +# { 1 => 1, 2 => 2, '...' => '...', 999_999_999 => 999_999_999} +# +# # bad +# # Huge Set "literal" +# Set[1, 2, '...', 999_999_999] +# +# # good +# # Reasonably sized Array literal +# [1, 2, '...', 10] +# +# # good +# # Reading huge Array from external data source +# # File.readlines('numbers.txt', chomp: true).map!(&:to_i) +# +# # good +# # Reasonably sized Hash literal +# { 1 => 1, 2 => 2, '...' => '...', 10 => 10} +# +# # good +# # Reading huge Hash from external data source +# CSV.foreach('numbers.csv', headers: true).each_with_object({}) do |row, hash| +# hash[row["key"].to_i] = row["value"].to_i +# end +# +# # good +# # Reasonably sized Set "literal" +# Set[1, 2, '...', 10] +# +# # good +# # Reading huge Set from external data source +# SomeFramework.config_for(:something)[:numbers].to_set +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:50 +class RuboCop::Cop::Metrics::CollectionLiteralLength < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:60 + def on_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:63 + def on_hash(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:65 + def on_index(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:71 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:56 + def set_const?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:77 + def collection_threshold; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:51 +RuboCop::Cop::Metrics::CollectionLiteralLength::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/collection_literal_length.rb:53 +RuboCop::Cop::Metrics::CollectionLiteralLength::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that the cyclomatic complexity of methods is not higher +# than the configured maximum. The cyclomatic complexity is the number of +# linearly independent paths through a method. The algorithm counts +# decision points and adds one. +# +# An if statement (or unless or ?:) increases the complexity by one. An +# else branch does not, since it doesn't add a decision point. The && +# operator (or keyword and) can be converted to a nested if statement, +# and ||/or is shorthand for a sequence of ifs, so they also add one. +# Loops can be said to have an exit condition, so they add one. +# Blocks that are calls to builtin iteration methods +# (e.g. `ary.map{...}`) also add one, others are ignored. +# +# @example +# +# def each_child_node(*types) # count begins: 1 +# unless block_given? # unless: +1 +# return to_enum(__method__, *types) +# end +# +# children.each do |child| # each{}: +1 +# next unless child.is_a?(Node) # unless: +1 +# +# yield child if types.empty? || # if: +1, ||: +1 +# types.include?(child.type) +# end +# +# self +# end # total: 6 +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/cyclomatic_complexity.rb:35 +class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount + include ::RuboCop::Cop::MethodComplexity + include ::RuboCop::Cop::Metrics::Utils::IteratingBlock + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/cyclomatic_complexity.rb:45 + def complexity_score_for(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/cyclomatic_complexity.rb:52 + def count_block?(block); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/cyclomatic_complexity.rb:40 +RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/cyclomatic_complexity.rb:39 +RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) + +# Checks if the length of a method exceeds some maximum value. +# Comment lines can optionally be allowed. +# The maximum allowed length is configurable. +# +# You can set constructs you want to fold with `CountAsOne`. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. +# +# NOTE: The `ExcludedMethods` and `IgnoredMethods` configuration is +# deprecated and only kept for backwards compatibility. +# Please use `AllowedMethods` and `AllowedPatterns` instead. +# By default, there are no allowed methods. +# +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] +# +# def m +# array = [ # +1 +# 1, +# 2 +# ] +# +# hash = { # +1 +# key: 'value' +# } +# +# <<~HEREDOC # +1 +# Heredoc +# content. +# HEREDOC +# +# foo( # +1 +# 1, +# 2 +# ) +# end # 4 points +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:43 +class RuboCop::Cop::Metrics::MethodLength < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CodeLength + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:57 + def on_block(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:50 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:55 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:66 + def on_itblock(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:65 + def on_numblock(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:74 + def allowed?(method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:70 + def cop_label; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/method_length.rb:48 +RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) + +# Checks if the length of a module exceeds some maximum value. +# Comment lines can optionally be ignored. +# The maximum allowed length is configurable. +# +# You can set constructs you want to fold with `CountAsOne`. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. +# +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] +# +# module M +# ARRAY = [ # +1 +# 1, +# 2 +# ] +# +# HASH = { # +1 +# key: 'value' +# } +# +# MSG = <<~HEREDOC # +1 +# Heredoc +# content. +# HEREDOC +# +# foo( # +1 +# 1, +# 2 +# ) +# end # 4 points +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/module_length.rb:38 +class RuboCop::Cop::Metrics::ModuleLength < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CodeLength + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/module_length.rb:52 + def module_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/module_length.rb:45 + def on_casgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/module_length.rb:41 + def on_module(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/module_length.rb:56 + def message(length, max_length); end +end + +# Checks for methods with too many parameters. +# +# The maximum number of parameters is configurable. +# Keyword arguments can optionally be excluded from the total count, +# as they add less complexity than positional or optional parameters. +# +# Any number of arguments for `initialize` method inside a block of +# `Struct.new` and `Data.define` like this is always allowed: +# +# [source,ruby] +# ---- +# Struct.new(:one, :two, :three, :four, :five, keyword_init: true) do +# def initialize(one:, two:, three:, four:, five:) +# end +# end +# ---- +# +# This is because checking the number of arguments of the `initialize` method +# does not make sense. +# +# NOTE: Explicit block argument `&block` is not counted to prevent +# erroneous change that is avoided by making block argument implicit. +# +# @example Max: 3 +# # good +# def foo(a, b, c = 1) +# end +# +# @example Max: 2 +# # bad +# def foo(a, b, c = 1) +# end +# +# @example CountKeywordArgs: true (default) +# # counts keyword args towards the maximum +# +# # bad (assuming Max is 3) +# def foo(a, b, c, d: 1) +# end +# +# # good (assuming Max is 3) +# def foo(a, b, c: 1) +# end +# +# @example CountKeywordArgs: false +# # don't count keyword args towards the maximum +# +# # good (assuming Max is 3) +# def foo(a, b, c, d: 1) +# end +# +# This cop also checks for the maximum number of optional parameters. +# This can be configured using the `MaxOptionalParameters` config option. +# +# @example MaxOptionalParameters: 3 (default) +# # good +# def foo(a = 1, b = 2, c = 3) +# end +# +# @example MaxOptionalParameters: 2 +# # bad +# def foo(a = 1, b = 2, c = 3) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:70 +class RuboCop::Cop::Metrics::ParameterLists < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:121 + def argument_to_lambda_or_proc?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:71 + def max=(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:72 + def max_optional_parameters=(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:104 + def on_args(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:90 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:102 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:81 + def struct_new_or_data_define_block?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:125 + def args_count(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:141 + def count_keyword_args?; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:137 + def max_optional_parameters; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:133 + def max_params; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:74 +RuboCop::Cop::Metrics::ParameterLists::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:77 +RuboCop::Cop::Metrics::ParameterLists::NAMED_KEYWORD_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/parameter_lists.rb:75 +RuboCop::Cop::Metrics::ParameterLists::OPTIONAL_PARAMETERS_MSG = T.let(T.unsafe(nil), String) + +# Tries to produce a complexity score that's a measure of the +# complexity the reader experiences when looking at a method. For that +# reason it considers `when` nodes as something that doesn't add as much +# complexity as an `if` or a `&&`. Except if it's one of those special +# `case`/`when` constructs where there's no expression after `case`. Then +# the cop treats it as an `if`/`elsif`/`elsif`... and lets all the `when` +# nodes count. In contrast to the CyclomaticComplexity cop, this cop +# considers `else` nodes as adding complexity. +# +# A `case`/`in` branch whose pattern is a simple literal (e.g. `in 1`, `in "red"`, `in 1..10`) +# or a constant/type (e.g. `in Integer`) and has no guard is just as easy to read as a `when` +# branch, so it is discounted the same way. Branches with structural patterns (e.g. array, +# hash, or find patterns), bindings, alternatives, or a guard add the full complexity of +# a decision point. +# +# @example +# +# def example_1 # 1 +# if cond # 1 +# case var # 2 (0.8 + 4 * 0.2, rounded) +# when 1 then func_one +# when 2 then func_two +# when 3 then func_three +# when 4..10 then func_other +# end +# else # 1 +# do_something until a && b # 2 +# end # === +# end # 7 complexity points +# +# def example_2 # 1 +# case color # 1 (3 * 0.2, rounded) +# in "red" then func_red +# in "blue" then func_blue +# in "green" then func_green +# end # === +# end # 2 complexity points +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/perceived_complexity.rb:43 +class RuboCop::Cop::Metrics::PerceivedComplexity < ::RuboCop::Cop::Metrics::CyclomaticComplexity + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/perceived_complexity.rb:53 + def complexity_score_for(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/perceived_complexity.rb:79 + def simple_in_pattern?(in_pattern_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/perceived_complexity.rb:46 +RuboCop::Cop::Metrics::PerceivedComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/perceived_complexity.rb:44 +RuboCop::Cop::Metrics::PerceivedComplexity::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb:6 +module RuboCop::Cop::Metrics::Utils; end + +# > ABC is .. a software size metric .. computed by counting the number +# > of assignments, branches and conditions for a section of code. +# > http://c2.com/cgi/wiki?AbcMetric +# +# We separate the *calculator* from the *cop* so that the calculation, +# the formula itself, is easier to test. +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:13 +class RuboCop::Cop::Metrics::Utils::AbcSizeCalculator + include ::RuboCop::AST::Sexp + include ::RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount + include ::RuboCop::Cop::Metrics::Utils::IteratingBlock + include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:34 + def initialize(node, discount_repeated_attributes: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:42 + def calculate; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:76 + def calculate_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:65 + def else_branch?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:51 + def evaluate_branch_nodes(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:60 + def evaluate_condition_node(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:128 + def argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:86 + def assignment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:124 + def branch?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:120 + def capturing_variable?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:98 + def compound_assignment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:132 + def condition?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:109 + def simple_assignment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:71 + def visit_depth_last(node, &block); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:30 + def calculate(node, discount_repeated_attributes: T.unsafe(nil)); end + end +end + +# > Branch -- an explicit forward program branch out of scope -- a +# > function call, class method call .. +# > http://c2.com/cgi/wiki?AbcMetric +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:21 +RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::BRANCH_NODES = T.let(T.unsafe(nil), Array) + +# > Condition -- a logical/Boolean test, == != <= >= < > else case +# > default try catch ? and unary conditionals. +# > http://c2.com/cgi/wiki?AbcMetric +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/abc_size_calculator.rb:26 +RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::CONDITION_NODES = T.let(T.unsafe(nil), Array) + +# Helps to calculate code length for the provided node. +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:8 +class RuboCop::Cop::Metrics::Utils::CodeLengthCalculator + include ::RuboCop::PathUtil + include ::RuboCop::Cop::Util + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:16 + def initialize(node, processed_source, count_comments: T.unsafe(nil), foldable_types: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:24 + def calculate; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:181 + def another_args?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:42 + def build_foldable_checks(types); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:90 + def classlike_code_length(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:138 + def classlike_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:66 + def code_length(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:162 + def count_comments?; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:126 + def each_top_level_descendant(node, types, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:146 + def extract_body(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:142 + def foldable_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:121 + def heredoc_length(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:86 + def heredoc_node?(node); end + + # Returns true for lines that shall not be included in the count. + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:158 + def irrelevant_line?(source_line); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:110 + def line_numbers_of_inner_nodes(node, *types); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:106 + def namespace_module?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:185 + def node_with_heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:60 + def normalize_foldable_types(types); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:166 + def omit_length(descendant); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:177 + def parenthesized?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:189 + def source_from_node_with_heredoc(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:13 +RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::CLASSLIKE_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/code_length_calculator.rb:12 +RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::FOLDABLE_TYPES = T.let(T.unsafe(nil), Array) + +# Used to identify iterating blocks like `.map{}` and `.map(&:...)` +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/iterating_block.rb:8 +module RuboCop::Cop::Metrics::Utils::IteratingBlock + # Returns the name of the method called with a block + # if node is a block node, or a block-pass node. + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/iterating_block.rb:37 + def block_method_name(node); end + + # Returns nil if node is neither a block node or a block-pass node. + # Otherwise returns true/false if method call is a known iterating call + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/iterating_block.rb:53 + def iterating_block?(node); end + + # Returns true only when name is a known iterating type (e.g. :each, :transform_values). + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/iterating_block.rb:47 + def iterating_method?(name); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/iterating_block.rb:33 +RuboCop::Cop::Metrics::Utils::IteratingBlock::KNOWN_ITERATING_METHODS = T.let(T.unsafe(nil), Set) + +# @api private +# +# Identifies repetitions `{c}send` calls with no arguments: +# +# foo.bar +# foo.bar # => repeated +# foo.bar.baz.qux # => inner send repeated +# foo.bar.baz.other # => both inner send repeated +# foo.bar(2) # => not repeated +# +# It also invalidates sequences if a receiver is reassigned: +# +# xx.foo.bar +# xx.foo.baz # => inner send repeated +# self.xx = any # => invalidates everything so far +# xx.foo.baz # => no repetition +# self.xx.foo.baz # => all repeated +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:25 +module RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount + include ::RuboCop::AST::Sexp + extend ::RuboCop::AST::NodePattern::Macros + + # Plug into the calculator + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:37 + def initialize(node, discount_repeated_attributes: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:68 + def attribute_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:60 + def calculate_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:50 + def discount_repeated_attributes?; end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:54 + def evaluate_branch_nodes(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:99 + def root_node?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:73 + def discount_repeated_attribute?(send_node); end + + # Returns the "known_attributes" for the `node` by walking the receiver tree + # If at any step the subdirectory does not exist, it is yielded with the + # associated key (method_name) + # If the node is not a series of `(c)send` calls with no arguments, + # then `nil` is yielded + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:110 + def find_attributes(node, &block); end + + # @returns `[receiver, method | nil]` for the given setter `node` + # or `nil` if it is not a setter. + # + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:126 + def setter_to_getter(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:87 + def update_repeated_attribute(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb:29 +RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount::VAR_SETTER_TO_GETTER = T.let(T.unsafe(nil), Hash) + +# @api private +# +# Identifies repetitions `&.` on the same variable: +# +# my_var&.foo +# my_var&.bar # => repeated +# my_var = baz # => reset +# my_var&.qux # => not repeated +# +# pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb:15 +module RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb:20 + def discount_for_repeated_csend?(csend_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb:34 + def reset_on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb:16 + def reset_repeated_csend; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:8 +module RuboCop::Cop::Migration; end + +# department name. +# +# @example +# # bad +# +# # good +# +# pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:18 +class RuboCop::Cop::Migration::DepartmentName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:31 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:57 + def check_cop_name(name, comment, offset); end + + # pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:79 + def contain_unexpected_character_for_department_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:53 + def disable_comment_offset; end + + # pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:83 + def qualified_legacy_cop_name(cop_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:73 + def valid_content_token?(content_token); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:24 +RuboCop::Cop::Migration::DepartmentName::DISABLE_COMMENT_FORMAT = T.let(T.unsafe(nil), Regexp) + +# The token that makes up a disable comment. +# `DepartmentName/CopName` or` all`. +# +# pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:29 +RuboCop::Cop::Migration::DepartmentName::DISABLING_COPS_CONTENT_TOKEN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop#lib/rubocop/cop/migration/department_name.rb:22 +RuboCop::Cop::Migration::DepartmentName::MSG = T.let(T.unsafe(nil), String) + +# Common functionality for checking minimum body length. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/min_body_length.rb:6 +module RuboCop::Cop::MinBodyLength + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/min_body_length.rb:13 + def min_body_length; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/min_body_length.rb:9 + def min_body_length?(node); end +end + +# Common functionality for checking minimum branches count. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/min_branches_count.rb:6 +module RuboCop::Cop::MinBranchesCount + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/min_branches_count.rb:29 + def if_conditional_branches(node, branches = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/min_branches_count.rb:22 + def min_branches_count; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/min_branches_count.rb:9 + def min_branches_count?(node); end +end + +# Common code for indenting the first elements in multiline +# array literals, hash literals, and method definitions. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:7 +module RuboCop::Cop::MultilineElementIndentation + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:42 + def check_expected_style(styles); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:26 + def check_first(first, left_brace, left_parenthesis, offset); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:80 + def detected_styles(actual_column, offset, left_parenthesis, left_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:85 + def detected_styles_for_column(column, left_parenthesis, left_brace); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:10 + def each_argument_node(node, type); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:66 + def hash_pair_where_value_beginning_with(left_brace, first); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:98 + def incorrect_style_detected(styles, first, base_column_type); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:50 + def indent_base(left_brace, first, left_parenthesis); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:72 + def key_and_value_begin_on_same_line?(pair); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_indentation.rb:76 + def right_sibling_begins_on_subsequent_line?(pair); end +end + +# Common functionality for checking for a line break before each +# element in a multi-line collection. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_line_breaks.rb:7 +module RuboCop::Cop::MultilineElementLineBreaks + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_line_breaks.rb:23 + def all_on_same_line?(nodes, ignore_last: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_element_line_breaks.rb:10 + def check_line_breaks(_node, children, ignore_last: T.unsafe(nil)); end +end + +# Common functionality for checking multiline method calls and binary +# operations. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:7 +module RuboCop::Cop::MultilineExpressionIndentation + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:25 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:14 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:132 + def argument_in_method_call(node, kind); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:188 + def assignment_rhs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:67 + def check(range, node, lhs, rhs); end + + # The correct indentation of `node` is usually `IndentationWidth`, with + # one exception: prefix keywords. + # + # ``` + # while foo && # Here, `while` is called a "prefix keyword" + # bar # This is called "special indentation" + # baz + # end + # ``` + # + # Note that *postfix conditionals* do *not* get "special indentation". + # + # ``` + # next if foo && + # bar # normal indentation, not special + # ``` + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:57 + def correct_indentation(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:160 + def disqualified_rhs?(candidate, ancestor); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:202 + def grouped_expression?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:75 + def incorrect_style_detected(range, node, lhs, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:87 + def indentation(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:124 + def indented_keyword_expression(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:206 + def inside_arg_list_parentheses?(node, ancestor); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:101 + def keyword_message_tail(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:109 + def kw_node_with_special_indentation(node); end + + # In a chain of method calls, we regard the top call node as the base + # for indentation of all lines following the first. For example: + # a. + # b c { block }. <-- b is indented relative to a + # d <-- d is indented relative to a + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:34 + def left_hand_side(lhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:196 + def not_for_this_cop?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:91 + def operation_description(node, rhs); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:146 + def part_of_assignment_rhs(node, candidate); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:184 + def part_of_block_body?(candidate, block_node); end + + # Returns true if `node` is a conditional whose `body` and `condition` + # begin on the same line. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:215 + def postfix_conditional?(node); end + + # The []= operator and setters (a.b = c) are parsed as :send nodes. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:176 + def valid_method_rhs_candidate?(candidate, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:165 + def valid_rhs?(candidate, ancestor); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:180 + def valid_rhs_candidate?(candidate, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:219 + def within_node?(inner, outer); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:11 +RuboCop::Cop::MultilineExpressionIndentation::ASSIGNMENT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:10 +RuboCop::Cop::MultilineExpressionIndentation::DEFAULT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:8 +RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:12 +RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_MESSAGE_TAIL = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_expression_indentation.rb:9 +RuboCop::Cop::MultilineExpressionIndentation::UNALIGNED_RHS_TYPES = T.let(T.unsafe(nil), Array) + +# Autocorrection logic for the closing brace of a literal either +# on the same line as the last contained elements, or a new line. +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:7 +class RuboCop::Cop::MultilineLiteralBraceCorrector + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::MultilineLiteralBraceLayout + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:15 + def initialize(corrector, node, processed_source); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:21 + def call; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:61 + def content_if_comment_present(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:51 + def correct_heredoc_argument_method_chain(corrector, end_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:46 + def correct_next_line_brace(corrector, end_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:42 + def correct_same_line_brace(corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:40 + def corrector; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:90 + def last_element_range_with_trailing_comma(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:99 + def last_element_trailing_comma_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:40 + def node; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:40 + def processed_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:86 + def remove_trailing_content_of_comment(corrector, range); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:76 + def select_content_to_be_inserted_after_last_element(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:69 + def use_heredoc_argument_method_chain?(parent); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb:11 + def correct(corrector, node, processed_source); end + end +end + +# Common functionality for checking the closing brace of a literal is +# either on the same line as the last contained elements or a new line. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:7 +module RuboCop::Cop::MultilineLiteralBraceLayout + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:34 + def check(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:12 + def check_brace_layout(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:42 + def check_new_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:50 + def check_same_line(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:58 + def check_symmetrical(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:86 + def children(node); end + + # This method depends on the fact that we have guarded + # against implicit and empty literals. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:98 + def closing_brace_on_same_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:74 + def empty_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:82 + def ignored_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:78 + def implicit_literal?(node); end + + # Starting with the parent node and recursively for the parent node's + # children, check if the node is a HEREDOC and if the HEREDOC ends below + # or on the last line of the parent node. + # + # Example: + # + # # node is `b: ...` parameter + # # last_line_heredoc?(node) => false + # foo(a, + # b: { + # a: 1, + # c: <<-EOM + # baz + # EOM + # } + # ) + # + # # node is `b: ...` parameter + # # last_line_heredoc?(node) => true + # foo(a, + # b: <<-EOM + # baz + # EOM + # ) + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:126 + def last_line_heredoc?(node, parent = T.unsafe(nil)); end + + # Returns true for the case + # [a, + # b # comment + # ].some_method + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:26 + def new_line_needed_before_closing_brace?(node); end + + # This method depends on the fact that we have guarded + # against implicit and empty literals. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb:92 + def opening_brace_on_same_line?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:5 +module RuboCop::Cop::Naming; end + +# Avoid prefixing accessor method names with `get_` or `set_`. +# Applies to both instance and class methods. +# +# NOTE: Method names starting with `get_` or `set_` only register an offense +# when the methods match the expected arity for getters and setters respectively. +# Getters (`get_attribute`) must have no arguments to be registered, +# and setters (`set_attribute(value)`) must have exactly one. +# +# @example +# # bad +# def set_attribute(value) +# end +# +# # good +# def attribute=(value) +# end +# +# # bad +# def get_attribute +# end +# +# # good +# def attribute +# end +# +# # accepted, incorrect arity for getter +# def get_value(attr) +# end +# +# # accepted, incorrect arity for setter +# def set_value +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:38 +class RuboCop::Cop::Naming::AccessorMethodName < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:42 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:50 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:66 + def bad_reader_name?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:70 + def bad_writer_name?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:54 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:62 + def proper_attribute_name?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:39 +RuboCop::Cop::Naming::AccessorMethodName::MSG_READER = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/accessor_method_name.rb:40 +RuboCop::Cop::Naming::AccessorMethodName::MSG_WRITER = T.let(T.unsafe(nil), String) + +# Checks for non-ascii characters in identifier and constant names. +# Identifiers are always checked and whether constants are checked +# can be controlled using AsciiConstants config. +# +# @example +# # bad +# def καλημερα # Greek alphabet (non-ascii) +# end +# +# # bad +# def こんにちはと言う # Japanese character (non-ascii) +# end +# +# # bad +# def hello_🍣 # Emoji (non-ascii) +# end +# +# # good +# def say_hello +# end +# +# # bad +# 신장 = 10 # Hangul character (non-ascii) +# +# # good +# height = 10 +# +# # bad +# params[:عرض_gteq] # Arabic character (non-ascii) +# +# # good +# params[:width_gteq] +# +# @example AsciiConstants: true (default) +# # bad +# class Foö +# end +# +# FOÖ = "foo" +# +# @example AsciiConstants: false +# # good +# class Foö +# end +# +# FOÖ = "foo" +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:53 +class RuboCop::Cop::Naming::AsciiIdentifiers < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:59 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:84 + def first_non_ascii_chars(string); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:74 + def first_offense_range(identifier); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:70 + def should_check?(token); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:57 +RuboCop::Cop::Naming::AsciiIdentifiers::CONSTANT_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/ascii_identifiers.rb:56 +RuboCop::Cop::Naming::AsciiIdentifiers::IDENTIFIER_MSG = T.let(T.unsafe(nil), String) + +# Makes sure that certain binary operator methods have their +# sole parameter named `other`. +# +# @example +# +# # bad +# def +(amount); end +# +# # good +# def +(other); end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:16 +class RuboCop::Cop::Naming::BinaryOperatorParameterName < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:29 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:25 + def op_method_candidate?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:45 + def op_method?(name); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:22 +RuboCop::Cop::Naming::BinaryOperatorParameterName::EXCLUDED = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:19 +RuboCop::Cop::Naming::BinaryOperatorParameterName::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/binary_operator_parameter_name.rb:21 +RuboCop::Cop::Naming::BinaryOperatorParameterName::OP_LIKE_METHODS = T.let(T.unsafe(nil), Array) + +# In Ruby 3.1, anonymous block forwarding has been added. +# +# This cop identifies places where `do_something(&block)` can be replaced +# by `do_something(&)`. +# +# It also supports the opposite style by alternative `explicit` option. +# You can specify the block variable name for autocorrection with `BlockForwardingName`. +# The default variable name is `block`. If the name is already in use, it will not be +# autocorrected. +# +# [NOTE] +# ==== +# Because of a bug in Ruby 3.3.0, when a block is referenced inside of another block, +# no offense will be registered until Ruby 3.4: +# +# [source,ruby] +# ---- +# def foo(&block) +# # Using an anonymous block would be a syntax error on Ruby 3.3.0 +# block_method { bar(&block) } +# end +# ---- +# ==== +# +# @example EnforcedStyle: anonymous (default) +# +# # bad +# def foo(&block) +# bar(&block) +# end +# +# # good +# def foo(&) +# bar(&) +# end +# +# @example EnforcedStyle: explicit +# +# # bad +# def foo(&) +# bar(&) +# end +# +# # good +# def foo(&block) +# bar(&block) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:54 +class RuboCop::Cop::Naming::BlockForwarding < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:68 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:87 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:118 + def anonymous_block_argument?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:101 + def block_argument_name_matched?(block_pass_node, last_argument); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:150 + def block_forwarding_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:91 + def expected_block_forwarding_style?(node, last_argument); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:122 + def explicit_block_argument?(node); end + + # Ruby 3.3.0 had a bug where accessing an anonymous block argument inside of a block + # was a syntax error in unambiguous cases: https://bugs.ruby-lang.org/issues/20090 + # We disallow this also for earlier Ruby versions so that code is forwards compatible. + # + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:110 + def invalidates_syntax?(block_pass_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:126 + def register_offense(block_argument, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:142 + def use_block_argument_as_local_variable?(node, last_argument); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:114 + def use_kwarg_in_method_definition?(node); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:64 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/block_forwarding.rb:62 +RuboCop::Cop::Naming::BlockForwarding::MSG = T.let(T.unsafe(nil), String) + +# Checks block parameter names for how descriptive they +# are. It is highly configurable. +# +# The `MinNameLength` config option takes an integer. It represents +# the minimum amount of characters the name must be. Its default is 1. +# The `AllowNamesEndingInNumbers` config option takes a boolean. When +# set to false, this cop will register offenses for names ending with +# numbers. Its default is false. The `AllowedNames` config option +# takes an array of permitted names that will never register an +# offense. The `ForbiddenNames` config option takes an array of +# restricted names that will always register an offense. +# +# @example +# # bad +# bar do |varOne, varTwo| +# varOne + varTwo +# end +# +# # With `AllowNamesEndingInNumbers` set to false +# foo { |num1, num2| num1 * num2 } +# +# # With `MinNameLength` set to number greater than 1 +# baz { |a, b, c| do_stuff(a, b, c) } +# +# # good +# bar do |thud, fred| +# thud + fred +# end +# +# foo { |speed, distance| speed * distance } +# +# baz { |age, height, gender| do_stuff(age, height, gender) } +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/block_parameter_name.rb:38 +class RuboCop::Cop::Naming::BlockParameterName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::UncommunicativeName + + # pkg:gem/rubocop#lib/rubocop/cop/naming/block_parameter_name.rb:41 + def on_block(node); end +end + +# Checks for class and module names with +# an underscore in them. +# +# `AllowedNames` config takes an array of permitted names. +# Its default value is `['module_parent']`. +# These names can be full class/module names or part of the name. +# eg. Adding `my_class` to the `AllowedNames` config will allow names like +# `my_class`, `my_class::User`, `App::my_class`, `App::my_class::User`, etc. +# +# @example +# # bad +# class My_Class +# end +# module My_Module +# end +# +# # good +# class MyClass +# end +# module MyModule +# end +# class module_parent::MyModule +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/class_and_module_camel_case.rb:29 +class RuboCop::Cop::Naming::ClassAndModuleCamelCase < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/naming/class_and_module_camel_case.rb:32 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/class_and_module_camel_case.rb:41 + def on_module(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/class_and_module_camel_case.rb:30 +RuboCop::Cop::Naming::ClassAndModuleCamelCase::MSG = T.let(T.unsafe(nil), String) + +# Checks whether constant names are written using +# SCREAMING_SNAKE_CASE. +# +# To avoid false positives, it ignores cases in which we cannot know +# for certain the type of value that would be assigned to a constant. +# +# @example +# # bad +# InchInCm = 2.54 +# INCHinCM = 2.54 +# Inch_In_Cm = 2.54 +# +# # good +# INCH_IN_CM = 2.54 +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:20 +class RuboCop::Cop::Naming::ConstantName < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:27 + def class_or_struct_return_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:67 + def literal_receiver?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:33 + def on_casgn(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:55 + def allowed_assignment?(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:72 + def allowed_conditional_expression_on_rhs?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:62 + def allowed_method_call_on_rhs?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:76 + def contains_constant?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:21 +RuboCop::Cop::Naming::ConstantName::MSG = T.let(T.unsafe(nil), String) + +# Use POSIX character classes, so we allow accented characters rather +# than just standard ASCII characters +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/constant_name.rb:24 +RuboCop::Cop::Naming::ConstantName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) + +# Makes sure that Ruby source files have snake_case +# names. Ruby scripts (i.e. source files with a shebang in the +# first line) are ignored. +# +# The cop also ignores `.gemspec` files, because Bundler +# recommends using dashes to separate namespaces in nested gems +# (i.e. `bundler-console` becomes `Bundler::Console`). As such, the +# gemspec is supposed to be named `bundler-console.gemspec`. +# +# When `ExpectMatchingDefinition` (default: `false`) is `true`, the cop requires +# each file to have a class, module or `Struct` defined in it that matches +# the filename. This can be further configured using +# `CheckDefinitionPathHierarchy` (default: `true`) to determine whether the +# path should match the namespace of the above definition. +# +# When `IgnoreExecutableScripts` (default: `true`) is `true`, files that start +# with a shebang line are not considered by the cop. +# +# When `Regex` is set, the cop will flag any filename that does not match +# the regular expression. +# +# @example +# # bad +# lib/layoutManager.rb +# +# anything/usingCamelCase +# +# # good +# lib/layout_manager.rb +# +# anything/using_snake_case.rake +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:39 +class RuboCop::Cop::Naming::FileName < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:54 + def on_new_investigation; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:47 + def struct_definition(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:132 + def allowed_acronyms; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:94 + def bad_filename_allowed?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:120 + def check_definition_path_hierarchy?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:167 + def defined_struct(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:124 + def definition_path_hierarchy_roots; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:116 + def expect_matching_definition?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:136 + def filename_good?(basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:145 + def find_class_or_module(node, namespace); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:163 + def find_definition(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:63 + def for_bad_filename(file_path); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:112 + def ignore_executable_scripts?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:200 + def match?(expected); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:204 + def match_acronym?(expected, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:90 + def matching_class?(file_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:86 + def matching_definition?(file_path); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:172 + def namespace_matches?(node, namespace, expected); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:98 + def no_definition_message(basename, file_path); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:104 + def other_message(basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:186 + def partial_matcher!(expected); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:75 + def perform_class_and_module_naming_checks(file_path, basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:128 + def regex; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:239 + def to_module_name(basename); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:212 + def to_namespace(path); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:41 +RuboCop::Cop::Naming::FileName::MSG_NO_DEFINITION = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:42 +RuboCop::Cop::Naming::FileName::MSG_REGEX = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:40 +RuboCop::Cop::Naming::FileName::MSG_SNAKE_CASE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/file_name.rb:44 +RuboCop::Cop::Naming::FileName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) + +# Checks that your heredocs are using the configured case. +# By default it is configured to enforce uppercase heredocs. +# +# @example EnforcedStyle: uppercase (default) +# # bad +# <<-sql +# SELECT * FROM foo +# sql +# +# # good +# <<-SQL +# SELECT * FROM foo +# SQL +# +# @example EnforcedStyle: lowercase +# # bad +# <<-SQL +# SELECT * FROM foo +# SQL +# +# # good +# <<-sql +# SELECT * FROM foo +# sql +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_case.rb:30 +class RuboCop::Cop::Naming::HeredocDelimiterCase < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Heredoc + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_case.rb:37 + def on_heredoc(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_case.rb:54 + def correct_case_delimiters?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_case.rb:58 + def correct_delimiters(source); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_case.rb:50 + def message(_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_case.rb:35 +RuboCop::Cop::Naming::HeredocDelimiterCase::MSG = T.let(T.unsafe(nil), String) + +# Checks that your heredocs are using meaningful delimiters. +# By default it disallows `END` and `EO*`, and can be configured through +# forbidden listing additional delimiters. +# +# @example +# +# # good +# <<-SQL +# SELECT * FROM foo +# SQL +# +# # bad +# <<-END +# SELECT * FROM foo +# END +# +# # bad +# <<-EOS +# SELECT * FROM foo +# EOS +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_naming.rb:26 +class RuboCop::Cop::Naming::HeredocDelimiterNaming < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Heredoc + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_naming.rb:31 + def on_heredoc(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_naming.rb:51 + def forbidden_delimiters; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_naming.rb:41 + def meaningful_delimiters?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/heredoc_delimiter_naming.rb:29 +RuboCop::Cop::Naming::HeredocDelimiterNaming::MSG = T.let(T.unsafe(nil), String) + +# Recommends the use of inclusive language instead of problematic terms. +# The cop can check the following locations for offenses: +# +# - identifiers +# - constants +# - variables +# - strings +# - symbols +# - comments +# - file paths +# +# Each of these locations can be individually enabled/disabled via configuration, +# for example CheckIdentifiers = true/false. +# +# Flagged terms are configurable for the cop. For each flagged term an optional +# Regex can be specified to identify offenses. Suggestions for replacing a flagged term can +# be configured and will be displayed as part of the offense message. +# An AllowedRegex can be specified for a flagged term to exempt allowed uses of the term. +# `WholeWord: true` can be set on a flagged term to indicate the cop should only match when +# a term matches the whole word (partial matches will not be offenses). +# +# The cop supports autocorrection when there is only one suggestion. When there are multiple +# suggestions, the best suggestion cannot be identified and will not be autocorrected. +# +# @example FlaggedTerms: { whitelist: { Suggestions: ['allowlist'] } } +# # Suggest replacing identifier whitelist with allowlist +# +# # bad +# whitelist_users = %w(user1 user1) +# +# # good +# allowlist_users = %w(user1 user2) +# +# @example FlaggedTerms: { master: { Suggestions: ['main', 'primary', 'leader'] } } +# # Suggest replacing master in an instance variable name with main, primary, or leader +# +# # bad +# @master_node = 'node1.example.com' +# +# # good +# @primary_node = 'node1.example.com' +# +# @example FlaggedTerms: { whitelist: { Regex: !ruby/regexp '/white[-_\s]?list' } } +# # Identify problematic terms using a Regexp +# +# # bad +# white_list = %w(user1 user2) +# +# # good +# allow_list = %w(user1 user2) +# +# @example FlaggedTerms: { master: { AllowedRegex: 'master\'?s degree' } } +# # Specify allowed uses of the flagged term as a string or regexp. +# +# # bad +# # They had a masters +# +# # good +# # They had a master's degree +# +# @example FlaggedTerms: { slave: { WholeWord: true } } +# # Specify that only terms that are full matches will be flagged. +# +# # bad +# Slave +# +# # good (won't be flagged despite containing `slave`) +# TeslaVehicle +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:74 +class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:84 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:93 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:113 + def add_offenses_for_token(token, word_locations); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:178 + def add_to_flagged_term_hash(regex_string, term, term_definition); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:208 + def array_to_ignorecase_regex(strings); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:128 + def check_token?(type); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:258 + def create_message(word, message = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:232 + def create_multiple_word_message_for_file(words); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:228 + def create_single_word_message_for_file(word); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:204 + def ensure_regex_string(regex); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:171 + def extract_regexp(term, term_definition); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:266 + def find_flagged_term(word); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:280 + def format_suggestions(suggestions); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:212 + def investigate_filepath; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:102 + def investigate_tokens; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:246 + def mask_input(str); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:295 + def offense_range(token, word); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:162 + def preferred_sole_term(suggestions); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:132 + def preprocess_check_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:146 + def preprocess_flagged_terms; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:273 + def preprocess_suggestions(suggestions); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:194 + def process_allowed_regex(allowed); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:236 + def scan_for_words(input); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:185 + def set_regexes(flagged_term_strings, allowed_strings); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:78 +RuboCop::Cop::Naming::InclusiveLanguage::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:79 +RuboCop::Cop::Naming::InclusiveLanguage::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:80 +RuboCop::Cop::Naming::InclusiveLanguage::MSG_FOR_FILE_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 +class RuboCop::Cop::Naming::InclusiveLanguage::WordLocation < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def position; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def position=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def word; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def word=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/inclusive_language.rb:82 + def new(*_arg0); end + end +end + +# Checks for memoized methods whose instance variable name +# does not match the method name. Applies to both regular methods +# (defined with `def`) and dynamic methods (defined with +# `define_method` or `define_singleton_method`). +# +# This cop can be configured with the EnforcedStyleForLeadingUnderscores +# directive. It can be configured to allow for memoized instance variables +# prefixed with an underscore. Prefixing ivars with an underscore is a +# convention that is used to implicitly indicate that an ivar should not +# be set or referenced outside of the memoization method. +# +# @safety +# This cop relies on the pattern `@instance_var ||= ...`, +# but this is sometimes used for other purposes than memoization +# so this cop is considered unsafe. Also, its autocorrection is unsafe +# because it may conflict with instance variable names already in use. +# +# @example EnforcedStyleForLeadingUnderscores: disallowed (default) +# # bad +# # Method foo is memoized using an instance variable that is +# # not `@foo`. This can cause confusion and bugs. +# def foo +# @something ||= calculate_expensive_thing +# end +# +# def foo +# return @something if defined?(@something) +# @something = calculate_expensive_thing +# end +# +# # good +# def _foo +# @foo ||= calculate_expensive_thing +# end +# +# # good +# def foo +# @foo ||= calculate_expensive_thing +# end +# +# # good +# def foo +# @foo ||= begin +# calculate_expensive_thing +# end +# end +# +# # good +# def foo +# helper_variable = something_we_need_to_calculate_foo +# @foo ||= calculate_expensive_thing(helper_variable) +# end +# +# # good +# define_method(:foo) do +# @foo ||= calculate_expensive_thing +# end +# +# # good +# define_method(:foo) do +# return @foo if defined?(@foo) +# @foo = calculate_expensive_thing +# end +# +# @example EnforcedStyleForLeadingUnderscores: required +# # bad +# def foo +# @something ||= calculate_expensive_thing +# end +# +# # bad +# def foo +# @foo ||= calculate_expensive_thing +# end +# +# def foo +# return @foo if defined?(@foo) +# @foo = calculate_expensive_thing +# end +# +# # good +# def foo +# @_foo ||= calculate_expensive_thing +# end +# +# # good +# def _foo +# @_foo ||= calculate_expensive_thing +# end +# +# def foo +# return @_foo if defined?(@_foo) +# @_foo = calculate_expensive_thing +# end +# +# # good +# define_method(:foo) do +# @_foo ||= calculate_expensive_thing +# end +# +# # good +# define_method(:foo) do +# return @_foo if defined?(@_foo) +# @_foo = calculate_expensive_thing +# end +# +# @example EnforcedStyleForLeadingUnderscores: optional +# # bad +# def foo +# @something ||= calculate_expensive_thing +# end +# +# # good +# def foo +# @foo ||= calculate_expensive_thing +# end +# +# # good +# def foo +# @_foo ||= calculate_expensive_thing +# end +# +# # good +# def _foo +# @_foo ||= calculate_expensive_thing +# end +# +# # good +# def foo +# return @_foo if defined?(@_foo) +# @_foo = calculate_expensive_thing +# end +# +# # good +# define_method(:foo) do +# @foo ||= calculate_expensive_thing +# end +# +# # good +# define_method(:foo) do +# @_foo ||= calculate_expensive_thing +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:148 +class RuboCop::Cop::Naming::MemoizedInstanceVariableName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:199 + def defined_memoized?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:161 + def method_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:207 + def on_defined?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:171 + def on_or_asgn(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:244 + def find_definition(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:262 + def matches?(method_name, ivar_assign); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:271 + def message(variable); end + + # Operator and other non-word method names (e.g. `[]`, `+`, `<=>`) cannot form a + # valid instance variable name, so there is no matching ivar to enforce and a + # suggested correction like `@[]` would be invalid Ruby. + # + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:258 + def nameable_method?(method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:240 + def style_parameter_name; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:279 + def suggested_var(method_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:285 + def variable_name_candidates(method_name); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:157 +RuboCop::Cop::Naming::MemoizedInstanceVariableName::DYNAMIC_DEFINE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:158 +RuboCop::Cop::Naming::MemoizedInstanceVariableName::INITIALIZE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:153 +RuboCop::Cop::Naming::MemoizedInstanceVariableName::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/memoized_instance_variable_name.rb:155 +RuboCop::Cop::Naming::MemoizedInstanceVariableName::UNDERSCORE_REQUIRED = T.let(T.unsafe(nil), String) + +# Makes sure that all methods use the configured style, +# snake_case or camelCase, for their names. +# +# Method names matching patterns are always allowed. +# +# The cop can be configured with `AllowedPatterns` to allow certain regexp patterns: +# +# [source,yaml] +# ---- +# Naming/MethodName: +# AllowedPatterns: +# - '\AonSelectionBulkChange\z' +# - '\AonSelectionCleared\z' +# ---- +# +# As well, you can also forbid specific method names or regexp patterns +# using `ForbiddenIdentifiers` or `ForbiddenPatterns`: +# +# [source,yaml] +# ---- +# Naming/MethodName: +# ForbiddenIdentifiers: +# - 'def' +# - 'super' +# ForbiddenPatterns: +# - '_v1\z' +# - '_gen1\z' +# ---- +# +# @example EnforcedStyle: snake_case (default) +# # bad +# def fooBar; end +# +# # good +# def foo_bar; end +# +# # bad +# define_method :fooBar do +# end +# +# # good +# define_method :foo_bar do +# end +# +# # bad +# Struct.new(:fooBar) +# +# # good +# Struct.new(:foo_bar) +# +# # bad +# alias_method :fooBar, :some_method +# +# # good +# alias_method :foo_bar, :some_method +# +# @example EnforcedStyle: camelCase +# # bad +# def foo_bar; end +# +# # good +# def fooBar; end +# +# # bad +# define_method :foo_bar do +# end +# +# # good +# define_method :fooBar do +# end +# +# # bad +# Struct.new(:foo_bar) +# +# # good +# Struct.new(:fooBar) +# +# # bad +# alias_method :foo_bar, :some_method +# +# # good +# alias_method :fooBar, :some_method +# +# @example ForbiddenIdentifiers: ['def', 'super'] +# # bad +# def def; end +# def super; end +# +# @example ForbiddenPatterns: ['_v1\z', '_gen1\z'] +# # bad +# def release_v1; end +# def api_gen1; end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:99 +class RuboCop::Cop::Naming::MethodName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting + include ::RuboCop::Cop::ConfigurableNaming + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::ForbiddenIdentifiers + include ::RuboCop::Cop::ForbiddenPattern + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:122 + def define_data?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:119 + def new_struct?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:149 + def on_alias(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:138 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:147 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:124 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:116 + def str_name(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:113 + def sym_name(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:232 + def attr_name(name_item); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:208 + def forbidden_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:176 + def handle_alias_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:183 + def handle_attr_accessor(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:170 + def handle_define_data(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:157 + def handle_define_method(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:198 + def handle_method_name(node, name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:163 + def handle_new_struct(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:247 + def message(style); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:236 + def range_position(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:213 + def register_forbidden_name(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:106 +RuboCop::Cop::Naming::MethodName::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:107 +RuboCop::Cop::Naming::MethodName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/method_name.rb:109 +RuboCop::Cop::Naming::MethodName::OPERATOR_METHODS = T.let(T.unsafe(nil), Set) + +# Checks method parameter names for how descriptive they +# are. It is highly configurable. +# +# The `MinNameLength` config option takes an integer. It represents +# the minimum amount of characters the name must be. Its default is 3. +# The `AllowNamesEndingInNumbers` config option takes a boolean. When +# set to false, this cop will register offenses for names ending with +# numbers. Its default is false. The `AllowedNames` config option +# takes an array of permitted names that will never register an +# offense. The `ForbiddenNames` config option takes an array of +# restricted names that will always register an offense. +# +# @example +# # bad +# def bar(varOne, varTwo) +# varOne + varTwo +# end +# +# # With `AllowNamesEndingInNumbers` set to false +# def foo(num1, num2) +# num1 * num2 +# end +# +# # With `MinNameLength` set to number greater than 1 +# def baz(a, b, c) +# do_stuff(a, b, c) +# end +# +# # good +# def bar(thud, fred) +# thud + fred +# end +# +# def foo(speed, distance) +# speed * distance +# end +# +# def baz(age_a, height_b, gender_c) +# do_stuff(age_a, height_b, gender_c) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/method_parameter_name.rb:46 +class RuboCop::Cop::Naming::MethodParameterName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::UncommunicativeName + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_parameter_name.rb:49 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/method_parameter_name.rb:54 + def on_defs(node); end +end + +# Checks that predicate methods end with `?` and non-predicate methods do not. +# +# The names of predicate methods (methods that return a boolean value) should end +# in a question mark. Methods that don't return a boolean shouldn't +# end in a question mark. +# +# The cop assesses a predicate method as one that returns boolean values. Likewise, +# a method that only returns literal values is assessed as non-predicate. Other predicate +# method calls are assumed to return boolean values. The cop does not make an assessment +# if the return type is unknown (non-predicate method calls, variables, etc.). +# +# NOTE: The `initialize` method and operator methods (`def ==`, etc.) are ignored. +# +# By default, the cop runs in `conservative` mode, which allows a method to be named +# with a question mark as long as at least one return value is boolean. In `aggressive` +# mode, methods with a question mark will register an offense if any known non-boolean +# return values are detected. +# +# The cop also has `AllowedMethods` configuration in order to prevent the cop from +# registering an offense from a method name that does not conform to the naming +# guidelines. By default, `call` is allowed. The cop also has `AllowedPatterns` +# configuration to allow method names by regular expression. +# +# Although returning a call to another predicate method is treated as a boolean value, +# certain method names can be known to not return a boolean, despite ending in a `?` +# (for example, `Numeric#nonzero?` returns `self` or `nil`). These methods can be +# configured using `NonBooleanPredicates`. +# +# The cop can furthermore be configured to allow all bang methods (method names +# ending with `!`), with `AllowBangMethods: true` (default false). +# +# @example Mode: conservative (default) +# # bad +# def foo +# bar == baz +# end +# +# # good +# def foo? +# bar == baz +# end +# +# # bad +# def foo? +# 5 +# end +# +# # good +# def foo +# 5 +# end +# +# # bad +# def foo +# x == y +# end +# +# # good +# def foo? +# x == y +# end +# +# # bad +# def foo +# !x +# end +# +# # good +# def foo? +# !x +# end +# +# # bad - returns the value of another predicate method +# def foo +# bar? +# end +# +# # good +# def foo? +# bar? +# end +# +# # good - operator method +# def ==(other) +# hash == other.hash +# end +# +# # good - at least one return value is boolean +# def foo? +# return unless bar? +# true +# end +# +# # ok - return type is not known +# def foo? +# bar +# end +# +# # ok - return type is not known +# def foo +# bar? +# end +# +# @example Mode: aggressive +# # bad - the method returns nil in some cases +# def foo? +# return unless bar? +# true +# end +# +# @example AllowedMethods: [call] (default) +# # good +# def call +# foo == bar +# end +# +# @example AllowedPatterns: [\Afoo] +# # good +# def foo? +# 'foo' +# end +# +# @example AllowBangMethods: false (default) +# # bad +# def save! +# true +# end +# +# @example AllowBangMethods: true +# # good +# def save! +# true +# end +# +# @example WaywardPredicates: ['infinite?', 'nonzero?'] (default) +# # good +# def non_predicate_method(num) +# num.infinite? +# end +# +# # good +# def non_predicate_method(num) +# num.nonzero? +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:151 +class RuboCop::Cop::Naming::PredicateMethod < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:158 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:170 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:183 + def acceptable?(return_values); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:212 + def all_return_values_boolean?(return_values); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:313 + def allow_bang_methods?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:174 + def allowed?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:307 + def allowed_bang_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:277 + def and_or?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:219 + def boolean_return?(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:303 + def conservative?; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:281 + def extract_and_or_clauses(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:288 + def extract_conditional_branches(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:246 + def extract_return_value(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:259 + def last_value(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:225 + def method_returning_boolean?(value); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:232 + def potential_non_predicate?(return_values); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:265 + def process_return_values(return_values); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:199 + def return_values(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:193 + def unknown_method_call?(value); end + + # If a method ending in `?` is known to not return a boolean value, + # (for example, `Numeric#nonzero?`) it should be treated as a non-boolean + # value, despite the method naming. + # + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:320 + def wayward_predicate?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:324 + def wayward_predicates; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:156 +RuboCop::Cop::Naming::PredicateMethod::MSG_NON_PREDICATE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_method.rb:155 +RuboCop::Cop::Naming::PredicateMethod::MSG_PREDICATE = T.let(T.unsafe(nil), String) + +# Checks that predicate method names end with a question mark and +# do not start with a forbidden prefix. +# +# A method is determined to be a predicate method if its name starts with +# one of the prefixes listed in the `NamePrefix` configuration. The list +# defaults to `is_`, `has_`, and `have_` but may be overridden. +# +# Predicate methods must end with a question mark. +# +# When `ForbiddenPrefixes` is also set (as it is by default), predicate +# methods which begin with a forbidden prefix are not allowed, even if +# they end with a `?`. These methods should be changed to remove the +# prefix. +# +# When `UseSorbetSigs` is set to true (optional), the cop will only report +# offenses if the method has a Sorbet `sig` with a return type of +# `T::Boolean`. Dynamic methods are not supported with this configuration. +# +# @example NamePrefix: ['is_', 'has_', 'have_'] (default) +# # bad +# def is_even(value) +# end +# +# # When ForbiddenPrefixes: ['is_', 'has_', 'have_'] (default) +# # good +# def even?(value) +# end +# +# # When ForbiddenPrefixes: [] +# # good +# def is_even?(value) +# end +# +# @example NamePrefix: ['seems_to_be_'] +# # bad +# def seems_to_be_even(value) +# end +# +# # When ForbiddenPrefixes: ['seems_to_be_'] +# # good +# def even?(value) +# end +# +# # When ForbiddenPrefixes: [] +# # good +# def seems_to_be_even?(value) +# end +# +# @example AllowedMethods: ['is_a?'] (default) +# # Despite starting with the `is_` prefix, this method is allowed +# # good +# def is_a?(value) +# end +# +# @example AllowedMethods: ['is_even?'] +# # good +# def is_even?(value) +# end +# +# @example UseSorbetSigs: false (default) +# # bad +# sig { returns(String) } +# def is_this_thing_on +# "yes" +# end +# +# # good - Sorbet signature is not evaluated +# sig { returns(String) } +# def is_this_thing_on? +# "yes" +# end +# +# @example UseSorbetSigs: true +# # bad +# sig { returns(T::Boolean) } +# def odd(value) +# end +# +# # good +# sig { returns(T::Boolean) } +# def odd?(value) +# end +# +# @example MethodDefinitionMacros: ['define_method', 'define_singleton_method'] (default) +# # bad +# define_method(:is_even) { |value| } +# +# # good +# define_method(:even?) { |value| } +# +# @example MethodDefinitionMacros: ['def_node_matcher'] +# # bad +# def_node_matcher(:is_even) { |value| } +# +# # good +# def_node_matcher(:even?) { |value| } +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:103 +class RuboCop::Cop::Naming::PredicatePrefix < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedMethods + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:107 + def dynamic_method_define(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:126 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:139 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:113 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:154 + def sorbet_return_type(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:141 + def validate_config; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:164 + def allowed_method_name?(method_name, prefix); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:172 + def expected_name(method_name, prefix); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:186 + def forbidden_prefixes; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:182 + def message(method_name, new_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:198 + def method_definition_macro?(macro_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:190 + def predicate_prefixes; end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:158 + def sorbet_sig?(node, return_type: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/predicate_prefix.rb:194 + def use_sorbet_sigs?; end +end + +# Makes sure that rescued exception variables are named as +# expected. +# +# The `PreferredName` config option takes a `String`. It represents +# the required name of the variable. Its default is `e`. +# +# NOTE: This cop does not consider nested rescues because it cannot +# guarantee that the variable from the outer rescue is not used within +# the inner rescue (in which case, changing the inner variable would +# shadow the outer variable). +# +# @example PreferredName: e (default) +# # bad +# begin +# # do something +# rescue MyException => exception +# # do something +# end +# +# # good +# begin +# # do something +# rescue MyException => e +# # do something +# end +# +# # good +# begin +# # do something +# rescue MyException => _e +# # do something +# end +# +# @example PreferredName: exception +# # bad +# begin +# # do something +# rescue MyException => e +# # do something +# end +# +# # good +# begin +# # do something +# rescue MyException => exception +# # do something +# end +# +# # good +# begin +# # do something +# rescue MyException => _exception +# # do something +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:61 +class RuboCop::Cop::Naming::RescuedExceptionsVariableName < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:66 + def on_resbody(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:96 + def autocorrect(corrector, node, range, offending_name, preferred_name); end + + # Returns the reassignment node once the exception variable is reassigned (a truthy + # signal to stop correcting later references), or `nil` when no reassignment is found. + # + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:122 + def correct_node(corrector, node, offending_name, preferred_name); end + + # If the exception variable is reassigned, that assignment needs to be corrected. + # Further `lvar` nodes will not be corrected though since they now refer to a + # different variable. + # + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:149 + def correct_reassignment(corrector, node, offending_name, preferred_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:166 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:91 + def offense_range(resbody); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:153 + def preferred_name(variable_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:172 + def shadowed_variable_name?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:162 + def variable_name(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:109 + def variable_name_matches?(node, name); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb:64 +RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String) + +# Checks that the configured style (snake_case or camelCase) is used for all variable names. +# This includes local variables, instance variables, class variables, method arguments +# (positional, keyword, rest or block), and block arguments. +# +# The cop can also be configured to forbid using specific names for variables, using +# `ForbiddenIdentifiers` or `ForbiddenPatterns`. In addition to the above, this applies +# to global variables as well. +# +# Method definitions and method calls are not affected by this cop. +# +# @example EnforcedStyle: snake_case (default) +# # bad +# fooBar = 1 +# +# # good +# foo_bar = 1 +# +# @example EnforcedStyle: camelCase +# # bad +# foo_bar = 1 +# +# # good +# fooBar = 1 +# +# @example AllowedIdentifiers: ['fooBar'] +# # good (with EnforcedStyle: snake_case) +# fooBar = 1 +# +# @example AllowedPatterns: ['_v\d+\z'] +# # good (with EnforcedStyle: camelCase) +# release_v1 = true +# +# @example ForbiddenIdentifiers: ['fooBar'] +# # bad (in all cases) +# fooBar = 1 +# @fooBar = 1 +# @@fooBar = 1 +# $fooBar = 1 +# +# @example ForbiddenPatterns: ['_v\d+\z'] +# # bad (in all cases) +# release_v1 = true +# @release_v1 = true +# @@release_v1 = true +# $release_v1 = true +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:52 +class RuboCop::Cop::Naming::VariableName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedIdentifiers + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting + include ::RuboCop::Cop::ConfigurableNaming + include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::ForbiddenIdentifiers + include ::RuboCop::Cop::ForbiddenPattern + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:78 + def on_arg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:84 + def on_blockarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:77 + def on_cvasgn(node); end + + # Only forbidden names are checked for global variable assignment + # + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:88 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:76 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:82 + def on_kwarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:81 + def on_kwoptarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:83 + def on_kwrestarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:85 + def on_lvar(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:66 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:79 + def on_optarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:80 + def on_restarg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:62 + def valid_name?(node, name, given_style = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:97 + def forbidden_name?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:101 + def message(style); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:105 + def register_forbidden_name(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:59 +RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/naming/variable_name.rb:60 +RuboCop::Cop::Naming::VariableName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) + +# Makes sure that all numbered variables use the +# configured style, snake_case, normalcase, or non_integer, +# for their numbering. +# +# Additionally, `CheckMethodNames` and `CheckSymbols` configuration options +# can be used to specify whether method names and symbols should be checked. +# Both are enabled by default. +# +# @example EnforcedStyle: normalcase (default) +# # bad +# :some_sym_1 +# variable_1 = 1 +# +# def some_method_1; end +# +# def some_method1(arg_1); end +# +# # good +# :some_sym1 +# variable1 = 1 +# +# def some_method1; end +# +# def some_method1(arg1); end +# +# @example EnforcedStyle: snake_case +# # bad +# :some_sym1 +# variable1 = 1 +# +# def some_method1; end +# +# def some_method_1(arg1); end +# +# # good +# :some_sym_1 +# variable_1 = 1 +# +# def some_method_1; end +# +# def some_method_1(arg_1); end +# +# @example EnforcedStyle: non_integer +# # bad +# :some_sym1 +# :some_sym_1 +# +# variable1 = 1 +# variable_1 = 1 +# +# def some_method1; end +# +# def some_method_1; end +# +# def some_methodone(arg1); end +# def some_methodone(arg_1); end +# +# # good +# :some_symone +# :some_sym_one +# +# variableone = 1 +# variable_one = 1 +# +# def some_methodone; end +# +# def some_method_one; end +# +# def some_methodone(argone); end +# def some_methodone(arg_one); end +# +# # In the following examples, we assume `EnforcedStyle: normalcase` (default). +# +# @example CheckMethodNames: true (default) +# # bad +# def some_method_1; end +# +# @example CheckMethodNames: false +# # good +# def some_method_1; end +# +# @example CheckSymbols: true (default) +# # bad +# :some_sym_1 +# +# @example CheckSymbols: false +# # good +# :some_sym_1 +# +# @example AllowedIdentifiers: [capture3] +# # good +# expect(Open3).to receive(:capture3) +# +# @example AllowedPatterns: ['_v\d+\z'] +# # good +# :some_sym_v1 +# +# pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:103 +class RuboCop::Cop::Naming::VariableNumber < ::RuboCop::Cop::Base + include ::RuboCop::Cop::AllowedIdentifiers + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting + include ::RuboCop::Cop::ConfigurableNumbering + include ::RuboCop::Cop::AllowedPattern + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:114 + def on_arg(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:122 + def on_cvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:125 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:131 + def on_defs(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:123 + def on_gvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:121 + def on_ivasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:120 + def on_lvasgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:133 + def on_sym(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:110 + def valid_name?(node, name, given_style = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:142 + def message(style); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/naming/variable_number.rb:108 +RuboCop::Cop::Naming::VariableNumber::MSG = T.let(T.unsafe(nil), String) + +# Some common code shared between `NegatedIf` and +# `NegatedWhile` cops. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/negative_conditional.rb:7 +module RuboCop::Cop::NegativeConditional + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/negative_conditional.rb:18 + def empty_condition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/negative_conditional.rb:15 + def single_negative?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/negative_conditional.rb:20 + def check_negative_conditional(node, message:, &block); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/negative_conditional.rb:10 +RuboCop::Cop::NegativeConditional::MSG = T.let(T.unsafe(nil), String) + +# This module provides a list of methods that are: +# 1. In the NilClass by default +# 2. Added to NilClass by explicitly requiring any standard libraries +# 3. Cop's configuration parameter AllowedMethods. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/nil_methods.rb:9 +module RuboCop::Cop::NilMethods + include ::RuboCop::Cop::AllowedMethods + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/nil_methods.rb:14 + def nil_methods; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/nil_methods.rb:18 + def other_stdlib_methods; end +end + +# An offense represents a style violation detected by RuboCop. +# +# pkg:gem/rubocop#lib/rubocop/cop/offense.rb:6 +class RuboCop::Cop::Offense + include ::Comparable + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:90 + def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end + + # @api public + # + # Returns `-1`, `0`, or `+1` + # if this offense is less than, equal to, or greater than `other`. + # + # @return [Integer] + # comparison result + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:245 + def <=>(other); end + + # @api public + # + # @return [Boolean] + # returns `true` if two offenses contain same attributes + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:226 + def ==(other); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:175 + def column; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:185 + def column_length; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:209 + def column_range; end + + # @api public + # + # @!attribute [r] cop_name + # + # @return [String] + # the cop name as a String for which this offense is for. + # + # @example + # 'Layout/LineLength' + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:50 + def cop_name; end + + # @api public + # + # @!attribute [r] correctable? + # + # @return [Boolean] + # whether this offense can be automatically corrected via autocorrect. + # This includes todo comments, for example when requested with `--disable-uncorrectable`. + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:116 + def correctable?; end + + # @api public + # + # @!attribute [r] corrected? + # + # @return [Boolean] + # whether this offense is automatically corrected via + # autocorrect or a todo. + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:127 + def corrected?; end + + # @api public + # + # @!attribute [r] corrected_with_todo? + # + # @return [Boolean] + # whether this offense is automatically disabled via a todo. + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:137 + def corrected_with_todo?; end + + # @api public + # + # @!attribute [r] corrector + # + # @return [Corrector | nil] + # the autocorrection for this offense, or `nil` when not available + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:61 + def corrector; end + + # @api public + # + # @!attribute [r] disabled? + # + # @return [Boolean] + # whether this offense was locally disabled with a + # disable or todo where it occurred. + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:148 + def disabled?; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:232 + def eql?(other); end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:194 + def first_line; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:234 + def hash; end + + # @api public + # + # @return [Parser::Source::Range] + # the range of the code that is highlighted + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:156 + def highlighted_area; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:204 + def last_column; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:199 + def last_line; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:170 + def line; end + + # @api public + # + # @!attribute [r] location + # + # @return [Parser::Source::Range] + # the location where the violation is detected. + # + # @see https://www.rubydoc.info/gems/parser/Parser/Source/Range + # Parser::Source::Range + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:28 + def location; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:101 + def marshal_dump; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:105 + def marshal_load(array); end + + # @api public + # + # @!attribute [r] message + # + # @return [String] + # human-readable message + # + # @example + # 'Line is too long. [90/80]' + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:39 + def message; end + + # @api private + # + # Internally we use column number that start at 0, but when + # outputting column numbers, we want them to start at 1. One + # reason is that editors, such as Emacs, expect this. + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:218 + def real_column; end + + # @api public + # + # @!attribute [r] severity + # + # @return [RuboCop::Cop::Severity] + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:17 + def severity; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:180 + def source_line; end + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:53 + def status; end + + # @api private + # This is just for debugging purpose. + # + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:163 + def to_s; end +end + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cop/offense.rb:10 +RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/offense.rb:87 +RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange) + +# pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 +class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:71 + def initialize(line, column, source_line, begin_pos, end_pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def begin_pos; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def begin_pos=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def column; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def column=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:76 + def column_range; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def end_pos; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def end_pos=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:65 + def first_line; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:67 + def last_column; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:66 + def last_line; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:83 + def length; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def line; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def line=(_); end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:80 + def size; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:69 + def source_buffer; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def source_line; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def source_line=(_); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def [](*_arg0); end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def inspect; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def keyword_init?; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def members; end + + # pkg:gem/rubocop#lib/rubocop/cop/offense.rb:63 + def new(*_arg0); end + end +end + +# Common functionality for cops checking if and unless expressions. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/on_normal_if_unless.rb:6 +module RuboCop::Cop::OnNormalIfUnless + # pkg:gem/rubocop#lib/rubocop/cop/mixin/on_normal_if_unless.rb:7 + def on_if(node); end +end + +# This autocorrects gem dependency order +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/ordered_gem_corrector.rb:6 +class RuboCop::Cop::OrderedGemCorrector + extend ::RuboCop::Cop::OrderedGemNode + extend ::RuboCop::Cop::RangeHelp + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/ordered_gem_corrector.rb:11 + def comments_as_separators; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/ordered_gem_corrector.rb:13 + def correct(processed_source, node, previous_declaration, comments_as_separators); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/ordered_gem_corrector.rb:11 + def processed_source; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/ordered_gem_corrector.rb:33 + def declaration_with_comment(node); end + end +end + +# Common functionality for Bundler/OrderedGems and +# Gemspec/OrderedDependencies. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:7 +module RuboCop::Cop::OrderedGemNode + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:23 + def case_insensitive_out_of_order?(string_a, string_b); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:27 + def consecutive_lines?(previous, current); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:55 + def find_gem_name(gem_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:18 + def gem_canonical_name(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:49 + def gem_name(declaration_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:10 + def get_source_range(node, comments_as_separators); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:32 + def register_offense(previous, current); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/ordered_gem_node.rb:61 + def treat_comments_as_separators; end +end + +# Common functionality for handling parentheses. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/parentheses.rb:6 +module RuboCop::Cop::Parentheses + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/parentheses.rb:9 + def parens_required?(node); end +end + +# This autocorrects parentheses +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:6 +class RuboCop::Cop::ParenthesesCorrector + extend ::RuboCop::Cop::RangeHelp + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:12 + def correct(corrector, node); end + + private + + # Add a comma back after the heredoc identifier + # + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:108 + def add_heredoc_comma(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:48 + def chained_after_close_paren?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:34 + def comment_above_close_paren_swallows_chain?(node, buffer); end + + # If the node contains a heredoc, remove the comma too + # It'll be added back in the right place later + # + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:98 + def extend_range_for_heredoc(node, range); end + + # If removing parentheses leaves a comma on its own line, remove all the whitespace + # preceding it to prevent a syntax error. + # + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:75 + def handle_orphaned_comma(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:114 + def heredoc?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:62 + def next_char_is_question_mark?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:66 + def only_closing_paren_before_comma?(node); end + + # Get a range for the closing parenthesis and all whitespace to the left of it + # + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:85 + def parens_range(node); end + + # When the line above `)` ends with a comment and a chained call follows `)`, + # crossing the newline would pull the chain into the comment. Preserve the newline. + # + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:28 + def remove_close_paren(corrector, node, buffer); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/parentheses_corrector.rb:58 + def ternary_condition?(node); end + end +end + +# Common functionality for handling percent arrays. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:6 +module RuboCop::Cop::PercentArray + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:26 + def allowed_bracket_array?(node); end + + # @param [RuboCop::AST::ArrayNode] node + # @param [Array] elements + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:83 + def build_bracketed_array_with_appropriate_whitespace(elements:, node:); end + + # @param [String] preferred_array_code + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:56 + def build_message_for_bracketed_array(preferred_array_code); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:67 + def check_bracketed_array(node, literal_prefix); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:36 + def check_percent_array(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:31 + def comments_in_array?(node); end + + # Override to determine values that are invalid in a percent array + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:22 + def invalid_percent_array_contents?(_node); end + + # Ruby does not allow percent arrays in an ambiguous block context. + # + # @example + # + # foo %i[bar baz] { qux } + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:14 + def invalid_percent_array_context?(node); end + + # Provides whitespace between elements for building a bracketed array. + # %w[ a b c ] + # ^^^ + # @param [RuboCop::AST::ArrayNode] node + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:98 + def whitespace_between(node); end + + # Provides leading whitespace for building a bracketed array. + # %w[ a b c ] + # ^^ + # @param [RuboCop::AST::ArrayNode] node + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:111 + def whitespace_leading(node); end + + # Provides trailing whitespace for building a bracketed array. + # %w[ a b c ] + # ^^^^ + # @param [RuboCop::AST::ArrayNode] node + # @return [String] + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_array.rb:120 + def whitespace_trailing(node); end +end + +# Common functionality for handling percent literals. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_literal.rb:6 +module RuboCop::Cop::PercentLiteral + include ::RuboCop::Cop::RangeHelp + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_literal.rb:23 + def begin_source(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_literal.rb:11 + def percent_literal?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_literal.rb:17 + def process(node, *types); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/percent_literal.rb:27 + def type(node); end +end + +# This autocorrects percent literals +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:6 +class RuboCop::Cop::PercentLiteralCorrector + include ::RuboCop::PathUtil + include ::RuboCop::Cop::Util + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:11 + def initialize(config, preferred_delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:9 + def config; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:16 + def correct(corrector, node, char); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:9 + def preferred_delimiters; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:46 + def autocorrect_multiline_words(node, escape, delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:52 + def autocorrect_words(node, escape, delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:34 + def delimiters_for(type); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:110 + def end_content(source); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:30 + def escape_words?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:78 + def first_line?(node, previous_line_num); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:89 + def fix_escaped_content(word_node, escape, delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:69 + def line_breaks(node, source, previous_line_num, base_line_num, node_index); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:38 + def new_contents(node, escape, delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:82 + def process_lines(node, previous_line_num, base_line_num, source_in_lines); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:58 + def process_multiline_words(node, escape, delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:96 + def substitute_escaped_delimiters(content, delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/percent_literal_corrector.rb:26 + def wrap_contents(corrector, node, contents, char, delimiters); end +end + +# Common functionality for checking whether an AST node/token is aligned +# with something on a preceding or following line +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:8 +module RuboCop::Cop::PrecedingFollowingAlignment + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:79 + def aligned_comment_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:102 + def aligned_equals_operator?(range, lineno); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:133 + def aligned_identical?(range, line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:90 + def aligned_operator?(range, line, lineno); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:86 + def aligned_token?(range, line, lineno); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:43 + def aligned_with_adjacent_line?(range, predicate); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:61 + def aligned_with_any_line?(line_ranges, range, indent = T.unsafe(nil), &predicate); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:51 + def aligned_with_any_line_range?(line_ranges, range, &predicate); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:125 + def aligned_with_append_operator?(range, token); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:137 + def aligned_with_equals_sign(token, line_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:65 + def aligned_with_line?(line_nos, range, indent = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:23 + def aligned_with_operator?(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:119 + def aligned_with_preceding_equals?(range, token); end + + # Allows alignment with a preceding operator that ends with an `=`, + # including assignment and comparison operators. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:29 + def aligned_with_preceding_equals_operator(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:19 + def aligned_with_something?(range); end + + # Allows alignment with a subsequent operator that ends with an `=`, + # including assignment and comparison operators. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:37 + def aligned_with_subsequent_equals_operator(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:94 + def aligned_words?(range, line); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:15 + def allow_for_alignment?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:152 + def assignment_lines; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:156 + def assignment_tokens; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:176 + def relevant_assignment_lines(line_range); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:203 + def remove_equals_in_def(asgn_tokens, processed_source); end +end + +# Tokens that end with an `=`, as well as `<<`, that can be aligned together: +# `=`, `==`, `===`, `!=`, `<=`, `>=`, `<<` and operator assignment (`+=`, etc). +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/preceding_following_alignment.rb:11 +RuboCop::Cop::PrecedingFollowingAlignment::ASSIGNMENT_OR_COMPARISON_TOKENS = T.let(T.unsafe(nil), Array) + +# Common functionality for handling percent literal delimiters. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:6 +class RuboCop::Cop::PreferredDelimiters + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:11 + def initialize(type, config, preferred_delimiters); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:7 + def config; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:17 + def delimiters; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:7 + def type; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:23 + def ensure_valid_preferred_delimiters; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:30 + def preferred_delimiters; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:45 + def preferred_delimiters_config; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/preferred_delimiters.rb:9 +RuboCop::Cop::PreferredDelimiters::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +# Common helpers for cops that consult the project-wide static-analysis index +# via `Cop::Base#project_index`. +# +# Mixed-in cops gain the `external_dependency_checksum` override that invalidates +# the `ResultCache` whenever the indexed project files change on disk. +# To run index-backed analysis, cops should simply check whether `project_index` is non-nil; +# the runner only exposes a non-nil index when the user opted in via `AllCops/UseProjectIndex` +# and the underlying gem is available. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/project_index_help.rb:13 +module RuboCop::Cop::ProjectIndexHelp + # pkg:gem/rubocop#lib/rubocop/cop/mixin/project_index_help.rb:20 + def external_dependency_checksum; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/project_index_help.rb:30 + def project_index_signature; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/project_index_help.rb:14 +RuboCop::Cop::ProjectIndexHelp::BUILTIN_DOCUMENT_URI = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/project_index_help.rb:15 +RuboCop::Cop::ProjectIndexHelp::FILE_URI_PREFIX = T.let(T.unsafe(nil), String) + +# Matches the spurious leading slash before a Windows drive letter that +# remains after stripping `file://` from a `file:///C:/...` URI. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/project_index_help.rb:18 +RuboCop::Cop::ProjectIndexHelp::WINDOWS_DRIVE_PREFIX = T.let(T.unsafe(nil), Regexp) + +# This autocorrects punctuation +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/punctuation_corrector.rb:6 +class RuboCop::Cop::PunctuationCorrector + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/punctuation_corrector.rb:12 + def add_space(corrector, token); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/punctuation_corrector.rb:8 + def remove_space(corrector, space_before); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/punctuation_corrector.rb:16 + def swap_comma(corrector, range); end + end +end + +module RuboCop::Cop::RSpec; end +class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base; end +class RuboCop::Cop::RSpec::MultipleMemoizedHelpers < ::RuboCop::Cop::RSpec::Base; end +class RuboCop::Cop::RSpec::NestedGroups < ::RuboCop::Cop::RSpec::Base; end + +# Methods that calculate and return Parser::Source::Ranges +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:6 +module RuboCop::Cop::RangeHelp + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:152 + def add_range(range1, range2); end + + # A range containing the first to the last argument + # of a method call or method definition. + # def foo(a, b:) + # ^^^^^ + # bar(1, 2, 3, &blk) + # ^^^^^^^^^^^^^ + # baz { |x, y:, z:| } + # ^^^^^^^^^ + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:45 + def arguments_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:93 + def column_offset_between(base_range, range); end + + # A range containing only the contents of a literal with delimiters (e.g. in + # `%i{1 2 3}` this will be the range covering `1 2 3` only). + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:33 + def contents_range(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:111 + def directions(side); end + + # Returns the column attribute of the range, except if the range is on + # the first line and there's a byte order mark at the beginning of that + # line, in which case 1 is subtracted from the column value. This gives + # the column as it appears when viewing the file in an editor. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:103 + def effective_column(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:120 + def final_pos(src, pos, increment, continuations, newlines, whitespace); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:128 + def move_pos(src, pos, step, condition, regexp); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:134 + def move_pos_str(src, pos, step, condition, needle); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:49 + def range_between(start_pos, end_pos); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:84 + def range_by_whole_lines(range, include_final_newline: T.unsafe(nil), buffer: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:145 + def range_with_comments(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:141 + def range_with_comments_and_lines(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:53 + def range_with_surrounding_comma(range, side = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:67 + def range_with_surrounding_space(range_positional = T.unsafe(nil), range: T.unsafe(nil), side: T.unsafe(nil), newlines: T.unsafe(nil), whitespace: T.unsafe(nil), continuations: T.unsafe(nil), buffer: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:12 + def source_range(source_buffer, line_number, column, length = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:7 +RuboCop::Cop::RangeHelp::BYTE_ORDER_MARK = T.let(T.unsafe(nil), Integer) + +# The Unicode codepoint +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/range_help.rb:8 +module RuboCop::Cop::RangeHelp::NOT_GIVEN; end + +# Common functionality for handling Rational literals. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/rational_literal.rb:6 +module RuboCop::Cop::RationalLiteral + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/rational_literal.rb:12 + def rational_literal?(param0 = T.unsafe(nil)); end +end + +# Registry that tracks all cops by their badge and department. +# +# pkg:gem/rubocop#lib/rubocop/cop/registry.rb:19 +class RuboCop::Cop::Registry + include ::Enumerable + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:51 + def initialize(cops = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:237 + def ==(other); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:99 + def contains_cop_matching?(names); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:182 + def cops; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:229 + def cops_for_department(department); end + + # @return [Boolean] Checks if given name is department + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:95 + def department?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:149 + def department_missing?(badge, name); end + + # @return [Array] list of departments for current cops. + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:79 + def departments; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:197 + def disabled(config); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:74 + def dismiss(cop); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:253 + def each(&block); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:193 + def enabled(config); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:201 + def enabled?(cop, config); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:217 + def enabled_pending_cop?(cop_cfg, config); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:70 + def enlist(cop); end + + # @param [String] cop_name + # @return [Class, nil] + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:259 + def find_by_cop_name(cop_name); end + + # When a cop name is given returns a single-element array with the cop class. + # When a department name is given returns an array with all the cop classes + # for that department. + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:268 + def find_cops_by_directive(directive); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:273 + def freeze; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:64 + def lazy_load(cop_name, constant_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:188 + def length; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:224 + def names; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:233 + def names_for_department(department); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:49 + def options; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:153 + def print_department_missing_warning(name, path); end + + # Convert a user provided cop name into a properly namespaced name + # + # @example gives back a correctly qualified cop name + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('Layout/EndOfLine', '') # => 'Layout/EndOfLine' + # + # @example fixes incorrect namespaces + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('Lint/EndOfLine', '') # => 'Layout/EndOfLine' + # + # @example namespaces bare cop identifiers + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('EndOfLine', '') # => 'Layout/EndOfLine' + # + # @example passes back unrecognized cop names + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('NotACop', '') # => 'NotACop' + # + # @param name [String] Cop name extracted from config + # @param path [String, nil] Path of file that `name` was extracted from + # @param warn [Boolean] Print a warning if no department given for `name` + # + # @raise [AmbiguousCopName] + # if a bare identifier with two possible namespaces is provided + # + # @note Emits a warning if the provided name has an incorrect namespace + # + # @return [String] Qualified cop name + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:135 + def qualified_cop_name(name, path, warn: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:168 + def qualify_badge(badge); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:249 + def select(&block); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:241 + def sort!; end + + # @return [Hash{String => Array}] + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:176 + def to_h; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:161 + def unqualified_cop_names; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:49 + def warnings; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:286 + def warnings?(path); end + + # @return [Registry] Cops for that specific department. + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:85 + def with_department(department); end + + # @return [Registry] Cops not for a specific department. + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:90 + def without_department(department); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:296 + def clear_enrollment_queue; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:331 + def emit_warning(path, message); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:292 + def initialize_copy(reg); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:306 + def load_all_lazy_cops; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:310 + def load_lazy_cop(badge); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:336 + def registered?(badge); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:321 + def resolve_badge(given_badge, real_badge, source_path, warn: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:317 + def with(cops); end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:22 + def all; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:283 + def global; end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:44 + def qualified_cop?(name); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:26 + def qualified_cop_name(name, origin, warn: T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:40 + def reset!; end + + # Changes momentarily the global registry + # Intended for testing purposes + # + # pkg:gem/rubocop#lib/rubocop/cop/registry.rb:32 + def with_temporary_global(temp_global = T.unsafe(nil)); end + end +end + +# Ensure a require statement is present for a standard library determined +# by variable library_name +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:7 +module RuboCop::Cop::RequireLibrary + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:12 + def ensure_required(corrector, node, library_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:33 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:24 + def remove_subsequent_requires(corrector, node, library_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:51 + def require_any_library?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:56 + def require_library_name?(param0 = T.unsafe(nil), param1); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:44 + def on_new_investigation; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/require_library.rb:10 +RuboCop::Cop::RequireLibrary::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# This class ensures a require statement is present for a standard library +# determined by the variable library_name +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/require_library_corrector.rb:7 +class RuboCop::Cop::RequireLibraryCorrector + extend ::RuboCop::Cop::RangeHelp + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/require_library_corrector.rb:11 + def correct(corrector, node, library_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/require_library_corrector.rb:17 + def require_statement(library_name); end + end +end + +# Common functionality for checking `rescue` nodes. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/rescue_node.rb:6 +module RuboCop::Cop::RescueNode + # pkg:gem/rubocop#lib/rubocop/cop/mixin/rescue_node.rb:7 + def modifier_locations; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/rescue_node.rb:13 + def rescue_modifier?(node); end + + # @deprecated Use ResbodyNode#exceptions instead + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/rescue_node.rb:20 + def rescued_exceptions(resbody); end +end + +# Common functionality for safe assignment. By safe assignment we mean +# putting parentheses around an assignment to indicate "I know I'm using an +# assignment as a condition. It's not a mistake." +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/safe_assignment.rb:8 +module RuboCop::Cop::SafeAssignment + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/safe_assignment.rb:14 + def empty_condition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/safe_assignment.rb:20 + def safe_assignment?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/safe_assignment.rb:17 + def setter_method?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/safe_assignment.rb:22 + def safe_assignment_allowed?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:5 +module RuboCop::Cop::Security; end + +# Checks for implementations of the `hash` method which combine +# values using custom logic instead of delegating to `Array#hash`. +# +# Manually combining hashes is error prone and hard to follow, especially +# when there are many values. Poor implementations may also introduce +# performance or security concerns if they are prone to collisions. +# Delegating to `Array#hash` is clearer and safer, although it might be slower +# depending on the use case. +# +# @safety +# This cop may be unsafe if the application logic depends on the hash +# value, however this is inadvisable anyway. +# +# @example +# +# # bad +# def hash +# @foo ^ @bar +# end +# +# # good +# def hash +# [@foo, @bar].hash +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:30 +class RuboCop::Cop::Security::CompoundHash < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:59 + def bad_hash_combinator?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:76 + def contained_in_hash_method?(node, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:43 + def dynamic_hash_method_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:38 + def hash_method_definition?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:64 + def monuple_hash?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:103 + def on_csend(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:104 + def on_op_asgn(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:88 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:82 + def outer_bad_hash_combinator?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:69 + def redundant_hash?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:52 + def static_hash_method_definition?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:31 +RuboCop::Cop::Security::CompoundHash::COMBINATOR_IN_HASH_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:32 +RuboCop::Cop::Security::CompoundHash::MONUPLE_HASH_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:34 +RuboCop::Cop::Security::CompoundHash::REDUNDANT_HASH_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/compound_hash.rb:35 +RuboCop::Cop::Security::CompoundHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of `Kernel#eval` and `Binding#eval` with +# dynamic strings as arguments. Evaluating non-literal strings +# can enable code injection attacks and makes it difficult to +# reason about what code will actually be executed. +# +# Calls to `eval` with literal strings are not flagged by this cop, +# as they do not pose the same injection risk. +# +# @example +# +# # bad +# eval(something) +# binding.eval(something) +# Kernel.eval(something) +# +# # good - use safer alternatives +# obj.public_send(method_name) +# obj.send(method_name, *args) +# +# # good - literal strings are allowed +# eval("1 + 1") +# binding.eval("foo") +# +# pkg:gem/rubocop#lib/rubocop/cop/security/eval.rb:28 +class RuboCop::Cop::Security::Eval < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/security/eval.rb:33 + def eval?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/eval.rb:37 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/eval.rb:29 +RuboCop::Cop::Security::Eval::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/eval.rb:30 +RuboCop::Cop::Security::Eval::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`, +# `IO.foreach`, and `IO.readlines`. +# +# If argument starts with a pipe character (`'|'`) and the receiver is the `IO` class, +# a subprocess is created in the same way as `Kernel#open`, and its output is returned. +# `Kernel#open` may allow unintentional command injection, which is the reason these +# `IO` methods are a security risk. +# Consider using `File.read` to disable the behavior of subprocess invocation. +# +# @safety +# This cop is unsafe because false positive will occur if the variable passed as +# the first argument is a command that is not a file path. +# +# @example +# +# # bad +# IO.read(path) +# IO.read('path') +# +# # good +# File.read(path) +# File.read('path') +# IO.read('| command') # Allow intentional command invocation. +# +# pkg:gem/rubocop#lib/rubocop/cop/security/io_methods.rb:30 +class RuboCop::Cop::Security::IoMethods < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/security/io_methods.rb:36 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/io_methods.rb:33 +RuboCop::Cop::Security::IoMethods::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/io_methods.rb:34 +RuboCop::Cop::Security::IoMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of JSON class methods which have potential +# security issues. +# +# `JSON.load` and similar methods allow deserialization of arbitrary ruby objects: +# +# [source,ruby] +# ---- +# require 'json/add/string' +# result = JSON.load('{ "json_class": "String", "raw": [72, 101, 108, 108, 111] }') +# pp result # => "Hello" +# ---- +# +# Never use `JSON.load` for untrusted user input. Prefer `JSON.parse` unless you have +# a concrete use-case for `JSON.load`. +# +# NOTE: Starting with `json` gem version 2.8.0, triggering this behavior without explicitly +# passing the `create_additions` keyword argument emits a deprecation warning, with the +# goal of being secure by default in the next major version 3.0.0. +# +# @safety +# This cop's autocorrection is unsafe because it's potentially dangerous. +# If using a stream, like `JSON.load(open('file'))`, you will need to call +# `#read` manually, like `JSON.parse(open('file').read)`. +# Other similar issues may apply. +# +# @example +# # bad +# JSON.load('{}') +# JSON.restore('{}') +# +# # good +# JSON.parse('{}') +# JSON.unsafe_load('{}') +# +# # good - explicit use of `create_additions` option +# JSON.load('{}', create_additions: true) +# JSON.load('{}', create_additions: false) +# +# pkg:gem/rubocop#lib/rubocop/cop/security/json_load.rb:44 +class RuboCop::Cop::Security::JSONLoad < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/security/json_load.rb:51 + def insecure_json_load(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/json_load.rb:59 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/json_load.rb:47 +RuboCop::Cop::Security::JSONLoad::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/json_load.rb:48 +RuboCop::Cop::Security::JSONLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of Marshal class methods which have +# potential security issues leading to remote code execution when +# loading from an untrusted source. +# +# @example +# # bad +# Marshal.load("{}") +# Marshal.restore("{}") +# +# # good +# Marshal.dump("{}") +# +# # okish - deep copy hack +# Marshal.load(Marshal.dump({})) +# +# pkg:gem/rubocop#lib/rubocop/cop/security/marshal_load.rb:21 +class RuboCop::Cop::Security::MarshalLoad < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/security/marshal_load.rb:26 + def marshal_load(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/marshal_load.rb:31 + def on_send(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/marshal_load.rb:22 +RuboCop::Cop::Security::MarshalLoad::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/marshal_load.rb:23 +RuboCop::Cop::Security::MarshalLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of `Kernel#open` and `URI.open` with dynamic +# data. +# +# `Kernel#open` and `URI.open` enable not only file access but also process +# invocation by prefixing a pipe symbol (e.g., `open("| ls")`). +# So, it may lead to a serious security risk by using variable input to +# the argument of `Kernel#open` and `URI.open`. It would be better to use +# `File.open`, `IO.popen` or `URI.parse#open` explicitly. +# +# NOTE: `open` and `URI.open` with literal strings are not flagged by this +# cop. +# +# @safety +# This cop could register false positives if `open` is redefined +# in a class and then used without a receiver in that class. +# +# @example +# # bad +# open(something) +# open("| #{something}") +# open("| foo") +# URI.open(something) +# +# # good +# File.open(something) +# IO.popen(something) +# URI.parse(something).open +# +# # good (literal strings) +# open("foo.text") +# URI.open("http://example.com") +# URI.parse(url).open +# +# pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:38 +class RuboCop::Cop::Security::Open < ::RuboCop::Cop::Base + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:47 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:43 + def open?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:76 + def composite_string?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:84 + def concatenated_string?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:80 + def interpolated_string?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:58 + def safe?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:68 + def safe_argument?(argument); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:72 + def simple_string?(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:39 +RuboCop::Cop::Security::Open::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/open.rb:40 +RuboCop::Cop::Security::Open::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the use of YAML class methods which have +# potential security issues leading to remote code execution when +# loading from an untrusted source. +# +# NOTE: Ruby 3.1+ (Psych 4) uses `Psych.load` as `Psych.safe_load` by default. +# +# @safety +# The behavior of the code might change depending on what was +# in the YAML payload, since `YAML.safe_load` is more restrictive. +# +# @example +# # bad +# YAML.load("--- !ruby/object:Foo {}") # Psych 3 is unsafe by default +# +# # good +# YAML.safe_load("--- !ruby/object:Foo {}", [Foo]) # Ruby 2.5 (Psych 3) +# YAML.safe_load("--- !ruby/object:Foo {}", permitted_classes: [Foo]) # Ruby 3.0- (Psych 3) +# YAML.load("--- !ruby/object:Foo {}", permitted_classes: [Foo]) # Ruby 3.1+ (Psych 4) +# YAML.dump(foo) +# +# pkg:gem/rubocop#lib/rubocop/cop/security/yaml_load.rb:26 +class RuboCop::Cop::Security::YAMLLoad < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/security/yaml_load.rb:40 + def on_send(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/security/yaml_load.rb:36 + def yaml_load(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/security/yaml_load.rb:30 +RuboCop::Cop::Security::YAMLLoad::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/security/yaml_load.rb:31 +RuboCop::Cop::Security::YAMLLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Severity class is simple value object about severity +# +# pkg:gem/rubocop#lib/rubocop/cop/severity.rb:6 +class RuboCop::Cop::Severity + include ::Comparable + + # @api private + # + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:30 + def initialize(name_or_code); end + + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:62 + def <=>(other); end + + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:50 + def ==(other); end + + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:42 + def code; end + + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:58 + def hash; end + + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:46 + def level; end + + # @api public + # + # @!attribute [r] name + # + # @return [Symbol] + # severity. + # any of `:info`, `:refactor`, `:convention`, `:warning`, `:error` or `:fatal`. + # + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:22 + def name; end + + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:38 + def to_s; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/severity.rb:24 + def name_from_code(code); end + end +end + +# @api private +# +# pkg:gem/rubocop#lib/rubocop/cop/severity.rb:12 +RuboCop::Cop::Severity::CODE_TABLE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop#lib/rubocop/cop/severity.rb:9 +RuboCop::Cop::Severity::NAMES = T.let(T.unsafe(nil), Array) + +# Common functionality for cops checking for missing space after +# punctuation. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:7 +module RuboCop::Cop::SpaceAfterPunctuation + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:10 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:39 + def allowed_type?(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:20 + def each_missing_space(tokens); end + + # The normal offset, i.e., the distance from the punctuation + # token where a space should be, is 1. + # + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:50 + def offset; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:43 + def space_forbidden_before_rcurly?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:31 + def space_missing?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:35 + def space_required_before?(token); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/space_after_punctuation.rb:8 +RuboCop::Cop::SpaceAfterPunctuation::MSG = T.let(T.unsafe(nil), String) + +# Common functionality for cops checking for space before +# punctuation. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:7 +module RuboCop::Cop::SpaceBeforePunctuation + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:12 + def on_new_investigation; end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:22 + def each_missing_space(tokens); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:34 + def space_missing?(token1, token2); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:38 + def space_required_after?(token); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:42 + def space_required_after_lcurly?; end +end + +# pkg:gem/rubocop#lib/rubocop/cop/mixin/space_before_punctuation.rb:10 +RuboCop::Cop::SpaceBeforePunctuation::MSG = T.let(T.unsafe(nil), String) + +# This autocorrects whitespace +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/space_corrector.rb:6 +class RuboCop::Cop::SpaceCorrector + extend ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::SurroundingSpace + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/space_corrector.rb:36 + def add_space(processed_source, corrector, left_token, right_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/space_corrector.rb:12 + def empty_corrections(processed_source, corrector, empty_config, left_token, right_token); end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/space_corrector.rb:10 + def processed_source; end + + # pkg:gem/rubocop#lib/rubocop/cop/correctors/space_corrector.rb:24 + def remove_space(processed_source, corrector, left_token, right_token); end + end +end + +# Common functionality for modifier cops. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:6 +module RuboCop::Cop::StatementModifier + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::LineLengthHelp + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:85 + def code_after(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:103 + def comment_disables_cop?(comment); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:77 + def first_line_comment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:57 + def if_body_source(if_body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:43 + def length_in_modifier_form(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:71 + def method_source(if_body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:37 + def modifier_fits_on_single_line?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:26 + def non_eligible_body?(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:33 + def non_eligible_condition?(condition); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:19 + def non_eligible_node?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:65 + def omitted_value_in_last_hash_arg?(if_body); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:91 + def parenthesize?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:11 + def single_line_as_modifier?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/statement_modifier.rb:50 + def to_modifier_form(node); end +end + +# Classes that include this module just implement functions to determine +# what is an offense and how to do autocorrection. They get help with +# adding offenses for the faulty string nodes, and with filtering out +# nodes. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/string_help.rb:9 +module RuboCop::Cop::StringHelp + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_help.rb:26 + def on_regexp(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_help.rb:10 + def on_str(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_help.rb:32 + def inside_interpolation?(node); end +end + +# This autocorrects string literals +# +# pkg:gem/rubocop#lib/rubocop/cop/correctors/string_literal_corrector.rb:6 +class RuboCop::Cop::StringLiteralCorrector + extend ::RuboCop::PathUtil + extend ::RuboCop::Cop::Util + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/correctors/string_literal_corrector.rb:10 + def correct(corrector, node, style); end + end +end + +# Common functionality for cops checking single/double quotes. +# +# pkg:gem/rubocop#lib/rubocop/cop/mixin/string_literals_help.rb:6 +module RuboCop::Cop::StringLiteralsHelp + private + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_literals_help.rb:24 + def enforce_double_quotes?; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_literals_help.rb:20 + def preferred_string_literal; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_literals_help.rb:28 + def string_literals_config; end + + # pkg:gem/rubocop#lib/rubocop/cop/mixin/string_literals_help.rb:9 + def wrong_quotes?(src_or_node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:5 +module RuboCop::Cop::Style; end + +# Access modifiers should be declared to apply to a group of methods +# or inline before each method, depending on configuration. +# EnforcedStyle config covers only method definitions. +# Applications of visibility methods to symbols can be controlled +# using AllowModifiersOnSymbols config. +# Also, the visibility of `attr*` methods can be controlled using +# AllowModifiersOnAttrs config. +# +# In Ruby 3.0, `attr*` methods now return an array of defined method names +# as symbols. So we can write the modifier and `attr*` in inline style. +# AllowModifiersOnAttrs config allows `attr*` methods to be written in +# inline style without modifying applications that have been maintained +# for a long time in group style. Furthermore, developers who are not very +# familiar with Ruby may know that the modifier applies to `def`, but they +# may not know that it also applies to `attr*` methods. It would be easier +# to understand if we could write `attr*` methods in inline style. +# +# @safety +# Autocorrection is not safe, because the visibility of dynamically +# defined methods can vary depending on the state determined by +# the group access modifier. +# +# @example EnforcedStyle: group (default) +# # bad +# class Foo +# +# private def bar; end +# private def baz; end +# +# end +# +# # good +# class Foo +# +# private +# +# def bar; end +# def baz; end +# +# end +# +# @example EnforcedStyle: inline +# # bad +# class Foo +# +# private +# +# def bar; end +# def baz; end +# +# end +# +# # good +# class Foo +# +# private def bar; end +# private def baz; end +# +# end +# +# @example AllowModifiersOnSymbols: true (default) +# # good +# class Foo +# +# private :bar, :baz +# private *%i[qux quux] +# private *METHOD_NAMES +# private *private_methods +# +# end +# +# @example AllowModifiersOnSymbols: false +# # bad +# class Foo +# +# private :bar, :baz +# private *%i[qux quux] +# private *METHOD_NAMES +# private *private_methods +# +# end +# +# @example AllowModifiersOnAttrs: true (default) +# # good +# class Foo +# +# public attr_reader :bar +# protected attr_writer :baz +# private attr_accessor :qux +# private attr :quux +# +# def public_method; end +# +# private +# +# def private_method; end +# +# end +# +# @example AllowModifiersOnAttrs: false +# # bad +# class Foo +# +# public attr_reader :bar +# protected attr_writer :baz +# private attr_accessor :qux +# private attr :quux +# +# end +# +# @example AllowModifiersOnAliasMethod: true (default) +# # good +# class Foo +# +# public alias_method :bar, :foo +# protected alias_method :baz, :foo +# private alias_method :qux, :foo +# +# end +# +# @example AllowModifiersOnAliasMethod: false +# # bad +# class Foo +# +# public alias_method :bar, :foo +# protected alias_method :baz, :foo +# private alias_method :qux, :foo +# +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:135 +class RuboCop::Cop::Style::AccessModifierDeclarations < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:167 + def access_modifier_with_alias_method?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:161 + def access_modifier_with_attr?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:154 + def access_modifier_with_symbol?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:172 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:263 + def access_modifier_is_inlined?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:267 + def access_modifier_is_not_inlined?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:234 + def allow_modifiers_on_alias_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:230 + def allow_modifiers_on_attrs?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:226 + def allow_modifiers_on_symbols?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:187 + def allowed?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:195 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:204 + def autocorrect_group_style(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:211 + def autocorrect_inline_style(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:248 + def correctable_group_offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:367 + def def_source(node, def_nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:310 + def find_argument_less_modifier_node(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:291 + def find_corresponding_def_nodes(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:358 + def first_comment_or_node_start(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:255 + def group_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:259 + def inline_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:339 + def insert_inline_modifier(corrector, node, modifier_name); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:281 + def message(range); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:238 + def offense?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:222 + def percent_symbol_array?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:349 + def remove_modifier_node_within_begin(corrector, modifier_node, begin_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:343 + def remove_nodes(corrector, *nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:324 + def replace_defs(corrector, node, def_nodes); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:271 + def right_siblings_same_inline_method?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:318 + def select_grouped_def_nodes(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:141 +RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:146 +RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/access_modifier_declarations.rb:151 +RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for grouping of accessors in `class` and `module` bodies. +# By default it enforces accessors to be placed in grouped +# declarations, reducing boilerplate. It can also be configured +# to enforce separating them into individual declarations for +# easier diffing and per-attribute documentation. +# +# NOTE: If there is a method call before the accessor method it is always allowed +# as it might be intended like Sorbet. +# +# NOTE: If there is a RBS::Inline annotation comment just after the accessor method +# it is always allowed. +# +# @example EnforcedStyle: grouped (default) +# # bad +# class Foo +# attr_reader :bar +# attr_reader :bax +# attr_reader :baz +# end +# +# # good +# class Foo +# attr_reader :bar, :bax, :baz +# end +# +# # good +# class Foo +# # may be intended comment for bar. +# attr_reader :bar +# +# sig { returns(String) } +# attr_reader :bax +# +# may_be_intended_annotation :baz +# attr_reader :baz +# end +# +# @example EnforcedStyle: separated +# # bad +# class Foo +# attr_reader :bar, :baz +# end +# +# # good +# class Foo +# attr_reader :bar +# attr_reader :baz +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:55 +class RuboCop::Cop::Style::AccessorGrouping < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::VisibilityHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:64 + def on_class(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:72 + def on_module(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:71 + def on_sclass(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:87 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:76 + def check(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:127 + def class_send_elements(class_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:184 + def group_accessors(node, accessors); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:104 + def groupable_accessor?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:147 + def groupable_sibling_accessor?(node, sibling); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:154 + def groupable_sibling_accessors(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:139 + def grouped_style?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:160 + def message(send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:165 + def preferred_accessors(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:99 + def previous_line_comment?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:205 + def range_with_trailing_argument_comment(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:190 + def separate_accessors(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:143 + def separated_style?; end + + # Group after constants + # + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:179 + def skip_for_grouping?(node); end + + # For a single-line declaration the parser associates the trailing + # comment with the first argument, not `last_argument`, so look through + # all arguments for a comment that trails the whole node. + # + # pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:217 + def trailing_argument_comment(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:61 +RuboCop::Cop::Style::AccessorGrouping::GROUPED_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/accessor_grouping.rb:62 +RuboCop::Cop::Style::AccessorGrouping::SEPARATED_MSG = T.let(T.unsafe(nil), String) + +# Enforces the use of either `#alias` or `#alias_method` +# depending on configuration. Consistent use of one or the +# other prevents confusion about their different semantics +# (e.g., `alias` is resolved at parse time, while `alias_method` +# is resolved at runtime). +# It also flags uses of `alias :symbol` rather than `alias bareword`. +# +# However, it will always enforce `alias_method` when `alias` is used +# in an instance method definition and in a singleton method definition. +# If used in a block, always enforce `alias_method` +# unless it is an `instance_eval` block. +# +# @example EnforcedStyle: prefer_alias (default) +# # bad +# alias_method :bar, :foo +# alias :bar :foo +# +# # good +# alias bar foo +# +# @example EnforcedStyle: prefer_alias_method +# # bad +# alias :bar :foo +# alias bar foo +# +# # good +# alias_method :bar, :foo +# +# pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:34 +class RuboCop::Cop::Style::Alias < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:56 + def on_alias(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:44 + def on_send(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:98 + def add_offense_for_args(node, &block); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:80 + def alias_keyword_possible?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:92 + def alias_method_possible?(node); end + + # `alias_method` is a method call whose return value can be used + # (e.g., as an argument to `public`/`module_function`, or as an assignment), + # but `alias` is a keyword statement that cannot appear in such positions. + # Detect these positions so the conversion does not produce a syntax error. + # + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:88 + def alias_method_value_used?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:70 + def autocorrect(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:137 + def bareword?(sym_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:141 + def correct_alias_method_to_alias(corrector, send_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:148 + def correct_alias_to_alias_method(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:155 + def correct_alias_with_symbol_args(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:160 + def identifier(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:126 + def lexical_scope_type(node); end + + # In this expression, will `self` be the same as the innermost enclosing + # class or module block (:lexical)? Or will it be something else + # (:dynamic)? If we're in an instance_eval block, return that. + # + # pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:109 + def scope_type(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:38 +RuboCop::Cop::Style::Alias::MSG_ALIAS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:39 +RuboCop::Cop::Style::Alias::MSG_ALIAS_METHOD = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:40 +RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/alias.rb:42 +RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Looks for endless methods inside operations of lower precedence (`and`, `or`, and +# modifier forms of `if`, `unless`, `while`, `until`) that are ambiguous due to +# lack of parentheses. This may lead to unexpected behavior as the code may appear +# to use these keywords as part of the method but in fact they modify +# the method definition itself. +# +# In these cases, using a normal method definition is more clear. +# +# @example +# +# # bad +# def foo = true if bar +# +# # good - using a non-endless method is more explicit +# def foo +# true +# end if bar +# +# # ok - method body is explicit +# def foo = (true if bar) +# +# # ok - method definition is explicit +# (def foo = true) if bar +# +# pkg:gem/rubocop#lib/rubocop/cop/style/ambiguous_endless_method_definition.rb:29 +class RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::EndlessMethodRewriter + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::TargetRubyVersion + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/style/ambiguous_endless_method_definition.rb:40 + def ambiguous_endless_method_body(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/ambiguous_endless_method_definition.rb:48 + def on_def(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/style/ambiguous_endless_method_definition.rb:69 + def keyword(operation); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/ambiguous_endless_method_definition.rb:63 + def modifier_form?(operation); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/ambiguous_endless_method_definition.rb:37 +RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +# Checks for uses of `and` and `or`, and suggests using `&&` and +# `||` instead. It can be configured to check only in conditions or in +# all contexts. +# +# @safety +# Autocorrection is unsafe because there is a different operator precedence +# between logical operators (`&&` and `||`) and semantic operators (`and` and `or`), +# and that might change the behavior. +# +# @example EnforcedStyle: conditionals (default) +# # bad +# if foo and bar +# end +# +# # good +# foo.save && return +# +# # good +# foo.save and return +# +# # good +# if foo && bar +# end +# +# @example EnforcedStyle: always +# # bad +# foo.save and return +# +# # bad +# if foo and bar +# end +# +# # good +# foo.save && return +# +# # good +# if foo && bar +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:44 +class RuboCop::Cop::Style::AndOr < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:51 + def on_and(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:56 + def on_if(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:54 + def on_or(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:61 + def on_until(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:62 + def on_until_post(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:59 + def on_while(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:60 + def on_while_post(node); end + + private + + # ! is a special case: + # 'x and !obj.method arg' can be autocorrected if we + # recurse down a level and add parens to 'obj.method arg' + # however, 'not x' also parses as (send x :!) + # + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:117 + def correct_not(node, receiver, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:129 + def correct_other(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:95 + def correct_send(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:108 + def correct_setter(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:144 + def correctable_send?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:136 + def keep_operator_precedence(corrector, node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:91 + def message(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:85 + def on_conditionals(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:66 + def process_logical_operator(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:148 + def whitespace_before_arg(node); end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/and_or.rb:49 +RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) + +# In Ruby 2.7, arguments forwarding has been added. +# +# This cop identifies places where `do_something(*args, &block)` +# can be replaced by `do_something(...)`. +# +# In Ruby 3.1, anonymous block forwarding has been added. +# +# This cop identifies places where `do_something(&block)` can be replaced +# by `do_something(&)`; if desired, this functionality can be disabled +# by setting `UseAnonymousForwarding: false`. +# +# In Ruby 3.2, anonymous args/kwargs forwarding has been added. +# +# This cop also identifies places where `+use_args(*args)+`/`+use_kwargs(**kwargs)+` can be +# replaced by `+use_args(*)+`/`+use_kwargs(**)+`; if desired, this functionality can be +# disabled by setting `UseAnonymousForwarding: false`. +# +# And this cop has `RedundantRestArgumentNames`, `RedundantKeywordRestArgumentNames`, +# and `RedundantBlockArgumentNames` options. This configuration is a list of redundant names +# that are sufficient for anonymizing meaningless naming. +# +# Meaningless names that are commonly used can be anonymized by default: +# e.g., `+*args+`, `+**options+`, `&block`, and so on. +# +# Names not on this list are likely to be meaningful and are allowed by default. +# +# This cop handles not only method forwarding but also forwarding to `super`. +# +# [NOTE] +# ==== +# Because of a bug in Ruby 3.3.0, when a block is referenced inside of another block, +# no offense will be registered until Ruby 3.4: +# +# [source,ruby] +# ---- +# def foo(&block) +# # Using an anonymous block would be a syntax error on Ruby 3.3.0 +# block_method { bar(&block) } +# end +# ---- +# ==== +# +# @example +# # bad +# def foo(*args, &block) +# bar(*args, &block) +# end +# +# # bad +# def foo(*args, **kwargs, &block) +# bar(*args, **kwargs, &block) +# end +# +# # good +# def foo(...) +# bar(...) +# end +# +# @example UseAnonymousForwarding: true (default, only relevant for Ruby >= 3.2) +# # bad +# def foo(*args, **kwargs, &block) +# args_only(*args) +# kwargs_only(**kwargs) +# block_only(&block) +# end +# +# # good +# def foo(*, **, &) +# args_only(*) +# kwargs_only(**) +# block_only(&) +# end +# +# @example UseAnonymousForwarding: false (only relevant for Ruby >= 3.2) +# # good +# def foo(*args, **kwargs, &block) +# args_only(*args) +# kwargs_only(**kwargs) +# block_only(&block) +# end +# +# @example AllowOnlyRestArgument: true (default, only relevant for Ruby < 3.2) +# # good +# def foo(*args) +# bar(*args) +# end +# +# def foo(**kwargs) +# bar(**kwargs) +# end +# +# @example AllowOnlyRestArgument: false (only relevant for Ruby < 3.2) +# # bad +# # The following code can replace the arguments with `...`, +# # but it will change the behavior. Because `...` forwards block also. +# def foo(*args) +# bar(*args) +# end +# +# def foo(**kwargs) +# bar(**kwargs) +# end +# +# @example RedundantRestArgumentNames: ['args', 'arguments'] (default) +# # bad +# def foo(*args) +# bar(*args) +# end +# +# # good +# def foo(*) +# bar(*) +# end +# +# @example RedundantKeywordRestArgumentNames: ['kwargs', 'options', 'opts'] (default) +# # bad +# def foo(**kwargs) +# bar(**kwargs) +# end +# +# # good +# def foo(**) +# bar(**) +# end +# +# @example RedundantBlockArgumentNames: ['blk', 'block', 'proc'] (default) +# # bad - But it is good with `EnforcedStyle: explicit` set for `Naming/BlockForwarding`. +# def foo(&block) +# bar(&block) +# end +# +# # good +# def foo(&) +# bar(&) +# end +# +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:141 +class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:159 + def on_def(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:179 + def on_defs(node); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:201 + def add_forward_all_offenses(node, send_classifications, forwardable_args); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:379 + def add_parens_if_missing(node, corrector); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:230 + def add_post_ruby_32_offenses(def_node, send_classifications, forwardable_args); end + + # Checks if forwarding is uses both in blocks and outside of blocks. + # On Ruby 3.3.0, anonymous block forwarding in blocks can be is a syntax + # error, so we only want to register an offense if we can change all occurrences. + # + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:312 + def all_forwarding_offenses_correctable?(send_classifications); end + + # Ruby 3.3.0 had a bug where accessing an anonymous block argument inside of a block + # was a syntax error in unambiguous cases: https://bugs.ruby-lang.org/issues/20090 + # We disallow this also for earlier Ruby versions so that code is forwards compatible. + # + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:323 + def allow_anonymous_forwarding_in_block?(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:371 + def allow_only_rest_arguments?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:367 + def arguments_range(node, first_node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:280 + def classification_and_forwards(def_node, send_node, referenced_lvars, forwardable_args); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:265 + def classify_send_nodes(def_node, send_nodes, referenced_lvars, forwardable_args); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:576 + def explicit_block_name?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:183 + def extract_forwardable_args(args); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:225 + def forward_all_first_argument(node); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:255 + def non_splat_or_block_pass_lvar_references(body); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:195 + def only_forwards_all?(send_classifications); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:187 + def redundant_forwardable_named_args(restarg, kwrestarg, blockarg); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:299 + def redundant_named_arg(arg, config_name, keyword); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:357 + def register_forward_all_offense(def_or_send, send_or_arguments, rest_or_splat); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:330 + def register_forward_args_offense(def_arguments_or_send, rest_arg_or_splat); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:346 + def register_forward_block_arg_offense(add_parens, def_arguments_or_send, block_arg); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:338 + def register_forward_kwargs_offense(add_parens, def_arguments_or_send, kwrest_arg_or_splat); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:375 + def use_anonymous_forwarding?; end + + class << self + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:155 + def autocorrect_incompatible_with; end + end +end + +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:151 +RuboCop::Cop::Style::ArgumentsForwarding::ARGS_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:153 +RuboCop::Cop::Style::ArgumentsForwarding::BLOCK_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:148 +RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_LVAR_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:150 +RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:152 +RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), String) + +# Classifies send nodes for possible rest/kwrest/all (including block) forwarding. +# +# pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:387 +class RuboCop::Cop::Style::ArgumentsForwarding::SendNodeClassifier + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:416 + def initialize(def_node, send_node, referenced_lvars, forwardable_args, **config); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:462 + def classification; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:400 + def def_all_anonymous_args?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:394 + def extract_forwarded_kwrest_arg(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:450 + def forwarded_block_arg; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:397 + def forwarded_block_arg?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:438 + def forwarded_kwrest_arg; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:426 + def forwarded_rest_arg; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:391 + def forwarded_rest_arg?(param0 = T.unsafe(nil), param1); end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:409 + def send_all_anonymous_args?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:547 + def additional_kwargs?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:543 + def additional_kwargs_or_forwarded_kwargs?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:557 + def allow_offense_for_no_block?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:528 + def any_arg_referenced?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:512 + def arguments; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:477 + def can_forward_all?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:551 + def forward_additional_kwargs?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:508 + def forwarded_rest_and_kwrest_args; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:570 + def missing_rest_arg_or_kwrest_arg?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:561 + def no_additional_args?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:536 + def no_post_splat_args?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:504 + def offensive_block_forwarding?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:524 + def referenced_block_arg?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:520 + def referenced_kwrest_arg?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:516 + def referenced_rest_arg?; end + + # def foo(a = 41, ...) is a syntax error in 3.0. + # + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:489 + def ruby_30_or_lower_optarg?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:493 + def ruby_32_only_anonymous_forwarding?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:500 + def ruby_32_or_higher_missing_rest_or_kwest?; end + + # pkg:gem/rubocop#lib/rubocop/cop/style/arguments_forwarding.rb:532 + def target_ruby_version; end +end + +# Enforces the use of `Array()` instead of explicit `Array` check or `[*var]`. +# +# The cop is disabled by default due to safety concerns. +# +# @safety +# This cop is unsafe because a false positive may occur if +# the argument of `Array()` is (or could be) nil or depending +# on how the argument is handled by `Array()` (which can be +# different than just wrapping the argument in an array). +# +# For example: +# +# [source,ruby] +# ---- +# [nil] #=> [nil] +# Array(nil) #=> [] +# +# [{a: 'b'}] #= [{a: 'b'}] +# Array({a: 'b'}) #=> [[:a, 'b']] +# +# [Time.now] #=> [#